GUIDetectorBuilder.cpp
Go to the documentation of this file.00001
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifdef _MSC_VER
00025 #include <windows_config.h>
00026 #else
00027 #include <config.h>
00028 #endif
00029
00030 #include <string>
00031 #include <iostream>
00032 #include <microsim/MSNet.h>
00033 #include <microsim/output/MSInductLoop.h>
00034 #include <guisim/GUIInductLoop.h>
00035 #include <guisim/GUI_E2_ZS_Collector.h>
00036 #include <guisim/GUI_E2_ZS_CollectorOverLanes.h>
00037 #include <guisim/GUIE3Collector.h>
00038 #include <utils/common/UtilExceptions.h>
00039 #include <utils/common/FileHelpers.h>
00040 #include "GUIDetectorBuilder.h"
00041
00042 #ifdef HAVE_MESOSIM
00043 #include <mesogui/GUIMEInductLoop.h>
00044 #include <mesosim/MELoop.h>
00045 #endif
00046
00047 #ifdef CHECK_MEMORY_LEAKS
00048 #include <foreign/nvwa/debug_new.h>
00049 #endif // CHECK_MEMORY_LEAKS
00050
00051
00052
00053
00054
00055 GUIDetectorBuilder::GUIDetectorBuilder(MSNet &net) throw()
00056 : NLDetectorBuilder(net) {}
00057
00058
00059 GUIDetectorBuilder::~GUIDetectorBuilder() throw() {}
00060
00061
00062 MSInductLoop *
00063 GUIDetectorBuilder::createInductLoop(const std::string &id,
00064 MSLane *lane, SUMOReal pos) throw() {
00065 return new GUIInductLoop(id, lane, pos);
00066 }
00067
00068
00069 #ifdef HAVE_MESOSIM
00070 MEInductLoop *
00071 GUIDetectorBuilder::createMEInductLoop(const std::string &id,
00072 MESegment *s, SUMOReal pos) throw() {
00073 return new GUIMEInductLoop(id, s, pos);
00074 }
00075 #endif
00076
00077
00078 MSE2Collector *
00079 GUIDetectorBuilder::createSingleLaneE2Detector(const std::string &id,
00080 DetectorUsage usage, MSLane *lane, SUMOReal pos, SUMOReal length,
00081 SUMOTime haltingTimeThreshold,
00082 MetersPerSecond haltingSpeedThreshold,
00083 SUMOReal jamDistThreshold) throw() {
00084 return new GUI_E2_ZS_Collector(id, usage, lane, pos, length,
00085 haltingTimeThreshold, haltingSpeedThreshold,
00086 jamDistThreshold);
00087
00088 }
00089
00090
00091 MS_E2_ZS_CollectorOverLanes *
00092 GUIDetectorBuilder::createMultiLaneE2Detector(const std::string &id,
00093 DetectorUsage usage, MSLane *lane, SUMOReal pos,
00094 SUMOTime haltingTimeThreshold,
00095 MetersPerSecond haltingSpeedThreshold,
00096 SUMOReal jamDistThreshold) throw() {
00097 return new GUI_E2_ZS_CollectorOverLanes(id, usage, lane, pos,
00098 haltingTimeThreshold, haltingSpeedThreshold,
00099 jamDistThreshold);
00100 }
00101
00102
00103 MSE3Collector *
00104 GUIDetectorBuilder::createE3Detector(const std::string &id,
00105 const CrossSectionVector &entries,
00106 const CrossSectionVector &exits,
00107 MetersPerSecond haltingSpeedThreshold,
00108 SUMOTime haltingTimeThreshold) throw() {
00109 return new GUIE3Collector(id, entries, exits, haltingSpeedThreshold, haltingTimeThreshold);
00110 }
00111
00112
00113
00114
00115