43 #define DEBUG_COND (getID()=="C")
49 "**",
"^",
"*",
"/",
"+",
"-",
"%",
50 "=",
"==",
"!=",
"<",
">",
"<=",
">=",
51 "and",
"&&",
"or",
"||",
57 #define DEFAULT_MAX_GAP "3.0"
58 #define DEFAULT_PASSING_TIME "1.9"
59 #define DEFAULT_DETECTOR_GAP "2.0"
60 #define DEFAULT_INACTIVE_THRESHOLD "180"
61 #define DEFAULT_CURRENT_PRIORITY 10
63 #define DEFAULT_LENGTH_WITH_GAP 7.5
65 #define NO_DETECTOR "NO_DETECTOR"
71 const std::string&
id,
const std::string& programID,
75 const std::map<std::string, std::string>& parameter,
76 const std::string& basePath,
77 const std::map<std::string, std::string>& conditions) :
79 myLastTrySwitchTime(0),
80 myConditions(conditions),
82 myDetectorPrefix(id +
"_" + programID +
"_") {
104 const int numLinks = (int)
myLinks.size();
127 std::map<const MSLane*, MSInductLoop*> laneInductLoopMap;
128 std::map<MSInductLoop*, const MSLane*> inductLoopLaneMap;
129 int detEdgeIndex = -1;
130 int detLaneIndex = 0;
131 MSEdge* prevDetEdge =
nullptr;
133 for (
MSLane* lane : lanes) {
138 if (laneInductLoopMap.find(lane) != laneInductLoopMap.end()) {
143 if (minDur == std::numeric_limits<SUMOTime>::max()) {
147 const std::string customID =
getParameter(lane->getID());
148 double length = lane->getLength();
150 double inductLoopPosition;
152 if (&lane->getEdge() != prevDetEdge) {
155 prevDetEdge = &lane->getEdge();
159 if (customID ==
"") {
161 inductLoopPosition =
MIN2(
166 ilpos = length - inductLoopPosition;
167 MSLane* placementLane = lane;
168 while (ilpos < 0 && placementLane->getIncomingLanes().size() == 1) {
183 if (loop ==
nullptr) {
184 WRITE_ERROR(
"Unknown inductionLoop '" + customID +
"' given as custom detector for actuated tlLogic '" +
getID() +
"', program '" +
getProgramID() +
".");
188 inductLoopPosition = length - ilpos;
190 laneInductLoopMap[lane] = loop;
191 inductLoopLaneMap[loop] = lane;
218 std::map<int, std::set<MSInductLoop*> > linkToLoops;
219 std::set<int> actuatedLinks;
221 std::vector<bool> neverMajor(numLinks,
true);
223 const std::string& state = phase->getState();
224 for (
int i = 0; i < numLinks; i++) {
226 neverMajor[i] =
false;
230 std::vector<bool> oneLane(numLinks,
false);
231 std::vector<bool> turnaround(numLinks,
true);
232 for (
int i = 0; i < numLinks; i++) {
235 int numMotorized = 0;
237 if ((l->getPermissions() & motorized) != 0) {
241 if (numMotorized == 1) {
247 if (!link->isTurnaround()) {
248 turnaround[i] =
false;
257 std::set<MSInductLoop*> loops;
258 if (phase->isActuted()) {
259 const std::string& state = phase->getState();
261 std::set<int> greenLinks;
263 std::map<MSInductLoop*, std::set<int> > loopLinks;
265 for (
int i = 0; i < numLinks; i++) {
268 && (((neverMajor[i] || turnaround[i])
272 greenLinks.insert(i);
274 actuatedLinks.insert(i);
277 #ifdef DEBUG_DETECTORS
279 std::cout <<
" phase=" << phaseIndex <<
" i=" << i <<
" state=" << state[i] <<
" green=" << greenLinks.count(i) <<
" oneLane=" << oneLane[i]
280 <<
" turn=" << turnaround[i] <<
" loopLanes=";
282 if (laneInductLoopMap.count(lane) != 0) {
283 std::cout << lane->getID() <<
" ";
290 if (laneInductLoopMap.count(lane) != 0) {
291 loopLinks[laneInductLoopMap[lane]].insert(i);
295 for (
auto& item : loopLinks) {
297 const MSLane* loopLane = inductLoopLaneMap[loop];
300 for (
int j : item.second) {
301 if (greenLinks.count(j) == 0) {
303 #ifdef DEBUG_DETECTORS
305 std::cout <<
" phase=" << phaseIndex <<
" check1: loopLane=" << loopLane->
getID() <<
" notGreen=" << j <<
" oneLane[j]=" << oneLane[j] <<
"\n";
314 if (link->isTurnaround()) {
317 const MSLane* next = link->getLane();
318 if (laneInductLoopMap.count(next) != 0) {
320 for (
int j : loopLinks[nextLoop]) {
321 if (greenLinks.count(j) == 0) {
323 #ifdef DEBUG_DETECTORS
324 if (
DEBUG_COND) std::cout <<
" phase=" << phaseIndex <<
" check2: loopLane=" << loopLane->
getID()
325 <<
" nextLane=" << next->
getID() <<
" nextLink=" << j <<
" nextState=" << state[j] <<
"\n";
335 loops.insert(item.first);
336 #ifdef DEBUG_DETECTORS
338 std::cout <<
" phase=" << phaseIndex <<
" usableLoops=" << item.first->getID() <<
" links=" <<
joinToString(item.second,
" ") <<
"\n";
341 for (
int j : item.second) {
342 linkToLoops[j].insert(item.first);
346 if (loops.size() == 0) {
350 #ifdef DEBUG_DETECTORS
352 std::cout <<
" phase=" << phaseIndex <<
" loops=" <<
joinNamedToString(loops,
" ") <<
"\n";
355 std::cout <<
" linkToLoops:\n";
356 for (
auto item : linkToLoops) {
357 std::cout <<
" link=" << item.first <<
" loops=" <<
joinNamedToString(item.second,
" ") <<
"\n";
361 std::vector<InductLoopInfo*> loopInfos;
365 if (loopInfo.loop == loop) {
367 loopInfo.servedPhase[phaseIndex] =
true;
372 #ifdef DEBUG_DETECTORS
374 std::cout <<
"final linkToLoops:\n";
375 for (
auto item : linkToLoops) {
376 std::cout <<
" link=" << item.first <<
" loops=" <<
joinNamedToString(item.second,
" ") <<
"\n";
380 for (
int i : actuatedLinks) {
381 if (linkToLoops[i].size() == 0 &&
myLinks[i].size() > 0
382 && (
myLinks[i].front()->getLaneBefore()->getPermissions() & motorized) != 0) {
393 WRITE_ERROR(
"Invalid link '" + kv.first.substr(11) +
"' given as linkMaxDur parameter for actuated tlLogic '" +
getID() +
"', program '" +
getProgramID() +
".");
403 WRITE_ERROR(
"Invalid link '" + kv.first.substr(11) +
"' given as linkMinDur parameter for actuated tlLogic '" +
getID() +
"', program '" +
getProgramID() +
".");
423 for (
int i = 0; i < (int)
myPhases.size(); i++) {
426 std::vector<int> nextPhases = phase->
nextPhases;
427 if (nextPhases.size() == 0) {
428 nextPhases.push_back((i + 1) % (int)
myPhases.size());
430 for (
int next : nextPhases) {
431 if (next >= 0 && next < (
int)
myPhases.size()) {
447 SUMOTime result = std::numeric_limits<SUMOTime>::max();
449 const std::string& state = phase->getState();
450 for (
int i = 0; i < (int)state.size(); i++) {
454 if (phase->isActuted()) {
455 result =
MIN2(result, phase->minDuration);
467 for (
int i = 0; i < (int)state.size(); i++) {
470 for (
MSLane* lane : lanes) {
496 loopInfo.loop->setVisible(
false);
504 if (step >= 0 && step !=
myStep) {
509 }
else if (step < 0) {
530 if (state[i] ==
'G' || state[i] ==
'g') {
535 if (state[i] ==
'r' || state[i] ==
'u') {
545 const int origStep =
myStep;
555 #ifdef DEBUG_PHASE_SELECTION
557 std::cout <<
SIMTIME <<
" p=" <<
myStep <<
" trySwitch dGap=" << detectionGap <<
" multi=" << multiTarget <<
"\n";
560 if (detectionGap < std::numeric_limits<double>::max() && !multiTarget && !
myTraCISwitch) {
576 if (linkMinDur > 0) {
579 return multiTarget ?
TIME2STEPS(1) : linkMinDur;
587 myPhases[origStep]->myLastEnd = now;
596 loopInfo->lastGreenTime = now;
615 if (newDuration % 1000 != 0) {
616 const SUMOTime totalDur = newDuration + actDuration;
617 newDuration = (totalDur / 1000 + 1) * 1000 - actDuration;
629 double result = std::numeric_limits<double>::max();
636 if (loopInfo.lastGreenTime < loopInfo.loop->getLastDetectionTime()) {
639 loopInfo.loop->setSpecialColor(
nullptr);
650 #ifdef DEBUG_PHASE_SELECTION
664 if (actualGap < loopInfo->maxGap) {
665 result =
MIN2(result, actualGap);
677 int result = cands.front();
685 #ifdef DEBUG_PHASE_SELECTION
688 if (currentPrio > maxPrio) {
690 maxPrio = currentPrio;
693 for (
int step : cands) {
696 #ifdef DEBUG_PHASE_SELECTION
709 if (prio > maxPrio) {
710 result = cands.front();
713 +
"', starvation at e1Detector '" + loopInfo.loop->getID()
714 +
"' which cannot be reached from the default phase " +
toString(
myStep) +
".");
717 #ifdef DEBUG_PHASE_SELECTION
719 std::cout <<
SIMTIME <<
" p=" <<
myStep <<
" loop=" << loopInfo.loop->getID() <<
" prio=" << prio <<
" next=" << result <<
"\n";
733 while (!
myPhases[step]->isGreenPhase()) {
734 if (
myPhases[step]->nextPhases.size() > 0 &&
myPhases[step]->nextPhases.front() >= 0) {
735 if (
myPhases[step]->nextPhases.size() > 1) {
736 WRITE_WARNING(
"At actuated tlLogic '" +
getID() +
"', transition phase " +
toString(step) +
" should not have multiple next phases");
738 step =
myPhases[step]->nextPhases.front();
740 step = (step + 1) % (
int)
myPhases.size();
742 if (step == origStep) {
758 #ifdef DEBUG_PHASE_SELECTION
820 const std::string& targetState =
myPhases[target]->getState();
823 targetState[i] ==
'G' || targetState[i] ==
'g')) {
836 const std::string& targetState =
myPhases[target]->getState();
839 && (state[i] ==
'G' || state[i] ==
'g')
840 && !(targetState[i] ==
'G' || targetState[i] ==
'g')) {
866 const size_t bracketOpen = condition.find(
'(');
867 if (bracketOpen != std::string::npos) {
869 size_t bracketClose = std::string::npos;
871 for (
size_t i = bracketOpen + 1; i < condition.size(); i++) {
872 if (condition[i] ==
'(') {
874 }
else if (condition[i] ==
')') {
882 if (bracketOpen == std::string::npos) {
883 throw ProcessError(
"Unmatched parentheses in condition " + condition +
"'");
885 std::string cond2 = condition;
886 const std::string inBracket = condition.substr(bracketOpen + 1, bracketClose - bracketOpen - 1);
888 cond2.replace(bracketOpen, bracketClose - bracketOpen + 1,
toString(bracketVal));
893 if (tokens.size() == 0) {
894 throw ProcessError(
"Invalid empty condition '" + condition +
"'");
895 }
else if (tokens.size() == 1) {
897 }
else if (tokens.size() == 2) {
898 if (tokens[0] ==
"not") {
901 throw ProcessError(
"Unsupported condition '" + condition +
"'");
903 }
else if (tokens.size() == 3) {
907 const std::string& o = tokens[1];
911 const int iEnd = (int)tokens.size() - 1;
913 for (
int i = 1; i < iEnd; i++) {
914 if (tokens[i] == o) {
918 std::vector<std::string> newTokens(tokens.begin(), tokens.begin() + (i - 1));
920 newTokens.insert(newTokens.end(), tokens.begin() + (i + 2), tokens.end());
925 throw ProcessError(
"Parsing expressions with " +
toString(tokens.size()) +
" elements ('" + condition +
"') is not supported");
932 if (o ==
"=" || o ==
"==") {
933 return (
double)(a == b);
934 }
else if (o ==
"<") {
935 return (
double)(a < b);
936 }
else if (o ==
">") {
937 return (
double)(a > b);
938 }
else if (o ==
"<=") {
939 return (
double)(a <= b);
940 }
else if (o ==
">=") {
941 return (
double)(a >= b);
942 }
else if (o ==
"!=") {
943 return (
double)(a != b);
944 }
else if (o ==
"or" || o ==
"||") {
945 return (
double)(a || b);
946 }
else if (o ==
"and" || o ==
"&&") {
947 return (
double)(a && b);
948 }
else if (o ==
"+") {
950 }
else if (o ==
"-") {
952 }
else if (o ==
"*") {
954 }
else if (o ==
"/") {
956 WRITE_ERROR(
"Division by 0 in condition '" + condition +
"'");
960 }
else if (o ==
"%") {
962 }
else if (o ==
"**" || o ==
"^") {
965 throw ProcessError(
"Unsupported operator '" + o +
"' in condition '" + condition +
"'");
971 if (expr.size() == 0) {
973 }
else if (expr[0] ==
'!') {
975 }
else if (expr[0] ==
'-') {
979 const size_t pos = expr.find(
':');
980 if (pos == std::string::npos) {
989 const std::string fun = expr.substr(0, pos);
990 const std::string arg = expr.substr(pos + 1);
992 return retrieveDetExpression<MSInductLoop, SUMO_TAG_INDUCTION_LOOP>(arg, expr,
true)->getTimeSinceLastDetection();
993 }
else if (fun ==
"a") {
995 return retrieveDetExpression<MSInductLoop, SUMO_TAG_INDUCTION_LOOP>(arg, expr,
true)->getTimeSinceLastDetection() == 0;
997 return retrieveDetExpression<MSE2Collector, SUMO_TAG_LANE_AREA_DETECTOR>(arg, expr,
true)->getCurrentVehicleNumber() > 0;
999 }
else if (fun ==
"g" || fun ==
"r") {
1002 if (linkIndex >= 0 && linkIndex <
myNumLinks) {
1013 return STEPS2TIME(times[linkIndex] + currentGreen);
1022 throw ProcessError(
"Invalid link index '" + arg +
"' in expression '" + expr +
"'");
1024 throw ProcessError(
"Unsupported function '" + fun +
"' in expression '" + expr +
"'");
1031 std::map<std::string, double>
1033 std::map<std::string, double> result;
1035 result[li.loop->getID()] = li.loop->getOccupancy() > 0 ? 1 : 0;
1040 std::map<std::string, double>
1042 std::map<std::string, double> result;
1052 if (key ==
"detector-gap" || key ==
"passing-time" || key ==
"file" || key ==
"freq" || key ==
"vTypes"
1055 throw InvalidArgument(key +
" cannot be changed dynamically for actuated traffic light '" +
getID() +
"'");
1056 }
else if (key ==
"max-gap") {
1062 }
else if (key ==
"show-detectors") {
1064 }
else if (key ==
"inactive-threshold") {
#define DEFAULT_DETECTOR_GAP
#define DEFAULT_PASSING_TIME
#define DEFAULT_LENGTH_WITH_GAP
#define DEFAULT_INACTIVE_THRESHOLD
#define DEFAULT_CURRENT_PRIORITY
#define WRITE_WARNINGF(...)
#define WRITE_WARNING(msg)
std::string time2string(SUMOTime t)
convert SUMOTime to string
SUMOTime string2time(const std::string &r)
convert string to SUMOTime
bool noVehicles(SVCPermissions permissions)
Returns whether an edge with the given permission forbids vehicles.
@ SVC_BICYCLE
vehicle is a bicycle
@ SVC_PEDESTRIAN
pedestrian
int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
@ SUMO_TAG_INDUCTION_LOOP
alternative tag for e1 detector
LinkState
The right-of-way state of a link between two lanes used when constructing a NBTrafficLightLogic,...
@ LINKSTATE_TL_REDYELLOW
The link has red light (must brake) but indicates upcoming green.
@ LINKSTATE_TL_GREEN_MAJOR
The link has green light, may pass.
@ LINKSTATE_TL_RED
The link has red light (must brake)
@ LINKSTATE_TL_GREEN_MINOR
The link has green light, has to brake.
std::string joinNamedToString(const std::set< T *, C > &ns, const T_BETWEEN &between)
std::string joinToString(const std::vector< T > &v, const T_BETWEEN &between, std::streamsize accuracy=gPrecision)
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
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.
double myDetectorGap
The detector distance in seconds.
MSActuatedTrafficLightLogic(MSTLLogicControl &tlcontrol, const std::string &id, const std::string &programID, const SUMOTime offset, const MSSimpleTrafficLightLogic::Phases &phases, int step, SUMOTime delay, const std::map< std::string, std::string > ¶meter, const std::string &basePath, const std::map< std::string, std::string > &conditions=std::map< std::string, std::string >())
Constructor.
double myMaxGap
The maximum gap to check in seconds.
void activateProgram()
called when switching programs
std::vector< SwitchingRules > mySwitchingRules
~MSActuatedTrafficLightLogic()
Destructor.
double evalAtomicExpression(const std::string &expr) const
evaluate atomic expression
int getTarget(int step)
get the green phase following step
void setParameter(const std::string &key, const std::string &value)
Sets a parameter and updates internal constants.
SUMOTime myLastTrySwitchTime
last time trySwitch was called
int getDetectorPriority(const InductLoopInfo &loopInfo) const
std::map< std::string, double > getConditions() const
return all named conditions defined for this traffic light
SUMOTime myFreq
The frequency for aggregating detector output.
SUMOTime getMinimumMinDuration(MSLane *lane) const
get the minimum min duration for all stretchable phases that affect the given lane
bool myShowDetectors
Whether the detectors shall be shown in the GUI.
std::vector< SUMOTime > myLinkMaxGreenTimes
maximum consecutive time that the given link may remain green
std::string myVehicleTypes
Whether detector output separates by vType.
double gapControl()
Return the minimum detection gap of all detectors if the current phase should be extended and double:...
void init(NLDetectorBuilder &nb)
Initialises the tls with information about incoming lanes.
double evalExpression(const std::string &condition) const
evaluate custom switching condition
std::vector< SUMOTime > myLinkMinGreenTimes
minimum consecutive time that the given link must remain green
SUMOTime trySwitch()
Switches to the next phase.
static const std::vector< std::string > OPERATOR_PRECEDENCE
double myPassingTime
The passing time used in seconds.
SUMOTime getLinkMinDuration(int target) const
the minimum duratin for keeping the current phase due to linkMinDur constraints
bool canExtendLinkGreen(int target)
whether the target phase is acceptable in light of linkMaxDur constraints
InductLoopMap myInductLoopsForPhase
A map from phase to induction loops to be used for gap control.
int decideNextPhaseCustom(bool mustSwitch)
select among candidate phases based on detector states and custom switching rules
double evalTernaryExpression(double a, const std::string &o, double b, const std::string &condition) const
evaluate atomic expression
void setShowDetectors(bool show)
bool myTraCISwitch
whether the next switch time was requested via TraCI
int getPhasePriority(int step) const
count the number of active detectors for the given step
SUMOTime duration(const double detectionGap) const
Returns the minimum duration of the current phase.
std::vector< InductLoopInfo > myInductLoops
std::map< std::string, std::string > myConditions
The custom switching conditions.
bool maxLinkDurationReached()
whether the current phase cannot be continued due to linkMaxDur constraints
bool hasMajor(const std::string &state, const LaneVector &lanes) const
return whether there is a major link from the given lane in the given phase
std::vector< SUMOTime > myLinkGreenTimes
consecutive time that the given link index has been green
std::map< std::string, double > getDetectorStates() const
retrieve all detectors used by this program
std::vector< SUMOTime > myLinkRedTimes
std::string myFile
The output file for generated detectors.
void initSwitchingRules()
initialize custom switching rules
const std::string myDetectorPrefix
int decideNextPhase()
select among candidate phases based on detector states
void changeStepAndDuration(MSTLLogicControl &tlcontrol, SUMOTime simStep, int step, SUMOTime stepDuration)
Changes the current phase and her duration.
SUMOTime myInactiveThreshold
The time threshold to avoid starved phases.
const NamedObjectCont< MSDetectorFileOutput * > & getTypedDetectors(SumoXMLTag type) const
Returns the list of detectors of the given type.
void add(SumoXMLTag type, MSDetectorFileOutput *d, const std::string &device, SUMOTime interval, SUMOTime begin=-1)
Adds a detector/output combination into the containers.
A road/street connecting two junctions.
const std::vector< MSLane * > & getLanes() const
Returns this edge's lanes.
double getSpeedLimit() const
Returns the speed limit of the edge @caution The speed limit of the first lane is retured; should pro...
virtual void addEvent(Command *operation, SUMOTime execTimeStep=-1)
Adds an Event.
An unextended detector measuring at a fixed position on a fixed lane.
double getPosition() const
Returns the position of the detector on the lane.
virtual void setSpecialColor(const RGBColor *)
allows for special color in the gui version
double getTimeSinceLastDetection() const
Returns the time since the last vehicle left the detector.
SUMOTime getLastDetectionTime() const
return last time a vehicle was on the detector
Representation of a lane in the micro simulation.
const std::vector< MSLink * > & getLinkCont() const
returns the container with all links !!!
double getLength() const
Returns the lane's length.
MSLane * getLogicalPredecessorLane() const
get the most likely precedecessor lane (sorted using by_connections_to_sorter). The result is cached ...
MSEdge & getEdge() const
Returns the lane's edge.
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
MSDetectorControl & getDetectorControl()
Returns the detector control.
SUMOTime getCurrentTimeStep() const
Returns the current simulation step.
MSEventControl * getBeginOfTimestepEvents()
Returns the event control for events executed at the begin of a time step.
The definition of a single phase of a tls logic.
const std::string & getState() const
Returns the state within this phase.
SUMOTime maxDuration
The maximum duration of the phase.
LinkState getSignalState(int pos) const
Returns the state of the tls signal at the given position.
SUMOTime minDuration
The minimum duration of the phase.
std::vector< int > nextPhases
The index of the phase that suceeds this one (or -1)
std::string finalTarget
The condition expression for switching into this phase when the active phase must end.
std::string earlyTarget
The condition expression for an early switch into this phase.
A fixed traffic light logic.
SUMOTime getLatest() const
the maximum duratin for keeping the current phase when considering 'latestEnd'
Phases myPhases
The list of phases this logic uses.
SUMOTime getEarliest(SUMOTime prevStart) const
the minimum duration for keeping the current phase when considering 'earliestEnd'
const MSPhaseDefinition & getCurrentPhaseDef() const
Returns the definition of the current phase.
int myStep
The current step.
void executeOnSwitchActions() const
A class that stores and controls tls and switching of their programs.
TLSLogicVariants & get(const std::string &id) const
Returns the variants of a named tls.
Class realising the switch between the traffic light phases.
void deschedule(MSTrafficLightLogic *tlLogic)
Marks this swicth as invalid (if the phase duration has changed, f.e.)
const LinkVector & getLinksAt(int i) const
Returns the list of links that are controlled by the signals at the given position.
std::vector< MSLane * > LaneVector
Definition of the list of arrival lanes subjected to this tls.
virtual void deactivateProgram()
LaneVectorVector myLanes
The list of LaneVectors; each vector contains the incoming lanes that belong to the same link index.
SwitchCommand * mySwitchCommand
The current switch command.
int myNumLinks
number of controlled links
virtual void activateProgram()
called when switching programs
const LaneVector & getLanesAt(int i) const
Returns the list of lanes that are controlled by the signals at the given position.
bool setTrafficLightSignals(SUMOTime t) const
Applies the current signal states to controlled links.
std::vector< MSPhaseDefinition * > Phases
Definition of a list of phases, being the junction logic.
LinkVectorVector myLinks
The list of LinkVectors; each vector contains the links that belong to the same link index.
virtual void init(NLDetectorBuilder &nb)
Initialises the tls with information about incoming lanes.
const std::string & getProgramID() const
Returns this tl-logic's id.
Builds detectors for microsim.
virtual MSDetectorFileOutput * createInductLoop(const std::string &id, MSLane *lane, double pos, const std::string &vTypes, int detectPersons, bool show=true)
Creates an instance of an e1 detector using the given values.
const std::string & getID() const
Returns the id.
T get(const std::string &id) const
Retrieves an item.
static OptionsCont & getOptions()
Retrieves the options.
double getDouble(const std::string &key, const double defaultValue) const
Returns the value for a given key converted to a double.
virtual const std::string getParameter(const std::string &key, const std::string defaultValue="") const
Returns the value for a given key.
virtual void setParameter(const std::string &key, const std::string &value)
Sets a parameter.
const std::map< std::string, std::string > & getParametersMap() const
Returns the inner key/value map.
static const RGBColor GREEN
static const RGBColor RED
named colors
std::vector< std::string > getVector()
return vector of strings
static double toDouble(const std::string &sData)
converts a string into the double value described by it by calling the char-type converter
static bool startsWith(const std::string &str, const std::string prefix)
Checks whether a given string starts with the prefix.
static int toInt(const std::string &sData)
converts a string into the integer value described by it by calling the char-type converter,...
static bool toBool(const std::string &sData)
converts a string into the bool value described by it by calling the char-type converter
std::vector< bool > servedPhase