public class TransportJunction extends WaitQueue
Transporter s pick up
the goods to move them around in a manufacturing system. The goods are
normally modeled as some kind of SimProcess es. So what
happens at the TransportJunction is some kind of Rendez-vous synchronisation,
where Transporter s meet the goods to carry them around. There
is one wait queue for the masters (Transporters) and one
queue for the slaves (SimProcess es), where they have to wait
for each other to cooperate. The Transporter s are the masters
which perform the transportation. The corporate transportation process is
described in the method cooperation in a subclass of
Transportation. The goods (SimProcess es)
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
Transporter s in the queue until enough goods are available to
satisfy his minimum load. Use different priorities for the different
Transporter s 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.WaitQueue,
QueueBased,
ProcessCoopQueueBased.QueueActionFIFO, LIFO, RANDOM, UNDEFINED| Constructor and Description |
|---|
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.
|
| Modifier and Type | Method and Description |
|---|---|
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). |
Reporter |
createDefaultReporter()
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 sim-process which wants to be transported as
a slave.
|
avail, availMaster, cancelCoop, cooperate, cooperate, getCooperationsCompleted, getMQueueStrategy, getMRefused, getMRemoved, getSlaveQueue, getSQueueStrategy, getSRefused, getSRemoved, mAverageCoopTime, 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, sZeroWaitsaddObserver, averageLength, averageWaitTime, deleteObserver, getQueueLimit, length, maxLength, maxLengthAt, maxWaitTime, maxWaitTimeAt, minLength, minLengthAt, notifyObservers, setQueueImpWarning, stdDevLength, stdDevWaitTime, zeroWaitsgetCorrespondingSchedulable, getDescription, getObservations, getReporter, incrementObservations, incrementObservations, reportIsOn, reportOff, reportOn, resetAt, setCorrespondingSchedulable, setDescription, setReportercurrent, currentEntity, currentEntityAll, currentEvent, currentModel, currentSimProcess, debugIsOn, debugOff, debugOn, getModel, isExperimentCompatible, isModelCompatible, presentTime, sendDebugNote, sendMessage, sendTraceNote, sendWarning, skipTraceNote, skipTraceNote, traceIsOn, traceOff, traceOngetName, getQuotedName, toStringpublic TransportJunction(Model owner, java.lang.String name, int mSortOrder, int mQCapacity, int sSortOrder, int sQCapacity, boolean showInReport, boolean showInTrace)
QueueList for the
Transporter s (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.owner - desmoj.Model : The model this TransportJunction is associated
to.name - java.lang.String : The name of this TransportJunction.mSortOrder - int : determines the sort order of the underlying master queue
implementation. Choose a constant from QueueBased
like QueueBased.FIFO or
QueueBased.LIFO or ...mQCapacity - int : The capacity of the master queue, that is how many
processes can be enqueued. Zero (0) means unlimited capacity.sSortOrder - int : determines the sort order of the underlying slave queue
implementation. Choose a constant from QueueBased
like QueueBased.FIFO or
QueueBased.LIFO or ...sQCapacity - int : The capacity of the slave queue, that is how many
processes can be enqueued. Zero (0) means unlimited capacity.showInReport - boolean : Flag, if TransportJunction should produce a report
or not.showInTrace - boolean : Flag, if trace messages of this TransportJunction
should be displayed in the trace file.public TransportJunction(Model owner, java.lang.String name, boolean showInReport, boolean showInTrace)
QueueList for the
Transporter s (masters) and one separate
ProcessQueue for the slave processes. Both queues have a
FIFO sort order and no capacity limit.owner - desmoj.Model : The model this TransportJunction is associated
to.name - java.lang.String : The TransportJunction's nameshowInReport - boolean : Flag, if TransportJunction should produce a report
or not.showInTrace - boolean : Flag, if trace messages of this TransportJunction
should be displayed in the trace file.public SimProcess[] availableSet(Condition cond)
cond - desmoj.Condition : The condition to which the sim-processes we
are looking for must comply.null will be returned.public Transporter availTransporter(Condition cond)
null is returned.cond - Condition : The Condition cond is describing
the condition to which the trasnporter must comply to. This
has to be implemented by the user in the class:
Condition in the method: check().public boolean cooperate(Transportation transportation) throws SuspendExecution
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.transportation - Transportation : The transportation process transportation is
describing the joint action of the processes. The transport to
be carried out has to be implemented by the user in the class:
Transportation in the method:
cooperation().true if the process can be enqueued
successfully, false otherwise (i.e. capacity limit
of the master queue is reached).SuspendExecutionpublic boolean cooperate(Transportation transportation, Condition cond) throws SuspendExecution
WaitQueue and will
be overwritten here to use the more suitable method
transport(Transportation, Condition).transportation - Transportation : The transportation process transportation is
describing the joint action of the processes. The transport to
be carried out has to be implemented by the user in the class:
Transportation in the method:
cooperation().cond - Condition : The Condition cond is describing
the condition to which the slave process must comply to. This
has to be implemented by the user in the class:
Condition in the method: check().true if the process can be enqueued
successfully, false otherwise (i.e. capacity limit
of the master queue is reached).SuspendExecutionpublic Reporter createDefaultReporter()
createDefaultReporter in class WaitQueuepublic boolean getPassBy()
public void setPassBy(boolean newPassBy)
newPassBy - boolean : The new value of passBy. Set it to true
if you want transporters to pass by other transporters which
are enqueued before them in the queue. Set it to
false if you don't want transporters to
overtake other transporters in the queue.public boolean transport(Transportation transportation) throws SuspendExecution
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.transportation - Transportation : The transportation process transportation is
describing the joint action of the processes. The
transportation to be carried out has to be implemented by the
user in the class: Transportation in the
method: transport().true if the process can be enqueued
successfully, false otherwise (i.e. capacity limit
of the master queue is reached).SuspendExecutionpublic boolean transport(Transportation transportation, Condition cond) throws SuspendExecution
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.transportation - Transportation : The transportation process is describing the
joint action of the processes. The transportation to be
carried out has to be implemented by the user in the class:
Transportation in the method:
transport().cond - Condition : The Condition cond is describing
the condition to which the slave process must comply. This has
to be implemented by the user in the class:
Condition in the method: check().true if the process can be enqueued
successfully, false otherwise (i.e. capacity limit
of the master queue is reached).SuspendExecutionpublic boolean waitOnCoop()
throws SuspendExecution
WaitQueue and will
be overwritten here to use the more suitable method
waitOnTransport().waitOnCoop in class WaitQueuetrue if the process requesting the
transportation has been transported successfully to his
destination, false otherwise (i.e. capacity limit
of the slave queue is reached).SuspendExecutionpublic boolean waitOnTransport()
throws SuspendExecution
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.true if the process requesting the
transportation has been transported successfully to his
destination, false otherwise (i.e. capacity limit
of the slave queue is reached).SuspendExecution