|
SUMO - Simulation of Urban MObility
|
00001 /****************************************************************************/ 00007 // Bus line of the city: contains all the buses of this line 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 // activitygen module 00012 // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/) 00013 /****************************************************************************/ 00014 // 00015 // This program is free software; you can redistribute it and/or modify 00016 // it under the terms of the GNU General Public License as published by 00017 // the Free Software Foundation; either version 2 of the License, or 00018 // (at your option) any later version. 00019 // 00020 /****************************************************************************/ 00021 #ifndef AGBUSLINE_H 00022 #define AGBUSLINE_H 00023 00024 00025 // =========================================================================== 00026 // included modules 00027 // =========================================================================== 00028 #ifdef _MSC_VER 00029 #include <windows_config.h> 00030 #else 00031 #include <config.h> 00032 #endif 00033 00034 #include <iostream> 00035 #include <string> 00036 #include <list> 00037 #include "AGBus.h" 00038 #include "AGPosition.h" 00039 #include "AGDataAndStatistics.h" 00040 00041 00042 // =========================================================================== 00043 // class definitions 00044 // =========================================================================== 00045 class AGBusLine { 00046 public: 00047 AGBusLine(std::string lineNr) : 00048 lineNumber(lineNr) {}; 00049 void setMaxTripTime(int time); 00050 void setBusNames(); 00051 int nbrBuses(); 00052 void locateStation(AGPosition pos); 00053 void locateRevStation(AGPosition pos); 00054 void generateBuses(int start, int stop, int rate); 00055 void printBuses(); 00056 00057 std::list<AGPosition> stations; 00058 std::list<AGPosition> revStations; 00059 std::list<AGBus> buses; 00060 std::list<AGBus> revBuses; 00061 00062 private: 00066 std::string createName(); 00067 00072 int getReady(int time); 00073 00074 std::string lineNumber; 00075 int maxTripTime; 00076 int busNbr; 00077 }; 00078 00079 #endif 00080 00081 /****************************************************************************/