public class DemandProcess extends SimProcess
Entrepot
where the products to be sold are stored, the random
number distribution to determine the quantity of demanded products, the rate
(frequenzy) also a random number distribution, at which the demand occurs.
Once the DemandProcess has obtained the products, they are consumed and will
leave the simulated system for ever. Actually they will be destroyed as the
the garbage collector will get them. Internally CustomerProcesss
es are set up and initialized, which are the ones actually fetching the
products from the Entrepot
. But this is done automatically,
so the user does not have to care about it.Constructor and Description |
---|
DemandProcess(Model owner,
java.lang.String name,
Entrepot supplier,
NumericalDist<java.lang.Long> quantity,
NumericalDist<?> interval,
boolean showInTrace)
Constructor of a DemandProcess.
|
Modifier and Type | Method and Description |
---|---|
NumericalDist<?> |
getDemandInterval()
Returns the random number distribution determining the intervals in which
the demand occurs.
|
NumericalDist<java.lang.Long> |
getDemandQuantity()
Returns the random number distribution determining the demand (quantity).
|
Entrepot |
getEntrepot()
Returns the
Entrepot supplying the products this
DemandProcess is demanding. |
void |
lifeCycle()
The DemandProcess is fetching in certain intervals a certain quantity of
products from the given
Entrepot and destroys them. |
void |
setDemandInterval(NumericalDist<?> newDemandInterval)
Sets the intervals in which the demand occurs to the new given random
number distribution.
|
void |
setDemandQuantity(NumericalDist<java.lang.Long> newDemandQuantity)
Sets the demand (quantity) to the new given random number distribution.
|
activate, activate, activate, activateAfter, activateBefore, activatePreempt, cancelInterruptDelayed, canCooperate, clearInterruptCode, cooperate, getActivatedBy, getInterruptCode, getInterruptException, getMaster, getRealTimeConstraint, getSchedulingPriority, getSlaveWaitQueue, getSupervisor, hold, hold, hold, interrupt, interrupt, interruptDelayed, interruptDelayed, isBlocked, isComponent, isDelayedInterruptScheduled, isInterrupted, isRepeating, isTerminated, obtainResources, passivate, prepareTransport, reActivate, reActivate, resetMaster, returnAllResources, returnResources, setBlocked, setRealTimeConstraint, setRepeating, setSchedulingPriority, setSlaveWaitQueue
getIdentNumber, getQueueingPriority, getQueues, getScheduledEvents, isEqual, isLarger, isLargerOrEqual, isNotEqual, isQueued, isSimProcess, isSmaller, isSmallerOrEqual, schedule, schedule, schedule, schedule, schedule, schedule, schedule, schedule, schedule, scheduleAfter, scheduleAfter, scheduleAfter, scheduleBefore, scheduleBefore, scheduleBefore, schedulePreempt, schedulePreempt, schedulePreempt, setQueueingPriority
assignReporter, cancel, getCorrespondingReportable, isCurrent, isScheduled, rename, reSchedule, reSchedule, reSchedulePreempt, scheduledNext, setCorrespondingReportable
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 DemandProcess(Model owner, java.lang.String name, Entrepot supplier, NumericalDist<java.lang.Long> quantity, NumericalDist<?> interval, boolean showInTrace)
Entrepot
in certain
intervals.owner
- desmoj.Model : The model this DemandProcess is associated to.name
- java.lang.String : The name of this DemandProcess.supplier
- desmoj.Entrepot : The Entrepot
supplying the
products this DemandProcess is buying.quantity
- NumericalDistdesmoj.dist.DiscreteDistConstant
to simulate a
constant demand.interval
- NumericalDist> : The random number distribution
determining the intervals in which the demand occurs. Use e.g.
desmoj.dist.DiscreteDistConstant
to simulate
fixed intervals.showInTrace
- boolean : Flag, if this DemandProcess should produce a trace
output or not.public NumericalDist<?> getDemandInterval()
public NumericalDist<java.lang.Long> getDemandQuantity()
public Entrepot getEntrepot()
Entrepot
supplying the products this
DemandProcess is demanding.Entrepot
supplying the
products this DemandProcess is demanding.public void lifeCycle() throws SuspendExecution
Entrepot
and destroys them. So it
serves as a drain for the finished products. To prevent this process from
being blocked waiting in the queue of the Entrepot
, it
will instantiate CustomerProcess
es which will actually
fetching the products from the Entrepot
.lifeCycle
in class SimProcess
SuspendExecution
public void setDemandInterval(NumericalDist<?> newDemandInterval)
desmoj.dist.RealDistConstant
to
simulate constant intervals.newDemandInterval
- NumericalDist> : The new random number distribution
determining the intervals in which the demand occurs.public void setDemandQuantity(NumericalDist<java.lang.Long> newDemandQuantity)
desmoj.dist.IntDistConstant
to simulate a constant
demand.newDemandQuantity
- NumericalDist