com.azalient.api.b.control
Interface IPhase

All Superinterfaces:
IRecord, RecordR, RecordRW, RecordW, SortableData, StoreRecordRW

public interface IPhase
extends StoreRecordRW

A signal phase (also called a "stage"), which represents set of traffic and pedestrian movements which are given a "go" signal for a fixed or variable period of time.


Field Summary
static String IX_PHASE_SEPARATOR
           
static IPhase[] ZERO
           
 
Fields inherited from interface com.azalient.api.a.tables.IRecord
DELETED, KEY_SEP, KEY_SEP_CHAR
 
Method Summary
 void addToPlans(IUndoStack us)
           
 void adjust(double[] da)
          Set an array of adjustments (of size J) that will be applied over the next J phases
 IPhase[] associate()
          Return any associate phase, for example phase D might return { D1, D2, }
 IPhase associateBus()
          Return any associated bus phase
 double cancel(int cycles)
          Phase was extended, but now extension should be terminated.
 IController controller()
          The signal controller which controls this phase
 boolean delete(IUndoStack us)
           
 double elapsed()
          Returns the elapsed time for this (running) phase.
 void elapsed(double d)
          Set the elapsed time for this (running) phase.
 double expired()
          Deprecated. use elapsed()
 void expired(double d)
          Deprecated. use elapsed()
 int extend(double ext, int cycles)
          Extend the phase by the given extension, balancing this by reducing the same phase over given number of subsequent cycles.
 boolean extending()
          Return true if this phase is extending because of the actions of a rule
 double extension()
          Return the time extension currently applying to this phase.
 IGapOutData gapOut()
          Return the (playback) gap-out data for this phase
 double green()
          Returns the stored green time for this phase
 void green(double t)
          Set the stored green time for this phase
 int index()
          An index number for this phase, in the range 1..N.
 IIntersection intersection()
          The intersection to which this phase applies
 boolean isRunning()
          Returns true if this phase is currently running
 void isRunning(boolean b)
           
 String letterStr()
          The "name" of this phase, such as "A" or "D1".
 double maximum()
          Returns the maximum green time for this phase
 double minimum()
          Returns the minimum green time for this phase
 double nextGreen()
          Return the next green time after any adjustment that will be made
 double nextGreenShift()
          Make adjustment[0], shift adjustment array and return the (adjusted) next green time
 boolean onGreen()
           
 double red()
          Returns the stored red time for this phase
 void red(double t)
          Set the stored red time for this phase
 double remaining()
          Returns the remaining (green) run-time for this (running) phase.
 void remaining(double t)
           
 double remainingRed()
          Returns the remaining red (inter-green) run-time for this (running) phase.
 double remainingYellow()
          Returns the remaining yellow run-time for this (running) phase.
 void reset()
          Extension and rebalancing are finished.
 void rewind()
           
 boolean selected()
          Return true if this object is selected in the GUI
 void selected(boolean b)
          Set to true to mark this object as being selected in the GUI
 Signal signal()
          Get the signal state for this phase; valid values are { GREEN, YELLOW, RED }
 Signal signal(IGroup group)
          Get the signal for the given group when this phase is running; valid values are { GREEN, RED, OFF }
 void signal(IGroup group, Signal signal)
          Set the signal for the given group when this phase is running; valid values are { GREEN, RED, OFF }
 void signal(Signal setSignal, IPhase nextPhase)
          Set the signal state for this phase; valid values are { GREEN, YELLOW, RED }
 Signal[] signalArray()
          Get the signals for all groups on the controller when this phase is running; valid values are { GREEN, RED, OFF }
 void signalArray(Signal[] pa)
          Set the signals for all groups on the controller when this phase is running; valid values are { GREEN, RED, OFF }
 boolean stretch()
          Returns true if this phase has been designated as the stretch phase.
 boolean stretchDynamic()
          Returns True if this phase is temporarily stretchable - a parameter that can be changed dynamically, and is not saved with the phase
 void stretchDynamic(boolean b)
          Allow this phase to stretch, but do not save the setting in the file.
 boolean stretchStatic()
          Returns True if this phase is permanently stretchable - this is a parameter saved with the phase
 boolean terminating()
          Returns true if this phase is going to terminate soon because of a rule
 void terminating(boolean b)
           
 void tick(double tick)
           
 double yellow()
          Returns the stored yellow time for this phase
 void yellow(double t)
          Set the stored yellow time for this phase
 
Methods inherited from interface com.azalient.api.file.StoreRecordRW
canRename, rename, store
 
Methods inherited from interface com.azalient.api.file.RecordR
extraSet, finished, isApplicable, isEditable, set
 
Methods inherited from interface com.azalient.api.a.tables.IRecord
name
 
Methods inherited from interface com.azalient.api.file.RecordW
extraCols, extraGet, extraGetB, extraGetD, extraGetI, extraGetS, extraGetT, get, isVolatile
 

Field Detail

ZERO

static final IPhase[] ZERO

IX_PHASE_SEPARATOR

static final String IX_PHASE_SEPARATOR
See Also:
Constant Field Values
Method Detail

intersection

IIntersection intersection()
The intersection to which this phase applies


controller

IController controller()
The signal controller which controls this phase


signalArray

void signalArray(Signal[] pa)
Set the signals for all groups on the controller when this phase is running; valid values are { GREEN, RED, OFF }


signalArray

Signal[] signalArray()
Get the signals for all groups on the controller when this phase is running; valid values are { GREEN, RED, OFF }


signal

Signal signal(IGroup group)
Get the signal for the given group when this phase is running; valid values are { GREEN, RED, OFF }


signal

void signal(IGroup group,
            Signal signal)
Set the signal for the given group when this phase is running; valid values are { GREEN, RED, OFF }


signal

void signal(Signal setSignal,
            IPhase nextPhase)
Set the signal state for this phase; valid values are { GREEN, YELLOW, RED }


signal

Signal signal()
Get the signal state for this phase; valid values are { GREEN, YELLOW, RED }


index

int index()
An index number for this phase, in the range 1..N. Phases are normally referred to by a letter character (A,B,C,...) or a letter-number combination (D1, D2, ...)


letterStr

String letterStr()
The "name" of this phase, such as "A" or "D1". The full name() contains the intersection name and the phases, in the form 1001_A


isRunning

boolean isRunning()
Returns true if this phase is currently running


stretch

boolean stretch()
Returns true if this phase has been designated as the stretch phase. There is normally only a single stretch phase on an intersection. If signal rules are defined, and there is no explicit "other" phase target for the time gained or lost by time change made by a rule, then the time will be taken from, or given to, the stretch phase.


stretchStatic

boolean stretchStatic()
Returns True if this phase is permanently stretchable - this is a parameter saved with the phase


stretchDynamic

boolean stretchDynamic()
Returns True if this phase is temporarily stretchable - a parameter that can be changed dynamically, and is not saved with the phase


expired

double expired()
Deprecated. use elapsed()


expired

void expired(double d)
Deprecated. use elapsed()


elapsed

double elapsed()
Returns the elapsed time for this (running) phase.


elapsed

void elapsed(double d)
Set the elapsed time for this (running) phase.


remaining

double remaining()
Returns the remaining (green) run-time for this (running) phase.


remainingYellow

double remainingYellow()
Returns the remaining yellow run-time for this (running) phase.


remainingRed

double remainingRed()
Returns the remaining red (inter-green) run-time for this (running) phase.


minimum

double minimum()
Returns the minimum green time for this phase


maximum

double maximum()
Returns the maximum green time for this phase


isRunning

void isRunning(boolean b)
Internal - Not recommended for use. Public as a side-effect of implementation method
Set to true if this phase is currently running

remaining

void remaining(double t)
Internal - Not recommended for use. Public as a side-effect of implementation method
Set the remaining green time for this phase

extend

int extend(double ext,
           int cycles)
Extend the phase by the given extension, balancing this by reducing the same phase over given number of subsequent cycles. Return the actual number of cycles used to balance


cancel

double cancel(int cycles)
Phase was extended, but now extension should be terminated. Time gained should be added to given number of following cycles. The time gained is returned


reset

void reset()
Extension and rebalancing are finished. Reset phase to default values


green

double green()
Returns the stored green time for this phase


yellow

double yellow()
Returns the stored yellow time for this phase


red

double red()
Returns the stored red time for this phase


green

void green(double t)
Set the stored green time for this phase


yellow

void yellow(double t)
Set the stored yellow time for this phase


red

void red(double t)
Set the stored red time for this phase


nextGreenShift

double nextGreenShift()
Make adjustment[0], shift adjustment array and return the (adjusted) next green time


nextGreen

double nextGreen()
Return the next green time after any adjustment that will be made


adjust

void adjust(double[] da)
Set an array of adjustments (of size J) that will be applied over the next J phases


rewind

void rewind()
Internal - Not recommended for use. Public as a side-effect of implementation method
Reset phase on time rewind

onGreen

boolean onGreen()
Internal - Not recommended for use. Public as a side-effect of implementation method

associate

IPhase[] associate()
Return any associate phase, for example phase D might return { D1, D2, }


associateBus

IPhase associateBus()
Return any associated bus phase


gapOut

IGapOutData gapOut()
Return the (playback) gap-out data for this phase


selected

boolean selected()
Return true if this object is selected in the GUI


selected

void selected(boolean b)
Set to true to mark this object as being selected in the GUI


terminating

boolean terminating()
Returns true if this phase is going to terminate soon because of a rule


terminating

void terminating(boolean b)
Internal - Not recommended for use. Public as a side-effect of implementation method
Set to true to mark this phase as terminated (by a rule)

stretchDynamic

void stretchDynamic(boolean b)
Allow this phase to stretch, but do not save the setting in the file.


extending

boolean extending()
Return true if this phase is extending because of the actions of a rule


extension

double extension()
Return the time extension currently applying to this phase. This extension is set by an "Extend" rule


tick

void tick(double tick)
Internal - Not recommended for use. Public as a side-effect of implementation method

addToPlans

void addToPlans(IUndoStack us)
Internal - Not recommended for use. Public as a side-effect of implementation method

delete

boolean delete(IUndoStack us)
Internal - Not recommended for use. Public as a side-effect of implementation method