|
SUMO - Simulation of Urban MObility
|
00001 /****************************************************************************/ 00007 // Builds detectors for guisim 00008 /****************************************************************************/ 00009 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ 00010 // Copyright (C) 2001-2011 DLR (http://www.dlr.de/) and contributors 00011 /****************************************************************************/ 00012 // 00013 // This program is free software; you can redistribute it and/or modify 00014 // it under the terms of the GNU General Public License as published by 00015 // the Free Software Foundation; either version 2 of the License, or 00016 // (at your option) any later version. 00017 // 00018 /****************************************************************************/ 00019 00020 00021 // =========================================================================== 00022 // included modules 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 <guisim/GUIInstantInductLoop.h> 00039 #include <utils/common/UtilExceptions.h> 00040 #include <utils/common/FileHelpers.h> 00041 #include "GUIDetectorBuilder.h" 00042 00043 #ifdef HAVE_MESOSIM 00044 #include <mesogui/GUIMEInductLoop.h> 00045 #include <mesosim/MELoop.h> 00046 #endif 00047 00048 #ifdef CHECK_MEMORY_LEAKS 00049 #include <foreign/nvwa/debug_new.h> 00050 #endif // CHECK_MEMORY_LEAKS 00051 00052 00053 // =========================================================================== 00054 // method definitions 00055 // =========================================================================== 00056 GUIDetectorBuilder::GUIDetectorBuilder(MSNet& net) throw() 00057 : NLDetectorBuilder(net) {} 00058 00059 00060 GUIDetectorBuilder::~GUIDetectorBuilder() throw() {} 00061 00062 00063 MSDetectorFileOutput* 00064 GUIDetectorBuilder::createInductLoop(const std::string& id, 00065 MSLane* lane, SUMOReal pos, bool splitByType) throw() { 00066 return new GUIInductLoop(id, lane, pos, splitByType); 00067 } 00068 00069 00070 MSDetectorFileOutput* 00071 GUIDetectorBuilder::createInstantInductLoop(const std::string& id, 00072 MSLane* lane, SUMOReal pos, OutputDevice& od) throw() { 00073 return new GUIInstantInductLoop(id, od, lane, pos); 00074 } 00075 00076 00077 #ifdef HAVE_MESOSIM 00078 MEInductLoop* 00079 GUIDetectorBuilder::createMEInductLoop(const std::string& id, 00080 MESegment* s, SUMOReal pos) throw() { 00081 return new GUIMEInductLoop(id, s, pos); 00082 } 00083 #endif 00084 00085 00086 MSDetectorFileOutput* 00087 GUIDetectorBuilder::createSingleLaneE2Detector(const std::string& id, 00088 DetectorUsage usage, MSLane* lane, SUMOReal pos, SUMOReal length, 00089 SUMOTime haltingTimeThreshold, 00090 SUMOReal haltingSpeedThreshold, 00091 SUMOReal jamDistThreshold) throw() { 00092 return new GUI_E2_ZS_Collector(id, usage, lane, pos, length, haltingTimeThreshold, haltingSpeedThreshold, jamDistThreshold); 00093 } 00094 00095 00096 MSDetectorFileOutput* 00097 GUIDetectorBuilder::createMultiLaneE2Detector(const std::string& id, 00098 DetectorUsage usage, MSLane* lane, SUMOReal pos, 00099 SUMOTime haltingTimeThreshold, 00100 SUMOReal haltingSpeedThreshold, 00101 SUMOReal jamDistThreshold) throw() { 00102 return new GUI_E2_ZS_CollectorOverLanes(id, usage, lane, pos, haltingTimeThreshold, haltingSpeedThreshold, jamDistThreshold); 00103 } 00104 00105 00106 MSDetectorFileOutput* 00107 GUIDetectorBuilder::createE3Detector(const std::string& id, 00108 const CrossSectionVector& entries, 00109 const CrossSectionVector& exits, 00110 SUMOReal haltingSpeedThreshold, 00111 SUMOTime haltingTimeThreshold) throw() { 00112 return new GUIE3Collector(id, entries, exits, haltingSpeedThreshold, haltingTimeThreshold); 00113 } 00114 00115 00116 00117 /****************************************************************************/ 00118