ptolemy.domains.ct.kernel
Class CTSchedule

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

public class CTSchedule
extends ptolemy.actor.sched.Schedule

A 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 LinkedList. The array always has length X, consisting of the following entries in that order (in a type-safe enumeration),

   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 the schedule is to get one of the subschedules. For example, to schedule the CT execution and get the iterator for 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,v 1.19 2004/04/13 05:12:47 cxh Exp $
Author:
Jie Liu
Accepted Rating:
Red (liuj)
Proposed Rating:
Yellow (liuj)

Field Summary
static int CONTINUOUS_ACTORS
          Index for actors in the continuous part of the system, unordered.
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.
static int EVENT_GENERATORS
          Index for actors implement the CTEventGenerator interface.
static int OUTPUT_ACTORS
          Index for output schedule.
static int OUTPUT_STEP_SIZE_CONTROL_ACTORS
          Index for actors that are in the output map and implement the CTStepSizeControlActor.
static int STATE_STEP_SIZE_CONTROL_ACTORS
          Index for actors that are in the state transition map and implement the CTStepSizeControlActor interface.
static int STATE_TRANSITION_ACTORS
          Index for state transition schedule.
static int STATEFUL_ACTORS
          Index for actors that implement the CTStatefulActor interface.
static int WAVEFORM_GENERATORS
          Index for actors that implement the CTWaveformGenerator interface.
 
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

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

CONTINUOUS_ACTORS

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

See Also:
Constant Field Values

DYNAMIC_ACTORS

public static final int DYNAMIC_ACTORS
Index for dynamic actor schedule.

See Also:
Constant Field Values

EVENT_GENERATORS

public static final int EVENT_GENERATORS
Index for actors implement the CTEventGenerator interface.

See Also:
Constant Field Values

OUTPUT_ACTORS

public static final int OUTPUT_ACTORS
Index for output schedule.

See Also:
Constant Field Values

OUTPUT_STEP_SIZE_CONTROL_ACTORS

public static final int OUTPUT_STEP_SIZE_CONTROL_ACTORS
Index for actors that are in the output map and implement the CTStepSizeControlActor.

See Also:
Constant Field Values

STATE_TRANSITION_ACTORS

public static final int STATE_TRANSITION_ACTORS
Index for state transition schedule.

See Also:
Constant Field Values

STATEFUL_ACTORS

public static final int STATEFUL_ACTORS
Index for actors that implement the CTStatefulActor interface.

See Also:
Constant Field Values

STATE_STEP_SIZE_CONTROL_ACTORS

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

See Also:
Constant Field Values

WAVEFORM_GENERATORS

public static final int WAVEFORM_GENERATORS
Index for actors that implement the CTWaveformGenerator interface.

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.

Returns:
All the schedules.