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