Package jline.lang
Class Event
java.lang.Object
jline.lang.Event
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
RenvEvent
Class abstracting an event within a Network model
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new Event with basic parameters.Creates a new Event with all basic parameters specified.Event(EventType event, int node, int jobclass, SerializableFunction<Pair<Map<Node, Matrix>, Map<Node, Matrix>>, Double> probFun, Matrix state, double t, double job) Creates a new Event where probability is determined by a function of system state. -
Method Summary
Modifier and TypeMethodDescriptiongetEvent()Gets the type of this event.doublegetJob()Gets the job identifier associated with this event.intGets the job class index associated with this event.intgetNode()Gets the node index where this event occurred.doublegetProb()Gets the fixed probability value for this event.doubleComputes the probability of this event using the probability function and current system state.Gets the probability function used to dynamically compute event probability.getState()Gets the system state matrix when this event occurred.doublegetT()Gets the time when this event occurred.voidSets the type of this event.voidsetJob(double job) Sets the job identifier for this event.voidsetJobClass(int jobclass) Sets the job class index for this event.voidsetNode(int node) Sets the node index where this event occurred.voidsetProb(double prob) Sets the fixed probability value for this event.voidsetProbFun(SerializableFunction<Pair<Map<Node, Matrix>, Map<Node, Matrix>>, Double> probFun) Sets the probability function to dynamically compute event probability based on system state.voidSets the system state matrix for this event.voidsetT(double t) Sets the time when this event occurred.
-
Field Details
-
node
protected int node -
event
-
jobclass
protected int jobclass -
prob
protected double prob -
probFun
-
state
-
t
protected double t -
job
protected double job
-
-
Constructor Details
-
Event
Creates a new Event with basic parameters. Other properties are initialized with default values: probability = NaN, state = empty matrix, time = NaN, job = NaN, probFun = null.- Parameters:
event- the type of event that occurrednode- the node index where the event occurredjobclass- the job class index associated with the event
-
Event
public Event(EventType event, int node, int jobclass, double prob, Matrix state, double t, double job) Creates a new Event with all basic parameters specified.- Parameters:
event- the type of event that occurrednode- the node index where the event occurredjobclass- the job class index associated with the eventprob- the probability associated with this eventstate- the system state matrix when this event occurredt- the time when this event occurredjob- the job identifier associated with this event
-
Event
public Event(EventType event, int node, int jobclass, SerializableFunction<Pair<Map<Node, Matrix>, Map<Node, Matrix>>, Double> probFun, Matrix state, double t, double job) Creates a new Event where probability is determined by a function of system state. The probability parameter is set to NaN since it will be computed dynamically.- Parameters:
event- the type of event that occurrednode- the node index where the event occurredjobclass- the job class index associated with the eventprobFun- function that computes probability based on current system statestate- the system state matrix when this event occurredt- the time when this event occurredjob- the job identifier associated with this event
-
-
Method Details
-
getEvent
Gets the type of this event.- Returns:
- the event type
-
setEvent
Sets the type of this event.- Parameters:
event- the new event type
-
getJob
public double getJob()Gets the job identifier associated with this event.- Returns:
- the job identifier, or NaN if not set
-
setJob
public void setJob(double job) Sets the job identifier for this event.- Parameters:
job- the job identifier
-
getJobClass
public int getJobClass()Gets the job class index associated with this event.- Returns:
- the job class index
-
setJobClass
public void setJobClass(int jobclass) Sets the job class index for this event.- Parameters:
jobclass- the job class index
-
getNode
public int getNode()Gets the node index where this event occurred.- Returns:
- the node index
-
setNode
public void setNode(int node) Sets the node index where this event occurred.- Parameters:
node- the node index
-
getProb
Computes the probability of this event using the probability function and current system state. This method requires that a probability function was set during construction.- Parameters:
state- the current system state as a pair of node-to-matrix mappings- Returns:
- the computed probability
- Throws:
NullPointerException- if no probability function was set
-
getProb
public double getProb()Gets the fixed probability value for this event.- Returns:
- the probability, or NaN if not set or if using a probability function
-
setProb
public void setProb(double prob) Sets the fixed probability value for this event.- Parameters:
prob- the probability value
-
getProbFun
Gets the probability function used to dynamically compute event probability.- Returns:
- the probability function, or null if using fixed probability
-
setProbFun
public void setProbFun(SerializableFunction<Pair<Map<Node, Matrix>, Map<Node, Matrix>>, Double> probFun) Sets the probability function to dynamically compute event probability based on system state.- Parameters:
probFun- function that takes system state and returns probability
-
getState
Gets the system state matrix when this event occurred.- Returns:
- the state matrix, or empty matrix if not set
-
setState
Sets the system state matrix for this event.- Parameters:
state- the system state matrix
-
getT
public double getT()Gets the time when this event occurred.- Returns:
- the event time, or NaN if not set
-
setT
public void setT(double t) Sets the time when this event occurred.- Parameters:
t- the event time
-