61 #include <mesosim/MEInductLoop.h>
62 #include <mesosim/MELoop.h>
63 #include <mesosim/MESegment.h>
66 #ifdef CHECK_MEMORY_LEAKS
68 #endif // CHECK_MEMORY_LEAKS
78 const std::string& device,
SUMOReal haltingSpeedThreshold,
79 SUMOTime haltingTimeThreshold,
int splInterval)
80 : myID(id), myDevice(device),
81 myHaltingSpeedThreshold(haltingSpeedThreshold),
82 myHaltingTimeThreshold(haltingTimeThreshold),
83 mySampleInterval(splInterval) {}
101 const std::string& lane,
SUMOReal pos,
int splInterval,
102 const std::string& device,
bool friendlyPos,
bool splitByType) {
118 MESegment* s = MSGlobals::gMesoNet->getSegmentForEdge(clane->
getEdge());
121 while (cpos + prev->getLength() < pos && s != 0) {
123 cpos += s->getLength();
124 s = s->getNextSegment();
127 if (rpos > prev->getLength() || rpos < 0) {
129 rpos = prev->getLength() - (
SUMOReal) 0.1;
131 throw InvalidArgument(
"The position of detector '" +
id +
"' lies beyond the lane's '" + lane +
"' length.");
135 createMEInductLoop(
id, prev, rpos);
144 const std::string& lane,
SUMOReal pos,
145 const std::string& device,
bool friendlyPos) {
160 bool cont,
int splInterval,
161 const std::string& device,
164 SUMOReal jamDistThreshold,
bool friendlyPos) {
186 const std::string& device,
189 SUMOReal jamDistThreshold,
bool friendlyPos) {
191 throw InvalidArgument(
"The detector '" +
id +
"' refers to the unknown lsa.");
215 const std::string& tolane,
216 const std::string& device,
219 SUMOReal jamDistThreshold,
bool friendlyPos) {
221 throw InvalidArgument(
"The detector '" +
id +
"' refers to the unknown lsa.");
228 "The detector output can not be build as no connection between lanes '"
229 + lane +
"' and '" + tolane +
"' exists.");
264 throw InvalidArgument(
"The length of detector '" +
id +
"' lies beyond the lane's '" + clane->
getID() +
"' length.");
271 throw InvalidArgument(
"The length of detector '" +
id +
"' is almost 0.");
289 const std::string& device,
int splInterval,
352 const std::string& vtype,
SUMOTime frequency,
353 const std::string& device) {
362 const std::string& device) {
380 length, haltingTimeThreshold, haltingSpeedThreshold,
392 lane, pos, haltingTimeThreshold, haltingSpeedThreshold,
415 NLDetectorBuilder::createMEInductLoop(
const std::string&
id,
417 return new MEInductLoop(
id, s, pos);
426 return new MSE2Collector(
id, usage, lane, pos, length, haltingTimeThreshold, haltingSpeedThreshold, jamDistThreshold);
444 return new MSE3Collector(
id, entries, exits, haltingSpeedThreshold, haltingTimeThreshold);
450 const std::string& detid) {
460 throw InvalidArgument(
"The position of detector '" + detid +
"' lies beyond the lane's '" + lane->
getID() +
"' length.");
467 throw InvalidArgument(
"The position of detector '" + detid +
"' lies beyond the lane's '" + lane->
getID() +
"' length.");
477 const bool useLanes,
const bool withEmpty,
const bool printDefaults,
478 const bool withInternal,
const bool trackVehicles,
480 const SUMOReal haltSpeed,
const std::string& vTypes,
481 const std::string& device) {
483 throw InvalidArgument(
"Negative begin time for meandata dump '" +
id +
"'.");
489 throw InvalidArgument(
"End before or at begin for meandata dump '" +
id +
"'.");
491 std::set<std::string> vt;
494 vt.insert(st.
next());
497 if (type ==
"" || type ==
"performance" || type ==
"traffic") {
499 printDefaults, withInternal, trackVehicles,
500 maxTravelTime, minSamples, haltSpeed, vt);
501 }
else if (type ==
"hbefa") {
503 printDefaults, withInternal, trackVehicles,
504 maxTravelTime, minSamples, vt);
505 }
else if (type ==
"harmonoise") {
507 printDefaults, withInternal, trackVehicles,
508 maxTravelTime, minSamples, vt);
510 throw InvalidArgument(
"Invalid type '" + type +
"' for meandata dump '" +
id +
"'.");
514 frequency = end - begin;
526 const std::string& detid) {
530 throw InvalidArgument(
"The lane with the id '" + edgeID +
"' is not known (while building " +
toString(type) +
" '" + detid +
"').");
538 const std::string& detid) {
542 throw InvalidArgument(
"The lane with the id '" + laneID +
"' is not known (while building " +
toString(type) +
" '" + detid +
"').");
550 if (splInterval < 0) {
553 if (splInterval == 0) {