Package jsl.modeling.resource
Class SingleFailureEvent
- java.lang.Object
-
- jsl.simulation.ModelElement
-
- jsl.simulation.SchedulingElement
-
- jsl.modeling.resource.FailureProcess
-
- jsl.modeling.resource.SingleFailureEvent
-
- All Implemented Interfaces:
ObservableIfc
,GetNameIfc
,IdentityIfc
public class SingleFailureEvent extends FailureProcess
A FailureEvent models a one time failure process. There is a time until the failure occurs and a duration for the failure. When the process is started the failure event is scheduled. If the process is not started then no failure event scheduled. Stopping the process causes the failure event to be cancelled. If the failure event occurs then the end of the duration of the event is scheduled. Suspending the process causes the first and only failure event to be cancelled, if the process has been started. If the process has been suspended, then this implies that it has been started but the failure event has not yet occurred. Suspending the process can not stop the failure if it has already occurred. Resuming the process only causes the first event to be uncancelled. If the failure has already occurred, then resume has not effect.
-
-
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 SingleFailureEvent(ResourceUnit resourceUnit, RandomIfc duration)
SingleFailureEvent(ResourceUnit resourceUnit, RandomIfc duration, java.lang.String name)
SingleFailureEvent(ResourceUnit resourceUnit, RandomIfc duration, RandomIfc initialStartTimeRV)
SingleFailureEvent(ResourceUnit resourceUnit, RandomIfc duration, RandomIfc initialStartTimeRV, java.lang.String name)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addFailureEventListener(FailureEventListenerIfc listener)
Adds a listener to react to failureStarted eventprotected void
failureNoticeActivated(FailureNotice fn)
When a FailureNotice is made active, this method is called.protected void
failureNoticeCompleted(FailureNotice fn)
When a FailureNotice is completed, this method is called.protected void
failureNoticeDelayed(FailureNotice fn)
When a FailureNotice is delayed, this method is called.protected void
failureNoticeIgnored(FailureNotice fn)
When a FailureNotice is ignored, this method is called.protected void
notifyFailureEventListenersFailureCompleted()
Used internally to notify failure event listeners that the failure completedprotected void
notifyFailureEventListenersFailureStarted()
Used internally to notify failure event listeners that the failure startedvoid
removeFailureEventListener(FailureEventListenerIfc listener)
Removes the listener from the eventprotected void
resumeProcess()
Performs work to resume the process.protected void
stopProcess()
Performs work associated with stopping the processprotected void
suspendProcess()
Performs work associated with suspending the process-
Methods inherited from class jsl.modeling.resource.FailureProcess
addFailureProcessListener, cancelStartEvent, createFailureNotice, fail, getAutoStartProcessOption, getDurationValue, getFailureDelayOption, getFailureDurationRV, getInitialStartTimeRV, getInitialStartTimeValue, getPriority, getResourceUnit, getStartEvent, initialize, isCreated, isRunning, isStopped, isSuspended, notifyFailureProcessListeners, removeFailureProcessListener, resourceUnitBusyToBusy, resourceUnitBusyToFailed, resourceUnitBusyToIdle, resourceUnitBusyToInactive, resourceUnitFailedToBusy, resourceUnitFailedToFailed, resourceUnitFailedToIdle, resourceUnitFailedToInactive, resourceUnitIdleToBusy, resourceUnitIdleToFailed, resourceUnitIdleToIdle, resourceUnitIdleToInactive, resourceUnitInactiveToBusy, resourceUnitInactiveToFailed, resourceUnitInactiveToIdle, resourceUnitInactiveToInactive, resourceUnitStateChange, resume, scheduleStartOfProcess, setFailureDurationTimeInitialRandomSource, setPriority, signalFailure, start, start, start, stop, suspend, turnOffAutoStartProcessOption, turnOnAutoStartProcessOption, unCancelStartEvent
-
Methods inherited from class jsl.simulation.SchedulingElement
cancelEvent, rescheduleEvent, rescheduleEvent, rescheduleEvent, rescheduleEvent, scheduleEvent, scheduleEvent, scheduleEvent, scheduleEvent, scheduleEvent, scheduleEvent, scheduleEvent, scheduleEvent, scheduleEvent, scheduleEvent
-
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_, 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
-
SingleFailureEvent
public SingleFailureEvent(ResourceUnit resourceUnit, RandomIfc duration)
- Parameters:
resourceUnit
- the resource unit effected by the failureduration
- the duration of the failure
-
SingleFailureEvent
public SingleFailureEvent(ResourceUnit resourceUnit, RandomIfc duration, java.lang.String name)
- Parameters:
resourceUnit
- the resource unit effected by the failureduration
- the duration of the failurename
- the name of the model element
-
SingleFailureEvent
public SingleFailureEvent(ResourceUnit resourceUnit, RandomIfc duration, RandomIfc initialStartTimeRV)
- Parameters:
resourceUnit
- the resource unit effected by the failureduration
- the duration of the failureinitialStartTimeRV
- the time that the failure should start
-
SingleFailureEvent
public SingleFailureEvent(ResourceUnit resourceUnit, RandomIfc duration, RandomIfc initialStartTimeRV, java.lang.String name)
- Parameters:
resourceUnit
- the resource unit effected by the failureduration
- the duration of the failureinitialStartTimeRV
- the time that the failure should startname
- the name of the model element
-
-
Method Detail
-
addFailureEventListener
public final void addFailureEventListener(FailureEventListenerIfc listener)
Adds a listener to react to failureStarted event- Parameters:
listener
- the listener to add
-
removeFailureEventListener
public final void removeFailureEventListener(FailureEventListenerIfc listener)
Removes the listener from the event- Parameters:
listener
- the listener to remove
-
notifyFailureEventListenersFailureStarted
protected final void notifyFailureEventListenersFailureStarted()
Used internally to notify failure event listeners that the failure started
-
notifyFailureEventListenersFailureCompleted
protected final void notifyFailureEventListenersFailureCompleted()
Used internally to notify failure event listeners that the failure completed
-
failureNoticeActivated
protected void failureNoticeActivated(FailureNotice fn)
Description copied from class:FailureProcess
When a FailureNotice is made active, this method is called. Called from FailureNotice.CreatedState or FailureNotice.DelayedState when activate() is called. A FailureNotice is activated from ResourceUnit when scheduling the end of failure for the generated FailureNotice using ResourceUnit's scheduleEndOfFailure(FailureNotice failureNotice). If the FailureNotice is not delayed then it is activated immediately upon the ResourceUnit receiving the failure notice. If the FailureNotice is delayed, then after the delay it is activated This can be used to react to the notices becoming active. A FailureNotice becoming active means that the failure has started (taking down the resource unit).- Specified by:
failureNoticeActivated
in classFailureProcess
- Parameters:
fn
- the failure notice
-
failureNoticeDelayed
protected void failureNoticeDelayed(FailureNotice fn)
Description copied from class:FailureProcess
When a FailureNotice is delayed, this method is called. This can be used to react to the notice becoming delayed.- Specified by:
failureNoticeDelayed
in classFailureProcess
- Parameters:
fn
- the failure notice
-
failureNoticeIgnored
protected void failureNoticeIgnored(FailureNotice fn)
Description copied from class:FailureProcess
When a FailureNotice is ignored, this method is called. This can be used to react to the notice becoming ignored.- Specified by:
failureNoticeIgnored
in classFailureProcess
- Parameters:
fn
- the failure notice
-
failureNoticeCompleted
protected void failureNoticeCompleted(FailureNotice fn)
Description copied from class:FailureProcess
When a FailureNotice is completed, this method is called. This can be used to react to the notice becoming completed.- Specified by:
failureNoticeCompleted
in classFailureProcess
- Parameters:
fn
- the failure notice
-
suspendProcess
protected void suspendProcess()
Description copied from class:FailureProcess
Performs work associated with suspending the process- Specified by:
suspendProcess
in classFailureProcess
-
stopProcess
protected void stopProcess()
Description copied from class:FailureProcess
Performs work associated with stopping the process- Specified by:
stopProcess
in classFailureProcess
-
resumeProcess
protected void resumeProcess()
Description copied from class:FailureProcess
Performs work to resume the process.- Specified by:
resumeProcess
in classFailureProcess
-
-