public class TransportTerminal extends ModelComponent
SimpleTransporter
s) are waiting for goods to transport them
around. The SimpleTransporter
s are generated automatically
when a TransportTerminal is initialized. It is intended as an easy to use
interface (facade) for the user and to hide the different classes and their
more or less complex interaction from the user, he normally has to set up
when he wants to model transportation in his model.SimpleTransporter
Constructor and Description |
---|
TransportTerminal(Model owner,
java.lang.String name,
int numOfTransp,
int capac,
int minLoad,
NumericalDist<?> transportTimeStream,
NumericalDist<?> returnTime,
int mSortOrder,
int mQCapacity,
int sSortOrder,
int sQCapacity,
Transportation transportation,
boolean showInReport,
boolean showInTrace)
Constructor for a simple TransportTerminal where a given number of
SimpleTransporter s wait for goods to carry them to their
destination. |
TransportTerminal(Model owner,
java.lang.String name,
int numOfTransp,
int capac,
NumericalDist<?> transportTimeStream,
NumericalDist<?> returnTime,
boolean showInReport,
boolean showInTrace)
Constructor for a simple TransportTerminal where a given number of
SimpleTransporter s wait for goods to carry them to their
destination. |
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.
|
TransportJunction |
getTransportJunction()
Returns the underlying
TransportJunction . |
boolean |
transport(Transportation transport)
This method is to be called from a
Transporter which wants
to transport goods. |
boolean |
transport(Transportation transport,
Condition cond)
This method is to be called from a
Transporter who wants
to transport goods which comply to a certain condition. |
boolean |
waitOnTransport()
This method is called from a sim-process which wants to be transported as
a slave.
|
current, currentEntity, currentEntityAll, currentEvent, currentModel, currentSimProcess, debugIsOn, debugOff, debugOn, getModel, isExperimentCompatible, isModelCompatible, presentTime, sendDebugNote, sendMessage, sendTraceNote, sendWarning, skipTraceNote, skipTraceNote, traceIsOn, traceOff, traceOn
getName, getQuotedName, toString
public TransportTerminal(Model owner, java.lang.String name, int numOfTransp, int capac, int minLoad, NumericalDist<?> transportTimeStream, NumericalDist<?> returnTime, int mSortOrder, int mQCapacity, int sSortOrder, int sQCapacity, Transportation transportation, boolean showInReport, boolean showInTrace)
SimpleTransporter
s wait for goods to carry them to their
destination. The kind of transportation they perform can be determined by
the user. The class implementing this special transportation can be
provided as a parameter. The sort order and the capacity of the queues
for the transporters and the goods can be chosen, too.owner
- desmoj.Model : The model this TransportTerminal is associated
to.name
- java.lang.String : The name of this TransportTerminal.numOfTransp
- int : The number of transporters belonging to this
TransportTerminal.capac
- int : The maximum number of goods the transporters can carry
around.minLoad
- int : The minimum number of goods the transporters will carry
around.transportTimeStream
- NumericalDist> : The random number stream determining
the time it takes to transport the goods.returnTime
- NumericalDist> : The time it takes the transporters to
return to their TransportTerminal after carrying the goods to
their destination.mSortOrder
- int : The sort order of the transporters waiting-queue. Choose
a constant from QueueBased
like
QueueBased.FIFO
or QueueBased.LIFO
or ...mQCapacity
- int : The capacity of the transporters waiting-queue, that is
how many transporters can be enqueued. Zero (0) means
unlimited capacity.sSortOrder
- int : The sort order of the goods waiting-queue. Choose a
constant from QueueBased
like
QueueBased.FIFO
or QueueBased.LIFO
or ...sQCapacity
- int : The capacity of the goods waiting-queue, that is how
many goods processes can be enqueued. Zero (0) means unlimited
capacity.transportation
- Transportation : The type of transportation to be performed by
the transporters.showInReport
- boolean : Flag, if this TransportTerminal should produce a
report or not.showInTrace
- boolean : Flag, if trace messages of this TransportTerminal
should be displayed in the trace file.public TransportTerminal(Model owner, java.lang.String name, int numOfTransp, int capac, NumericalDist<?> transportTimeStream, NumericalDist<?> returnTime, boolean showInReport, boolean showInTrace)
SimpleTransporter
s wait for goods to carry them to their
destination. The SimpleTransporter
s all have a minimum
load of one (1) and they perform just a simple transportation. That is,
they pick up the goods carry them to their destination and release them
there. The queues for the transporters and the goods have a FIFO sort
order and no capacity limit. The following parameters must be specified
by the user.owner
- desmoj.Model : The model this TransportTerminal is associated
to.name
- java.lang.String : The name of this TransportTerminal.numOfTransp
- int : The number of SimpleTransporters belonging to this
TransportTerminal.capac
- int : The maximum number of goods the SimpleTransporters can
carry around.transportTimeStream
- NumericalDist> : The random number stream determining
the time it takes to transport the goods.returnTime
- NumericalDist> : The time it takes the
SimpleTransporters to return to their TransportTerminal after
carrying the goods to their destination.showInReport
- boolean : Flag, if this TransportTerminal should produce a
report or not.showInTrace
- boolean : Flag, if trace messages of this TransportTerminal
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. This method is passed on to the
underlying TransportJunction
.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 TransportJunction getTransportJunction()
TransportJunction
. That is the
home base of all the transporters associated to this TransportTerminal.public boolean transport(Transportation transport) throws SuspendExecution
Transporter
which wants
to transport goods. If not enough suitable goods (slave processes) are
available at the moment, the transporter process will be stored in a
waiting-queue, until enough suitable slaves are available. If the
capacity limit of the queue is reached, the transporter will not be
enqueued and false
will be returned. When enough suitable
slaves are available their cooperate
method (in the class
SimProcess
) will be called. During the transportation
process the transporter process is the only active one. The slave
processes are passive and will be reactivated after the transportation is
done. This method is passed on to the underlying
TransportJunction
.transport
- Transportation : The transportation process transport 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 transporter can be
enqueued successfully, false
otherwise (i.e.
capacity limit of the transporter queue is reached).SuspendExecution
public boolean transport(Transportation transport, 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 waiting-queue, until enough suitable slaves are available.
If the capacity limit of the queue is reached, the transporter will not
be enqueued and false
returned. When enough suitable
slaves are available their cooperate
method (in the class
SimProcess
) will be called. During the transportation
process the transporter process is the only active one. The slave process
is passive and will be reactivated after the transportation is done. This
method is passed on to the underlying TransportJunction
.transport
- Transportation : The transportation process transport 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. This has
to be implemented by the user in the class:
Condition
in the method: check()
.true
if the transporter can be
enqueued successfully, false
otherwise (i.e.
capacity limit of the master queue is reached).SuspendExecution
public boolean waitOnTransport() throws SuspendExecution
false
will be returned. During the cooperation the master process is the only
active one. The slave process is passive and will be reactivated after
the cooperation is done. This method is passed on to the underlying
TransportJunction
.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