Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
AGTrip.h
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3// Copyright (C) 2010-2024 German Aerospace Center (DLR) and others.
4// activitygen module
5// Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/)
6// This program and the accompanying materials are made available under the
7// terms of the Eclipse Public License 2.0 which is available at
8// https://www.eclipse.org/legal/epl-2.0/
9// This Source Code may also be made available under the following Secondary
10// Licenses when the conditions for such availability set forth in the Eclipse
11// Public License 2.0 are satisfied: GNU General Public License, version 2
12// or later which is available at
13// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
14// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
15/****************************************************************************/
24// Class containing all information of a given trip (car, bus)
25/****************************************************************************/
26#pragma once
27#include <config.h>
28
29#include <list>
33
34
35// ===========================================================================
36// class definitions
37// ===========================================================================
38class AGTrip {
39public:
40 AGTrip(AGPosition from, AGPosition to, int at) : //vehicle not specified
41 myFrom(from),
42 myTo(to),
43 myDepTime(at),
44 myType("default"),
45 myDay(0) {};
46 AGTrip(AGPosition from, AGPosition to, AGCar c, int at) :
47 myFrom(from),
48 myTo(to),
49 myDepTime(at),
50 myVehicle(c.getName()),
51 myType("default"),
52 myDay(0) {};
53 AGTrip(AGPosition from, AGPosition to, AGBus b, int at) :
54 myFrom(from),
55 myTo(to),
56 myDepTime(at),
57 myVehicle(b.getName()),
58 myType("bus"),
59 myDay(0) {};
60 AGTrip(AGPosition from, AGPosition to, std::string v, int at) :
61 myFrom(from),
62 myTo(to),
63 myDepTime(at),
64 myVehicle(v),
65 myType("default"),
66 myDay(0) {};
67 AGTrip(AGPosition from, AGPosition to, std::string v, int at, int day) :
68 myFrom(from),
69 myTo(to),
70 myDepTime(at),
71 myVehicle(v),
72 myType("default"),
73 myDay(day) {};
74 void print() const;
75 bool operator<(const AGTrip& trip) const;
76
77 void addLayOver(AGPosition by);
78 void addLayOver(AGTrip& trip);
80
81 AGPosition getDep() const;
82 AGPosition getArr() const;
83 int getTime() const;
84 void setDepTime(int time);
85 const std::string& getVehicleName() const;
86 void setVehicleName(std::string name);
87 void setArr(AGPosition arrival);
88 void setDep(AGPosition departure);
89 int getDay() const;
90 void setDay(int day);
91 const std::string& getType() const;
92 void setType(std::string type);
93 const std::list<AGPosition>* getPassed() const;
94
100 int getRideBackArrTime(double secPerKm) const;
105 int getArrTime(double secPerKm) const;
111 int getTimeTrip(double secPerKm) const;
116 int estimateDepTime(int arrTime, double secPerKm) const;
120 bool isDaily() const;
121
122private:
126 std::string myVehicle;
131 std::string myType;
136 int myDay;
137 std::list<AGPosition> myPassBy;
138};
Definition AGBus.h:34
Definition AGCar.h:36
A location in the 2D plane freely positioned on a street.
Definition AGPosition.h:53
void setDep(AGPosition departure)
Definition AGTrip.cpp:165
void setVehicleName(std::string name)
Definition AGTrip.cpp:155
const std::list< AGPosition > * getPassed() const
Definition AGTrip.cpp:81
int getTimeTrip(double secPerKm) const
Definition AGTrip.cpp:111
AGPosition getDep() const
Definition AGTrip.cpp:96
void setArr(AGPosition arrival)
Definition AGTrip.cpp:160
AGPosition myTo
Definition AGTrip.h:124
int myDay
Definition AGTrip.h:136
int getTime() const
Definition AGTrip.cpp:106
AGTrip(AGPosition from, AGPosition to, int at)
Definition AGTrip.h:40
bool isDaily() const
Definition AGTrip.cpp:170
void setDepTime(int time)
Definition AGTrip.cpp:140
std::string myType
Definition AGTrip.h:131
int getRideBackArrTime(double secPerKm) const
Definition AGTrip.cpp:135
void print() const
Definition AGTrip.cpp:47
void addLayOverWithoutDestination(AGTrip &trip)
Definition AGTrip.cpp:73
int myDepTime
Definition AGTrip.h:125
AGPosition myFrom
Definition AGTrip.h:123
void setType(std::string type)
Definition AGTrip.cpp:91
AGTrip(AGPosition from, AGPosition to, AGCar c, int at)
Definition AGTrip.h:46
const std::string & getType() const
Definition AGTrip.cpp:86
AGTrip(AGPosition from, AGPosition to, std::string v, int at, int day)
Definition AGTrip.h:67
bool operator<(const AGTrip &trip) const
Definition AGTrip.cpp:35
std::string myVehicle
Definition AGTrip.h:126
AGPosition getArr() const
Definition AGTrip.cpp:101
std::list< AGPosition > myPassBy
Definition AGTrip.h:137
int getDay() const
Definition AGTrip.cpp:175
AGTrip(AGPosition from, AGPosition to, std::string v, int at)
Definition AGTrip.h:60
void addLayOver(AGPosition by)
Definition AGTrip.cpp:59
AGTrip(AGPosition from, AGPosition to, AGBus b, int at)
Definition AGTrip.h:53
int getArrTime(double secPerKm) const
Definition AGTrip.cpp:130
int estimateDepTime(int arrTime, double secPerKm) const
Definition AGTrip.cpp:145
void setDay(int day)
Definition AGTrip.cpp:180
const std::string & getVehicleName() const
Definition AGTrip.cpp:150