47 #define INVALID_POSITION std::numeric_limits<double>::max()
55 const std::string&
id,
const std::string& programID,
59 const std::map<std::string, std::string>& parameter,
60 const std::string& basePath) :
62 myPhase(phases[0]->duration, phases[0]->getState()) {
76 for (
int i = 0; i < (int)VecMinRecall.size(); i++) {
78 recall[VecMinRecall[i] - 1] =
true;
82 for (
int i = 0; i < (int)VecMaxRecall.size(); i++) {
84 recall[VecMaxRecall[i] - 1] =
true;
88 std::cout <<
"minRecall: ";
89 for (
int i = 0; i < 8; i++) {
92 std::cout << std::endl;
94 std::cout <<
"maxRecall: ";
95 for (
int i = 0; i < 8; i++) {
98 std::cout << std::endl;
117 std::cout <<
"JunctionID = " <<
myID << std::endl;
118 std::cout <<
"All parameters after calling constructor are: " << std::endl;
121 std::cout <<
"ring1 = " <<
ring1 << std::endl;
122 std::cout <<
"ring2 = " <<
ring2 << std::endl;
123 std::cout <<
"barriers = " <<
barriers << std::endl;
124 std::cout <<
"coordinates = " <<
coordinates << std::endl;
125 std::cout <<
"offset = " <<
offset << std::endl;
129 std::cout <<
"fixForceOff = " <<
fixForceOff << std::endl;
130 std::cout <<
"greenTransfer = " <<
greenTransfer << std::endl;
131 std::cout <<
"You reach the end of constructor" << std::endl;
132 std::cout <<
"****************************************\n";
138 std::string cps =
"crossPhaseSwitching:";
143 std::string cps =
"crossPhaseSwitching:";
149 if (phaseDetectInfo.second.cpdSource > 0) {
150 phase2DetectorMap.find(phaseDetectInfo.second.cpdSource) -> second.cpdTarget = phaseDetectInfo.first;
174 for (
int i = 0; i < phaseNumber; i++) {
183 int i = NEMAPhase - 1;
189 std::cout <<
"NEMAIndex = " << NEMAPhase <<
": ";
198 std::string state = phase->getState();
200 std::vector<std::string> laneIDs_vector;
201 for (std::string laneID : laneIDs) {
202 laneIDs_vector.push_back(laneID);
214 std::cout <<
"NEMA phase index = " << item.first <<
" have lanes: ";
215 for (
auto id : item.second) {
216 std::cout <<
id <<
" ";
218 std::cout << std::endl;
231 for (
int i = 0; i < (int)
rings.size(); i++) {
233 std::cout <<
"Ring" << i + 1 <<
" includes phases: \t";
234 for (
auto j :
rings[i]) {
236 std::cout << j <<
" ";
237 if (count == 2 || count == 4) {
241 std::cout << std::endl;
255 for (
int i = 0; (int)
rings[0].size(); i++) {
256 if (
rings[0][i] != 0) {
258 std::cout <<
"rings[0][" << i <<
"] = " <<
rings[0][i] << std::endl;
265 for (
int i = 0; (int)
rings[1].size(); i++) {
266 if (
rings[1][i] != 0) {
268 std::cout <<
"rings[1][" << i <<
"] = " <<
rings[1][i] << std::endl;
277 for (
int ringNumber = 0; ringNumber < 2; ringNumber++) {
278 int length = (int)
rings[ringNumber].size();
279 int aPhaseNumber =
rings[ringNumber][initialIndexRing[ringNumber]];
280 int aPhaseIndex = aPhaseNumber - 1;
281 int nPhaseIndex = aPhaseIndex;
282 int nPhaseNumber = aPhaseNumber;
286 std::cout <<
"Phase " << aPhaseNumber <<
": force off " <<
forceOffs[aPhaseNumber - 1] << std::endl;
288 for (
int i = initialIndexRing[ringNumber] + 1; i < length; i++) {
289 nPhaseNumber =
rings[ringNumber][i];
290 nPhaseIndex = nPhaseNumber - 1;
292 if (nPhaseNumber != 0) {
294 aPhaseNumber = nPhaseNumber;
295 aPhaseIndex = nPhaseIndex;
298 std::cout <<
"- Phase " << aPhaseNumber <<
": force off " <<
forceOffs[aPhaseIndex] << std::endl;
305 for (
int ringNumber = 0; ringNumber < 2; ringNumber++) {
306 int length = (int)
rings[ringNumber].size();
307 for (
int i = initialIndexRing[ringNumber]; i < length; i++) {
308 int aPhaseIndex =
rings[ringNumber][i] - 1;
309 if (aPhaseIndex != -1) {
312 std::cout <<
"Phase " << aPhaseIndex + 1 <<
" cut off is " <<
phaseCutOffs[aPhaseIndex] << std::endl;
324 for (
int ringNumber = 0; ringNumber < 2; ringNumber++) {
325 int length = (int)
rings[ringNumber].size();
326 int aPhaseIndex = -1;
328 for (
int i = initialIndexRing[ringNumber]; i < length; i++) {
329 aPhaseIndex =
rings[ringNumber][i] - 1;
330 if (aPhaseIndex != -1) {
333 std::cout <<
"current in cycle time=" << currentInCycleTime <<
" phase: " << aPhaseIndex << std::endl;
341 aPhaseIndex =
rings[ringNumber][initialIndexRing[ringNumber]] - 1;
344 std::cout <<
"current in cycle time=" << currentInCycleTime <<
" ring " << ringNumber <<
" aphase: " << aPhaseIndex + 1 << std::endl;
346 if (ringNumber == 0) {
359 std::cout <<
"After init, active ring1 phase is " <<
activeRing1Phase << std::endl;
360 std::cout <<
"After init, active ring2 phase is " <<
activeRing2Phase << std::endl;
364 std::cout <<
"Print to check NEMA phase definitions\n";
366 std::cout <<
"index = " << p->getName() <<
"; ";
367 std::cout <<
"duration (useless) = " <<
time2string(p->duration) <<
"; ";
368 std::cout <<
"minDur = " <<
time2string(p->minDuration) <<
"; ";
369 std::cout <<
"maxDur = " <<
time2string(p->maxDuration) <<
"; ";
370 std::cout <<
"vehext = " <<
time2string(p->vehext) <<
"; ";
371 std::cout <<
"yellow = " <<
time2string(p->yellow) <<
"; ";
372 std::cout <<
"red = " <<
time2string(p->red) <<
"; ";
373 std::cout <<
"state = " << p->getState() << std::endl;
382 for (
MSLane*
const lane : lanes) {
384 double detector_length = 0;
397 const std::string customID =
getParameter(lane->getID());
398 if (customID !=
"") {
400 if (det ==
nullptr) {
401 WRITE_ERROR(
"Unknown laneAreaDetector '" + customID +
"' given as custom detector for NEMA tlLogic '" +
getID() +
"', program '" +
getProgramID() +
".");
407 std::string
id =
"TLS_" +
myID +
"_" +
myProgramID +
"_E2DetectorOnLane_" + lane->getID();
446 int NEMAPhaseIndex = item.first;
447 std::vector<std::string> laneIDs = item.second;
448 std::vector<MSE2Collector*> detectors;
450 for (std::string laneID : laneIDs) {
453 detectors.push_back(detector);
459 std::cout <<
"Print to check phase2DetectorMap" << std::endl;
461 std::cout <<
"The NEMA phase index = " << item.first <<
" has detectors: \n";
462 for (
auto det : item.second.detectors) {
463 std::cout <<
'\t' << det->getID() << std::endl;
496 std::cout <<
"After init, r1/r2 barrier phase = " <<
r1barrier <<
" and " <<
r2barrier << std::endl;
520 std::map<int, std::set<MSE2Collector*>> linkToDetectors;
521 std::set<int> actuatedLinks;
523 const int numLinks = (int)
myLinks.size();
524 std::vector<bool> neverMajor(numLinks,
true);
526 const std::string& state = phase->getState();
527 for (
int i = 0; i < numLinks; i++) {
529 neverMajor[i] =
false;
533 std::vector<bool> oneLane(numLinks,
false);
534 for (
int i = 0; i < numLinks; i++) {
536 int numMotorized = 0;
538 if ((l->getPermissions() & motorized) != 0) {
542 if (numMotorized == 1) {
551 std::set<MSE2Collector*> detectors;
552 if (phase->isActuted()) {
553 const std::string& state = phase->getState();
554 std::set<int> greenLinks;
555 std::map<MSE2Collector*, std::set<int>> detectorLinks;
557 for (
int i = 0; i < numLinks; i++) {
564 greenLinks.insert(i);
565 actuatedLinks.insert(i);
574 for (
auto& item : detectorLinks) {
579 for (
int j : item.second) {
580 if (greenLinks.count(j) == 0) {
588 MSLane* next = link->getLane();
591 for (
int j : detectorLinks[nextDet]) {
592 if (greenLinks.count(j) == 0) {
602 detectors.insert(item.first);
603 for (
int j : item.second) {
604 linkToDetectors[j].insert(item.first);
608 if (detectors.size() == 0) {
612 std::vector<DetectorInfo*> detectorInfos;
616 if (detInfo.det == det) {
618 detInfo.servedPhase[phaseIndex] =
true;
624 for (
int i : actuatedLinks) {
625 if (linkToDetectors[i].size() == 0 &&
myLinks[i].size() > 0
626 && (
myLinks[i].front()->getLaneBefore()->getPermissions() & motorized) != 0) {
648 for (
int ringIndex = 0; ringIndex <= 1; ringIndex++) {
649 int lastPhasePositionIndex = (int)
rings[ringIndex].size() - 1;
650 int lastPhase =
rings[ringIndex][lastPhasePositionIndex];
651 if (lastPhase == 0) {
652 lastPhase =
rings[ringIndex][lastPhasePositionIndex - 1];
654 int lastPhaseIndex = lastPhase - 1;
657 int ringNumber = ringIndex + 1;
658 const std::string error =
"At NEMA tlLogic '" +
getID() +
"', Ring " +
toString(ringNumber) +
" does not add to cycle length.";
669 if (ring1barrier1_length != ring2barrier1_length) {
670 const std::string error =
"At NEMA tlLogic '" +
getID() +
"', the phases before barrier 1 from both rings do not add up. (ring1="
671 +
toString(ring1barrier1_length) +
", ring2=" +
toString(ring2barrier1_length) +
")";
680 if (ring1barrier2_length != ring2barrier2_length) {
681 const std::string error =
"At NEMA tlLogic '" +
getID() +
"', the phases before barrier 2 from both rings do not add up. (ring1="
682 +
toString(ring1barrier2_length) +
", ring2=" +
toString(ring2barrier2_length) +
")";
697 assert(newSplits.size() == 8);
698 for (
int i = 0; i < 8; i++) {
706 for (
int i = 0; i < 8; i++) {
726 std::vector<int> output;
728 if (c >=
'0' && c <=
'9') {
730 output.push_back(temp);
737 std::vector<std::string> output;
738 std::stringstream ss(s);
741 std::getline(ss, substr,
',');
742 output.push_back(substr);
746 for (
auto i : output) {
747 std::cout << i << std::endl;
754 std::string output =
"";
755 if (state1.size() != state2.size()) {
756 throw ProcessError(
"At NEMA tlLogic '" +
getID() +
"', different sizes of NEMA phase states. Please check the NEMA XML");
758 for (
int i = 0; i < (int)state1.size(); i++) {
759 char ch1 = state1[i];
760 char ch2 = state2[i];
763 if (ch1 ==
'G' || ch2 ==
'G') {
765 }
else if (ch1 ==
'g' || ch2 ==
'g') {
767 }
else if (ch1 ==
's' || ch2 ==
's') {
769 }
else if (ch1 ==
'y' || ch2 ==
'y') {
771 }
else if (ch1 ==
'u' || ch2 ==
'u') {
773 }
else if (ch1 ==
'O' || ch2 ==
'O') {
775 }
else if (ch1 ==
'o' || ch2 ==
'o') {
789 if ((phaseNumber !=
R1State) && (phaseNumber !=
R2State) && depth < 1) {
795 for (
auto det : detectInfo.detectors) {
796 if (det->getCurrentVehicleNumber() > 0) {
800 if (detectInfo.cpdSource > 0 && depth < 1) {
808 std::map<std::string, double>
810 std::map<std::string, double> result;
812 result[item.first->getID()] = item.first->getCurrentVehicleNumber();
838 std::string outputState =
"";
847 std::cout <<
"current time in cycle:\t" << currentInCycleTime <<
"\t" <<
"phases: " <<
R1State <<
'\t' <<
R2State << std::endl;
851 int R1Index = R1Phase - 1;
853 double durationR1 = currentTimeInSecond -
phaseStartTime[R1Index];
867 std::cout <<
"R1 phase " <<
R1State <<
" forceOff " <<
forceOffs[R1Index] <<
"\tphase start " << phaseStartTimeInCycleR1 << std::endl;
876 int R2Index = R2Phase - 1;
877 double durationR2 = currentTimeInSecond -
phaseStartTime[R2Index];
891 std::cout <<
"R2 phase " <<
R1State <<
" forceOff " <<
forceOffs[R2Index] <<
"\tphase start " << phaseStartTimeInCycleR2 << std::endl;
899 bool EndCurrentPhaseR1 =
false;
900 bool EndCurrentPhaseR2 =
false;
902 EndCurrentPhaseR1 =
true;
905 EndCurrentPhaseR2 =
true;
908 if (EndCurrentPhaseR1 && (R1Phase ==
r1barrier)) {
910 EndCurrentPhaseR1 =
false;
915 EndCurrentPhaseR1 =
false;
918 if (EndCurrentPhaseR2 && (R2Phase ==
r2barrier)) {
920 EndCurrentPhaseR2 =
false;
925 EndCurrentPhaseR2 =
false;
953 if ((tempR1Phase == R1Phase && EndCurrentPhaseR1) && (tempR2Phase == R2Phase && EndCurrentPhaseR2) && !
coordinateMode) {
955 EndCurrentPhaseR1 =
false;
956 EndCurrentPhaseR2 =
false;
972 }
else if (tempR1Phase == R1Phase && EndCurrentPhaseR1 &&
greenTransfer) {
976 if (!EndCurrentPhaseR2 || (tempR2Phase != R2Phase)) {
977 EndCurrentPhaseR1 =
false;
987 }
else if (tempR2Phase == R2Phase && EndCurrentPhaseR2 &&
greenTransfer) {
988 if (!EndCurrentPhaseR1 || (tempR1Phase != R1Phase)) {
990 EndCurrentPhaseR2 =
false;
1006 bool calculate =
false;
1031 for (
int i = 0; i < 8; i++) {
1073 std::cout <<
"R2 phase " << R1Phase <<
" is coordinated and has an expected duration of " <<
phaseExpectedDuration[R1Phase - 1] << std::endl;
1083 std::string state1 =
"";
1086 state1 = p->getState();
1092 std::string state2 =
"";
1095 state2 = p->getState();
1117 int length = (int)ring.size();
1122 for (i = 0; i < length * 2; i++) {
1124 if (ring[i % length] != 0) {
1125 int tempPhase = ring[i % length];
1133 std::cout <<
"phase " << tempPhase <<
" was skipped" << std::endl;
1138 if (ring[i % length] == currentPhase) {
1150 return ring[matching_i % length];
1153 return ring[(matching_i + 1) % length];
1161 std::vector<int> barrierOne;
1162 std::vector<int> barrierTwo;
1163 for (
int localPhase :
rings[ring]) {
1165 barrierOne.push_back(localPhase);
1170 barrierTwo.push_back(localPhase);
1173 barrierMap.push_back(barrierOne);
1174 barrierMap.push_back(barrierTwo);
1180 if (phase == localPhase) {
1191 int nextR1Phase = R1Phase;
1192 int nextR2Phase = R2Phase;
1198 }
else if (!toUpdateR2) {
1211 if ((r1Distance <= r2Distance) && (r1Barrier != r2Barrier)) {
1213 }
else if ((r1Distance > r2Distance) && (r1Barrier != r2Barrier)) {
1217 return std::make_tuple(nextR1Phase, nextR2Phase);
1233 std::string newState =
"";
1236 newState = curState;
1238 }
else if (RYG ==
RED) {
1240 for (
char ch : curState) {
1246 for (
char ch : curState) {
1247 if (ch ==
'G' || ch ==
'g') {
1260 std::set<std::string> output;
1262 for (
int i = 0; i < (int)state.size(); i++) {
1265 for (
auto link : linkV[i]) {
1266 output.insert(link->getLaneBefore()->getID());
1274 const std::vector<MSLink*> links = lane->
getLinkCont();
1283 for (
int i = 0; i < (int)state.size(); i++) {
1286 for (
MSLane* lane : lanes) {
1302 item.second->setVisible(
true);
1310 item.second->setVisible(
false);
1323 std::stringstream ss(s);
1333 if (key ==
"NEMA.phaseCall") {
1335 for (
int i = 2; i <= 8; i++) {
1341 throw InvalidArgument(
"Unsupported parameter '" + key +
"' for NEMA controller '" +
getID() +
"'");
1352 if (key ==
"NEMA.splits" || key ==
"NEMA.maxGreens") {
1355 if (tmp.size() != 8) {
1356 throw InvalidArgument(
"Parameter '" + key +
"' for NEMA controller '" +
getID() +
"' requires 8 space-separated values");
1358 std::vector<double> timing;
1359 for (
const std::string& s : tmp) {
1362 if (key ==
"NEMA.maxGreens") {
1367 }
else if (key ==
"NEMA.cycleLength") {
1369 }
else if (key ==
"NEMA.offset") {
1372 throw InvalidArgument(
"Unsupported parameter '" + key +
"' for NEMA controller '" +
getID() +
"'");
1380 if (param_variable ==
"") {
#define WRITE_WARNINGF(...)
#define WRITE_WARNING(msg)
std::string time2string(SUMOTime t)
convert SUMOTime to string
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_LANE_AREA_DETECTOR
alternative tag for e2 detector
@ LEFT
The link is a (hard) left direction.
@ LINKSTATE_TL_GREEN_MAJOR
The link has green light, may pass.
@ LINKSTATE_TL_GREEN_MINOR
The link has green light, has to brake.
#define UNUSED_PARAMETER(x)
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.
const NamedObjectCont< MSDetectorFileOutput * > & getTypedDetectors(SumoXMLTag type) const
Returns the list of detectors of the given type.
An areal detector corresponding to a sequence of consecutive lanes.
virtual void setVisible(bool)
const std::vector< MSLane * > & getLanes() const
Returns this edge's lanes.
Representation of a lane in the micro simulation.
const std::vector< MSLink * > & getLinkCont() const
returns the container with all links !!!
static bool dictionary(const std::string &id, MSLane *lane)
Static (sic!) container methods {.
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.
MSTLLogicControl & getTLSControl()
Returns the tls logics control.
SUMOTime getCurrentTimeStep() const
Returns the current simulation step.
The definition of a single phase of a tls logic.
const std::string & getState() const
Returns the state within this phase.
void setState(const std::string &_state)
void setName(const std::string &_name)
A fixed traffic light logic.
Phases myPhases
The list of phases this logic uses.
int myStep
The current step.
MSTrafficLightLogic * getActive() 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.
std::vector< MSLane * > LaneVector
Definition of the list of arrival lanes subjected to this tls.
virtual void deactivateProgram()
const LinkVectorVector & getLinks() const
Returns the list of lists of all affected links.
SUMOTime myDefaultCycleTime
The cycle time (without changes)
const std::string myProgramID
The id of the logic.
LaneVectorVector myLanes
The list of LaneVectors; each vector contains the incoming lanes that belong to the same link index.
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.
std::vector< MSPhaseDefinition * > Phases
Definition of a list of phases, being the junction logic.
std::vector< LinkVector > LinkVectorVector
Definition of a list that holds lists of links that do have the same attribute.
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.
std::map< int, phaseDetectorInfo > phase2DetectorMap
std::map< std::string, double > getDetectorStates() const override
retrieve all detectors used by this program
bool isDetectorActivated(int phaseNumber, int depth) const
void setNewMaxGreens(std::vector< double > newMaxGreens)
const std::string getParameter(const std::string &key, const std::string defaultValue="") const override
try to get the value of the given parameter. Parameters prefixed with 'NEMA.' control functionality
std::vector< DetectorInfo > myDetectorInfoVector
void init(NLDetectorBuilder &nb) override
Initialises the tls with information about incoming lanes.
std::string myVehicleTypes
Whether detector output separates by vType.
std::string myFile
The output file for generated detectors.
std::string combineStates(std::string state1, std::string state2)
void constructBarrierMap(int ring, std::vector< std::vector< int >> &barrierMap)
helps to construct myRingBarrierMapping
std::vector< std::vector< int > > rings
SUMOTime myFreq
The frequency for aggregating detector output.
DetectorLaneMap myDetectorLaneMap
A map from detectors to lanes.
SUMOTime trySwitch() override
Switches to the next phase.
std::vector< int > coordinatePhaseIndecies
int nextPhase(std::vector< int > ring, int phaseNum, int &distance, bool sameAllowed)
int findBarrier(int desiredPhase, int ring)
std::vector< std::string > string2vector(std::string s)
std::string transitionState(std::string curState, int RYG)
NEMALogic(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)
Constructor.
void activateProgram() override
called when switching programs
void setShowDetectors(bool show)
double phaseExpectedDuration[8]
std::string outputStateFilePath
std::tuple< int, int > getNextPhases(int currentR1Index, int currentR2Index, bool toUpdateR1, bool toUpdateR2, bool stayOk=false)
void setParameter(const std::string &key, const std::string &value) override
try to set the given parameter. Parameters prefixed with 'NEMA.' control functionality
void error_handle_not_set(std::string param_variable, std::string param_name)
std::string NEMA_control()
void setNewOffset(double newOffset)
std::set< std::string > getLaneIDsFromNEMAState(std::string state)
std::string currentR2State
std::vector< int > readParaFromString(std::string s)
std::string currentR1State
bool myShowDetectors
Whether the detectors shall be shown in the GUI.
detectorMap myDetectorForPhase
int string2int(std::string s)
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
void deactivateProgram() override
MSPhaseDefinition myPhase
virtual phase that holds the current state
double myDetectorLengthLeftTurnLane
std::ofstream outputStateFile
bool isLeftTurnLane(const MSLane *const lane) const
LaneDetectorMap myLaneDetectorMap
A map from lanes to detectors.
std::vector< int > barrierPhaseIndecies
double ModeCycle(double a, double b)
void setNewCycleLength(double newCycleLength)
std::vector< std::vector< int > > myRingBarrierMapping[2]
const MSPhaseDefinition & getCurrentPhaseDef() const override
Returns the definition of the current phase.
std::map< int, std::vector< std::string > > phase2ControllerLanesMap
void setNewSplits(std::vector< double > newSplits)
Builds detectors for microsim.
Parameterised * buildE2Detector(const std::string &id, MSLane *lane, double pos, double endPos, double length, const std::string &device, SUMOTime frequency, SUMOTime haltingTimeThreshold, double haltingSpeedThreshold, double jamDistThreshold, const std::string &vTypes, int detectPersons, bool friendlyPos, bool showDetector, MSTLLogicControl::TLSLogicVariants *tlls=0, MSLane *toLane=0)
Builds a new E2 detector and adds it to the net's detector control. Also performs some consistency ch...
std::string myID
The name of the object.
const std::string & getID() const
Returns the id.
T get(const std::string &id) const
Retrieves an item.
static OptionsCont & getOptions()
Retrieves the options.
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.
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
const unsigned char flag[]
std::string to_string(const std::vector< double > &value)