63 #include <mesosim/MEInductLoop.h>
64 #include <mesosim/MELoop.h>
65 #include <mesosim/MESegment.h>
68 #ifdef CHECK_MEMORY_LEAKS
70 #endif // CHECK_MEMORY_LEAKS
80 const std::string& device,
SUMOReal haltingSpeedThreshold,
81 SUMOTime haltingTimeThreshold,
int splInterval)
82 : myID(id), myDevice(device),
83 myHaltingSpeedThreshold(haltingSpeedThreshold),
84 myHaltingTimeThreshold(haltingTimeThreshold),
85 mySampleInterval(splInterval) {}
103 const std::string& lane,
SUMOReal pos,
int splInterval,
104 const std::string& device,
bool friendlyPos,
bool splitByType) {
120 MESegment* s = MSGlobals::gMesoNet->getSegmentForEdge(clane->
getEdge());
123 while (cpos + prev->getLength() < pos && s != 0) {
125 cpos += s->getLength();
126 s = s->getNextSegment();
129 if (rpos > prev->getLength() || rpos < 0) {
131 rpos = prev->getLength() - (
SUMOReal) 0.1;
133 throw InvalidArgument(
"The position of detector '" +
id +
"' lies beyond the lane's '" + lane +
"' length.");
137 createMEInductLoop(
id, prev, rpos);
146 const std::string& lane,
SUMOReal pos,
147 const std::string& device,
bool friendlyPos) {
162 bool cont,
int splInterval,
163 const std::string& device,
166 SUMOReal jamDistThreshold,
bool friendlyPos) {
188 const std::string& device,
191 SUMOReal jamDistThreshold,
bool friendlyPos) {
193 throw InvalidArgument(
"The detector '" +
id +
"' refers to the unknown lsa.");
217 const std::string& tolane,
218 const std::string& device,
221 SUMOReal jamDistThreshold,
bool friendlyPos) {
223 throw InvalidArgument(
"The detector '" +
id +
"' refers to the unknown lsa.");
230 "The detector output can not be build as no connection between lanes '"
231 + lane +
"' and '" + tolane +
"' exists.");
266 throw InvalidArgument(
"The length of detector '" +
id +
"' lies beyond the lane's '" + clane->
getID() +
"' length.");
273 throw InvalidArgument(
"The length of detector '" +
id +
"' is almost 0.");
291 const std::string& device,
int splInterval,
354 const std::string& vtype,
SUMOTime frequency,
355 const std::string& device) {
364 const std::string& device) {
382 length, haltingTimeThreshold, haltingSpeedThreshold,
394 lane, pos, haltingTimeThreshold, haltingSpeedThreshold,
417 NLDetectorBuilder::createMEInductLoop(
const std::string&
id,
419 return new MEInductLoop(
id, s, pos);
428 return new MSE2Collector(
id, usage, lane, pos, length, haltingTimeThreshold, haltingSpeedThreshold, jamDistThreshold);
446 return new MSE3Collector(
id, entries, exits, haltingSpeedThreshold, haltingTimeThreshold);
452 const std::string& detid) {
462 throw InvalidArgument(
"The position of detector '" + detid +
"' lies beyond the lane's '" + lane->
getID() +
"' length.");
469 throw InvalidArgument(
"The position of detector '" + detid +
"' lies beyond the lane's '" + lane->
getID() +
"' length.");
479 const bool useLanes,
const bool withEmpty,
const bool printDefaults,
480 const bool withInternal,
const bool trackVehicles,
482 const SUMOReal haltSpeed,
const std::string& vTypes,
483 const std::string& device) {
485 throw InvalidArgument(
"Negative begin time for meandata dump '" +
id +
"'.");
491 throw InvalidArgument(
"End before or at begin for meandata dump '" +
id +
"'.");
493 std::set<std::string> vt;
496 vt.insert(st.
next());
499 if (type ==
"" || type ==
"performance" || type ==
"traffic") {
501 printDefaults, withInternal, trackVehicles, maxTravelTime, minSamples, haltSpeed, vt);
502 }
else if (type ==
"emissions" || type ==
"hbefa") {
503 if (type ==
"hbefa") {
504 WRITE_WARNING(
"The netstate type 'hbefa' is deprecated. Please use the type 'emissions' instead.");
507 printDefaults, withInternal, trackVehicles, maxTravelTime, minSamples, vt);
508 }
else if (type ==
"harmonoise") {
510 printDefaults, withInternal, trackVehicles, maxTravelTime, minSamples, vt);
511 }
else if (type ==
"amitran") {
513 printDefaults, withInternal, trackVehicles, maxTravelTime, minSamples, haltSpeed, vt);
515 throw InvalidArgument(
"Invalid type '" + type +
"' for meandata dump '" +
id +
"'.");
519 frequency = end - begin;
531 const std::string& detid) {
535 throw InvalidArgument(
"The lane with the id '" + edgeID +
"' is not known (while building " +
toString(type) +
" '" + detid +
"').");
543 const std::string& detid) {
547 throw InvalidArgument(
"The lane with the id '" + laneID +
"' is not known (while building " +
toString(type) +
" '" + detid +
"').");
555 if (splInterval < 0) {
558 if (splInterval == 0) {