Class Executive

  • All Implemented Interfaces:
    ObservableIfc, IterativeProcessIfc, GetNameIfc, IdentityIfc

    public class Executive
    extends java.lang.Object
    implements IdentityIfc, ObservableIfc, IterativeProcessIfc
    The Executive controls the execution of events, permits the scheduling of events, updates the current time, and manages conditional actions. The Executive uses an instance of a class that extends IterativeProcess to control its execution. The Executive uses an instance of a class that implements the CalendarIfc interface to manage the time ordered execution of events. The Executive uses an instance of a ConditionalActionProcessor to manage the execution of ConditionalActions. The event calendar and attached conditional actions are cleared after the initialize() method is called The Executive can be pre-loaded with events and conditional actions prior to invoking the run() method if and only if the initialize() method had already been called. If the run() method is called without calling initialize() the calendar and conditional actions are cleared. If an ending event is not scheduled using the scheduleEndEvent() method and no real clock time execution limit has been set, then a default message will be sent to JSL.LOGGER.warning(). This message can be turned off by calling setTerminationWarningMessageOption(false)
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addObserver​(ObserverIfc observer)
      Allows the adding (attaching) of an observer to the observable
      protected void afterExecution()
      This method is called after executing all events when ending the iterative process.
      boolean allStepsCompleted()
      The iterative process may end by a variety of means, this method checks if the iterative process ended because it ran all of its steps
      protected void beforeExecutingAnyEvents()
      This method is called before any events are executed and after initializing the iterative process.
      void cancel​(JSLEvent e)
      Tells the event calendar to cancel the provided event.
      void changePriority​(ConditionalAction action, int priority)  
      boolean contains​(ObserverIfc observer)
      Returns true if the observer is already attached
      int countObservers()
      Returns how many observers are currently observing the observable
      void deleteObserver​(ObserverIfc observer)
      Allows the deletion (removing) of an observer from the observable
      void deleteObservers()
      Deletes all the observers from the observable
      void end()
      The iterative process will continue until there are no more steps or its maximum execution time has been reached, whichever comes first.
      void end​(java.lang.String msg)
      The iterative process will continue until there are no more steps or its maximum execution time has been reached, whichever comes first.
      protected void execute​(JSLEvent event)
      Executes the provided event
      void executeAllEvents()  
      void executeNextEvent()
      Causes the next event to be executed if it exists
      boolean executionTimeExceeded()
      The iterative process may end by a variety of means, this method checks if the iterative process ended because it timed out
      double getActualEndingTime()
      The simulated time that the Executive actually ended
      long getBeginExecutionTime()
      Returns system time in milliseconds that the iterative process started
      java.util.Optional<ExecutiveTraceReport> getDefaultExecutiveTraceReport()
      Returns the default event trace report or null if it has not yet been turned on.
      long getElapsedExecutionTime()
      Gets the clock time in milliseconds since the iterative process was initialized
      JSLEvent getEndEvent()
      Returns the Executive's end event if scheduled
      long getEndExecutionTime()
      Returns system time in milliseconds that the iterative process ended
      int getId()
      Returns the id for this object
      JSLEvent getLastExecutedEvent()
      Returns a reference to the last executed event or null if no events have been executed or no more events
      IPLogReport getLogReport()
      Returns a reference to the current log report.
      long getMaximumAllowedExecutionTime()
      Returns maximum (real) clock time allocated for the iterative process
      boolean getMaxScanFlag()  
      int getMaxScans()  
      java.lang.String getName()
      Gets the name.
      double getNumberEventsScheduled()
      Gets the number of events currently scheduled
      double getNumberEventsScheduledDuringExecution()
      Gets the number of events that were scheduled during the execution
      long getNumberStepsCompleted()
      Returns the number of steps completed since the iterative process was last initialized
      int getObserverState()
      Can be used by observers to check what occurred
      double getScheduledEndTime()
      Returns the time the execution was scheduled to end
      boolean getStoppingFlag()
      Returns the stopping flag
      java.lang.String getStoppingMessage()
      A string message for why stop() was called.
      boolean getTerminationWarningMessageOption()  
      double getTime()
      Returns the current simulated time as a double
      double getTotalNumberEventsExecuted()
      Gets the total number of events executed
      boolean hasNextEvent()
      Checks to see if the event calendar has another event
      void initialize()
      Initialize the executive, making it ready to run events This clears any events in the calendar and prepares for execution
      protected void initializeCalendar()
      Tells the event calendar to clear all the events.
      boolean isCompleted()  
      boolean isCreated()
      Checks if the iterative process is in the created state.
      boolean isDone()
      A flag to indicate whether the iterative process is done A iterative process can be done if: 1) it ran all of its steps 2) it was ended by a client prior to completing all of its steps 3) it ended because it exceeded its maximum allowable execution time before completing all of its steps.
      boolean isEmpty()
      Allows a check of the event calendar to see if it is empty, i.e.
      boolean isEndConditionMet()  
      boolean isEnded()
      Checks if the iterative process is in the ended state After the iterative process has been ended this method will return true
      boolean isEndEventScheduled()
      Returns true if an event has been scheduled to stop execution at getTimeHorizon()
      boolean isExecutionTimeExceeded()
      Returns if the elapsed execution time exceeds the maximum time allowed.
      boolean isInitialized()
      Checks if the iterative process is in the initialized state After the iterative process has been initialized this method will return true
      boolean isRunning()
      An iterative process is running if it is been told to run (i.e.
      boolean isRunningStep()
      Indicates that the iterative process is currently running an individual step
      boolean isStepCompleted()
      Checks if the iterative process is in the completed step state After the iterative process has successfully completed a step this method will return true
      boolean isTimedOut()  
      boolean isUnfinished()
      The iterative process may end by a variety of means, this method checks if the iterative process ended but was unfinished, not all steps completed
      boolean noStepsExecuted()
      Indicates that the iterative process ended because of no steps
      protected void notifyObservers​(JSLEvent e)  
      JSLEvent peekNextEvent()
      Returns a reference to the next event or null if no event exists.
      protected void performCPhase()  
      void register​(ConditionalAction action)  
      void register​(ConditionalAction action, int priority)  
      <T> void reschedule​(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.
      void run()
      Runs all of the steps of the iterative process.
      void runNext()
      Runs the next step in the iterative process
      protected void schedule​(JSLEvent e)  
      JSLEvent scheduleEndEvent​(double time, ModelElement theElement)
      Schedules the ending of the executive at the provided time
      <T> JSLEvent<T> scheduleEvent​(EventActionIfc<T> listener, double time, int priority, T message, java.lang.String name, ModelElement theElementScheduling)
      Creates an event and schedules it onto the event calendar
      protected void setConditionalActionProcessor​(ConditionalActionProcessor p)  
      void setMaximumExecutionTime​(long milliseconds)
      Set the maximum allotted (suggested) execution (real) clock for the entire iterative process.
      void setMaxScanFlag​(boolean flag)  
      void setMaxScans​(int max)  
      void setName​(java.lang.String str)
      Sets the name
      protected void setSimulation​(Simulation simulation)
      Used internally by Simulation to assign itself to the Executive
      void setTerminationWarningMessageOption​(boolean flag)
      False turns off the message
      void stop()
      This sets a flag to indicate to the process that is should stop after the next step is completed.
      void stop​(java.lang.String msg)
      This sets a flag to indicate to the process that is should stop after the next step is completed.
      boolean stoppedByCondition()
      The iterative process may end by a variety of means, this method checks if the iterative process ended because it was stopped
      java.lang.String toString()  
      void turnOffDefaultEventTraceReport()
      Removes the default ExecutiveTraceReport as an observer of the Executive and sets it to null.
      void turnOffLogReport()
      Turns off log reporting.
      void turnOnDefaultEventTraceReport()
      This method creates an instance of the default ExecutiveTraceReport and tells it to observe the scheduler.
      void turnOnDefaultEventTraceReport​(java.lang.String name)
      This method creates an instance of the default ExecutiveTraceReport and tells it to observe the scheduler.
      void turnOnLogReport​(java.nio.file.Path pathToFile)
      Turns on the log report.
      void turnOnTimer​(long milliseconds)
      This method will cause the a timer to start allowing a TimerTask to be scheduled.
      void unregister​(ConditionalAction action)  
      void unregisterAllActions()  
      boolean willTerminate()
      If the Executive has an end event or maximum allowed execution time, then return true
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • AFTER_EXECUTION

        public static final int AFTER_EXECUTION
        Used when observers are notified after all events are executed
      • INITIALIZED

        public static final int INITIALIZED
        Used when observers are notified of initialization
      • BEFORE_EVENT

        public static final int BEFORE_EVENT
        Used to indicate to observers that an event will be executed
      • AFTER_EVENT

        public static final int AFTER_EVENT
        Used to indicate to observers that an event will be executed
      • myObservableComponent

        protected ObservableComponent myObservableComponent
        Allows the object to be observed
    • Constructor Detail

      • Executive

        public Executive()
      • Executive

        public Executive​(java.lang.String name,
                         CalendarIfc c)
    • Method Detail

      • setSimulation

        protected final void setSimulation​(Simulation simulation)
        Used internally by Simulation to assign itself to the Executive
        Parameters:
        simulation - the simulation to set
      • getName

        public final java.lang.String getName()
        Gets the name.
        Specified by:
        getName in interface GetNameIfc
        Returns:
        The name of object.
      • getId

        public final int getId()
        Returns the id for this object
        Specified by:
        getId in interface IdentityIfc
        Returns:
        the id
      • setName

        public final void setName​(java.lang.String str)
        Sets the name
        Parameters:
        str - The name as a string.
      • getTerminationWarningMessageOption

        public final boolean getTerminationWarningMessageOption()
        Returns:
        true if the flag permits the message to be printed
      • setTerminationWarningMessageOption

        public final void setTerminationWarningMessageOption​(boolean flag)
        False turns off the message
        Parameters:
        flag - true means off
      • getObserverState

        public final int getObserverState()
        Can be used by observers to check what occurred
        Returns:
        an integer representation of the observer state
      • deleteObservers

        public final void deleteObservers()
        Description copied from interface: ObservableIfc
        Deletes all the observers from the observable
        Specified by:
        deleteObservers in interface ObservableIfc
      • deleteObserver

        public final void deleteObserver​(ObserverIfc observer)
        Description copied from interface: ObservableIfc
        Allows the deletion (removing) of an observer from the observable
        Specified by:
        deleteObserver in interface ObservableIfc
        Parameters:
        observer - the observer to delete
      • countObservers

        public final int countObservers()
        Description copied from interface: ObservableIfc
        Returns how many observers are currently observing the observable
        Specified by:
        countObservers in interface ObservableIfc
        Returns:
        number of observers
      • addObserver

        public final void addObserver​(ObserverIfc observer)
        Description copied from interface: ObservableIfc
        Allows the adding (attaching) of an observer to the observable
        Specified by:
        addObserver in interface ObservableIfc
        Parameters:
        observer - the observer to attach
      • contains

        public boolean contains​(ObserverIfc observer)
        Description copied from interface: ObservableIfc
        Returns true if the observer is already attached
        Specified by:
        contains in interface ObservableIfc
        Parameters:
        observer - the observer to check
        Returns:
        true if attached
      • turnOnLogReport

        public void turnOnLogReport​(java.nio.file.Path pathToFile)
        Description copied from interface: IterativeProcessIfc
        Turns on the log report. This report yields a text file of the state changes for the iterative process
        Specified by:
        turnOnLogReport in interface IterativeProcessIfc
        Parameters:
        pathToFile - specifies a prefix name for the report
      • notifyObservers

        protected final void notifyObservers​(JSLEvent e)
      • getScheduledEndTime

        public final double getScheduledEndTime()
        Returns the time the execution was scheduled to end
        Returns:
        the scheduled end time or Double.POSITIVE_INFINITY
      • reschedule

        public final <T> void reschedule​(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. NOTE: If an event is canceled it remains in the scheduler until its originally scheduled event time. Then and only then does it become unscheduled at which time the event can be rescheduled. If a client needs to reschedule a canceled event prior to the originally scheduled event time, then just use scheduleEvent() to make a new event.
        Type Parameters:
        T - the type of the event message
        Parameters:
        event - The event that needs rescheduling, cannot be null and cannot already be scheduled
        time - represents the inter-event time, i.e. the interval from the current time to when the event will need to occur. Cannot be negative
      • scheduleEvent

        public final <T> JSLEvent<T> scheduleEvent​(EventActionIfc<T> listener,
                                                   double time,
                                                   int priority,
                                                   T message,
                                                   java.lang.String name,
                                                   ModelElement theElementScheduling)
        Creates an event and schedules it onto the event calendar
        Type Parameters:
        T - the type of the event message
        Parameters:
        listener - represents an ActionListener that will handle the change of state logic, cannot be null
        time - represents the inter-event time, i.e. the interval from the current time to when the event will need to occur, Cannot be negative
        priority - is used to influence the ordering of events
        message - is a generic Object that may represent data to be transmitted with the event, may be null
        name - the name of the event, can be null
        theElementScheduling - the element doing the scheduling, cannot be null
        Returns:
        a valid JSLEvent
      • cancel

        public final void cancel​(JSLEvent e)
        Tells the event calendar to cancel the provided event. The event must have been scheduled otherwise an IllegalArgumentException is thrown.
        Parameters:
        e - A reference to the event to be canceled.
      • isEmpty

        public final boolean isEmpty()
        Allows a check of the event calendar to see if it is empty, i.e. it does not have any more events. Note: Depending on how the event calendar handles canceled events, canceled events may or may not be removed. In the default, canceled events are not removed from the calendar, until after their event time has occurred.
        Returns:
        True is empty, False is not empty
      • getTime

        public final double getTime()
        Returns the current simulated time as a double
        Returns:
        Simulated time as a double
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
        Returns:
        A string representing the Executive.
      • getNumberEventsScheduled

        public final double getNumberEventsScheduled()
        Gets the number of events currently scheduled
        Returns:
        number currently scheduled
      • getNumberEventsScheduledDuringExecution

        public final double getNumberEventsScheduledDuringExecution()
        Gets the number of events that were scheduled during the execution
        Returns:
        number during the execution
      • getTotalNumberEventsExecuted

        public final double getTotalNumberEventsExecuted()
        Gets the total number of events executed
        Returns:
        the total number of events executed
      • getActualEndingTime

        public double getActualEndingTime()
        The simulated time that the Executive actually ended
        Returns:
        the simulated time that the Executive actually ended
      • isEndEventScheduled

        public final boolean isEndEventScheduled()
        Returns true if an event has been scheduled to stop execution at getTimeHorizon()
        Returns:
        true if scheduled
      • hasNextEvent

        public final boolean hasNextEvent()
        Checks to see if the event calendar has another event
        Returns:
        true if it has another event
      • peekNextEvent

        public final JSLEvent peekNextEvent()
        Returns a reference to the next event or null if no event exists. Does not remove or execute the event. The event remains at the "top" of the calendar.
        Returns:
        a reference to the next event
      • getLastExecutedEvent

        public final JSLEvent getLastExecutedEvent()
        Returns a reference to the last executed event or null if no events have been executed or no more events
        Returns:
        the last event executed
      • initialize

        public final void initialize()
        Initialize the executive, making it ready to run events This clears any events in the calendar and prepares for execution
        Specified by:
        initialize in interface IterativeProcessIfc
      • executeNextEvent

        public final void executeNextEvent()
        Causes the next event to be executed if it exists
      • executeAllEvents

        public final void executeAllEvents()
      • end

        public final void end()
        Description copied from interface: IterativeProcessIfc
        The iterative process will continue until there are no more steps or its maximum execution time has been reached, whichever comes first. If this method is called the iterative process will stop processing (terminate) before the next step and not process the next step in the process. The current step will be completed. This method can be used to stop the process at an arbitrary step. Once stopped, the process must be restarted.
        Specified by:
        end in interface IterativeProcessIfc
      • end

        public final void end​(java.lang.String msg)
        Description copied from interface: IterativeProcessIfc
        The iterative process will continue until there are no more steps or its maximum execution time has been reached, whichever comes first. If this method is called the iterative process will stop processing (terminate) before the next step and not process the next step in the process. The current step will be completed. This method can be used to stop the process at an arbitrary step. Once stopped, the process must be restarted.
        Specified by:
        end in interface IterativeProcessIfc
        Parameters:
        msg - an option message to indicate the reason for stopping
      • isUnfinished

        public final boolean isUnfinished()
        Description copied from interface: IterativeProcessIfc
        The iterative process may end by a variety of means, this method checks if the iterative process ended but was unfinished, not all steps completed
        Specified by:
        isUnfinished in interface IterativeProcessIfc
        Returns:
        true if the process is not finished
      • isTimedOut

        public final boolean isTimedOut()
      • isStepCompleted

        public final boolean isStepCompleted()
        Description copied from interface: IterativeProcessIfc
        Checks if the iterative process is in the completed step state After the iterative process has successfully completed a step this method will return true
        Specified by:
        isStepCompleted in interface IterativeProcessIfc
        Returns:
        true if the iterative process completed the step
      • isRunning

        public final boolean isRunning()
        Description copied from interface: IterativeProcessIfc
        An iterative process is running if it is been told to run (i.e. runNext()) but has not yet been told to end().
        Specified by:
        isRunning in interface IterativeProcessIfc
        Returns:
        true if running
      • isInitialized

        public final boolean isInitialized()
        Description copied from interface: IterativeProcessIfc
        Checks if the iterative process is in the initialized state After the iterative process has been initialized this method will return true
        Specified by:
        isInitialized in interface IterativeProcessIfc
        Returns:
        true if initialized
      • isCreated

        public final boolean isCreated()
        Description copied from interface: IterativeProcessIfc
        Checks if the iterative process is in the created state. If the iterative process is in the created state this method will return true
        Specified by:
        isCreated in interface IterativeProcessIfc
        Returns:
        true if in the created state
      • isEnded

        public final boolean isEnded()
        Description copied from interface: IterativeProcessIfc
        Checks if the iterative process is in the ended state After the iterative process has been ended this method will return true
        Specified by:
        isEnded in interface IterativeProcessIfc
        Returns:
        true if ended
      • isEndConditionMet

        public final boolean isEndConditionMet()
      • isDone

        public final boolean isDone()
        Description copied from interface: IterativeProcessIfc
        A flag to indicate whether the iterative process is done A iterative process can be done if: 1) it ran all of its steps 2) it was ended by a client prior to completing all of its steps 3) it ended because it exceeded its maximum allowable execution time before completing all of its steps. 4) its end condition was satisfied
        Specified by:
        isDone in interface IterativeProcessIfc
        Returns:
        true if done
      • isCompleted

        public final boolean isCompleted()
      • getMaximumAllowedExecutionTime

        public final long getMaximumAllowedExecutionTime()
        Description copied from interface: IterativeProcessIfc
        Returns maximum (real) clock time allocated for the iterative process
        Specified by:
        getMaximumAllowedExecutionTime in interface IterativeProcessIfc
        Returns:
        the number as long representing milliseconds
      • setMaximumExecutionTime

        public final void setMaximumExecutionTime​(long milliseconds)
        Description copied from interface: IterativeProcessIfc
        Set the maximum allotted (suggested) execution (real) clock for the entire iterative process. This is a suggested time because the execution time requirement is only checked after the completion of an individual step After it is discovered that cumulative time for executing the step has exceeded the maximum time, then the iterative process will be ended (perhaps) not completing other steps.
        Specified by:
        setMaximumExecutionTime in interface IterativeProcessIfc
        Parameters:
        milliseconds - the time
      • getEndExecutionTime

        public final long getEndExecutionTime()
        Description copied from interface: IterativeProcessIfc
        Returns system time in milliseconds that the iterative process ended
        Specified by:
        getEndExecutionTime in interface IterativeProcessIfc
        Returns:
        the number as a long
      • getElapsedExecutionTime

        public final long getElapsedExecutionTime()
        Description copied from interface: IterativeProcessIfc
        Gets the clock time in milliseconds since the iterative process was initialized
        Specified by:
        getElapsedExecutionTime in interface IterativeProcessIfc
        Returns:
        a long representing the elapsed time
      • getBeginExecutionTime

        public final long getBeginExecutionTime()
        Description copied from interface: IterativeProcessIfc
        Returns system time in milliseconds that the iterative process started
        Specified by:
        getBeginExecutionTime in interface IterativeProcessIfc
        Returns:
        the number as a long
      • turnOnDefaultEventTraceReport

        public final void turnOnDefaultEventTraceReport()
        This method creates an instance of the default ExecutiveTraceReport and tells it to observe the scheduler.
      • turnOnDefaultEventTraceReport

        public final void turnOnDefaultEventTraceReport​(java.lang.String name)
        This method creates an instance of the default ExecutiveTraceReport and tells it to observe the scheduler.
        Parameters:
        name - specifies a prefix name for the report
      • turnOffDefaultEventTraceReport

        public final void turnOffDefaultEventTraceReport()
        Removes the default ExecutiveTraceReport as an observer of the Executive and sets it to null.
      • getDefaultExecutiveTraceReport

        public final java.util.Optional<ExecutiveTraceReport> getDefaultExecutiveTraceReport()
        Returns the default event trace report or null if it has not yet been turned on.
        Returns:
        the ExecutiveTraceReport
      • unregisterAllActions

        public final void unregisterAllActions()
      • setMaxScans

        public final void setMaxScans​(int max)
      • setMaxScanFlag

        public final void setMaxScanFlag​(boolean flag)
      • getMaxScans

        public final int getMaxScans()
      • getMaxScanFlag

        public final boolean getMaxScanFlag()
      • changePriority

        public final void changePriority​(ConditionalAction action,
                                         int priority)
      • stop

        public final void stop()
        Description copied from interface: IterativeProcessIfc
        This sets a flag to indicate to the process that is should stop after the next step is completed. This is different than end(). Calling end() immediately places the process in the End state. The process needs to be in a valid state before end() can be used. Calling stop tells the process to eventually get into the end state. stop() can be used to arbitrarily stop the process based on some user defined condition.
        Specified by:
        stop in interface IterativeProcessIfc
      • stop

        public final void stop​(java.lang.String msg)
        Description copied from interface: IterativeProcessIfc
        This sets a flag to indicate to the process that is should stop after the next step is completed. This is different than end(). Calling end() immediately places the process in the End state. The process needs to be in a valid state before end() can be used. Calling stop tells the process to eventually get into the end state. stop() can be used to arbitrarily stop the process based on some user defined condition.
        Specified by:
        stop in interface IterativeProcessIfc
        Parameters:
        msg - A string to represent the reason for the stopping
      • execute

        protected void execute​(JSLEvent event)
        Executes the provided event
        Parameters:
        event - represents the next event to execute or null
      • performCPhase

        protected void performCPhase()
      • schedule

        protected void schedule​(JSLEvent e)
      • scheduleEndEvent

        public final JSLEvent scheduleEndEvent​(double time,
                                               ModelElement theElement)
        Schedules the ending of the executive at the provided time
        Parameters:
        time - the time of the ending event, must be > 0
        theElement - the associated model element
        Returns:
        the scheduled event
      • getEndEvent

        public final JSLEvent getEndEvent()
        Returns the Executive's end event if scheduled
        Returns:
        The Executive's end event if scheduled, or null if not
      • isExecutionTimeExceeded

        public boolean isExecutionTimeExceeded()
        Description copied from interface: IterativeProcessIfc
        Returns if the elapsed execution time exceeds the maximum time allowed. Only true if the maximum was set and elapsed time is greater than or equal to getMaximumAllowedExecutionTime()
        Specified by:
        isExecutionTimeExceeded in interface IterativeProcessIfc
        Returns:
        true if the execution time exceeds getMaximumAllowedExecutionTime()
      • getNumberStepsCompleted

        public long getNumberStepsCompleted()
        Description copied from interface: IterativeProcessIfc
        Returns the number of steps completed since the iterative process was last initialized
        Specified by:
        getNumberStepsCompleted in interface IterativeProcessIfc
        Returns:
        the number of steps completed
      • turnOnTimer

        public void turnOnTimer​(long milliseconds)
        Description copied from interface: IterativeProcessIfc
        This method will cause the a timer to start allowing a TimerTask to be scheduled. This method causes a print to console task to be run which prints the elapsed time since initializing the iterative process.
        Specified by:
        turnOnTimer in interface IterativeProcessIfc
        Parameters:
        milliseconds - the time for the timer
      • allStepsCompleted

        public boolean allStepsCompleted()
        Description copied from interface: IterativeProcessIfc
        The iterative process may end by a variety of means, this method checks if the iterative process ended because it ran all of its steps
        Specified by:
        allStepsCompleted in interface IterativeProcessIfc
        Returns:
        true if all completed
      • executionTimeExceeded

        public boolean executionTimeExceeded()
        Description copied from interface: IterativeProcessIfc
        The iterative process may end by a variety of means, this method checks if the iterative process ended because it timed out
        Specified by:
        executionTimeExceeded in interface IterativeProcessIfc
        Returns:
        true if exceeded
      • stoppedByCondition

        public boolean stoppedByCondition()
        Description copied from interface: IterativeProcessIfc
        The iterative process may end by a variety of means, this method checks if the iterative process ended because it was stopped
        Specified by:
        stoppedByCondition in interface IterativeProcessIfc
        Returns:
        true if it was stopped via stop()
      • run

        public void run()
        Description copied from interface: IterativeProcessIfc
        Runs all of the steps of the iterative process. If the iterative process has not been initialized, then it will automatically be initialized. After attempting to run the steps, the process will be in the end() state. The process may or may not complete all of its steps.
        Specified by:
        run in interface IterativeProcessIfc
      • isRunningStep

        public boolean isRunningStep()
        Description copied from interface: IterativeProcessIfc
        Indicates that the iterative process is currently running an individual step
        Specified by:
        isRunningStep in interface IterativeProcessIfc
        Returns:
        true if the step is in progress
      • noStepsExecuted

        public boolean noStepsExecuted()
        Description copied from interface: IterativeProcessIfc
        Indicates that the iterative process ended because of no steps
        Specified by:
        noStepsExecuted in interface IterativeProcessIfc
        Returns:
        True if no steps are executed
      • beforeExecutingAnyEvents

        protected void beforeExecutingAnyEvents()
        This method is called before any events are executed and after initializing the iterative process. It can be used to insert behavior after initializing
      • afterExecution

        protected void afterExecution()
        This method is called after executing all events when ending the iterative process. It can be used to insert behavior after the executive ends
      • initializeCalendar

        protected void initializeCalendar()
        Tells the event calendar to clear all the events. Resets the simulation time to 0.0. Resets the event identification counter. Unregisters all actions Notifies observers of initialization
      • willTerminate

        public final boolean willTerminate()
        If the Executive has an end event or maximum allowed execution time, then return true
        Returns:
        true if the executive has an end event or max allowed execution time