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
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 Summary
ConstructorsConstructorDescriptionSchedulingChoice(Long taskId, T value) Constructs a new SchedulingChoice object with a value. -
Method Summary
Modifier and TypeMethodDescriptionstatic SchedulingChoice<?> Creates a scheduling choice that blocks execution.static SchedulingChoice<?> Creates a scheduling choice that blocks a specific task.static SchedulingChoice<?> end()Creates a scheduling choice that indicates the end of the task schedule.Returns the ID of the task associated with this scheduling choice.getValue()Returns the value associated with this scheduling choice.booleanChecks if this scheduling choice blocks execution.booleanChecks if this scheduling choice is a blocking task.booleanisEnd()Checks if this scheduling choice is the end of the schedule.static SchedulingChoice<?> Creates a scheduling choice for a specific task without any value.static <T extends SchedulingChoiceValue>
SchedulingChoice<T> Creates a scheduling choice for a specific task with a value.toString()
-
Constructor Details
-
SchedulingChoice
Constructs a new SchedulingChoice object with a value.- Parameters:
taskId- the ID of the task associated with this scheduling choicevalue- the value associated with this scheduling choice
-
-
Method Details
-
getTaskId
Returns the ID of the task associated with this scheduling choice.- Returns:
- the ID of the task
-
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
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
Creates a scheduling choice that blocks execution.- Returns:
- a SchedulingChoice that blocks execution
-
task
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
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 taskvalue- the value associated with the scheduling choice- Returns:
- a SchedulingChoice for the specified task with the given value
-
end
Creates a scheduling choice that indicates the end of the task schedule.- Returns:
- a SchedulingChoice that signifies the end of the schedule
-
toString
-