SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
MSSOTLPhaseTrafficLightLogic.cpp
Go to the documentation of this file.
1 /****************************************************************************/
7 // The class for SOTL Phase logics
8 /****************************************************************************/
9 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
10 // Copyright 2001-2009 DLR (http://www.dlr.de/) and contributors
11 /****************************************************************************/
12 //
13 // This file is part of SUMO.
14 // SUMO is free software: you can redistribute it and/or modify
15 // it under the terms of the GNU General Public License as published by
16 // the Free Software Foundation, either version 3 of the License, or
17 // (at your option) any later version.
18 //
19 /****************************************************************************/
20 
22 
24  MSTLLogicControl& tlcontrol, const std::string& id,
25  const std::string& subid, const Phases& phases, int step,
26  SUMOTime delay,
27  const std::map<std::string, std::string>& parameters) throw() :
28  MSSOTLTrafficLightLogic(tlcontrol, id, subid, phases, step, delay,
29  parameters) {
31  "*** Intersection " + id
32  + " will run using MSSOTLPhaseTrafficLightLogic ***");
33 }
34 
36  MSTLLogicControl& tlcontrol, const std::string& id,
37  const std::string& subid, const Phases& phases, int step,
38  SUMOTime delay, const std::map<std::string, std::string>& parameters,
39  MSSOTLSensors* sensors) throw() :
40  MSSOTLTrafficLightLogic(tlcontrol, id, subid, phases, step, delay,
41  parameters, sensors) {
42 }
43 
45  if (getCurrentPhaseElapsed() >= getCurrentPhaseDef().minDuration) {
46  return isThresholdPassed();
47  }
48  return false;
49 }
long long int SUMOTime
Definition: SUMOTime.h:43
MSSOTLPhaseTrafficLightLogic(MSTLLogicControl &tlcontrol, const std::string &id, const std::string &subid, const Phases &phases, int step, SUMOTime delay, const std::map< std::string, std::string > &parameters)
Constructor without sensors passed.
A class that stores and controls tls and switching of their programs.
A self-organizing traffic light logic.
static MsgHandler * getMessageInstance()
Returns the instance to add normal messages to.
Definition: MsgHandler.cpp:62
std::vector< MSPhaseDefinition * > Phases
Definition of a list of phases, being the junction logic.
void inform(std::string msg, bool addType=true)
adds a new error to the list
Definition: MsgHandler.cpp:89
const MSPhaseDefinition & getCurrentPhaseDef() const
Returns the definition of the current phase.