GUIDetectorBuilder.cpp

Go to the documentation of this file.
00001 /****************************************************************************/
00007 // Builds detectors for guisim
00008 /****************************************************************************/
00009 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/
00010 // Copyright 2001-2010 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 <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 // method definitions
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 

Generated on Wed May 5 00:06:29 2010 for Sumo - Simulation of Urban MObility by  doxygen 1.5.6