public class NPPoissonProcessThinnedVariate extends BasicSimEntity implements RandomVariate
Modifier and Type | Field and Description |
---|---|
private double |
lambda |
protected double |
lastTime
The previous time returned by generate().
|
private java.lang.Object |
rateInvoker |
private java.lang.reflect.Method |
rateMethod |
private RandomNumber |
rng |
protected double |
startTime
The starting time for the process.
|
eventList, property
DEFAULT_ENTITY_NAME, DEFAULT_EVENT_NAME, DEFAULT_PRIORITY, EVENT_METHOD_PREFIX, NL
Constructor and Description |
---|
NPPoissonProcessThinnedVariate()
Constructor to create an object without the parameters set.
|
Modifier and Type | Method and Description |
---|---|
double |
generate()
This uses the thinning algorithm of Lewis and Shedler.
|
double |
getLambda()
Get the first parameter - the maximum value of the rate function over the
time span of the process.
|
double |
getLastTime()
Get the previous time that was generated by the process.
|
java.lang.Object[] |
getParameters()
Get the three parameters of this process: lambda (max rate, double),
rateInvoker (Object), and rateMethod (String)
|
RandomNumber |
getRandomNumber()
Returns the instance of the supporting RandomNumber
|
java.lang.Object |
getRateInvoker()
Get the second parameter - the object containing the method which computes
the rate function.
|
java.lang.reflect.Method |
getRateMethod()
Get the method that computes the rate function within rateInvoker
|
double |
getStartTime()
Get the starting time for the process.
|
void |
handleSimEvent(SimEvent event)
Typically an Event is handled (as opposed to processed, as in SimEventListener)
by actually executing a method.
|
void |
processSimEvent(SimEvent event)
Process the given SimEvent.
|
void |
reset()
Rests startTime and lastTime to the starting simulation time.
|
void |
setLambda(double lambda)
Set the first parameter - the maximum value of the rate function over the
time span of the process.
|
void |
setParameters(java.lang.Object... obj)
Set the three parameters of this process: lambda (max rate, double),
rateInvoker (Object), and rateMethod (String)
|
void |
setRandomNumber(RandomNumber rng)
Sets the supporting RandomNumber object
|
void |
setRateInvoker(java.lang.Object rateInvoker)
Set the second parameter - the object containing the method which computes
the rate function.
|
void |
setRateMethod(java.lang.reflect.Method rateMethod)
set the method that computes the rate function within rateInvoker
|
java.lang.String |
toString()
A default string description of this entity, name (Entity Priority)
<list of all properties as key = value pairs>
|
addPropertyChangeListener, addPropertyChangeListener, attemptSchedule, clearAddedProperty, compareTo, fireIndexedPropertyChange, fireIndexedPropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAddedProperties, getEventList, getEventListID, getName, getPriority, getPropertiesString, getProperty, getProperty, getPropertyChangeListeners, getSerial, interrupt, interrupt, interruptAll, interruptAll, interruptAll, interruptAllWithArgs, interruptAllWithArgs, isClearAddedPropertiesOnReset, isJustDefinedProperties, isPersistant, isReRunnable, isVerbose, parametersMatch, removePropertyChangeListener, removePropertyChangeListener, resetNextSerial, setClearAddedPropertiesOnReset, setEventList, setEventListID, setJustDefinedProperties, setName, setPersistant, setPriority, setProperty, setVerbose, waitDelay, waitDelay, waitDelay, waitDelay
addSimEventListener, getSimEventListeners, notifyListeners, removeSimEventListener
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addSimEventListener, getSimEventListeners, notifyListeners, removeSimEventListener
private double lambda
private RandomNumber rng
private java.lang.Object rateInvoker
private java.lang.reflect.Method rateMethod
protected double startTime
protected double lastTime
public NPPoissonProcessThinnedVariate()
public void reset()
reset
in interface ReRunnable
reset
in class BasicSimEntity
public double generate()
lambda
here)
(i.e. a rate that is greater than any rate in the non-
homogeneous PP). It is then accepted with probability
λ(t);/λ*; - here lambdaT
is λ(t);.generate
in interface RandomVariate
public java.lang.Object[] getParameters()
getParameters
in interface RandomVariate
public void setParameters(java.lang.Object... obj)
setParameters
in interface RandomVariate
obj
- Array of three objects with the three parameters.public double getLambda()
public void setLambda(double lambda)
lambda
- The maximum value of the rate function.public RandomNumber getRandomNumber()
RandomVariate
getRandomNumber
in interface RandomVariate
public void setRandomNumber(RandomNumber rng)
RandomVariate
setRandomNumber
in interface RandomVariate
rng
- The RandomNumber instance supporting the generating algorithmpublic java.lang.Object getRateInvoker()
public void setRateInvoker(java.lang.Object rateInvoker)
rateInvoker
- The object used to invoke the rate function.public java.lang.reflect.Method getRateMethod()
public void setRateMethod(java.lang.reflect.Method rateMethod)
rateMethod
- The method that computes the rate function.public double getStartTime()
public double getLastTime()
public java.lang.String toString()
BasicSimEntity
toString
in class BasicSimEntity
public void handleSimEvent(SimEvent event)
SimEventScheduler
handleSimEvent
in interface SimEventScheduler
handleSimEvent
in class BasicSimEntity
event
- The SimEvent to be handled.public void processSimEvent(SimEvent event)
BasicSimEntity
processSimEvent
in interface SimEventListener
processSimEvent
in class BasicSimEntity
event
- The SimEvent to process.