SUMO - Simulation of Urban MObility

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 (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 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 class MSNet;
00040 
00041 
00042 // ===========================================================================
00043 // class definitions
00044 // ===========================================================================
00052 class MSPersonControl {
00053 public:
00054 
00055     typedef std::vector<MSPerson*> PersonVector;
00056 
00058     MSPersonControl();
00059 
00061     ~MSPersonControl();
00062 
00064     bool add(const std::string& id, MSPerson* person);
00065 
00067     void erase(MSPerson* person);
00068 
00070     void setArrival(SUMOTime time, MSPerson* person);
00071 
00073     void checkArrivedPersons(MSNet* net, const SUMOTime time);
00074 
00076     void addWaiting(const MSEdge* edge, MSPerson* person) throw();
00077 
00084     bool boardAnyWaiting(const MSEdge* edge, MSVehicle* vehicle) throw();
00085 
00087     bool hasPersons() const throw();
00088 
00090     bool hasPedestrians() const throw();
00091 
00093     void abortWaiting() throw();
00094 
00095 private:
00097     std::map<std::string, MSPerson*> myPersons;
00098 
00100     std::map<SUMOTime, PersonVector> myArrivals;
00101 
00103     std::map<const MSEdge*, PersonVector> myWaiting;
00104 
00105 };
00106 
00107 
00108 #endif
00109 
00110 /****************************************************************************/
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines