Class ProcessDescription
- java.lang.Object
-
- jsl.simulation.ModelElement
-
- jsl.modeling.elements.processview.description.ProcessDescription
-
- All Implemented Interfaces:
ObservableIfc
,GetNameIfc
,IdentityIfc
public class ProcessDescription extends ModelElement
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
ProcessDescription.EntityTypeNameComparator
-
Nested classes/interfaces inherited from class jsl.simulation.ModelElement
ModelElement.EventBuilderIfc<T>, ModelElement.EventScheduler<T>, ModelElement.ModelElementComparator, ModelElement.RequestBuilder, ModelElement.RequestDurationIfc, ModelElement.RequestTimeIfc, ModelElement.RequestUsingIfc, ModelElement.TimedUpdateEventAction, ModelElement.TimeUnitIfc<T>, ModelElement.WarmUpEventAction
-
-
Field Summary
-
Fields inherited from class jsl.simulation.ModelElement
AFTER_EXPERIMENT, AFTER_REPLICATION, BEFORE_EXPERIMENT, BEFORE_REPLICATION, CONDITIONAL_ACTION_REGISTRATION, DEFAULT_TIMED_EVENT_PRIORITY, INITIALIZED, MONTE_CARLO, myAfterExperimentOption, myAfterReplicationOption, myBeforeExperimentOption, myBeforeReplicationOption, myInitializationOption, myLengthOfWarmUp, myModelElements, myMonteCarloOption, myObservableComponent, myReplicationEndedOption, myTimedUpdateActionListener, myTimedUpdateEvent, myTimedUpdateInterval, myTimedUpdateOption, myTimedUpdatePriority, myWarmUpActionListener, myWarmUpEvent, myWarmUpIndicator, myWarmUpOption, myWarmUpPriority, NONE, REMOVED_FROM_MODEL, REPLICATION_ENDED, TIME_UNIT_DAY, TIME_UNIT_HOUR, TIME_UNIT_MILLISECOND, TIME_UNIT_MINUTE, TIME_UNIT_SECOND, TIME_UNIT_WEEK, TIMED_UPDATE, UPDATE, WARMUP
-
-
Constructor Summary
Constructors Constructor Description ProcessDescription(ModelElement parent)
A ProcessDescription is a list or sequence of commands that represent the life of a processProcessDescription(ModelElement parent, java.lang.String name)
A ProcessDescription is a list or sequence of commands that represent the life of a process
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addProcessCommand(ProcessCommand command)
Adds a command to this process description.protected void
afterReplication()
This method should be overridden by subclasses that need actions performed after each replication.ProcessExecutor
createProcessExecutor()
Asks the process description to make an instance of a ProcessExecutor in order to execute the commands.ProcessExecutor
createProcessExecutor(Entity entity)
Asks the process description to make an instance of a ProcessExecutor in order to execute the commands.EntityType
defineEntityType(java.lang.String name)
Defines an entity type with the given name and adds it to the available types for this process descriptionprotected java.util.List<ProcessCommand>
getProcessCommands()
Returns the list of commandsprotected void
initialize()
This method should be overridden by subclasses that need actions performed to initialize prior to a replication.protected void
processExecutorTerminated(ProcessExecutor processExecutor)
This method is automatically called whenever a process executor associated with this process description has been terminatedvoid
setProcessExecutorCompletedListener(ProcessExecutorListenerIfc listener)
This can be used to automatically add this listener to any ProcessExecutors that are created by this ProcessDescription This listener is notified when the ProcessExecutor is completed.void
setProcessExecutorStartListener(ProcessExecutorListenerIfc listener)
This can be used to automatically add this listener to any ProcessExecutors that are created by this ProcessDescription This listener is notified when the ProcessExecutor is started.void
turnOffAutoStart()
Tells the process description that it should not auto start executing.void
turnOnAutoStart()
Tells the process description that it can auto start executing.-
Methods inherited from class jsl.simulation.ModelElement
addObserver, addObserverToModelElements, afterExperiment, afterExperiment_, afterReplication_, asString, beforeExperiment, beforeExperiment_, beforeReplication, beforeReplication_, buildEventGenerator, cancelTimedUpdateEvent, cancelWarmUpEvent, changeParentModelElement, checkForAfterExperiment, checkForAfterReplication, checkForBeforeExperiment, checkForBeforeReplication, checkForConditionalActionRegistration, checkForInitialize, checkForMonteCarlo, checkForRemoveFromModel, checkForReplicationEnded, checkForTimedUpdate, checkForUpdate, checkForWarmUp, checkObserverState, checkWarmUpOption, clearModelElementObservers, contains, countObservers, createEntity, createEntity, createQObject, day, deleteObserver, deleteObserverFromModelElements, deleteObservers, findModelElementWithWarmUpEvent, getAfterExperimentOption, getAfterReplicationOption, getAllCounters, getAllModelElements, getAllRandomElements, getAllResponseVariables, getAllVariables, getBeforeExperimentOption, getBeforeReplicationOption, getChildModelElementIterator, getCurrentReplicationNumber, getDefaultEntityType, getExecutive, getExperiment, getId, getInitializationOption, getInitializationOrderAsString, getLeftPreOrderTraversalCount, getLengthOfWarmUp, getModel, getModelElementCompartor, getModelElementsAsString, getModelElementsAsString, getModelElementsAsString, getMonteCarloOption, getName, getNumberOfModelElements, getObserverState, getParentModelElement, getPreviousObserverState, getReplicationEndedOption, getRightPreOrderTraversalCount, getSimulation, getSpatialModel, getStringLabel, getThisElementsCounters, getThisElementsModelElements, getThisElementsRandomVariables, getThisElementsResponseVariables, getThisElementsVariables, getTime, getTimedUpdateInterval, getTimedUpdateOption, getUpdateNotificationFlag, getVariable, getWarmUpEventTime, getWarmUpOption, hour, indent, initialize_, isTimedUpdateEventScheduled, isWarmedUp, isWarmUpEventScheduled, isWarmUpScheduled, millisecond, minute, montecarlo, montecarlo_, notifyAfterExperimentObservers, notifyAfterReplicationObservers, notifyBeforeExperimentObservers, notifyBeforeReplicationObservers, notifyConditionalActionRegistrationObservers, notifyInitializationObservers, notifyMonteCarloObservers, notifyObservers, notifyObservers, notifyRemovingFromModelObservers, notifyReplicationEndedObservers, notifyTimedUpdateObservers, notifyUpdateObservers, notifyWarmUpObservers, registerConditionalActions, registerConditionalActions_, removedFromModel, removeFromModel, replicationEnded, replicationEnded_, schedule, second, seize, setAfterExperimentOption, setAfterExperimentOptionForModelElements, setAfterReplicationOption, setAfterReplicationOptionForModelElements, setBeforeExperimentOption, setBeforeExperimentOptionForModelElements, setBeforeReplicationOption, setBeforeReplicationOptionForModelElements, setInitializationOption, setInitializationOptionForModelElements, setLengthOfWarmUp, setModel, setMonteCarloOption, setMonteCarloOptionForModelElements, setName, setObserverState, setParentModelElement, setReplicationEndedOption, setReplicationEndedOptionForModelElements, setSpatialModel, setStringLabel, setTimedUpdateInterval, setTimedUpdateOption, setTimedUpdateOptionForModelElements, setUpdateNotificationFlag, setWarmUpOption, setWarmUpOptionForModelElements, stopExecutive, stopExecutive, timedUpdate, timedUpdate_, toString, update, useControls, warmUp, warmUp_, week
-
-
-
-
Constructor Detail
-
ProcessDescription
public ProcessDescription(ModelElement parent)
A ProcessDescription is a list or sequence of commands that represent the life of a process- Parameters:
parent
- the parent model element
-
ProcessDescription
public ProcessDescription(ModelElement parent, java.lang.String name)
A ProcessDescription is a list or sequence of commands that represent the life of a process- Parameters:
parent
- the parent model elementname
- The name of process description
-
-
Method Detail
-
turnOnAutoStart
public final void turnOnAutoStart()
Tells the process description that it can auto start executing. That is it will create a default process executor and start processing at the beginning of a replication. The default is no auto start.
-
turnOffAutoStart
public final void turnOffAutoStart()
Tells the process description that it should not auto start executing.
-
addProcessCommand
public final void addProcessCommand(ProcessCommand command)
Adds a command to this process description. The order of adding commands determines the sequence of commands to be executed. Notice that commands can only be added at this time. No facilities for removing or rearranging commands have been provided. Once you make the sequence of command, they are set.- Parameters:
command
- the ProcessCommand to be added.
-
setProcessExecutorCompletedListener
public final void setProcessExecutorCompletedListener(ProcessExecutorListenerIfc listener)
This can be used to automatically add this listener to any ProcessExecutors that are created by this ProcessDescription This listener is notified when the ProcessExecutor is completed. The listener may be null. In which case nothing will be added.- Parameters:
listener
- The processExecutorCompletedListener to set.
-
setProcessExecutorStartListener
public final void setProcessExecutorStartListener(ProcessExecutorListenerIfc listener)
This can be used to automatically add this listener to any ProcessExecutors that are created by this ProcessDescription This listener is notified when the ProcessExecutor is started. The listener may be null. In which case, nothing will be added.- Parameters:
listener
- The processExecutorStartListener to set.
-
defineEntityType
public final EntityType defineEntityType(java.lang.String name)
Defines an entity type with the given name and adds it to the available types for this process description- Parameters:
name
- , the name of the entity type, must be non-null and unique to this process description- Returns:
- the entity type
-
createProcessExecutor
public final ProcessExecutor createProcessExecutor()
Asks the process description to make an instance of a ProcessExecutor in order to execute the commands. This method creates a default entity to be associated with the process.- Returns:
- An instance of a ProcessExecutor
-
createProcessExecutor
public ProcessExecutor createProcessExecutor(Entity entity)
Asks the process description to make an instance of a ProcessExecutor in order to execute the commands.- Parameters:
entity
- , An entity to be used within the execution- Returns:
- An instance of a ProcessExecutor
-
getProcessCommands
protected java.util.List<ProcessCommand> getProcessCommands()
Returns the list of commands- Returns:
- , the list of commands as a List
-
initialize
protected void initialize()
Description copied from class:ModelElement
This method should be overridden by subclasses that need actions performed to initialize prior to a replication. It is called once before each replication occurs if the model element wants initialization. It is called after beforeReplication() is called- Overrides:
initialize
in classModelElement
-
afterReplication
protected void afterReplication()
Description copied from class:ModelElement
This method should be overridden by subclasses that need actions performed after each replication. It is called after replicationEnded() has been called.- Overrides:
afterReplication
in classModelElement
-
processExecutorTerminated
protected void processExecutorTerminated(ProcessExecutor processExecutor)
This method is automatically called whenever a process executor associated with this process description has been terminated- Parameters:
processExecutor
-
-
-