SUMO - Simulation of Urban MObility

AGTrip.h

Go to the documentation of this file.
00001 /****************************************************************************/
00007 // Class containing all information of a given trip (car, bus)
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 AGTRIP_H
00022 #define AGTRIP_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 <list>
00035 #include "../city/AGPosition.h"
00036 #include "../city/AGCar.h"
00037 #include "../city/AGBus.h"
00038 
00039 
00040 // ===========================================================================
00041 // class definitions
00042 // ===========================================================================
00043 class AGTrip {
00044 public:
00045     /*Trip() :
00046         atTime(-1)
00047     {};*/
00048     AGTrip(AGPosition from, AGPosition to, int at) : //vehicle not specified
00049         from(from),
00050         to(to),
00051         atTime(at),
00052         type("default"),
00053         day(0) {};
00054     AGTrip(AGPosition from, AGPosition to, AGCar c, int at) :
00055         from(from),
00056         to(to),
00057         atTime(at),
00058         vehicle(c.getName()),
00059         type("default"),
00060         day(0) {};
00061     AGTrip(AGPosition from, AGPosition to, AGBus b, int at) :
00062         from(from),
00063         to(to),
00064         atTime(at),
00065         vehicle(b.getName()),
00066         type("bus"),
00067         day(0) {};
00068     AGTrip(AGPosition from, AGPosition to, std::string v, int at) :
00069         from(from),
00070         to(to),
00071         atTime(at),
00072         vehicle(v),
00073         type("default"),
00074         day(0) {};
00075     AGTrip(AGPosition from, AGPosition to, std::string v, int at, int day) :
00076         from(from),
00077         to(to),
00078         atTime(at),
00079         vehicle(v),
00080         type("default"),
00081         day(day) {};
00082     void print();
00083     bool operator<(AGTrip& trip);
00084 
00085     void addLayOver(AGPosition by);
00086     void addLayOver(AGTrip& trip);
00087     void addLayOverWithoutDestination(AGTrip& trip);
00088 
00089     AGPosition getDep();
00090     AGPosition getArr();
00091     int getTime();
00092     void setDepTime(int time);
00093     std::string getVehicleName();
00094     void setVehicleName(std::string name);
00095     void setArr(AGPosition arrival);
00096     void setDep(AGPosition departure);
00097     int getDay();
00098     void setDay(int day);
00099     std::string getType();
00100     void setType(std::string type);
00101     std::list<AGPosition>* getPassed();
00102 
00108     int getRideBackArrTime(SUMOReal secPerKm);
00113     int getArrTime(SUMOReal secPerKm);
00119     int getTimeTrip(SUMOReal secPerKm);
00124     int estimateDepTime(int arrTime, SUMOReal secPerKm);
00128     bool isDaily();
00129 
00130 private:
00131     int atTime;
00132     AGPosition from;
00133     AGPosition to;
00134     std::string vehicle;
00135     std::list<AGPosition> passBy;
00140     int day;
00145     std::string type;
00146 };
00147 
00148 #endif
00149 
00150 /****************************************************************************/
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines