|
SUMO - Simulation of Urban MObility
|
00001 /****************************************************************************/ 00007 // A device which is used to keep track of Persons riding with a vehicle 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 #ifndef MSDevice_Person_h 00020 #define MSDevice_Person_h 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 <set> 00033 #include <vector> 00034 #include <map> 00035 #include "MSDevice.h" 00036 #include <utils/common/SUMOTime.h> 00037 #include <microsim/MSVehicle.h> 00038 #include <utils/common/WrappingCommand.h> 00039 00040 00041 // =========================================================================== 00042 // class declarations 00043 // =========================================================================== 00044 class MSLane; 00045 00046 00047 // =========================================================================== 00048 // class definitions 00049 // =========================================================================== 00054 class MSDevice_Person : public MSDevice { 00055 public: 00063 static MSDevice_Person* buildVehicleDevices(SUMOVehicle& v, std::vector<MSDevice*> &into) throw(); 00064 00065 00066 public: 00069 00080 bool notifyMove(SUMOVehicle& veh, SUMOReal oldPos, SUMOReal newPos, SUMOReal newSpeed) throw(); 00081 00082 00091 bool notifyEnter(SUMOVehicle& veh, MSMoveReminder::Notification reason) throw(); 00092 00093 00103 bool notifyLeave(SUMOVehicle& veh, SUMOReal lastPos, 00104 MSMoveReminder::Notification reason) throw(); 00106 00107 00112 void addPerson(MSPerson* person) throw(); 00113 00114 00116 ~MSDevice_Person() throw(); 00117 00118 private: 00124 MSDevice_Person(SUMOVehicle& holder, const std::string& id) throw(); 00125 00126 00127 private: 00129 std::vector<MSPerson*> myPersons; 00130 00132 bool myStopped; 00133 00134 00135 private: 00137 MSDevice_Person(const MSDevice_Person&); 00138 00140 MSDevice_Person& operator=(const MSDevice_Person&); 00141 00142 00143 }; 00144 00145 00146 #endif 00147 00148 /****************************************************************************/ 00149