Class SchedulingChoice<T extends SchedulingChoiceValue>

java.lang.Object
org.mpi_sws.jmc.runtime.scheduling.SchedulingChoice<T>
Type Parameters:
T - the type of value associated with the scheduling choice

public class SchedulingChoice<T extends SchedulingChoiceValue> extends Object
Represents a scheduling choice in the JMC runtime.

This class encapsulates a scheduling choice, which can either be a task to be executed, a blocking task, or an end of the schedule. It also allows for the inclusion of additional values associated with the scheduling choice.

  • Constructor Details

    • SchedulingChoice

      public SchedulingChoice(Long taskId, T value)
      Constructs a new SchedulingChoice object with a value.
      Parameters:
      taskId - the ID of the task associated with this scheduling choice
      value - the value associated with this scheduling choice
  • Method Details

    • getTaskId

      public Long getTaskId()
      Returns the ID of the task associated with this scheduling choice.
      Returns:
      the ID of the task
    • getValue

      public T getValue()
      Returns the value associated with this scheduling choice.
      Returns:
      the value of type T
    • isBlockTask

      public boolean isBlockTask()
      Checks if this scheduling choice is a blocking task.
      Returns:
      true if it is a blocking task, false otherwise
    • isEnd

      public boolean isEnd()
      Checks if this scheduling choice is the end of the schedule.
      Returns:
      true if it is the end of the schedule, false otherwise
    • isBlockExecution

      public boolean isBlockExecution()
      Checks if this scheduling choice blocks execution.
      Returns:
      true if it blocks execution, false otherwise
    • blockTask

      public static SchedulingChoice<?> blockTask(Long taskId)
      Creates a scheduling choice that blocks a specific task.
      Parameters:
      taskId - the ID of the task to block
      Returns:
      a SchedulingChoice that blocks the specified task
    • blockExecution

      public static SchedulingChoice<?> blockExecution()
      Creates a scheduling choice that blocks execution.
      Returns:
      a SchedulingChoice that blocks execution
    • task

      public static SchedulingChoice<?> task(Long taskId)
      Creates a scheduling choice for a specific task without any value.
      Parameters:
      taskId - the ID of the task
      Returns:
      a SchedulingChoice for the specified task
    • task

      public static <T extends SchedulingChoiceValue> SchedulingChoice<T> task(Long taskId, T value)
      Creates a scheduling choice for a specific task with a value.
      Type Parameters:
      T - the type of value associated with the scheduling choice
      Parameters:
      taskId - the ID of the task
      value - the value associated with the scheduling choice
      Returns:
      a SchedulingChoice for the specified task with the given value
    • end

      public static SchedulingChoice<?> end()
      Creates a scheduling choice that indicates the end of the task schedule.
      Returns:
      a SchedulingChoice that signifies the end of the schedule
    • toString

      public String toString()
      Overrides:
      toString in class Object