AnyLogic
Expand
Font size
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<TaskPreemptionPolicy>

public enum TaskPreemptionPolicy
extends java.lang.Enum<TaskPreemptionPolicy>
TaskPreemptionPolicy

Enum Constant Summary

Enum Constants 
PP_CONTINUE_WITHOUT_RESOURCE
Entity-service specific policy.
PP_NO_PREEMPTION
The task cannot be interrupted by any high priority task
PP_SEIZE_ANY_RESOURCE  
PP_TERMINATE_SERVING
The unit task will be interrupted by any task with higher priority and will be terminated (forgotten).
Entity will not be suspended.
PP_WAIT_FOR_ORIGINAL_RESOURCE  
Enum Constant Description

Method Summary

All Methods Static Methods Concrete Methods 
static TaskPreemptionPolicy valueOf​(java.lang.String name)
Returns the enum constant of this type with the specified name.
static TaskPreemptionPolicy[] values()
Returns an array containing the constants of this enum type, in the order they are declared.
Modifier and Type Method Description

Methods inherited from class java.lang.Enum

compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf

Methods inherited from class java.lang.Object

getClass, notify, notifyAll, wait, wait, wait

Enum Constant Detail

PP_NO_PREEMPTION

public static final TaskPreemptionPolicy PP_NO_PREEMPTION
The task cannot be interrupted by any high priority task

PP_TERMINATE_SERVING

public static final TaskPreemptionPolicy PP_TERMINATE_SERVING
The unit task will be interrupted by any task with higher priority and will be terminated (forgotten).
Entity will not be suspended. It will just lose ALL resource units obtained in this Seize. Custom action may be defined using "On Task Terminated" (where the default action is remove entity from its current flowchart block)

PP_CONTINUE_WITHOUT_RESOURCE

public static final TaskPreemptionPolicy PP_CONTINUE_WITHOUT_RESOURCE
Entity-service specific policy. The unit task will be interrupted by any task with higher priority and will be terminated (forgotten). Entity will not be suspended. It will just lose ONLY one resource unit (which is being preempted). Custom action may be defined using "On Task lost unit" (where the default action is remove entity from its current flowchart block)

PP_SEIZE_ANY_RESOURCE

public static final TaskPreemptionPolicy PP_SEIZE_ANY_RESOURCE

PP_WAIT_FOR_ORIGINAL_RESOURCE

public static final TaskPreemptionPolicy PP_WAIT_FOR_ORIGINAL_RESOURCE

Method Detail

values

public static TaskPreemptionPolicy[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (TaskPreemptionPolicy c : TaskPreemptionPolicy.values())
    System.out.println(c);
Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static TaskPreemptionPolicy valueOf​(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null
How can we improve this article?