Package jsl.modeling.resource
Class TimeBasedFailure
- java.lang.Object
-
- jsl.simulation.ModelElement
-
- jsl.simulation.SchedulingElement
-
- jsl.modeling.resource.FailureProcess
-
- jsl.modeling.resource.TimeBasedFailure
-
- All Implemented Interfaces:
ObservableIfc
,GetNameIfc
,IdentityIfc
public class TimeBasedFailure extends FailureProcess
A TimeBasedFailure uses time to determine the next failure. By default the failure process does not start automatically at time zero. The user can turn on automatic starting of the failure process at time zero or use the start() method. Once the failure process has been started it cannot be started again. Once the failure process has been stopped, it cannot be started again.
-
-
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 Modifier and Type Field Description protected EventGenerator
myFailureGenerator
-
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 TimeBasedFailure(ResourceUnit resourceUnit, RandomIfc failureDuration, RandomIfc timeToFirstFailure, RandomIfc timeBtwFailures)
TimeBasedFailure(ResourceUnit resourceUnit, RandomIfc failureDuration, RandomIfc timeToFirstFailure, RandomIfc timeBtwFailures, java.lang.String name)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected 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
resumeProcess()
Performs work to resume the process.void
setTimeBetweenFailureEvents(RandomIfc tbf)
Sets the time between failures source of randomnessprotected 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
-
-
-
-
Field Detail
-
myFailureGenerator
protected EventGenerator myFailureGenerator
-
-
Constructor Detail
-
TimeBasedFailure
public TimeBasedFailure(ResourceUnit resourceUnit, RandomIfc failureDuration, RandomIfc timeToFirstFailure, RandomIfc timeBtwFailures)
-
TimeBasedFailure
public TimeBasedFailure(ResourceUnit resourceUnit, RandomIfc failureDuration, RandomIfc timeToFirstFailure, RandomIfc timeBtwFailures, java.lang.String name)
-
-
Method Detail
-
setTimeBetweenFailureEvents
public final void setTimeBetweenFailureEvents(RandomIfc tbf)
Sets the time between failures source of randomness- Parameters:
tbf
- the time between failure
-
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
-
-