41 #ifdef CHECK_MEMORY_LEAKS 43 #endif // CHECK_MEMORY_LEAKS 51 : myOutputDevice(od), myLogics(logics) {
66 for (
int i = 0; i < (int) links.size(); i++) {
81 for (
int j = 0; j < (int) currLinks.size(); j++) {
82 MSLink* link = currLinks[j];
85 <<
"\" fromLane=\"" << currLanes[j]->getID()
89 <<
"\" duration=\"" <<
time2string(currentTime - lastOn)
The link has green light, may pass.
virtual const MSPhaseDefinition & getCurrentPhaseDef() const =0
Returns the definition of the current phase.
Command_SaveTLSSwitches(const MSTLLogicControl::TLSLogicVariants &logics, OutputDevice &od)
Constructor.
const std::string & getState() const
Returns the state within this phase.
Storage for all programs of a single tls.
const LaneVector & getLanesAt(int i) const
Returns the list of lanes that are controlled by the signals at the given position.
SUMOTime execute(SUMOTime currentTime)
Writes the output if a change occured.
The link has green light, has to brake.
std::string time2string(SUMOTime t)
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
bool writeXMLHeader(const std::string &rootElement, const std::string &attrs="", const std::string &comment="")
Writes an XML header with optional configuration.
const std::string & getID() const
Returns the id.
std::vector< LinkVector > LinkVectorVector
Definition of a list that holds lists of links that do have the same attribute.
MSTrafficLightLogic * getActive() const
MSLane * getLane() const
Returns the connected lane.
const LinkVectorVector & getLinks() const
Returns the list of lists of all affected links.
virtual SUMOTime addEvent(Command *operation, SUMOTime execTimeStep, AdaptType type)
Adds an Event.
MSEventControl * getEndOfTimestepEvents()
Returns the event control for events executed at the end of a time step.
std::vector< MSLink * > LinkVector
Definition of the list of links that participate in this tl-light.
std::map< int, SUMOTime > myPreviousLinkStates
Storage for prior states; map from signal group to last green time begin.
std::vector< MSLane * > LaneVector
Definition of the list of links that participate in this tl-light.
~Command_SaveTLSSwitches()
Destructor.
OutputDevice & myOutputDevice
The device to write to.
const MSTLLogicControl::TLSLogicVariants & myLogics
The traffic light logic to use.
The parent class for traffic light logics.
Patch the time in a way that it is at least as high as the simulation begin time. ...
Static storage of an output device and its base (abstract) implementation.
const std::string & getProgramID() const
Returns this tl-logic's id.