org.eclipse.ohf.stem.core.sequencer
Interface Sequencer

All Superinterfaces:
org.eclipse.emf.ecore.EObject, Identifiable, org.eclipse.emf.common.notify.Notifier, SanityChecker
All Known Subinterfaces:
RealTimeSequencer, SequentialSequencer
All Known Implementing Classes:
RealTimeSequencerImpl, SequencerImpl, SequentialSequencerImpl

public interface Sequencer
extends Identifiable

A Sequencer is the computational unit that determines the sequence of time points at which the state of the canonical Graph is determined. It also is used to determine if and when the sequence terminates.

See Also:
Scenario#step(), STEMTime

Field Summary
static long UNKNOWN_DURATION
          This constant is returned by getEndTime() when a Sequencer has no specified end time.
 
Method Summary
 STEMTime getCurrentTime()
           
 int getCycle()
          obtain the number of processing cycles that have been completed.
 long getDuration()
           
 STEMTime getEndTime()
           
 STEMTime getNextTime()
           
 STEMTime getStartTime()
           
 long getTimeDelta()
           
 double getWorkComplete()
           
 int getWorkIncrement()
           
 boolean isTimeToStop()
           
 void reset()
          Set the current time to the start time and prepare the Sequencer to begin computing the next time from that point.
 void setCurrentTime(STEMTime value)
          Sets the value of the 'Current Time' containment reference.
 void setCycle(int value)
          Sets the value of the 'Cycle' attribute.
 void setDuration(long value)
          Sets the value of the 'Duration' attribute.
 void setEndTime(STEMTime value)
          Sets the value of the 'End Time' containment reference.
 void setStartTime(STEMTime value)
          Sets the value of the 'Start Time' containment reference.
 void setWorkComplete(double value)
          Sets the value of the 'Work Complete' attribute.
 
Methods inherited from interface org.eclipse.ohf.stem.core.common.Identifiable
getDublinCore, getTypeURI, getURI, sane, setDublinCore, setTypeURI, setURI
 
Methods inherited from interface org.eclipse.emf.ecore.EObject
eAllContents, eClass, eContainer, eContainingFeature, eContainmentFeature, eContents, eCrossReferences, eGet, eGet, eIsProxy, eIsSet, eResource, eSet, eUnset
 
Methods inherited from interface org.eclipse.emf.common.notify.Notifier
eAdapters, eDeliver, eNotify, eSetDeliver
 

Field Detail

UNKNOWN_DURATION

static final long UNKNOWN_DURATION
This constant is returned by getEndTime() when a Sequencer has no specified end time.

See Also:
getDuration(), Constant Field Values
Method Detail

getStartTime

STEMTime getStartTime()
Returns:
the start time of the sequence.

setStartTime

void setStartTime(STEMTime value)
Sets the value of the 'Start Time' containment reference.

Parameters:
value - the new value of the 'Start Time' containment reference.
See Also:
getStartTime()

getEndTime

STEMTime getEndTime()
Returns:
the ending time of the sequence, or UNKNOWN_DURATION if there is no end time.

setEndTime

void setEndTime(STEMTime value)
Sets the value of the 'End Time' containment reference.

Parameters:
value - the new value of the 'End Time' containment reference.
See Also:
getEndTime()

getCurrentTime

STEMTime getCurrentTime()
Returns:
the Sequencer's current time.

setCurrentTime

void setCurrentTime(STEMTime value)
Sets the value of the 'Current Time' containment reference.

Parameters:
value - the new value of the 'Current Time' containment reference.
See Also:
getCurrentTime()

getNextTime

STEMTime getNextTime()
Returns:
the next time point in the sequence. As a side effect the sequencer's current time is set to the returned value.

getTimeDelta

long getTimeDelta()
Returns:
the time difference in milliseconds between the value returned by getCurrentTime() and that returned by getNextTime(). This value is only valid after a call to getNextTime().
See Also:
getCurrentTime(), getNextTime()

getDuration

long getDuration()
Returns:
the total amount of time in milliseconds in the sequence. If there is no ending time specified for the sequence, the constant UNKNOWN_DURATION is returned.
See Also:
UNKNOWN_DURATION

setDuration

void setDuration(long value)
Sets the value of the 'Duration' attribute.

Parameters:
value - the new value of the 'Duration' attribute.
See Also:
getDuration()

isTimeToStop

boolean isTimeToStop()
Returns:
true if the sequence has ended.

reset

void reset()
Set the current time to the start time and prepare the Sequencer to begin computing the next time from that point. Also reset the amount of work complete

See Also:
getNextTime(), getWorkComplete()

getWorkComplete

double getWorkComplete()
Returns:
an value (0-100) representing the percentage of the sequence that has been completed so far. If no end time has been specified, then return 0.

setWorkComplete

void setWorkComplete(double value)
Sets the value of the 'Work Complete' attribute.

Parameters:
value - the new value of the 'Work Complete' attribute.
See Also:
getWorkComplete()

getWorkIncrement

int getWorkIncrement()
Returns:
an integer (0-100) representing the precentage of the sequence that was completed by the time delta between the previous two calls to getNextTime()

getCycle

int getCycle()
obtain the number of processing cycles that have been completed. It will return 0 if no cycles have been completed or if the simulation was reset or is just starting.

Returns:
number of completed cycles.

setCycle

void setCycle(int value)
Sets the value of the 'Cycle' attribute.

Parameters:
value - the new value of the 'Cycle' attribute.
See Also:
getCycle()