public class WorkStation extends QueueBased
PartsList
.QueueBased
,
PartsList
QueueBased.QueueAction
FIFO, LIFO, RANDOM, UNDEFINED
Constructor and Description |
---|
WorkStation(Model owner,
java.lang.String name,
PartsList partsList,
boolean showInReport,
boolean showInTrace)
Constructor for a WorkStation.
|
WorkStation(Model owner,
java.lang.String name,
PartsList partsList,
int mSortOrder,
int mQCapacity,
int sSortOrder,
int sQCapacity,
boolean showInReport,
boolean showInTrace)
Constructor for a WorkStation.
|
Modifier and Type | Method and Description |
---|---|
boolean |
allPartsAvailable()
Checks if all parts listed in the parts list are available at the moment.
|
SimProcess |
availMaster(Condition cond)
Returns the master process waiting in the master queue and complying to
the given condition.
|
SimProcess[] |
availSlaves(java.lang.Class kind,
Condition cond)
Returns an array containing the slave processes of the given kind waiting
in their queue and complying to the given condition.
|
Reporter |
createDefaultReporter()
Returns a Reporter to produce a report about this WorkStation.
|
java.lang.String |
getMQueueStrategy()
Returns the implemented queueing discipline of the underlying master
queue as a String, so it can be displayed in the report.
|
long |
getMRefused()
Returns the number of entities refused to be enqueued in the master
queue, because the capacity limit is reached.
|
int |
getNumOfParts()
Returns the number of different kinds of parts needed for processing
these parts at this WorkStation.
|
PartsList |
getPartsList()
Returns the parts list of this WorkStation.
|
ProcessQueue<SimProcess>[] |
getSlaveQueues()
Returns an array of
ProcessQueue s where the waiting
slaves are stored. |
java.lang.String |
getSQueueStrategy(int index)
Returns the implemented queueing discipline of the underlying slave queue
at the given index as a String, so it can be displayed in the report.
|
long |
getSRefused(int index)
Returns the number of entities refused to be enqueued in the slave's
queue, indicated by the index, because the capacity limit is reached.
|
double |
mAverageLength()
Returns the average length of the underlying master queue since the last
reset.
|
TimeSpan |
mAverageWaitTime()
Returns the average waiting time of all processes who have exited the
master queue.
|
boolean |
mIsEmpty()
Returns a boolean value indicating if the master queue is empty or if any
number of SimProcess is currently enqueued in it.
|
long |
mLength()
Returns the current length of the master queue.
|
long |
mMaxLength()
Returns the maximum length of the underlying master queue since the last
reset.
|
TimeInstant |
mMaxLengthAt()
Returns the point of simulation time with the maximum number of
Sim-processes waiting inside the underlying master queue.
|
TimeSpan |
mMaxWaitTime()
Returns the maximum duration in simulation time that an process has spent
waiting inside the underlying master queue.
|
TimeInstant |
mMaxWaitTimeAt()
Returns the point of simulation time when the process with the maximum
waiting time exited the underlying master queue.
|
long |
mMinLength()
Returns the minimumn length of the underlying master queue since the last
reset.
|
TimeInstant |
mMinLengthAt()
Returns the point of simulation time with the minimum number of processes
waiting inside the underlying master queue.
|
double |
mStdDevLength()
Returns the standard deviation of the master queue's length.
|
TimeSpan |
mStdDevWaitTime()
Returns the standard deviation of the master queue's processes waiting
times.
|
long |
mZeroWaits()
Returns the number of processes that have passed through the master queue
without spending time waiting.
|
boolean |
process(Processing process)
This method is to be called from a
SimProcess which wants
to process the other parts (slaves) as a master . |
boolean |
process(Processing process,
java.lang.Class[] kinds,
Condition[] conditions)
This method is to be called from a
SimProcess which wants
to process the other parts (slaves) as a master. |
void |
reset()
Resets all statistical counters to their default values.
|
double |
sAverageLength(int index)
Returns the average length of the slave queue at the given index since
the last reset.
|
TimeSpan |
sAverageWaitTime(int index)
Returns the average waiting time of all processes who have exited the
slave queue indicated by the index..
|
void |
setSQueueCapacity(int index,
int newCapacity)
Sets the capacity of the given slave queue to a new value.
|
void |
setSQueueStrategy(int index,
int sortOrder)
Sets the queueing discipline for the underlying slave queue at the given
index.
|
boolean |
sIsEmpty(int index)
Returns a boolean value indicating if the slave queue indicated by the
index is empty or if any SimProcess is currently enqueued in it.
|
long |
sLength(int index)
Returns the current length of the slave queue indicated by the index.
|
long |
sMaxLength(int index)
Returns the maximum length of the slave queue indicated by the index
since the last reset.
|
TimeInstant |
sMaxLengthAt(int index)
Returns the point of simulation time with the maximum number of
Sim-processes waiting inside the slave queue indicated by the index.
|
TimeSpan |
sMaxWaitTime(int index)
Returns the maximum duration in simulation time that an process has spent
waiting inside the slave queue indicated by the index.
|
TimeInstant |
sMaxWaitTimeAt(int index)
Returns the point of simulation time when the process with the maximum
waiting time exited the slave queue indicated by the index.
|
long |
sMinLength(int index)
Returns the minimumn length of the slave queue indicated by the index
since the last reset.
|
TimeInstant |
sMinLengthAt(int index)
Returns the point of simulation time with the minimum number of processes
waiting inside the slave queue indicated by the index.
|
double |
sStdDevLength(int index)
Returns the standard deviation of the length of the slave queue indicated
by the index.
|
TimeSpan |
sStdDevWaitTime(int index)
Returns the standard deviation of the slave queue's processes waiting
times.
|
long |
sZeroWaits(int index)
Returns the number of processes that have passed through the slave queue
indicated by the index without spending time waiting.
|
boolean |
waitOnProcessing()
This method is called from a sim-process (part or product) which wants to
be processed at this WorkStation as a slave.
|
addObserver, averageLength, averageWaitTime, deleteObserver, getQueueLimit, length, maxLength, maxLengthAt, maxWaitTime, maxWaitTimeAt, minLength, minLengthAt, notifyObservers, setQueueImpWarning, stdDevLength, stdDevWaitTime, zeroWaits
getCorrespondingSchedulable, getDescription, getObservations, getReporter, incrementObservations, incrementObservations, reportIsOn, reportOff, reportOn, resetAt, setCorrespondingSchedulable, setDescription, setReporter
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 WorkStation(Model owner, java.lang.String name, PartsList partsList, int mSortOrder, int mQCapacity, int sSortOrder, int sQCapacity, boolean showInReport, boolean showInTrace)
QueueList
for the masters (like
Worker
s or MachineProcess
es) and one
separate ProcessQueue
for the slave processes (the parts
or goods or products). The queueing discipline and the capacity limit of
the underlying queues can be chosen. Highest priority are always first in
the queues. All the slave wait queues will have the same queueing
discipline and capacity limit as provided in the parameters
sSortOrder
and sQCapacity
. To choose
individual settings for each slave wait queue use the method
setSQueueCapacity()
to change its capacity and/or the
method setSQueueStrategy()
to change its sort order.owner
- Model : The model this WorkStation is associated to.name
- java.lang.String : The WorkStation's namepartsList
- desmoj.PartsList : The list of parts determining the kind and
number of parts needed at this WorkStation to start processing
them here.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 queues
implementation. Choose a constant from QueueBased
like QueueBased.FIFO
or
QueueBased.LIFO
or ...sQCapacity
- int : The capacity of the slave queues, that is how many
processes can be enqueued. Zero (0) means unlimited capacity.showInReport
- boolean : Flag, if WorkStation should produce a report or not.showInTrace
- boolean : Flag, if trace messages of this WorkStation should
be displayed in the trace file.public WorkStation(Model owner, java.lang.String name, PartsList partsList, boolean showInReport, boolean showInTrace)
QueueList
for the masters (like
Worker
s or MachineProcess
es) and one
separate ProcessQueue
for the slave processes (the parts
or goods or products). Both queues have a FIFO sort order and no capacity
limit.owner
- Model : The model this WorkStation is associated to.name
- java.lang.String : The WorkStation's namepartsList
- desmoj.PartsList : The list of parts determining the kind and
number of parts needed at this WorkStation to start processing
them here.showInReport
- boolean : Flag, if WorkStation should produce a report or not.showInTrace
- boolean : Flag, if trace messages of this WorkStation should
be displayed in the trace file.public boolean allPartsAvailable()
true
, if all parts listed in the parts
list are available at the moment. false
otherwisepublic SimProcess availMaster(Condition cond)
null
is returned.cond
- Condition : The Condition cond
is describing
the condition to which the master process must comply to. This
has to be implemented by the user in the class:
Condition
in the method: check()
.public SimProcess[] availSlaves(java.lang.Class kind, Condition cond)
null
will be returned.kind
- Class : The Class specifying of which kind the processes have
to be, we are looking for.cond
- Condition : The Condition cond
is describing
the condition to which the slave processes must comply to.
This has to be implemented by the user in the class:
Condition
in the method: check()
.public Reporter createDefaultReporter()
public java.lang.String getMQueueStrategy()
public long getMRefused()
public int getNumOfParts()
public PartsList getPartsList()
public ProcessQueue<SimProcess>[] getSlaveQueues()
ProcessQueue
s where the waiting
slaves are stored.ProcessQueue
s where
the slaves are waiting on masters to cooperate with.public java.lang.String getSQueueStrategy(int index)
getIndexOfKind()
of the PartsList
.index
- int : The index of the kind of parts we want to get the
queueing discipline from. To get that index use the method
getIndexOfKind()
of the PartsList
.public long getSRefused(int index)
index
- int : Indicating the kind of part for which we want to know
its numbr of refused attempts to enqueue new processes. To get
the index of a certain kind of part use the method
getIndexOfKind()
of the PartsList
.public double mAverageLength()
public TimeSpan mAverageWaitTime()
public boolean mIsEmpty()
true
if the master queue is empty,
false
otherwisepublic long mLength()
public long mMaxLength()
public TimeInstant mMaxLengthAt()
public TimeSpan mMaxWaitTime()
public TimeInstant mMaxWaitTimeAt()
public long mMinLength()
public TimeInstant mMinLengthAt()
public double mStdDevLength()
public TimeSpan mStdDevWaitTime()
public long mZeroWaits()
public boolean process(Processing process) throws SuspendExecution
SimProcess
which wants
to process the other parts (slaves) as a master . It should be a
Worker
or a MachineProcess
. But any other
kind of SimProcess
will do, too, but produce a warning. If
no suitable or not enough slave processes are available at the moment,
the master 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
cooperate
method (in the class SimProcess
)
will be called. During the processing the master process is the only
active one. The slave processes are passive and will be reactivated after
the processing is done.process
- Processing : The Processing process is describing the joint
action of the two processes. The processing to be carried out
has to be implemented by the user in the class or subclass of
Processing
in the method:
cooperation()
.true
if the process can be enqueued
successfully in the master queue, false
otherwise
(i.e. capacity limit of the master queue is reached).SuspendExecution
public boolean process(Processing process, java.lang.Class[] kinds, Condition[] conditions) throws SuspendExecution
SimProcess
which wants
to process the other parts (slaves) as a master. For a WorkStation it
should be a Worker
or a MachineProcess
. By
using this method the master can determine some special slaves complying
to certain conditions he would like to process. The Class
array kinds must be a subset of the parts list and determines together
with the Condition
array (which must be of the same
length) which kind of parts must comply to which condition so the master
will cooperate with them. If no suitable or not enough slave processes
are available at the moment, the master 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 cooperate
method (in the class
SimProcess
) will be called. During the cooperation the
master process is the only active one. The slave processes are passive
and will be reactivated after the cooperation is done.process
- desmoj.Processing : The Processing process is describing the
joint action of the master and slave processes. The processing
to be carried out has to be implemented by the user in the
class: Processing
in the method:
cooperation()
.kinds
- java.lang.Class[] : is specifying in conjunction with the
array conditions which slaves have to comply to which
conditions so the master will cooperate with them. Must be a
subset of the parts list.conditions
- desmoj.Condition[] : is specifying in conjunction with the
array kinds which slaves have to comply to which conditions so
the master will cooperate with them.true
if the process can be enqueued
successfully, false
otherwise (i.e. capacity limit
of the master queue is reached).SuspendExecution
public void reset()
reset
in class QueueBased
public double sAverageLength(int index)
index
- int : Indicating the kind of part (slave) for which we want to
know its average length. To get the index of a certain kind of
part (slave) use the method getIndexOfKind()
of
the PartsList
.public TimeSpan sAverageWaitTime(int index)
index
- int : Indicating the kind of part (slave) for which we want to
know its average waiting time. To get the index of a certain
kind of part (slave) use the method
getIndexOfKind()
of the PartsList
.public void setSQueueCapacity(int index, int newCapacity)
getIndexOfKind()
of the
PartsList
.index
- int : The index indicating the slave queue for which the
capacity will be changed. To get that index one can use the
method getIndexOfKind()
of the
PartsList
.newCapacity
- int : The new capacity of the slave queue indicated by the
index.public void setSQueueStrategy(int index, int sortOrder)
getIndexOfKind()
of the PartsList
. Please choose a constant from
QueueBased
like QueueBased.FIFO
or
QueueBased.LIFO
to determine the sort order.index
- int : The index of the kind of parts for which the queueing
discipline should be changed. To get that index one can use
the method getIndexOfKind()
of the
PartsList
.sortOrder
- int : determines the sort order of the underlying slave queues
implementation at the given index. Choose a constant from
QueueBased
like QueueBased.FIFO
or QueueBased.LIFO
.public boolean sIsEmpty(int index)
index
- int : Indicating the kind of part (slave) for which we want to
know if its wait queue is empty or not. To get the index of a
certain kind of part (slave) use the method
getIndexOfKind()
of the PartsList
.true
if the indicated slave queue is
empty, false
otherwise.public long sLength(int index)
index
- int : Indicating the kind of part (slave) for which we want to
know its current queue length. To get the index of a certain
kind of part (slave) use the method
getIndexOfKind()
of the PartsList
.public long sMaxLength(int index)
index
- int : Indicating the kind of part (slave) for which we want to
know its maximum length of the queue. To get the index of a
certain kind of part (slave) use the method
getIndexOfKind()
of the PartsList
.public TimeInstant sMaxLengthAt(int index)
index
- int : Indicating the kind of part (slave) for which we want to
know when it had its maximum wait queue length. To get the
index of a certain kind of part (slave) use the method
getIndexOfKind()
of the PartsList
.public TimeSpan sMaxWaitTime(int index)
index
- int : Indicating the kind of part (slave) for which we want to
know its maximum waiting time. To get the index of a certain
kind of part (slave) use the method
getIndexOfKind()
of the PartsList
.public TimeInstant sMaxWaitTimeAt(int index)
index
- int : Indicating the kind of part (slave) for which we want to
know the point of simulation time when the process with the
maximum waiting time exited the slave queue. To get the index
of a certain kind of part (slave) use the method
getIndexOfKind()
of the PartsList
.public long sMinLength(int index)
index
- int : Indicating the kind of part (slave) for which we want to
know its minimum wait queue length. To get the index of a
certain kind of part (slave) use the method
getIndexOfKind()
of the PartsList
.public TimeInstant sMinLengthAt(int index)
index
- int : Indicating the kind of part (slave) for which we want to
know the point of simulation time with the minimum number of
processes waiting inside this slave queue. To get the index of
a certain kind of part (slave) use the method
getIndexOfKind()
of the PartsList
.public double sStdDevLength(int index)
index
- int : Indicating the kind of part (slave) for which we want to
know its standard deviation of the length of his queue. To get
the index of a certain kind of part (slave) use the method
getIndexOfKind()
of the PartsList
.public TimeSpan sStdDevWaitTime(int index)
index
- int : Indicating the kind of part (slave) for which we want to
know its standard deviation of process waiting times. To get
the index of a certain kind of part (slave) use the method
getIndexOfKind()
of the PartsList
.public long sZeroWaits(int index)
index
- int : Indicating the kind of part (slave) for which we want to
know how many parts hav elef tthe queue without time spent
waiting. To get the index of a certain kind of part (slave)
use the method getIndexOfKind()
of the
PartsList
.public boolean waitOnProcessing() throws SuspendExecution
false
returned. During the cooperation the master process is the only active
one. The slave processes are passive and will be reactivated after the
cooperation is done.true
if the process can be enqueued
successfully, false
otherwise (i.e. capacity limit
of the slave queue is reached).SuspendExecution