SUMO - Simulation of Urban MObility
MSInstantInductLoop.h
Go to the documentation of this file.
00001 /****************************************************************************/
00007 // An instantaneous induction loop
00008 /****************************************************************************/
00009 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/
00010 // Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors
00011 /****************************************************************************/
00012 //
00013 //   This file is part of SUMO.
00014 //   SUMO is free software: you can redistribute it and/or modify
00015 //   it under the terms of the GNU General Public License as published by
00016 //   the Free Software Foundation, either version 3 of the License, or
00017 //   (at your option) any later version.
00018 //
00019 /****************************************************************************/
00020 #ifndef MSInstantInductLoop_h
00021 #define MSInstantInductLoop_h
00022 
00023 
00024 // ===========================================================================
00025 // included modules
00026 // ===========================================================================
00027 #ifdef _MSC_VER
00028 #include <windows_config.h>
00029 #else
00030 #include <config.h>
00031 #endif
00032 
00033 #include <string>
00034 #include <deque>
00035 #include <map>
00036 #include <functional>
00037 #include <microsim/MSMoveReminder.h>
00038 #include <microsim/output/MSDetectorFileOutput.h>
00039 
00040 
00041 // ===========================================================================
00042 // class declarations
00043 // ===========================================================================
00044 class MSLane;
00045 class MSVehicle;
00046 class OutputDevice;
00047 
00048 
00049 // ===========================================================================
00050 // class definitions
00051 // ===========================================================================
00059 class MSInstantInductLoop
00060         : public MSMoveReminder, public MSDetectorFileOutput {
00061 public:
00070     MSInstantInductLoop(const std::string& id, OutputDevice& od,
00071                         MSLane* const lane, SUMOReal positionInMeters) ;
00072 
00073 
00075     ~MSInstantInductLoop() ;
00076 
00077 
00078 
00081 
00098     bool notifyMove(SUMOVehicle& veh, SUMOReal oldPos, SUMOReal newPos, SUMOReal newSpeed) ;
00099 
00100 
00115     bool notifyLeave(SUMOVehicle& veh, SUMOReal lastPos, MSMoveReminder::Notification reason) ;
00116 
00117 
00131     bool notifyEnter(SUMOVehicle& veh, MSMoveReminder::Notification reason) ;
00133 
00134 
00135 
00145     void writeXMLOutput(OutputDevice& dev,
00146                         SUMOTime startTime, SUMOTime stopTime) {
00147         UNUSED_PARAMETER(dev);
00148         UNUSED_PARAMETER(startTime);
00149         UNUSED_PARAMETER(stopTime);
00150     }
00151 
00152 
00161     void writeXMLDetectorProlog(OutputDevice& dev) const;
00162 
00163 
00164 protected:
00173     void write(const char* state, SUMOReal t, SUMOVehicle& veh, SUMOReal speed, const char* add = 0, SUMOReal addValue = -1);
00174 
00175 
00176 protected:
00178     OutputDevice& myOutputDevice;
00179 
00181     const SUMOReal myPosition;
00182 
00184     SUMOReal myLastExitTime;
00185 
00187     std::map<SUMOVehicle*, SUMOReal> myEntryTimes;
00188 
00189 private:
00191     MSInstantInductLoop(const MSInstantInductLoop&);
00192 
00194     MSInstantInductLoop& operator=(const MSInstantInductLoop&);
00195 
00196 
00197 };
00198 
00199 
00200 #endif
00201 
00202 /****************************************************************************/
00203 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines