50 #ifdef CHECK_MEMORY_LEAKS
52 #endif // CHECK_MEMORY_LEAKS
64 for (std::vector<PlanItem*>::const_iterator it =
myPlan.begin(); it !=
myPlan.end(); ++it) {
72 const std::string& vTypes,
const SUMOReal departPos,
const SUMOReal arrivalPos,
const std::string& busStop) {
102 myPlan.back()->addTripItem(
new Ride(from, to, lines, destStop));
111 myPlan.back()->addTripItem(
new Walk(edges, duration, speed, departPos, arrivalPos, busStop));
117 myPlan.push_back(
new Stop(stopPar, stopEdge));
148 if (dep != std::numeric_limits<SUMOReal>::infinity()) {
151 if (arr != std::numeric_limits<SUMOReal>::infinity()) {
154 if (destStop !=
"") {
163 for (std::vector<ROVehicle*>::const_iterator it = myVehicles.begin(); it != myVehicles.end(); ++it) {
164 (*it)->saveAsXML(os, typeos, asAlternatives, options);
171 std::vector<ROIntermodalRouter::TripItem> result;
174 bool carUsed =
false;
175 for (std::vector<ROIntermodalRouter::TripItem>::const_iterator it = result.begin(); it != result.end(); ++it) {
176 if (!it->edges.empty()) {
177 if (it->line ==
"") {
179 }
else if (veh != 0 && it->line == veh->
getID()) {
188 if (result.empty()) {
189 errorHandler->
inform(
"No route for trip in person '" +
getID() +
"'.");
200 for (std::vector<PlanItem*>::iterator it =
myPlan.begin(); it !=
myPlan.end(); ++it) {
201 if ((*it)->needsRouting()) {
204 std::vector<ROVehicle*>& vehicles = trip->
getVehicles();
205 if (vehicles.empty()) {
208 for (std::vector<ROVehicle*>::iterator v = vehicles.begin(); v != vehicles.end();) {
210 v = vehicles.erase(v);
224 for (std::vector<PlanItem*>::const_iterator it =
myPlan.begin(); it !=
myPlan.end(); ++it) {
225 (*it)->saveVehicles(os, typeos, asAlternatives, options);
240 for (std::vector<PlanItem*>::const_iterator it =
myPlan.begin(); it !=
myPlan.end(); ++it) {
241 (*it)->saveAsXML(os);
The departure is person triggered.
SUMOVehicleParameter myParameter
The vehicle's parameter.
void addRide(const ROEdge *const from, const ROEdge *const to, const std::string &lines, const std::string &destStop)
bool compute(const E *from, const E *to, SUMOReal departPos, SUMOReal arrivalPos, SUMOReal speed, const V *const vehicle, const SVCPermissions modeSet, SUMOTime msTime, std::vector< TripItem > &into)
Builds the route between the given edges using the minimum effort at the given time The definition of...
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
std::string vtypeid
The vehicle's type id.
void addVehicle(ROVehicle *veh)
SUMOReal getArrivalPos() const
void saveAsXML(OutputDevice &os) const
Structure representing possible vehicle parameter.
bool saved
Information whether this type was already saved (needed by routers)
A planItem can be a Stop.
void addWalk(const ConstROEdgeVector &edges, const SUMOReal duration, const SUMOReal speed, const SUMOReal departPos, const SUMOReal arrivalPos, const std::string &busStop)
bool computeIntermodal(const RORouterProvider &provider, PersonTrip *const trip, const ROVehicle *const veh, MsgHandler *const errorHandler)
const ROEdge * getDestination() const
SUMOReal getDepartPos() const
const std::map< std::string, std::string > & getMap() const
Returns the inner key/value map.
std::vector< const ROEdge * > ConstROEdgeVector
bool myRoutingSuccess
Whether the last routing was successful.
const std::string DEFAULT_VTYPE_ID
A planItem can be a Trip which contains multiple tripItems.
static RONet * getInstance()
Returns the pointer to the unique instance of RONet (singleton).
A routable thing such as a vehicle or person.
const std::string & getID() const
Returns the id.
A ride is part of a trip, e.g., go from here to here by car or bus.
A vehicle as used by router.
std::vector< PlanItem * > myPlan
The plan of the person.
void addStop(const SUMOVehicleParameter::Stop &stopPar, const ROEdge *const stopEdge)
void addTrip(const ROEdge *const from, const ROEdge *const to, const SVCPermissions modeSet, const std::string &vTypes, const SUMOReal departPos, const SUMOReal arrivalPos, const std::string &busStop)
const ROEdge * getOrigin() const
DepartDefinition departProcedure
Information how the vehicle shall choose the depart time.
void write(OutputDevice &dev, const OptionsCont &oc, const SumoXMLTag tag=SUMO_TAG_VEHICLE) const
Writes the parameters as a beginning element.
std::string toString(const T &t, std::streamsize accuracy=OUTPUT_ACCURACY)
vehicle is a passenger car (a "normal" car)
A walk is part of a trip, e.g., go from here to here by foot.
A basic edge for routing applications.
virtual ~ROPerson()
Destructor.
ROPerson(const SUMOVehicleParameter &pars, const SUMOVTypeParameter *type)
Constructor.
void write(OutputDevice &dev) const
Writes the vtype.
SUMOReal maxSpeed
The vehicle type's maximum speed [m/s].
SVCPermissions getModes() const
const SUMOVTypeParameter *const myType
The type of the vehicle.
void computeRoute(const RORouterProvider &provider, const bool removeLoops, MsgHandler *errorHandler)
The router's network representation.
Structure representing possible vehicle parameter.
int setParameter
Information for the router which parameter were set.
void saveAsXML(OutputDevice &os, OutputDevice *const typeos, bool asAlternatives, OptionsCont &options) const
Saves the complete person description.
const std::string & getID() const
Returns the id of the vehicle.
Definition of vehicle stop (position and duration)
void inform(std::string msg, bool addType=true)
adds a new error to the list
A storage for options typed value containers)
const std::string destStop
Base class for a vehicle's route definition.
void addLoadedAlternative(RORoute *alternative)
Adds a single alternative loaded from the file An alternative may also be generated during DUA...
const int VEHPARS_VTYPE_SET
IntermodalRouter< E, L, N, V > & getIntermodalRouter() const
Static storage of an output device and its base (abstract) implementation.
std::vector< ROVehicle * > & getVehicles()
virtual void addTripItem(TripItem *tripIt)
bool closeTag()
Closes the most recently opened tag.
SUMOVTypeParameter * getVehicleTypeSecure(const std::string &id)
Retrieves the named vehicle type.
void saveAsXML(OutputDevice &os) const
RORouteDef * getRouteDefinition() const
Returns the definition of the route the vehicle takes.
void saveVehicles(OutputDevice &os, OutputDevice *const typeos, bool asAlternatives, OptionsCont &options) const
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
A complete router's route.
std::string id
The vehicle's id.