![]() |
Eclipse SUMO - Simulation of Urban MObility
|
This class handles the transition logic between two phases. More...
#include <NEMAController.h>
Public Types | |
typedef NEMAPhase * | PhasePtr |
Typedef for commonly used phase pointer. | |
Public Member Functions | |
int | getDistance (PhaseTransitionLogic *otherTrans) |
return the ring distance that this transition represents | |
PhasePtr | getFromPhase (void) const |
get the from phase | |
PhasePtr | getToPhase (void) const |
get the to phase | |
bool | okay (NEMALogic *controller) |
This function is the main PhaseTransitionLogic function It is called by the fromPhase to check if a transition to the toPhase is acceptable. | |
PhaseTransitionLogic (PhasePtr fromPhase, PhasePtr toPhase) | |
Construct a new Phase Transition Logic object. | |
void | setDistance (int d) |
set the transition distance | |
~PhaseTransitionLogic () | |
deconstructor | |
Data Fields | |
int | distance |
Private Member Functions | |
void | buildLogic (void) |
build the transition logic based on the from and to phase | |
bool | coordBase (NEMALogic *controller) |
represents the bare minimum coordinate mode logic. Requires that the toPhase can fit its minimum green time before the force off | |
bool | freeBase (NEMALogic *controller) |
this represents the bare minimum logic, that the toPhase has an active detector and that the fromPhase is ready to switch | |
bool | fromBarrier (NEMALogic *controller) |
If the fromPhase is at a barrier, then this function will be called to check whether the transition is valid. | |
bool | fromCoord (NEMALogic *controller) |
if the fromPhase is a coordinated phase, then this logic will be checked | |
Private Attributes | |
PhasePtr | fromPhase |
PhasePtr | toPhase |
This class handles the transition logic between two phases.
This is intended to be extensible in the future. Each phase stores some number of PhaseTransitionLogics, equal to the number of non-zero phases in a ring
Definition at line 844 of file NEMAController.h.
typedef NEMAPhase* PhaseTransitionLogic::PhasePtr |
Typedef for commonly used phase pointer.
Definition at line 847 of file NEMAController.h.
Construct a new Phase Transition Logic object.
fromPhase | the phase who "owns" this transition |
toPhase | the phase to which I represent a transition to |
Definition at line 1655 of file NEMAController.cpp.
|
inline |
deconstructor
Definition at line 884 of file NEMAController.h.
|
private |
build the transition logic based on the from and to phase
|
private |
represents the bare minimum coordinate mode logic. Requires that the toPhase can fit its minimum green time before the force off
controller |
Definition at line 1706 of file NEMAController.cpp.
References NEMAPhase::barrierNum, NEMAPhase::coordinatePhase, NEMAPhase::forceOffTime, freeBase(), fromPhase, NEMALogic::getCurrentCycleLength(), NEMALogic::getOtherPhase(), NEMALogic::getTimeInCycle(), NEMAPhase::getTransitionTime(), NEMAPhase::minDuration, NEMALogic::ModeCycle(), NEMAPhase::readyToSwitch, and toPhase.
Referenced by fromCoord(), and okay().
|
private |
this represents the bare minimum logic, that the toPhase has an active detector and that the fromPhase is ready to switch
controller |
Definition at line 1686 of file NEMAController.cpp.
References NEMAPhase::barrierNum, NEMAPhase::callActive(), fromPhase, NEMALogic::getOtherPhase(), okay(), NEMAPhase::readyToSwitch, and toPhase.
Referenced by coordBase(), fromBarrier(), and okay().
|
private |
If the fromPhase is at a barrier, then this function will be called to check whether the transition is valid.
controller | a reference to the controller |
Definition at line 1726 of file NEMAController.cpp.
References NEMAPhase::barrierNum, freeBase(), fromPhase, NEMAPhase::getCurrentState(), NEMALogic::getOtherPhase(), NEMALogic::getPhasesByRing(), Green, NEMAPhase::readyToSwitch, NEMAPhase::ringNum, and toPhase.
Referenced by okay().
|
private |
if the fromPhase is a coordinated phase, then this logic will be checked
controller |
Definition at line 1751 of file NEMAController.cpp.
References coordBase(), NEMAPhase::forceOffTime, fromPhase, NEMALogic::getCurrentCycleLength(), NEMALogic::getOtherPhase(), NEMAPhase::getSequentialPriorPhase(), NEMALogic::getTimeInCycle(), NEMAPhase::getTransitionTime(), NEMAPhase::isTransitionActive(), NEMALogic::isType170(), NEMAPhase::minDuration, NEMALogic::ModeCycle(), NEMAPhase::readyToSwitch, and toPhase.
Referenced by okay().
int PhaseTransitionLogic::getDistance | ( | PhaseTransitionLogic * | otherTrans | ) |
return the ring distance that this transition represents
otherTrans | the other PhaseTransitionLogic |
Definition at line 1778 of file NEMAController.cpp.
References NEMAPhase::barrierNum, distance, fromPhase, NEMAPhase::getCurrentState(), Green, GreenXfer, and toPhase.
Referenced by NEMALogic::getNextPhases().
|
inline |
get the from phase
Definition at line 892 of file NEMAController.h.
References fromPhase.
Referenced by NEMALogic::getDefaultTransition().
|
inline |
get the to phase
Definition at line 887 of file NEMAController.h.
References toPhase.
Referenced by NEMAPhase::exit(), NEMALogic::getDefaultTransition(), NEMALogic::getNextPhases(), and NEMAPhase::trySwitch().
bool PhaseTransitionLogic::okay | ( | NEMALogic * | controller | ) |
This function is the main PhaseTransitionLogic function It is called by the fromPhase to check if a transition to the toPhase is acceptable.
controller | a reference to the controller |
Definition at line 1663 of file NEMAController.cpp.
References coordBase(), NEMALogic::coordinateMode, NEMAPhase::coordinatePhase, freeBase(), fromBarrier(), fromCoord(), fromPhase, NEMAPhase::getCurrentState(), Green, NEMAPhase::isAtBarrier, and toPhase.
Referenced by freeBase().
|
inline |
int PhaseTransitionLogic::distance |
Definition at line 881 of file NEMAController.h.
Referenced by getDistance(), and setDistance().
|
private |
Definition at line 897 of file NEMAController.h.
Referenced by coordBase(), freeBase(), fromBarrier(), fromCoord(), getDistance(), getFromPhase(), and okay().
|
private |
Definition at line 898 of file NEMAController.h.
Referenced by coordBase(), freeBase(), fromBarrier(), fromCoord(), getDistance(), getToPhase(), and okay().