48 #ifdef CHECK_MEMORY_LEAKS
50 #endif // CHECK_MEMORY_LEAKS
56 #define DEFAULT_MAX_GAP "3.1"
57 #define DEFAULT_PASSING_TIME "1.9"
58 #define DEFAULT_DETECTOR_GAP "3.0"
65 const std::string&
id,
const std::string& programID,
68 const std::map<std::string, std::string>& parameter) :
83 LaneVectorVector::const_iterator i2;
84 LaneVector::const_iterator i;
88 for (i = lanes.begin(); i != lanes.end(); i++) {
94 SUMOReal ilpos = length - inductLoopPosition;
146 for (
unsigned int i = 0; i < (
unsigned int) state.size(); i++) {
148 const std::vector<MSLane*>& lanes =
getLanesAt(i);
152 for (LaneVector::const_iterator j = lanes.begin(); j != lanes.end(); j++) {
157 if (tmpdur > newduration) {
159 newduration = (
int) tmpdur;
189 for (
unsigned int i = 0; i < (
unsigned int) state.size(); i++) {
191 const std::vector<MSLane*>& lanes =
getLanesAt(i);
195 for (LaneVector::const_iterator j = lanes.begin(); j != lanes.end(); j++) {
200 myInductLoops.find(*j)->second->getTimestepsSinceLastDetection();
The link has green light, may pass.
virtual MSDetectorFileOutput * createInductLoop(const std::string &id, MSLane *lane, SUMOReal pos, bool splitByType)
Creates an instance of an e1 detector using the given values.
Builds detectors for microsim.
const std::string & getState() const
Returns the state within this phase.
unsigned int myStep
The current step.
std::string myProgramID
The id of the logic.
static SUMOReal _2SUMOReal(const E *const data)
The link has green light, has to brake.
SUMOReal getLength() const
Returns the lane's length.
void init(NLDetectorBuilder &nb)
Initialises the tls with information about incoming lanes.
Phases myPhases
The list of phases this logic uses.
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
#define DEFAULT_DETECTOR_GAP
const std::string & getParameter(const std::string &key, const std::string &defaultValue) const
Returns the value for a given key.
SUMOTime getCurrentTimeStep() const
Returns the current simulation step (in s)
A fixed traffic light logic.
LaneVectorVector myLanes
The list of links which do participate in this traffic light.
A class that stores and controls tls and switching of their programs.
SUMOTime trySwitch(bool isActive)
Switches to the next phase.
const std::string & getID() const
Returns the id.
SUMOReal myMaxGap
The maximum gap to check.
SUMOTime duration() const
Returns the duration of the given step.
SUMOReal myPassingTime
The passing time used.
~MSActuatedTrafficLightLogic()
Destructor.
#define DEFAULT_PASSING_TIME
const LaneVector & getLanesAt(unsigned int i) const
Returns the list of lanes that are controlled by the signals at the given position.
const MSPhaseDefinition & getCurrentPhaseDef() const
Returns the definition of the current phase.
SUMOReal getSpeedLimit() const
Returns the lane's maximum allowed speed.
bool isGreenPhase() const
Returns whether this phase is a pure "green" phase.
InductLoopMap myInductLoops
A map from lanes to induct loops lying on them.
std::vector< MSPhaseDefinition * > Phases
Definition of a list of phases, being the junction logic.
SUMOReal myDetectorGap
The detector distance.
std::string myID
The name of the object.
std::vector< MSLane * > LaneVector
Definition of the list of links that participate in this tl-light.
SUMOTime maxDuration
The maximum duration of the phase.
bool myContinue
information whether the current phase should be lenghtend
SUMOTime minDuration
The minimum duration of the phase.
MSActuatedTrafficLightLogic(MSTLLogicControl &tlcontrol, const std::string &id, const std::string &programID, const MSSimpleTrafficLightLogic::Phases &phases, unsigned int step, SUMOTime delay, const std::map< std::string, std::string > ¶meter)
Constructor.
void gapControl()
Decides, whether a phase should be continued by checking the gaps of vehicles having green...
Representation of a lane in the micro simulation.
An unextended detector measuring at a fixed position on a fixed lane.