Class 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.
    • Constructor Detail

      • SingleFailureEvent

        public SingleFailureEvent​(ResourceUnit resourceUnit,
                                  RandomIfc duration)
        Parameters:
        resourceUnit - the resource unit effected by the failure
        duration - the duration of the failure
      • SingleFailureEvent

        public SingleFailureEvent​(ResourceUnit resourceUnit,
                                  RandomIfc duration,
                                  java.lang.String name)
        Parameters:
        resourceUnit - the resource unit effected by the failure
        duration - the duration of the failure
        name - the name of the model element
      • SingleFailureEvent

        public SingleFailureEvent​(ResourceUnit resourceUnit,
                                  RandomIfc duration,
                                  RandomIfc initialStartTimeRV)
        Parameters:
        resourceUnit - the resource unit effected by the failure
        duration - the duration of the failure
        initialStartTimeRV - 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 failure
        duration - the duration of the failure
        initialStartTimeRV - the time that the failure should start
        name - 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 class FailureProcess
        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 class FailureProcess
        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 class FailureProcess
        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 class FailureProcess
        Parameters:
        fn - the failure notice