Class NHPPEventGenerator

    • Method Detail

      • isEventPending

        public final boolean isEventPending()
        Specified by:
        isEventPending in interface EventGeneratorIfc
        Returns:
        true if an event is scheduled to occur for the generator
      • isGeneratorStarted

        public final boolean isGeneratorStarted()
        Specified by:
        isGeneratorStarted in interface EventGeneratorIfc
        Returns:
        true if the generator has been started (turned on) either automatically or manually
      • getEndingTime

        public double getEndingTime()
        Description copied from interface: EventGeneratorIfc
        Gets the currently planned ending time of the generator.
        Specified by:
        getEndingTime in interface EventGeneratorIfc
        Returns:
        A double representing the ending time.
      • getInitialEndingTime

        public double getInitialEndingTime()
        Description copied from interface: EventGeneratorIfc
        Returns the ending time that is to be used when the generator is initialized for each replication.
        Specified by:
        getInitialEndingTime in interface EventGeneratorIfc
        Returns:
        Returns the initial ending time that is to be used when the generator
      • getMaximumNumberOfEvents

        public long getMaximumNumberOfEvents()
        Description copied from interface: EventGeneratorIfc
        Gets the maximum number of actions for the generator. This is set by the supplied maxNum upon creation of the generator. This implies that it will be the same for every simulation replication.
        Specified by:
        getMaximumNumberOfEvents in interface EventGeneratorIfc
        Returns:
        A long representing the maximum number of actions for the generator.
      • getInitialMaximumNumberOfEvents

        public long getInitialMaximumNumberOfEvents()
        Description copied from interface: EventGeneratorIfc
        Returns the maximum number of events that is used for initializing each replication
        Specified by:
        getInitialMaximumNumberOfEvents in interface EventGeneratorIfc
        Returns:
        the initial maximum number of events
      • getNumberOfEventsGenerated

        public long getNumberOfEventsGenerated()
        Description copied from interface: EventGeneratorIfc
        Gets the number of events that have been generated by the generator
        Specified by:
        getNumberOfEventsGenerated in interface EventGeneratorIfc
        Returns:
        the number of events that have been generated
      • getInitialTimeUntilFirstEvent

        public RandomIfc getInitialTimeUntilFirstEvent()
        Description copied from interface: EventGeneratorIfc
        Gets the RandomIfc that will be used at the beginning of each replication to generate the time until the first event
        Specified by:
        getInitialTimeUntilFirstEvent in interface EventGeneratorIfc
        Returns:
        RandomIfc that will be used at the beginning of each replication to generate the time until the first event
      • isGeneratorDone

        public boolean isGeneratorDone()
        Description copied from interface: EventGeneratorIfc
        This method checks to see if the generator is done. In other words, if it has been turned off.
        Specified by:
        isGeneratorDone in interface EventGeneratorIfc
        Returns:
        True means that it is done.
      • isSuspended

        public boolean isSuspended()
        Description copied from interface: EventGeneratorIfc
        Indicates whether or not the generator has been suspended
        Specified by:
        isSuspended in interface EventGeneratorIfc
        Returns:
        true if generator is suspended
      • resume

        public void resume()
        Description copied from interface: EventGeneratorIfc
        Resume the generation of events according to the time between event distribution.
        Specified by:
        resume in interface EventGeneratorIfc
      • setEndingTime

        public void setEndingTime​(double endingTime)
        Description copied from interface: EventGeneratorIfc
        Sets the ending time for generating events for the current replication. A new ending time will be applied to the generator. If this change results in an ending time that is less than the current time, the generator will be turned off
        Specified by:
        setEndingTime in interface EventGeneratorIfc
        Parameters:
        endingTime - the ending time for generating events
      • setInitialEndingTime

        public void setInitialEndingTime​(double endingTime)
        Description copied from interface: EventGeneratorIfc
        This value is used to set the ending time for generating actions for each replication. Changing this variable during a replication cause the next replication to use this value for its ending time.
        Specified by:
        setInitialEndingTime in interface EventGeneratorIfc
        Parameters:
        endingTime - value is used to set the initial ending time for generating actions
      • setMaximumNumberOfEvents

        public void setMaximumNumberOfEvents​(long maxNum)
        Description copied from interface: EventGeneratorIfc
        Sets the maximum number of events for the generator. Must not be infinite (Long.MAX_VALUE) if the current time between events is 0.0
        Specified by:
        setMaximumNumberOfEvents in interface EventGeneratorIfc
        Parameters:
        maxNum - maximum number of events
      • setInitialMaximumNumberOfEvents

        public void setInitialMaximumNumberOfEvents​(long maxNumEvents)
        Description copied from interface: EventGeneratorIfc
        Sets the the maximum number of events to be used to initialize each replication. The time between events cannot evaluate to a constant value of 0.0 if the maximum number of events is infinite (Long.MAX_VALUE). Uses the current value for initial time between events
        Specified by:
        setInitialMaximumNumberOfEvents in interface EventGeneratorIfc
        Parameters:
        maxNumEvents - the the maximum number of events
      • setTimeBetweenEvents

        public void setTimeBetweenEvents​(RandomIfc timeBtwEvents,
                                         long maxNumEvents)
        Description copied from interface: EventGeneratorIfc
        Sets the time between events and the maximum number of events for the generator. These two parameters are dependent. The time between events cannot always evaluate to 0.0 if the maximum number of events is infinite (Long.MAX_VALUE). This method only changes these parameters for the current replication. The changes take effect when the next event is generated. If current number of events that have been generated is greater than or equal to the supplied maximum number of events, the generator will be turned off.
        Specified by:
        setTimeBetweenEvents in interface EventGeneratorIfc
        Parameters:
        timeBtwEvents - the time between events
        maxNumEvents - the maximum number of events
      • setTimeBetweenEvents

        public void setTimeBetweenEvents​(RandomIfc timeUntilNext)
        Description copied from interface: EventGeneratorIfc
        Sets the time between event random source. Must not always evaluate to 0.0, if the current setting of the maximum number of events is infinite (Long.MAX_VALUE)
        Specified by:
        setTimeBetweenEvents in interface EventGeneratorIfc
        Parameters:
        timeUntilNext - time until the next event
      • setInitialTimeBetweenEventsAndMaxNumEvents

        public void setInitialTimeBetweenEventsAndMaxNumEvents​(RandomIfc timeBtwEvents,
                                                               long maxNumEvents)
        Description copied from interface: EventGeneratorIfc
        Sets the time between events and the maximum number of events to be used to initialize each replication. These parameters are dependent. The time between events cannot evaluate to a constant value of 0.0 if the maximum number of events is infinite (Long.MAX_VALUE)
        Specified by:
        setInitialTimeBetweenEventsAndMaxNumEvents in interface EventGeneratorIfc
        Parameters:
        timeBtwEvents - the initial time between events
        maxNumEvents - the initial maximum number of events
      • setInitialTimeBetweenEvents

        public void setInitialTimeBetweenEvents​(RandomIfc timeBtwEvents)
        Description copied from interface: EventGeneratorIfc
        Sets the time between events and the maximum number of events to be used to initialize each replication. The time between events cannot evaluate to a constant value of 0.0. The maximum number of events is kept at its current value, which by default is Long.Max_Value
        Specified by:
        setInitialTimeBetweenEvents in interface EventGeneratorIfc
        Parameters:
        timeBtwEvents - the time between events
      • setInitialTimeUntilFirstEvent

        public void setInitialTimeUntilFirstEvent​(RandomIfc timeUntilFirst)
        Description copied from interface: EventGeneratorIfc
        Sets the RandomIfc representing the time until the first event that is used at the beginning of each replication to generate the time until the first event. This change becomes effective at the beginning of the next replication to execute
        Specified by:
        setInitialTimeUntilFirstEvent in interface EventGeneratorIfc
        Parameters:
        timeUntilFirst - , The supplied RandomIfc, cannot be null
      • suspend

        public void suspend()
        Description copied from interface: EventGeneratorIfc
        Suspends the generation of events and cancels the next scheduled event from the generator
        Specified by:
        suspend in interface EventGeneratorIfc
      • getStartOnInitializeFlag

        public final boolean getStartOnInitializeFlag()
        Description copied from interface: EventGeneratorIfc
        This flag indicates whether or not the generator will automatically start at the beginning of a replication when initialized. By default this option is true.
        Specified by:
        getStartOnInitializeFlag in interface EventGeneratorIfc
        Returns:
        true if on
      • setStartOnInitializeFlag

        public final void setStartOnInitializeFlag​(boolean flag)
        Description copied from interface: EventGeneratorIfc
        Sets the flag that indicates whether or not the generator will automatically start at the beginning of a replication when initialized
        Specified by:
        setStartOnInitializeFlag in interface EventGeneratorIfc
        Parameters:
        flag - true indicates automatic start
      • turnOnGenerator

        public final void turnOnGenerator()
        Description copied from interface: EventGeneratorIfc
        If the generator was not started upon initialization at the beginning of a replication, then this method can be used to start the generator The generator will be started 0.0 time units after the call If this method is used when the generator is already started it does nothing. If this method is used after the generator is done it does nothing. If this method is used after the generator has been suspended it does nothing. Use suspend() and resume() to suspend and resume a generator that has already been started.
        Specified by:
        turnOnGenerator in interface EventGeneratorIfc
      • turnOnGenerator

        public final void turnOnGenerator​(double t)
        Description copied from interface: EventGeneratorIfc
        If the generator was not started upon initialization at the beginning of a replication, then this method can be used to start the generator The generator will be started t time units after the call If this method is used when the generator is already started it does nothing. If this method is used after the generator is done it does nothing. If this method is used after the generator has been suspended it does nothing. Use suspend() and resume() to suspend and resume a generator that has already been started.
        Specified by:
        turnOnGenerator in interface EventGeneratorIfc
        Parameters:
        t - The time until the generator should be turned on
      • turnOnGenerator

        public void turnOnGenerator​(RandomIfc r)
        Description copied from interface: EventGeneratorIfc
        If the generator was not started upon initialization at the beginning of a replication, then this method can be used to start the generator The generator will be started r.getValue() time units after the call If this method is used when the generator is already started it does nothing. If this method is used after the generator is done it does nothing. If this method is used after the generator has been suspended it does nothing. Use suspend() and resume() to suspend and resume a generator that has already been started.
        Specified by:
        turnOnGenerator in interface EventGeneratorIfc
        Parameters:
        r - The time until the generator should be turned on
      • turnOffGenerator

        public void turnOffGenerator()
        Description copied from interface: EventGeneratorIfc
        This method turns the generator off, the next scheduled generation event will NOT occur, i.e. this method will also cancel a previously scheduled generation event if one exists. No future events will be scheduled after turning off the generator
        Specified by:
        turnOffGenerator in interface EventGeneratorIfc