streamit.scheduler2
Class Schedule

java.lang.Object
  extended by streamit.misc.AssertedClass
      extended by streamit.scheduler2.Schedule

public class Schedule
extends AssertedClass

Purpose: Schedule for External Users
Description:
This class represents a schedule. It can either hold a number of subschedules or it can hold a reference to a function that should be executed.

Version:
2
Author:
Michal Karczmarek

Constructor Summary
Schedule(Iterator stream)
          Create a schedule that will be used with many sub-schedules.
Schedule(Object workFunction, Iterator stream)
          Create the schedule to be a bottom schedule with a single work function.
 
Method Summary
 void addSubSchedule(Schedule subSchedule)
          Add a schedule to the list of sub-schedules of this schedule.
 void addSubSchedule(Schedule subSchedule, int numExecs)
          Add a schedule to be executed a certain # of times to the list of sub-schedules of this schedule.
 int getNumPhases()
          Get the number of phases in this schedule
 Iterator getStream()
          Returns the stream to which this schedule phase corresponds.
 Schedule getSubSched(int nSched)
          Get a subschedule of this schedule.
 int getSubSchedNumExecs(int nSched)
          Get the number of times a subschedule is to be executed.
 Object getWorkFunc()
          Returns the work function associated with a schedule.
 int hashCode()
          Use the identifier of this stream as the hashcode, to ensure deterministic behavior in sets and containers (was causing unpredictable exceptions).
 boolean isBottomSchedule()
          Checks if the Schedule is a bottom-level schedule.
 
Methods inherited from class streamit.misc.AssertedClass
ASSERT, ASSERT, ASSERT, ASSERT, ASSERT, ASSERT, ASSERT, ASSERT, ASSERT, ASSERT, ASSERT, ERROR, ERROR, ERROR, SASSERT, SASSERT, SASSERT, SASSERT, SASSERT, SASSERT, SASSERT, SASSERT, SERROR, SERROR, SERROR
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Schedule

public Schedule(Iterator stream)
Create a schedule that will be used with many sub-schedules.


Schedule

public Schedule(Object workFunction,
                Iterator stream)
Create the schedule to be a bottom schedule with a single work function.

Method Detail

isBottomSchedule

public boolean isBottomSchedule()
Checks if the Schedule is a bottom-level schedule. If the Schedule contains a work function that needs to be called, it is a bottom schedule. This work function is always attached to a workStream. If it contains a bunch of sub-schedules, which need to be executed in order, this is not a bottom schedule.

Returns:
true if this Schedule is a bottom schedule

getNumPhases

public int getNumPhases()
Get the number of phases in this schedule

Returns:
number of phases in this schedule

getSubSched

public Schedule getSubSched(int nSched)
Get a subschedule of this schedule. If this is the final (lowest level - one that references a work function) schedule, this function will assert.

Returns:
subschedules of this schedule

getSubSchedNumExecs

public int getSubSchedNumExecs(int nSched)
Get the number of times a subschedule is to be executed.

Returns:
number of times a subschedule is to be executed

addSubSchedule

public void addSubSchedule(Schedule subSchedule)
Add a schedule to the list of sub-schedules of this schedule. This basically appends another schedule to the subScheds, thus augmenting the current schedule from the end.


addSubSchedule

public void addSubSchedule(Schedule subSchedule,
                           int numExecs)
Add a schedule to be executed a certain # of times to the list of sub-schedules of this schedule. This basically appends another schedule to the subScheds, thus augmenting the current schedule from the end.


getWorkFunc

public Object getWorkFunc()
Returns the work function associated with a schedule. If the schedule isn't a bottom-level schedule, this function will assert.

Returns:
work function associated with schedule

getStream

public Iterator getStream()
Returns the stream to which this schedule phase corresponds.

Returns:
schedule's stream

hashCode

public int hashCode()
Use the identifier of this stream as the hashcode, to ensure deterministic behavior in sets and containers (was causing unpredictable exceptions).

Overrides:
hashCode in class Object