SUMO - Simulation of Urban MObility
|
00001 /****************************************************************************/ 00010 // Stores all persons in the net and handles their waiting for cars. 00011 /****************************************************************************/ 00012 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ 00013 // Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors 00014 /****************************************************************************/ 00015 // 00016 // This file is part of SUMO. 00017 // SUMO is free software: you can redistribute it and/or modify 00018 // it under the terms of the GNU General Public License as published by 00019 // the Free Software Foundation, either version 3 of the License, or 00020 // (at your option) any later version. 00021 // 00022 /****************************************************************************/ 00023 #ifndef MSPersonControl_h 00024 #define MSPersonControl_h 00025 00026 00027 // =========================================================================== 00028 // included modules 00029 // =========================================================================== 00030 #ifdef _MSC_VER 00031 #include <windows_config.h> 00032 #else 00033 #include <config.h> 00034 #endif 00035 00036 #include <vector> 00037 00038 00039 // =========================================================================== 00040 // class declarations 00041 // =========================================================================== 00042 class MSPerson; 00043 class MSNet; 00044 00045 00046 // =========================================================================== 00047 // class definitions 00048 // =========================================================================== 00056 class MSPersonControl { 00057 public: 00058 00059 typedef std::vector<MSPerson*> PersonVector; 00060 00062 MSPersonControl(); 00063 00065 ~MSPersonControl(); 00066 00068 bool add(const std::string& id, MSPerson* person); 00069 00071 void erase(MSPerson* person); 00072 00074 void setArrival(SUMOTime time, MSPerson* person); 00075 00077 void checkArrivedPersons(MSNet* net, const SUMOTime time); 00078 00080 void addWaiting(const MSEdge* edge, MSPerson* person) ; 00081 00088 bool boardAnyWaiting(const MSEdge* edge, MSVehicle* vehicle) ; 00089 00091 bool hasPersons() const ; 00092 00094 bool hasPedestrians() const ; 00095 00097 void abortWaiting() ; 00098 00099 private: 00101 std::map<std::string, MSPerson*> myPersons; 00102 00104 std::map<SUMOTime, PersonVector> myArrivals; 00105 00107 std::map<const MSEdge*, PersonVector> myWaiting; 00108 00109 }; 00110 00111 00112 #endif 00113 00114 /****************************************************************************/