desmoj
Class TransportJunction

java.lang.Object
desmoj.NamedObject
desmoj.ModelComponent
desmoj.Reportable
desmoj.QueueBased
desmoj.WaitQueue
desmoj.TransportJunction
- public class TransportJunction
- extends WaitQueue
The TransportJunction is the place where Transporters pick up
the goods to move them around in a manufacturing system. The goods are
normally modeled as some kind of SimProcesses. So what happens
at the TransportJunction is some kind of Rendez-vous synchronisation, where
Transporters meet the goods to carry them around.
There is one wait queue for the masters (Transporters) and one
queue for the slaves (SimProcesses), where they have to wait for
each other to cooperate. The Transporters are the masters which
perform the transportation.
The corporate transportation process is described in the method
cooperation in a subclass of Transportation.
The goods (SimProcesses) transported as slaves keep still
during the transport and will be reactivated thereafter.
The main difference to a normal WaitQueue is, that in this case
one master (Transporter) can cooperate with more than one slave
process at a time.
The number of slaves processes which will be transported togehter
will be determined by the master Transporter process. It depends
on the number of available slaves and will be between the minLoad and the
capacity of the Transporter.
Note that a Transporter with a large minimumLoad in front of the
wait queue might block all following Transporters in the queue
until enough goods are available to satisfy his minimum load. Use different
priorities for the different Transporters to cope with this
problem. Or set the passBy flag to true to make it possible for
transporters with a low minimumLoad to pass by the other transporters. Use
the methods setPassBy() and getPassBy().
The first sort criteria for the queues is always highest priorities first,
the second queueing discipline of the underlying queues and the capacity
limit can be determined by the user (default is Fifo and unlimited
capacity).
TransportJunction is derived from WaitQueue which in turn is
derived from QueueBased, which provides all the statistical
functionality for the queues.
- Version:
- DESMO-J, Ver. 1.5 copyright (c) 2001 licensed under GNU GPL
|
Field Summary |
private boolean |
passBy
Flag to indicate whether a transporter can pass by other transporters in the
master queue which are enqueued before that transporter in the queue. |
|
Constructor Summary |
TransportJunction(Model owner,
java.lang.String name,
boolean showInReport,
boolean showInTrace)
Constructor for a TransportJunction. |
TransportJunction(Model owner,
java.lang.String name,
int mSortOrder,
int mQCapacity,
int sSortOrder,
int sQCapacity,
boolean showInReport,
boolean showInTrace)
Constructor for a TransportJunction. |
|
Method Summary |
SimProcess[] |
availableSet(Condition cond)
Returns an array of available slave SimProcesses which comply to a given
condition at this moment. |
Transporter |
availTransporter(Condition cond)
Returns a transporter process waiting in the transporter (master) queue
complying to the given condition. |
boolean |
cooperate(Transportation transportation)
This method is inherited from the class WaitQueue and will be
overwritten here to use the more suitable method
transport(Transportation). |
boolean |
cooperate(Transportation transportation,
Condition cond)
This method is inherited from the class WaitQueue and will be
overwritten here to use the more suitable method
transport(Transportation, Condition). |
desmoj.report.Reporter |
createReporter()
Returns a Reporter to produce a report about this TransportJunction. |
boolean |
getPassBy()
Returns whether a transporter can pass by other transporters which are
enqueued before him in the queue. |
void |
setPassBy(boolean newPassBy)
Sets the flag passBy to a new value. |
boolean |
transport(Transportation transportation)
This method is to be called from a Transporter which wants to
transport goods as a master. |
boolean |
transport(Transportation transportation,
Condition cond)
This method is to be called from a Transporter who wants to
transport goods which comply to a certain condition. |
boolean |
waitOnCoop()
This method is inherited from the class WaitQueue and will be
overwritten here to use the more suitable method
waitOnTransport(). |
boolean |
waitOnTransport()
This method is called from a SimProcess which wants to be transported as
a slave. |
| Methods inherited from class desmoj.WaitQueue |
activateAsNext, activateFirst, avail, availMaster, checkCondition, checkProcess, cooperate, cooperate, getMQueueStrategy, getMRefused, getSlaveQueue, getSQueueStrategy, getSRefused, mAverageLength, mAverageWaitTime, mIsEmpty, mLength, mMaxLength, mMaxLengthAt, mMaxWaitTime, mMaxWaitTimeAt, mMinLength, mMinLengthAt, mStdDevLength, mStdDevWaitTime, mZeroWaits, reset, sAverageLength, sAverageWaitTime, sIsEmpty, sLength, sMaxLength, sMaxLengthAt, sMaxWaitTime, sMaxWaitTimeAt, sMinLength, sMinLengthAt, sStdDevLength, sStdDevWaitTime, sZeroWaits |
| Methods inherited from class desmoj.QueueBased |
addItem, averageLength, averageWaitTime, deleteItem, getQueueLimit, length, maxLength, maxLengthAt, maxWaitTime, maxWaitTimeAt, minLength, minLengthAt, qImpWarn, setQueueImpWarning, stdDevLength, stdDevWaitTime, updateStatistics, zeroWaits |
| Methods inherited from class desmoj.ModelComponent |
current, currentEntity, currentEvent, currentModel, currentSimProcess, currentTime, debugIsOn, debugOff, debugOn, epsilon, getModel, isExperimentCompatible, isModelCompatible, sendDebugNote, sendMessage, sendTraceNote, sendWarning, setOwner, skipTraceNote, skipTraceNote, traceIsOn, traceOff, traceOn |
passBy
private boolean passBy
- Flag to indicate whether a transporter can pass by other transporters in the
master queue which are enqueued before that transporter in the queue.
Is
false per default.
TransportJunction
public TransportJunction(Model owner,
java.lang.String name,
int mSortOrder,
int mQCapacity,
int sSortOrder,
int sQCapacity,
boolean showInReport,
boolean showInTrace)
- Constructor for a TransportJunction. There are two waiting queues constructed,
one internal
QueueList for the Transporters (masters)
and one separate ProcessQueue for the slave processes.
The queueing discipline and the capacity limit of the underlying queues
can be chosen. Highest priority are always first in the queues.
TransportJunction
public TransportJunction(Model owner,
java.lang.String name,
boolean showInReport,
boolean showInTrace)
- Constructor for a TransportJunction. There are two waiting queues constructed,
one internal
QueueList for the Transporters (masters)
and one separate ProcessQueue for the slave processes.
Both queues have a FIFO sort order and no capacity limit.
availableSet
public SimProcess[] availableSet(Condition cond)
- Returns an array of available slave SimProcesses which comply to a given
condition at this moment.
availTransporter
public Transporter availTransporter(Condition cond)
- Returns a transporter process waiting in the transporter (master) queue
complying to the given condition. If there is no such transporter waiting
null is returned.
cooperate
public boolean cooperate(Transportation transportation)
- This method is inherited from the class
WaitQueue and will be
overwritten here to use the more suitable method
transport(Transportation).
If the capacity limit of the master queue is reached, the process will not
be enqueued and false returned.
cooperate
public boolean cooperate(Transportation transportation,
Condition cond)
- This method is inherited from the class
WaitQueue and will be
overwritten here to use the more suitable method
transport(Transportation, Condition).
createReporter
public desmoj.report.Reporter createReporter()
- Returns a Reporter to produce a report about this TransportJunction.
- Overrides:
createReporter in class WaitQueue
getPassBy
public boolean getPassBy()
- Returns whether a transporter can pass by other transporters which are
enqueued before him in the queue.
setPassBy
public void setPassBy(boolean newPassBy)
- Sets the flag passBy to a new value. PassBy is indicating whether transporters
can pass by other transporters which are enqueued before them in the queue.
transport
public boolean transport(Transportation transportation)
- This method is to be called from a
Transporter which wants to
transport goods as a master. If not enough suitable goods (slave processes)
are available at the moment, the transporter process will be stored in the
master waiting queue, until enough suitable slaves are available.
If the capacity limit of the master queue is reached, the process will not
be enqueued and false returned.
When enough suitable slaves are available their prepareTransport()
method (in the class SimProcess) will be called.
During the transportation process the master process is the only active one.
The slave process is passive and will be reactivated after the
transportation is done.
transport
public boolean transport(Transportation transportation,
Condition cond)
- This method is to be called from a
Transporter who wants to
transport goods which comply to a certain condition. The condition must be
specified in the method check() in a class derived from
Condition. If not enough suitable goods (slave processes)
are available at the moment, the transporter process will be stored in the
master waiting queue, until enough suitable slaves are available.
If the capacity limit of the master queue is reached, the process will not
be enqueued and false returned.
When enough suitable slaves are available their prepareTransport()
method (in the class SimProcess) will be called.
During the transportation process the master process is the only active one.
The slave process is passive and will be reactivated after the
transportation is done.
waitOnCoop
public boolean waitOnCoop()
- This method is inherited from the class
WaitQueue and will be
overwritten here to use the more suitable method
waitOnTransport().
- Overrides:
waitOnCoop in class WaitQueue
waitOnTransport
public boolean waitOnTransport()
- This method is called from a SimProcess which wants to be transported as
a slave. If no suitable master process (transporter) is available at the
moment, the slave process will be stored in the slave queue, until a
suitable master (transporter) is available. If the capacity limit of the
slave queue is reached, the process will not be enqueued and
false will be returned.
During the transportation the master process (transporter) is the only
active one. The slave process is passive and will be reactivated after the
transportation is done.