50 #ifdef CHECK_MEMORY_LEAKS 52 #endif // CHECK_MEMORY_LEAKS 58 #define DEFAULT_MAX_GAP "3.1" 59 #define DEFAULT_PASSING_TIME "1.9" 60 #define DEFAULT_DETECTOR_GAP "3.0" 67 const std::string&
id,
const std::string& programID,
70 const std::map<std::string, std::string>& parameter,
71 const std::string& basePath) :
90 LaneVectorVector::const_iterator i2;
91 LaneVector::const_iterator i;
95 for (i = lanes.begin(); i != lanes.end(); i++) {
101 SUMOReal ilpos = length - inductLoopPosition;
154 if (newDuration % 1000 != 0) {
155 const SUMOTime totalDur = newDuration + actDuration;
156 newDuration = (totalDur / 1000 + 1) * 1000 - actDuration;
181 for (
unsigned int i = 0; i < (
unsigned int) state.size(); i++) {
183 const std::vector<MSLane*>& lanes =
getLanesAt(i);
184 for (LaneVector::const_iterator j = lanes.begin(); j != lanes.end(); j++) {
191 result =
MIN2(result, actualGap);
The link has green light, may pass.
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)
static bool _2bool(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.
bool mySplitByType
Whether detector output separates by vType.
Phases myPhases
The list of phases this logic uses.
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
std::string myFile
The output file for generated detectors.
#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.
A fixed traffic light logic.
LaneVectorVector myLanes
The list of LaneVectors; each vector contains the incoming lanes that belong to the same link index...
A class that stores and controls tls and switching of their programs.
const std::string & getID() const
Returns the id.
SUMOReal myMaxGap
The maximum gap to check in seconds.
SUMOReal myPassingTime
The passing time used in seconds.
virtual void init(NLDetectorBuilder &nb)
Initialises the tls with information about incoming lanes.
~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.
void add(SumoXMLTag type, MSDetectorFileOutput *d, const std::string &device, SUMOTime splInterval, SUMOTime begin=-1)
Adds a detector/output combination into the containers.
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, const std::string &basePath)
Constructor.
MSDetectorControl & getDetectorControl()
Returns the detector control.
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 in seconds.
std::string myID
The name of the object.
std::vector< MSLane * > LaneVector
Definition of the list of links that participate in this tl-light.
static std::string checkForRelativity(const std::string &filename, const std::string &basePath)
Returns the path from a configuration so that it is accessable from the current working directory...
SUMOTime duration(const SUMOReal detectionGap) const
Returns the minimum duration of the current phase.
SUMOTime minDuration
The minimum duration of the phase.
SUMOReal getTimestepsSinceLastDetection() const
Returns the time since the last vehicle left the detector.
SUMOTime myFreq
The frequency for aggregating detector output.
Representation of a lane in the micro simulation.
SUMOReal gapControl()
Return the minimum detection gap of all detectors if the current phase should be extended and SUMORea...
bool myShowDetectors
Whether the detectors shall be shown in the GUI.
SUMOTime trySwitch()
Switches to the next phase.
virtual MSDetectorFileOutput * createInductLoop(const std::string &id, MSLane *lane, SUMOReal pos, bool splitByType, bool show=true)
Creates an instance of an e1 detector using the given values.
An unextended detector measuring at a fixed position on a fixed lane.