Class Event
-
- All Implemented Interfaces:
-
java.io.Serializable
public class Event implements Serializable
Class abstracting an event within a Network model
-
-
Constructor Summary
Constructors Constructor Description Event(EventType event, int node, int jobclass)Creates a new Event with basic parameters. Event(EventType event, int node, int jobclass, double prob, Matrix state, double t, double job)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 Type Method Description EventTypegetEvent()Gets the type of this event. voidsetEvent(EventType event)Sets the type of this event. doublegetJob()Gets the job identifier associated with this event. voidsetJob(double job)Sets the job identifier for this event. intgetJobClass()Gets the job class index associated with this event. voidsetJobClass(int jobclass)Sets the job class index for this event. intgetNode()Gets the node index where this event occurred. voidsetNode(int node)Sets the node index where this event occurred. doublegetProb(Pair<Map<Node, Matrix>, Map<Node, Matrix>> state)Computes the probability of this event using the probability function and current system state. doublegetProb()Gets the fixed probability value for this event. voidsetProb(double prob)Sets the fixed probability value for this event. SerializableFunction<Pair<Map<Node, Matrix>, Map<Node, Matrix>>, Double>getProbFun()Gets the probability function used to dynamically compute event probability. voidsetProbFun(SerializableFunction<Pair<Map<Node, Matrix>, Map<Node, Matrix>>, Double> probFun)Sets the probability function to dynamically compute event probability based on system state. MatrixgetState()Gets the system state matrix when this event occurred. voidsetState(Matrix state)Sets the system state matrix for this event. doublegetT()Gets the time when this event occurred. voidsetT(double t)Sets the time when this event occurred. -
-
Constructor Detail
-
Event
Event(EventType event, int node, int jobclass)
Creates a new Event with basic parameters.- Parameters:
event- the type of event that occurrednode- the node index where the event occurredjobclass- the job class index associated with the event
-
Event
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
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.- 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 Detail
-
setEvent
void setEvent(EventType event)
Sets the type of this event.
- Parameters:
event- the new event type
-
getJob
double getJob()
Gets the job identifier associated with this event.
- Returns:
the job identifier, or NaN if not set
-
setJob
void setJob(double job)
Sets the job identifier for this event.
- Parameters:
job- the job identifier
-
getJobClass
int getJobClass()
Gets the job class index associated with this event.
- Returns:
the job class index
-
setJobClass
void setJobClass(int jobclass)
Sets the job class index for this event.
- Parameters:
jobclass- the job class index
-
getNode
int getNode()
Gets the node index where this event occurred.
- Returns:
the node index
-
setNode
void setNode(int node)
Sets the node index where this event occurred.
- Parameters:
node- the node index
-
getProb
double getProb(Pair<Map<Node, Matrix>, Map<Node, Matrix>> state)
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
-
getProb
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
void setProb(double prob)
Sets the fixed probability value for this event.
- Parameters:
prob- the probability value
-
getProbFun
SerializableFunction<Pair<Map<Node, Matrix>, Map<Node, Matrix>>, Double> getProbFun()
Gets the probability function used to dynamically compute event probability.
- Returns:
the probability function, or null if using fixed probability
-
setProbFun
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
Matrix getState()
Gets the system state matrix when this event occurred.
- Returns:
the state matrix, or empty matrix if not set
-
setState
void setState(Matrix state)
Sets the system state matrix for this event.
- Parameters:
state- the system state matrix
-
getT
double getT()
Gets the time when this event occurred.
- Returns:
the event time, or NaN if not set
-
setT
void setT(double t)
Sets the time when this event occurred.
- Parameters:
t- the event time
-
-
-
-