Package jsl.simulation
Class SchedulingElement
- java.lang.Object
-
- jsl.simulation.ModelElement
-
- jsl.simulation.SchedulingElement
-
- All Implemented Interfaces:
ObservableIfc
,GetNameIfc
,IdentityIfc
- Direct Known Subclasses:
AbstractMovementController
,ActionSchedule
,BedWard
,ChooseBetweenThreeStations
,ChooseBetweenTwoStations
,Component
,ComponentStateChangeListener
,ContinuousReviewPolicyrQ
,DLQTimedUpdateDemo
,DriverLicenseBureau
,DriverLicenseBureauWithQ
,DriverLicenseBureauWithQJ8
,DriverLicenseBureauWithResource
,DriverLicenseBureauWithResourceSet
,DriveThroughPharmacy
,DTPFunctionalTest
,DTPQueueModel
,DTPQueueResourceModelWithFailures
,DTPQueueResourceModelWithFailuresAndSchedule
,DTPQueueResourcePoolModel
,DTPQueueResourcePoolWithQModel
,EntityReceiver
,EntityType
,EventGenerator
,EventGeneratorCPP
,EventGeneratorDemo
,FailureProcess
,FastFoodRestaurant
,HospitalWard
,LevelResponse
,LKInventoryModel
,MachineRepair
,NHPDriverLicenseBureauWithQ
,OperatingRoom
,ProcessCommand
,QueueingSystemWithQ
,RectangularGridModel
,Resource
,ResourcePoolExample1
,ResourcePoolExample2
,ResourcePoolExample3
,ResourceProvider
,ResourceSingleFailureEvent
,ResourceTester
,ResourceUnit
,ResourceUnitExample1
,ResourceUnitExample2
,ResourceUnitExample3
,ResourceUnitExample4
,ResourceUnitExample5
,ResponseInterval
,ResponseSchedule
,Schedule
,SchedulingEventExamples
,SharedResource
,SimplePoissonProcess
,SingleServerStation
,SpatialModelElement
,SResource
,Station
,TandemQueue
,TandemQueue
,TestTimeWeighted
,TimedAction
,TimeSharedComputerModel
,TimeSharedComputerModel
,TransporterProvider
,TransporterUserAbstract
,TWBatchingElement
,UpDownComponent
,UpDownComponentV2
,WorkStation
public class SchedulingElement extends ModelElement
A SchedulingElement is a ModelElement that facilitates the scheduling of events. Every SchedulingElement has a built in event action which will call the handleEvent() method. A subclass can override the handleEvent() method to provide event routine logic. Alternatively (and more flexibly) events can be scheduled with their own action provided by implementing the EventActionIfc. The class that implements the EventActionIfc can be provided when scheduling the event to ensure that the proper event routine is called when the event is executed by the event scheduler.
-
-
Nested Class Summary
-
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 SchedulingElement(ModelElement parent)
SchedulingElement(ModelElement parent, java.lang.String name)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
cancelEvent(JSLEvent e)
Tells the scheduler to cancel the provided event.protected <T> void
rescheduleEvent(JSLEvent<T> event, double time)
This method allows a previously *executed* event to be reused The event must have already been removed from the calendar through the natural execute event mechanism and have been executed.protected <T> void
rescheduleEvent(JSLEvent<T> event, double time, T message)
This method allows a previously *executed* event to be reused The event must have already been removed from the calendar through the natural execute event mechanism and have been executed.protected <T> void
rescheduleEvent(JSLEvent<T> event, GetValueIfc time)
This method allows a previously *executed* event to be reused The event must have already been removed from the calendar through the natural execute event mechanism and have been executed.protected <T> void
rescheduleEvent(JSLEvent<T> event, GetValueIfc time, T message)
This method allows a previously *executed* event to be reused The event must have already been removed from the calendar through the natural execute event mechanism and have been executed.protected <T> JSLEvent<T>
scheduleEvent(EventActionIfc<T> action, double time)
Creates an event and schedules it onto the event calendarprotected <T> JSLEvent<T>
scheduleEvent(EventActionIfc<T> action, double time, int priority)
Creates an event and schedules it onto the event calendarprotected <T> JSLEvent<T>
scheduleEvent(EventActionIfc<T> action, double time, int priority, T message)
Creates an event and schedules it onto the event calendarprotected <T> JSLEvent<T>
scheduleEvent(EventActionIfc<T> action, double time, int priority, T message, java.lang.String name)
Creates an event and schedules it onto the event calendar.protected <T> JSLEvent<T>
scheduleEvent(EventActionIfc<T> action, double time, T message)
Creates an event and schedules it onto the event calendarprotected <T> JSLEvent<T>
scheduleEvent(EventActionIfc<T> action, double time, T message, java.lang.String name)
Creates an event and schedules it onto the event calendar.protected <T> JSLEvent<T>
scheduleEvent(EventActionIfc<T> action, GetValueIfc time)
Creates an event and schedules it onto the event calendarprotected <T> JSLEvent<T>
scheduleEvent(EventActionIfc<T> action, GetValueIfc time, int priority)
Creates an event and schedules it onto the event calendarprotected <T> JSLEvent<T>
scheduleEvent(EventActionIfc<T> action, GetValueIfc time, int priority, T message)
Creates an event and schedules it onto the event calendarprotected <T> JSLEvent<T>
scheduleEvent(EventActionIfc<T> action, GetValueIfc time, T message)
Creates an event and schedules it onto the event calendar-
Methods inherited from class jsl.simulation.ModelElement
addObserver, addObserverToModelElements, afterExperiment, afterExperiment_, afterReplication, 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, 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
-
SchedulingElement
public SchedulingElement(ModelElement parent)
- Parameters:
parent
- the parent
-
SchedulingElement
public SchedulingElement(ModelElement parent, java.lang.String name)
- Parameters:
parent
- the parentname
- the name
-
-
Method Detail
-
cancelEvent
protected final void cancelEvent(JSLEvent e)
Tells the scheduler to cancel the provided event.- Parameters:
e
- A reference to the event to be canceled.
-
rescheduleEvent
protected final <T> void rescheduleEvent(JSLEvent<T> event, double time)
This method allows a previously *executed* event to be reused The event must have already been removed from the calendar through the natural execute event mechanism and have been executed. The user can reset the action, priority, and message as required directly on the event prior to rescheduling.- Type Parameters:
T
- the type associated with the events message- Parameters:
event
- The event that needs reschedulingtime
- represents the inter-event time, i.e. the interval from the current time to when the event will need to occur
-
rescheduleEvent
protected final <T> void rescheduleEvent(JSLEvent<T> event, double time, T message)
This method allows a previously *executed* event to be reused The event must have already been removed from the calendar through the natural execute event mechanism and have been executed. The user can reset the action, priority, and message as required directly on the event prior to rescheduling.- Type Parameters:
T
- the type associated with the events message- Parameters:
event
- The event that needs reschedulingtime
- represents the inter-event time, i.e. the interval from the current time to when the event will need to occurmessage
- an Object to attach to the event
-
rescheduleEvent
protected final <T> void rescheduleEvent(JSLEvent<T> event, GetValueIfc time)
This method allows a previously *executed* event to be reused The event must have already been removed from the calendar through the natural execute event mechanism and have been executed. The user can reset the action, priority, and message as required directly on the event prior to rescheduling.- Type Parameters:
T
- the type associated with the events message- Parameters:
event
- The event that needs reschedulingtime
- represents the inter-event time, i.e. the interval from the current time to when the event will need to occur
-
rescheduleEvent
protected final <T> void rescheduleEvent(JSLEvent<T> event, GetValueIfc time, T message)
This method allows a previously *executed* event to be reused The event must have already been removed from the calendar through the natural execute event mechanism and have been executed. The user can reset the action, priority, and message as required directly on the event prior to rescheduling.- Type Parameters:
T
- the type of the message- Parameters:
event
- The event that needs reschedulingtime
- represents the inter-event time, i.e. the interval from the current time to when the event will need to occurmessage
- an Object to attach to the event
-
scheduleEvent
protected final <T> JSLEvent<T> scheduleEvent(EventActionIfc<T> action, double time, int priority, T message, java.lang.String name)
Creates an event and schedules it onto the event calendar. This is the main scheduling method that all other scheduling methods call. The other methods are just convenience methods for this method.- Type Parameters:
T
- the type associated with the attached message- Parameters:
action
- represents an ActionListener that will handle the change of state logictime
- represents the inter-event time, i.e. the interval from the current time to when the event will need to occurpriority
- is used to influence the ordering of eventsmessage
- is a generic Object that may represent data to be transmitted with the eventname
- the name of the event- Returns:
- a valid JSLEvent
-
scheduleEvent
protected final <T> JSLEvent<T> scheduleEvent(EventActionIfc<T> action, double time, T message, java.lang.String name)
Creates an event and schedules it onto the event calendar. This is the main scheduling method that all other scheduling methods call. The other methods are just convenience methods for this method.- Type Parameters:
T
- the type associated with the attached message- Parameters:
action
- represents an ActionListener that will handle the change of state logictime
- represents the inter-event time, i.e. the interval from the current time to when the event will need to occurmessage
- is a generic Object that may represent data to be transmitted with the eventname
- the name of the event- Returns:
- a valid JSLEvent
-
scheduleEvent
protected final <T> JSLEvent<T> scheduleEvent(EventActionIfc<T> action, double time)
Creates an event and schedules it onto the event calendar- Parameters:
action
- represents an ActionListener that will handle the change of state logictime
- represents the inter-event time, i.e. the interval from the current time to when the event will need to occur- Returns:
- a valid JSLEvent
-
scheduleEvent
protected final <T> JSLEvent<T> scheduleEvent(EventActionIfc<T> action, GetValueIfc time)
Creates an event and schedules it onto the event calendar- Parameters:
action
- represents an ActionListener that will handle the change of state logictime
- represents the inter-event time, i.e. the interval from the current time to when the event will need to occur- Returns:
- a valid JSLEvent
-
scheduleEvent
protected final <T> JSLEvent<T> scheduleEvent(EventActionIfc<T> action, double time, int priority)
Creates an event and schedules it onto the event calendar- Parameters:
action
- represents an ActionListener that will handle the change of state logictime
- represents the inter-event time, i.e. the interval from the current time to when the event will need to occurpriority
- is used to influence the ordering of events- Returns:
- a valid JSLEvent
-
scheduleEvent
protected final <T> JSLEvent<T> scheduleEvent(EventActionIfc<T> action, GetValueIfc time, int priority)
Creates an event and schedules it onto the event calendar- Parameters:
action
- represents an ActionListener that will handle the change of state logictime
- represents the inter-event time, i.e. the interval from the current time to when the event will need to occurpriority
- is used to influence the ordering of events- Returns:
- a valid JSLEvent
-
scheduleEvent
protected final <T> JSLEvent<T> scheduleEvent(EventActionIfc<T> action, double time, T message)
Creates an event and schedules it onto the event calendar- Type Parameters:
T
- the type associated with the attached message- Parameters:
action
- represents an ActionListener that will handle the change of state logictime
- represents the inter-event time, i.e. the interval from the current time to when the event will need to occurmessage
- is a generic Object that may represent data to be transmitted with the event- Returns:
- a valid JSLEvent
-
scheduleEvent
protected final <T> JSLEvent<T> scheduleEvent(EventActionIfc<T> action, GetValueIfc time, T message)
Creates an event and schedules it onto the event calendar- Type Parameters:
T
- the type associated with the attached message- Parameters:
action
- represents an ActionListener that will handle the change of state logictime
- represents the inter-event time, i.e. the interval from the current time to when the event will need to occurmessage
- is a generic Object that may represent data to be transmitted with the event- Returns:
- a valid JSLEvent
-
scheduleEvent
protected final <T> JSLEvent<T> scheduleEvent(EventActionIfc<T> action, double time, int priority, T message)
Creates an event and schedules it onto the event calendar- Type Parameters:
T
- the type associated with the attached message- Parameters:
action
- represents an ActionListener that will handle the change of state logictime
- represents the inter-event time, i.e. the interval from the current time to when the event will need to occurpriority
- is used to influence the ordering of eventsmessage
- is a generic Object that may represent data to be transmitted with the event- Returns:
- a valid JSLEvent
-
scheduleEvent
protected final <T> JSLEvent<T> scheduleEvent(EventActionIfc<T> action, GetValueIfc time, int priority, T message)
Creates an event and schedules it onto the event calendar- Type Parameters:
T
- the type associated with the attached message- Parameters:
action
- represents an ActionListener that will handle the change of state logictime
- represents the inter-event time, i.e. the interval from the current time to when the event will need to occurpriority
- is used to influence the ordering of eventsmessage
- is a generic Object that may represent data to be transmitted with the event- Returns:
- a valid JSLEvent
-
-