MSPersonControl.h

Go to the documentation of this file.
00001 /****************************************************************************/
00007 // Stores all persons in the net and handles their waiting for cars.
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 #ifndef MSPersonControl_h
00020 #define MSPersonControl_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 <vector>
00033 
00034 
00035 // ===========================================================================
00036 // class declarations
00037 // ===========================================================================
00038 class MSPerson;
00039 
00040 
00041 // ===========================================================================
00042 // class definitions
00043 // ===========================================================================
00051 class MSPersonControl {
00052 public:
00053 
00054     typedef std::vector<MSPerson*> PersonVector;
00055 
00057     MSPersonControl();
00058 
00060     ~MSPersonControl();
00061 
00063     bool add(const std::string &id, MSPerson *person);
00064 
00066     void erase(MSPerson *person);
00067 
00069     void setArrival(SUMOTime time, MSPerson *person);
00070 
00072     bool hasArrivedPersons(SUMOTime time) const;
00073 
00075     const PersonVector popArrivedPersons(SUMOTime time);
00076 
00078     void addWaiting(const MSEdge* edge, MSPerson *person) throw();
00079 
00081     void checkWaiting(const MSEdge* edge, MSVehicle *vehicle) throw();
00082 
00083 
00084 private:
00086     std::map<std::string, MSPerson*> myPersons;
00087 
00089     std::map<SUMOTime, PersonVector> myArrivals;
00090 
00092     std::map<const MSEdge*, PersonVector> myWaiting;
00093 
00094 };
00095 
00096 
00097 #endif
00098 
00099 /****************************************************************************/

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