Class ModelElementState

    • Constructor Detail

      • ModelElementState

        public ModelElementState​(ModelElement parent)
      • ModelElementState

        public ModelElementState​(ModelElement parent,
                                 java.lang.String name)
      • ModelElementState

        public ModelElementState​(ModelElement parent,
                                 java.lang.String name,
                                 boolean useStatistic)
    • Method Detail

      • notifyStateEnteredListeners

        protected void notifyStateEnteredListeners()
      • getStateAccessor

        public final StateAccessorIfc getStateAccessor()
        Allows the accumulated state information to be accessed
        Returns:
        the StateAccessorIfc
      • enter

        public final void enter()
        Causes the state to be entered at the current simulation time
      • enter

        public final void enter​(double time)
        Causes the state to be entered with the time entered set to the supplied value
        Parameters:
        time - the time entered
      • exit

        public final double exit()
        Causes the state to be exited at the current simulation time
        Returns:
        the time of exit
      • exit

        public final double exit​(double time)
        Causes the state to be exited with the time exited recorded as the supplied time
        Parameters:
        time - the time exited
        Returns:
        the time spent in the state as a double
      • getSojournTimeCollectionFlag

        public final boolean getSojournTimeCollectionFlag()
        Indicates whether or not statistics should be collected on the sojourn times within the state
        Returns:
        Returns the collect sojourn time flag.
      • turnOnSojournTimeCollection

        public final void turnOnSojournTimeCollection()
        Turns on statistical collection for the sojourn time in the state
      • turnOffSojournTimeCollection

        public final void turnOffSojournTimeCollection()
        Turns off statistical collection of the sojourn times in the state
      • resetSojournTimeStatistics

        public final void resetSojournTimeStatistics()
        Resets the statistics collected on the sojourn time in the state
      • resetStateCollection

        public final void resetStateCollection()
        Resets the counters for the number of times a state was entered, exited, and the total time spent in the state
      • getNumberOfTimesEntered

        public final double getNumberOfTimesEntered()
        Description copied from interface: StateAccessorIfc
        Gets the number of times the state was entered
        Specified by:
        getNumberOfTimesEntered in interface StateAccessorIfc
        Returns:
        A double representing the number of times entered
      • getNumberOfTimesExited

        public final double getNumberOfTimesExited()
        Description copied from interface: StateAccessorIfc
        Gets the number of times the state was exited
        Specified by:
        getNumberOfTimesExited in interface StateAccessorIfc
        Returns:
        A double representing the number of times exited
      • getSojournTimeStatistic

        public final java.util.Optional<Statistic> getSojournTimeStatistic()
        Description copied from interface: StateAccessorIfc
        Gets a statistic that collected sojourn times
        Specified by:
        getSojournTimeStatistic in interface StateAccessorIfc
        Returns:
        A statistic for sojourn times or null if use statistic was false
      • getTimeStateEntered

        public final double getTimeStateEntered()
        Description copied from interface: StateAccessorIfc
        Gets the time that the state was last entered
        Specified by:
        getTimeStateEntered in interface StateAccessorIfc
        Returns:
        A double representing the time that the state was last entered
      • getTimeStateExited

        public final double getTimeStateExited()
        Description copied from interface: StateAccessorIfc
        Gets the time that the state was last exited
        Specified by:
        getTimeStateExited in interface StateAccessorIfc
        Returns:
        A double representing the time that the state was last exited
      • getTotalTimeInState

        public final double getTotalTimeInState()
        Description copied from interface: StateAccessorIfc
        Gets the total time spent in the state
        Specified by:
        getTotalTimeInState in interface StateAccessorIfc
        Returns:
        a double representing the total sojourn time
      • isEntered

        public final boolean isEntered()
        Description copied from interface: StateAccessorIfc
        Gets whether or not the state has been entered
        Specified by:
        isEntered in interface StateAccessorIfc
        Returns:
        True means that the state has been entered
      • initialize

        protected void initialize()
        Description copied from class: ModelElement
        This method should be overridden by subclasses that need actions performed to initialize prior to a replication. It is called once before each replication occurs if the model element wants initialization. It is called after beforeReplication() is called
        Overrides:
        initialize in class ModelElement
      • warmUp

        protected void warmUp()
        Description copied from class: ModelElement
        This method should be overridden by subclasses that need actions performed at the warm up event during each replication. It is called once during each replication if the model element reacts to warm up actions.
        Overrides:
        warmUp in class ModelElement
      • onEnter

        protected void onEnter()
        can be overwritten by subclasses to perform work when the state is entered
      • onExit

        protected void onExit()
        can be overwritten by subclasses to perform work when the state is exited