ptolemy.domains.ct.kernel
Class CTSchedule

java.lang.Object
  extended by ptolemy.actor.sched.ScheduleElement
      extended by ptolemy.actor.sched.Schedule
          extended by ptolemy.domains.ct.kernel.CTSchedule

public class CTSchedule
extends Schedule

A static schedule for CT models. This class overrides the base class and uses an ArrayList implementation for the first level of the schedule, so that accessing subschedules takes constant time. A CT schedule is an array of schedules. The array always has length X, consisting of the following entries in that order (in a type-safe enumeration),

 CONTINUOUS_ACTORS
 DISCRETE_ACTORS
 DYNAMIC_ACTORS
 EVENT_GENERATORS
 OUTPUT_ACTORS
 OUTPUT_STEP_SIZE_CONTROL_ACTORS
 STATE_TRANSITION_ACTORS
 STATEFUL_ACTORS
 STATE_STEP_SIZE_CONTROL_ACTORS
 WAVEFORM_GENERATORS
 
Each entry is a schedule. Actors in the schedule are ordered according to the order they should be executed.

A typical use of this schedule is to get one of the above schedules. For example, to schedule an execution of dynamic actor schedule, (assume we have a CTScheduler called scheduler) do:

 CTSchedule schedule = scheduler.getSchedule();
 Iterator dynamicActorIterator =
 schedule.get(CTSchedule.DYNAMIC_ACTOR_SCHEDULE).actorIterator();
 

Since:
Ptolemy II 2.0
Version:
$Id: CTSchedule.java 57040 2010-01-27 20:52:32Z cxh $
Author:
Jie Liu, Haiyang Zheng
Accepted Rating:
Red (hyzheng)
Proposed Rating:
Yellow (hyzheng)

Field Summary
static int CONTINUOUS_ACTORS
          Index for actors in the continuous part of the system, not sorted.
static int DISCRETE_ACTORS
          Index for actors in the discrete part of the system, topologically ordered.
static int DYNAMIC_ACTORS
          Index for dynamic actor schedule, in a topologically reverse order.
static int EVENT_GENERATORS
          Index for the schedule of actors that implement the CTEventGenerator interface, topologically ordered.
static int OUTPUT_ACTORS
          Index for output schedule, topologically ordered.
static int OUTPUT_STEP_SIZE_CONTROL_ACTORS
          Index for the schedule of actors that are in the output map and implement the CTStepSizeControlActor, not ordered.
static int STATE_STEP_SIZE_CONTROL_ACTORS
          Index for the schedule of actors that are in the state transition map and implement the CTStepSizeControlActor interface, not ordered.
static int STATE_TRANSITION_ACTORS
          Index for state transition schedule, topologically sorted.
static int STATEFUL_ACTORS
          Index for the schedule of actors that implement the CTStatefulActor interface, not ordered.
static int WAVEFORM_GENERATORS
          Index for the schedule of actors that implement the CTWaveformGenerator interface, not ordered.
 
Fields inherited from class ptolemy.actor.sched.Schedule
_schedule
 
Fields inherited from class ptolemy.actor.sched.ScheduleElement
_parent
 
Constructor Summary
CTSchedule()
          Construct a CTSchedule.
 
Method Summary
 java.lang.String toString()
          Return all the scheduling information in a Sting.
 
Methods inherited from class ptolemy.actor.sched.Schedule
actorIterator, add, add, firingIterator, get, iterator, remove, size
 
Methods inherited from class ptolemy.actor.sched.ScheduleElement
_getVersion, _incrementVersion, getIterationCount, setIterationCount, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CONTINUOUS_ACTORS

public static final int CONTINUOUS_ACTORS
Index for actors in the continuous part of the system, not sorted.

See Also:
Constant Field Values

DISCRETE_ACTORS

public static final int DISCRETE_ACTORS
Index for actors in the discrete part of the system, topologically ordered.

See Also:
Constant Field Values

DYNAMIC_ACTORS

public static final int DYNAMIC_ACTORS
Index for dynamic actor schedule, in a topologically reverse order.

See Also:
Constant Field Values

EVENT_GENERATORS

public static final int EVENT_GENERATORS
Index for the schedule of actors that implement the CTEventGenerator interface, topologically ordered.

See Also:
Constant Field Values

OUTPUT_ACTORS

public static final int OUTPUT_ACTORS
Index for output schedule, topologically ordered.

See Also:
Constant Field Values

OUTPUT_STEP_SIZE_CONTROL_ACTORS

public static final int OUTPUT_STEP_SIZE_CONTROL_ACTORS
Index for the schedule of actors that are in the output map and implement the CTStepSizeControlActor, not ordered.

See Also:
Constant Field Values

STATE_TRANSITION_ACTORS

public static final int STATE_TRANSITION_ACTORS
Index for state transition schedule, topologically sorted.

See Also:
Constant Field Values

STATEFUL_ACTORS

public static final int STATEFUL_ACTORS
Index for the schedule of actors that implement the CTStatefulActor interface, not ordered.

See Also:
Constant Field Values

STATE_STEP_SIZE_CONTROL_ACTORS

public static final int STATE_STEP_SIZE_CONTROL_ACTORS
Index for the schedule of actors that are in the state transition map and implement the CTStepSizeControlActor interface, not ordered.

See Also:
Constant Field Values

WAVEFORM_GENERATORS

public static final int WAVEFORM_GENERATORS
Index for the schedule of actors that implement the CTWaveformGenerator interface, not ordered.

See Also:
Constant Field Values
Constructor Detail

CTSchedule

public CTSchedule()
Construct a CTSchedule.

Method Detail

toString

public java.lang.String toString()
Return all the scheduling information in a Sting.

Overrides:
toString in class Schedule
Returns:
All the schedules.