Package jline.lang

Class Event

java.lang.Object
jline.lang.Event
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
RenvEvent

public class Event extends Object implements Serializable
Class abstracting an event within a Network model
See Also:
  • Field Details

  • Constructor Details

    • Event

      public Event(EventType event, int node, int jobclass)
      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 occurred
      node - the node index where the event occurred
      jobclass - 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 occurred
      node - the node index where the event occurred
      jobclass - the job class index associated with the event
      prob - the probability associated with this event
      state - the system state matrix when this event occurred
      t - the time when this event occurred
      job - 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 occurred
      node - the node index where the event occurred
      jobclass - the job class index associated with the event
      probFun - function that computes probability based on current system state
      state - the system state matrix when this event occurred
      t - the time when this event occurred
      job - the job identifier associated with this event
  • Method Details

    • getEvent

      public EventType getEvent()
      Gets the type of this event.
      Returns:
      the event type
    • setEvent

      public void setEvent(EventType event)
      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

      public 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
      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

      public Matrix getState()
      Gets the system state matrix when this event occurred.
      Returns:
      the state matrix, or empty matrix if not set
    • setState

      public void setState(Matrix state)
      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