SUMO - Simulation of Urban MObility
|
00001 /****************************************************************************/ 00009 // A device which is used to keep track of Persons riding with a vehicle 00010 /****************************************************************************/ 00011 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ 00012 // Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors 00013 /****************************************************************************/ 00014 // 00015 // This file is part of SUMO. 00016 // SUMO is free software: you can redistribute it and/or modify 00017 // it under the terms of the GNU General Public License as published by 00018 // the Free Software Foundation, either version 3 of the License, or 00019 // (at your option) any later version. 00020 // 00021 /****************************************************************************/ 00022 #ifndef MSDevice_Person_h 00023 #define MSDevice_Person_h 00024 00025 00026 // =========================================================================== 00027 // included modules 00028 // =========================================================================== 00029 #ifdef _MSC_VER 00030 #include <windows_config.h> 00031 #else 00032 #include <config.h> 00033 #endif 00034 00035 #include <set> 00036 #include <vector> 00037 #include <map> 00038 #include "MSDevice.h" 00039 #include <utils/common/SUMOTime.h> 00040 #include <microsim/MSVehicle.h> 00041 #include <utils/common/WrappingCommand.h> 00042 00043 00044 // =========================================================================== 00045 // class declarations 00046 // =========================================================================== 00047 class MSLane; 00048 00049 00050 // =========================================================================== 00051 // class definitions 00052 // =========================================================================== 00057 class MSDevice_Person : public MSDevice { 00058 public: 00066 static MSDevice_Person* buildVehicleDevices(SUMOVehicle& v, std::vector<MSDevice*> &into) ; 00067 00068 00069 public: 00072 00083 bool notifyMove(SUMOVehicle& veh, SUMOReal oldPos, SUMOReal newPos, SUMOReal newSpeed) ; 00084 00085 00094 bool notifyEnter(SUMOVehicle& veh, MSMoveReminder::Notification reason) ; 00095 00096 00106 bool notifyLeave(SUMOVehicle& veh, SUMOReal lastPos, 00107 MSMoveReminder::Notification reason) ; 00109 00110 00115 void addPerson(MSPerson* person) ; 00116 00117 00119 ~MSDevice_Person() ; 00120 00121 private: 00127 MSDevice_Person(SUMOVehicle& holder, const std::string& id) ; 00128 00129 00130 private: 00132 std::vector<MSPerson*> myPersons; 00133 00135 bool myStopped; 00136 00137 00138 private: 00140 MSDevice_Person(const MSDevice_Person&); 00141 00143 MSDevice_Person& operator=(const MSDevice_Person&); 00144 00145 00146 }; 00147 00148 00149 #endif 00150 00151 /****************************************************************************/ 00152