public class NPPoissonProcessThinned_64Variate extends BasicSimEntity implements RandomVariate
Uses simkit.util.Math64.log() function for replicability on 64-bit platforms. ;
| 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, propertyDEFAULT_ENTITY_NAME, DEFAULT_EVENT_NAME, DEFAULT_PRIORITY, EVENT_METHOD_PREFIX, NL| Constructor and Description |
|---|
NPPoissonProcessThinned_64Variate()
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, waitDelayaddSimEventListener, getSimEventListeners, notifyListeners, removeSimEventListenerclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddSimEventListener, getSimEventListeners, notifyListeners, removeSimEventListenerprivate double lambda
private RandomNumber rng
private java.lang.Object rateInvoker
private java.lang.reflect.Method rateMethod
protected double startTime
protected double lastTime
public NPPoissonProcessThinned_64Variate()
public void reset()
reset in interface ReRunnablereset in class BasicSimEntitypublic 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 RandomVariatepublic java.lang.Object[] getParameters()
getParameters in interface RandomVariatepublic void setParameters(java.lang.Object... obj)
setParameters in interface RandomVariateobj - 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()
RandomVariategetRandomNumber in interface RandomVariatepublic void setRandomNumber(RandomNumber rng)
RandomVariatesetRandomNumber in interface RandomVariaterng - 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()
BasicSimEntitytoString in class BasicSimEntitypublic void handleSimEvent(SimEvent event)
SimEventSchedulerhandleSimEvent in interface SimEventSchedulerhandleSimEvent in class BasicSimEntityevent - The SimEvent to be handled.public void processSimEvent(SimEvent event)
BasicSimEntityprocessSimEvent in interface SimEventListenerprocessSimEvent in class BasicSimEntityevent - The SimEvent to process.