Class NHPPTimeBtwEventRV
- java.lang.Object
-
- jsl.simulation.ModelElement
-
- jsl.modeling.elements.variable.RandomVariable
-
- jsl.modeling.elements.variable.nhpp.NHPPTimeBtwEventRV
-
- All Implemented Interfaces:
RandomElementIfc
,ObservableIfc
,StreamOptionIfc
,GetNameIfc
,GetValueIfc
,IdentityIfc
,RandomIfc
,GetRandomNumberStreamIfc
,RNStreamControlIfc
,SetRandomNumberStreamIfc
,SampleIfc
public class NHPPTimeBtwEventRV extends RandomVariable
-
-
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 double
myCycleLength
The length of a cycle if it repeatsprotected double
myCycleStartTime
Holds the time that the cycle started, where a cycle is the time period over which the rate function is defined.protected double
myLastRate
If supplied and the repeat flag is false then this rate will be used after the range of the rate function has been passedprotected int
myNumCycles
The number of cycles completed if cyclesprotected double
myPPTime
Holds the time of the last event from the underlying Poisson processprotected ExponentialRV
myRate1Expo
Used to schedule the end of cycles if they repeatprotected InvertibleCumulativeRateFunctionIfc
myRateFunction
Supplied to invert the rate function.protected boolean
myRepeatFlag
Indicates whether or not the rate function should repeat when its range has been coveredprotected RNStreamIfc
myRNStream
protected boolean
myUseLastRateFlag
Turned on if the time goes past the rate function's range and a last rate was supplied-
Fields inherited from class jsl.modeling.elements.variable.RandomVariable
myAdvanceToNextSubStreamOption, myCaptureResponseFlag, myInitialRandomSource, myInitialRandomSourceChangeWarning, myRandomSource, myResetStartStreamOption, myResponse
-
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 NHPPTimeBtwEventRV(ModelElement parent, InvertibleCumulativeRateFunctionIfc rateFunction)
NHPPTimeBtwEventRV(ModelElement parent, InvertibleCumulativeRateFunctionIfc rateFunction, double lastRate)
NHPPTimeBtwEventRV(ModelElement parent, InvertibleCumulativeRateFunctionIfc rateFunction, double lastRate, java.lang.String name)
NHPPTimeBtwEventRV(ModelElement parent, InvertibleCumulativeRateFunctionIfc rateFunction, java.lang.String name)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description InvertibleCumulativeRateFunctionIfc
getRateFunction()
Returns the rate functiondouble
getValue()
Each call to getValue() returns a new observationprotected void
initialize()
This method should be overridden by subclasses that need actions performed to initialize prior to a replication.protected void
setRateFunction(InvertibleCumulativeRateFunctionIfc rateFunction)
Sets the rate function for the random variable.-
Methods inherited from class jsl.modeling.elements.variable.RandomVariable
advanceToNextSubstream, afterReplication, asString, beforeExperiment, getAntitheticOption, getCapturedResponse, getCaptureResponseFlag, getInitialRandomSource, getInitialRandomSourceChangeWarningOption, getRandomNumberStream, getRandomSource, getResetNextSubStreamOption, getResetStartStreamOption, getSumOfValues, removedFromModel, resetStartStream, resetStartSubstream, sample, setAntitheticOption, setInitialRandomSource, setInitialRandomSourceChangeWarningOption, setRandomNumberStream, setRandomSource, setResetNextSubStreamOption, setResetStartStreamOption, turnOnResponseCapture
-
Methods inherited from class jsl.simulation.ModelElement
addObserver, addObserverToModelElements, afterExperiment, afterExperiment_, afterReplication_, 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_, 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
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface jsl.utilities.random.rng.GetRandomNumberStreamIfc
getStreamNumber
-
Methods inherited from interface jsl.utilities.random.rng.SetRandomNumberStreamIfc
setRandomNumberStream
-
-
-
-
Field Detail
-
myCycleStartTime
protected double myCycleStartTime
Holds the time that the cycle started, where a cycle is the time period over which the rate function is defined.
-
myCycleLength
protected double myCycleLength
The length of a cycle if it repeats
-
myNumCycles
protected int myNumCycles
The number of cycles completed if cycles
-
myPPTime
protected double myPPTime
Holds the time of the last event from the underlying Poisson process
-
myRateFunction
protected InvertibleCumulativeRateFunctionIfc myRateFunction
Supplied to invert the rate function.
-
myLastRate
protected double myLastRate
If supplied and the repeat flag is false then this rate will be used after the range of the rate function has been passed
-
myRepeatFlag
protected boolean myRepeatFlag
Indicates whether or not the rate function should repeat when its range has been covered
-
myUseLastRateFlag
protected boolean myUseLastRateFlag
Turned on if the time goes past the rate function's range and a last rate was supplied
-
myRate1Expo
protected final ExponentialRV myRate1Expo
Used to schedule the end of cycles if they repeat
-
myRNStream
protected RNStreamIfc myRNStream
-
-
Constructor Detail
-
NHPPTimeBtwEventRV
public NHPPTimeBtwEventRV(ModelElement parent, InvertibleCumulativeRateFunctionIfc rateFunction)
- Parameters:
parent
- the parentrateFunction
- the rate function
-
NHPPTimeBtwEventRV
public NHPPTimeBtwEventRV(ModelElement parent, InvertibleCumulativeRateFunctionIfc rateFunction, java.lang.String name)
- Parameters:
parent
- the parentrateFunction
- the rate functionname
- the name
-
NHPPTimeBtwEventRV
public NHPPTimeBtwEventRV(ModelElement parent, InvertibleCumulativeRateFunctionIfc rateFunction, double lastRate)
- Parameters:
parent
- the parentrateFunction
- the rate functionlastRate
- the last rate
-
NHPPTimeBtwEventRV
public NHPPTimeBtwEventRV(ModelElement parent, InvertibleCumulativeRateFunctionIfc rateFunction, double lastRate, java.lang.String name)
- Parameters:
parent
- the parentrateFunction
- the rate functionlastRate
- the last ratename
- the name
-
-
Method Detail
-
getRateFunction
public InvertibleCumulativeRateFunctionIfc getRateFunction()
Returns the rate function- Returns:
- the function
-
setRateFunction
protected final void setRateFunction(InvertibleCumulativeRateFunctionIfc rateFunction)
Sets the rate function for the random variable. Must not be null- Parameters:
rateFunction
- the rate function
-
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 classModelElement
-
getValue
public final double getValue()
Description copied from class:RandomVariable
Each call to getValue() returns a new observation- Specified by:
getValue
in interfaceGetValueIfc
- Overrides:
getValue
in classRandomVariable
- Returns:
- The value.
-
-