Class FixedPriorityScheduler

  • All Implemented Interfaces:
    java.lang.Cloneable, Actor, ActorExecutionAspect, Executable, FiringsRecordable, Initializable, TypedActor, Changeable, Debuggable, DebugListener, Decorator, Derivable, Instantiable, ModelErrorHandler, MoMLExportable, Moveable, Nameable
    Direct Known Subclasses:
    EDFScheduler

    public class FixedPriorityScheduler
    extends AtomicExecutionAspect
    This is a fixed priority scheduler resource manager on a single processor or core. This attribute decorates actors in the model at the same and lower levels of the hierarchy, including those inside opaque composite actors. It decorates them with the following parameters:
    • enable: If true, then the decorated actor will use this resource. This is a boolean that defaults to false.
    • executionTime: Specifies the execution time of the decorated actor. This means the time that the decorated actor occupies the processor or core when it fires. This is a double that defaults to 0.0.
    • priority: An integer where a lower number indicates a higher priority. E.g., priority 1 means higher priority than priority 2. Priority 0 means higher priority than any positive number. Priority -1 means higher priority than any non-negative number.
    For usage and supported directors, see ActorExecutionAspect. When using this ExecutionAspect in the Ptides domain, the platform time in Ptides will be used to schedule execution times. When the Ptides director requests that an actor fire, if this resource is free, it will immediately schedule it. Otherwise, it will queue it to be executed when the resource becomes free. When the resource becomes free, the actor with the highest priority (the lower priority number) will be chosen from the queue to be executed. If two actors have the same highest priority, then they will be executed in FIFO order.
    Since:
    Ptolemy II 10.0
    Version:
    $Id$
    Author:
    Patricia Derler, Edward A. Lee
    Pt.AcceptedRating:
    Red (derler)
    Pt.ProposedRating:
    Yellow (eal)
    • Field Detail

      • preemptive

        public Parameter preemptive
        Parameter to configure whether a preemptive or non-preemptive scheduling strategy should be used. The default value is the boolean value true.
      • LOWEST_PRIORITY

        public static int LOWEST_PRIORITY
        Lowest task priority.
      • _currentlyExecuting

        protected java.util.Stack<NamedObj> _currentlyExecuting
        Stack of currently executing actors.
    • Constructor Detail

      • FixedPriorityScheduler

        public FixedPriorityScheduler​(CompositeEntity container,
                                      java.lang.String name)
                               throws IllegalActionException,
                                      NameDuplicationException
        Create a new actor in the specified container with the specified name. The name must be unique within the container or an exception is thrown. The container argument must not be null, or a NullPointerException will be thrown.
        Parameters:
        container - The container.
        name - The name of this actor within the container.
        Throws:
        IllegalActionException - If this actor cannot be contained by the proposed container (see the setContainer() method).
        NameDuplicationException - If the name coincides with an entity already in the container.