SUMO - Simulation of Urban MObility
AGTrip.h
Go to the documentation of this file.
00001 /****************************************************************************/
00009 // Class containing all information of a given trip (car, bus)
00010 /****************************************************************************/
00011 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/
00012 // Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors
00013 // activitygen module
00014 // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/)
00015 /****************************************************************************/
00016 //
00017 //   This file is part of SUMO.
00018 //   SUMO is free software: you can redistribute it and/or modify
00019 //   it under the terms of the GNU General Public License as published by
00020 //   the Free Software Foundation, either version 3 of the License, or
00021 //   (at your option) any later version.
00022 //
00023 /****************************************************************************/
00024 #ifndef AGTRIP_H
00025 #define AGTRIP_H
00026 
00027 
00028 // ===========================================================================
00029 // included modules
00030 // ===========================================================================
00031 #ifdef _MSC_VER
00032 #include <windows_config.h>
00033 #else
00034 #include <config.h>
00035 #endif
00036 
00037 #include <list>
00038 #include "../city/AGPosition.h"
00039 #include "../city/AGCar.h"
00040 #include "../city/AGBus.h"
00041 
00042 
00043 // ===========================================================================
00044 // class definitions
00045 // ===========================================================================
00046 class AGTrip {
00047 public:
00048     /*Trip() :
00049         atTime(-1)
00050     {};*/
00051     AGTrip(AGPosition from, AGPosition to, int at) : //vehicle not specified
00052         from(from),
00053         to(to),
00054         atTime(at),
00055         type("default"),
00056         day(0) {};
00057     AGTrip(AGPosition from, AGPosition to, AGCar c, int at) :
00058         from(from),
00059         to(to),
00060         atTime(at),
00061         vehicle(c.getName()),
00062         type("default"),
00063         day(0) {};
00064     AGTrip(AGPosition from, AGPosition to, AGBus b, int at) :
00065         from(from),
00066         to(to),
00067         atTime(at),
00068         vehicle(b.getName()),
00069         type("bus"),
00070         day(0) {};
00071     AGTrip(AGPosition from, AGPosition to, std::string v, int at) :
00072         from(from),
00073         to(to),
00074         atTime(at),
00075         vehicle(v),
00076         type("default"),
00077         day(0) {};
00078     AGTrip(AGPosition from, AGPosition to, std::string v, int at, int day) :
00079         from(from),
00080         to(to),
00081         atTime(at),
00082         vehicle(v),
00083         type("default"),
00084         day(day) {};
00085     void print();
00086     bool operator<(AGTrip& trip);
00087 
00088     void addLayOver(AGPosition by);
00089     void addLayOver(AGTrip& trip);
00090     void addLayOverWithoutDestination(AGTrip& trip);
00091 
00092     AGPosition getDep();
00093     AGPosition getArr();
00094     int getTime();
00095     void setDepTime(int time);
00096     std::string getVehicleName();
00097     void setVehicleName(std::string name);
00098     void setArr(AGPosition arrival);
00099     void setDep(AGPosition departure);
00100     int getDay();
00101     void setDay(int day);
00102     std::string getType();
00103     void setType(std::string type);
00104     std::list<AGPosition>* getPassed();
00105 
00111     int getRideBackArrTime(SUMOReal secPerKm);
00116     int getArrTime(SUMOReal secPerKm);
00122     int getTimeTrip(SUMOReal secPerKm);
00127     int estimateDepTime(int arrTime, SUMOReal secPerKm);
00131     bool isDaily();
00132 
00133 private:
00134     int atTime;
00135     AGPosition from;
00136     AGPosition to;
00137     std::string vehicle;
00138     std::list<AGPosition> passBy;
00143     int day;
00148     std::string type;
00149 };
00150 
00151 #endif
00152 
00153 /****************************************************************************/
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines