60 for (std::vector<PlanItem*>::const_iterator it =
myPlan.begin(); it !=
myPlan.end(); ++it) {
68 const std::string& vTypes,
const double departPos,
const double arrivalPos,
const std::string& busStop,
double walkFactor) {
69 PersonTrip* trip =
new PersonTrip(from, to, modeSet, departPos, arrivalPos, busStop, walkFactor);
98 myPlan.back()->addTripItem(
new Ride(from, to, lines, destStop));
107 myPlan.back()->addTripItem(
new Walk(edges, duration, speed, departPos, arrivalPos, busStop));
113 myPlan.push_back(
new Stop(stopPar, stopEdge));
126 if (destStop !=
"") {
144 if (dep != std::numeric_limits<double>::infinity()) {
147 if (arr != std::numeric_limits<double>::infinity()) {
150 if (destStop !=
"") {
159 for (std::vector<ROVehicle*>::const_iterator it = myVehicles.begin(); it != myVehicles.end(); ++it) {
160 (*it)->saveAsXML(os, typeos, asAlternatives, options);
167 std::vector<ROIntermodalRouter::TripItem> result;
170 bool carUsed =
false;
171 for (std::vector<ROIntermodalRouter::TripItem>::const_iterator it = result.begin(); it != result.end(); ++it) {
172 if (!it->edges.empty()) {
173 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)
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
double getArrivalPos() const
void write(OutputDevice &dev, const OptionsCont &oc, const SumoXMLTag tag=SUMO_TAG_VEHICLE, const std::string &typeID="") const
Writes the parameters as a beginning element.
bool hasBusStopDest() const
std::string vtypeid
The vehicle's type id.
void addVehicle(ROVehicle *veh)
void saveAsXML(OutputDevice &os) const
Structure representing possible vehicle parameter.
bool saved
Information whether this type was already saved (needed by routers)
int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
A planItem can be a Stop.
bool computeIntermodal(const RORouterProvider &provider, PersonTrip *const trip, const ROVehicle *const veh, MsgHandler *const errorHandler)
const ROEdge * getDestination() 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.
bool compute(const E *from, const E *to, double departPos, double arrivalPos, double 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...
A ride is part of a trip, e.g., go from here to here by car or bus.
A vehicle as used by router.
double maxSpeed
The vehicle type's maximum speed [m/s].
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
std::vector< PlanItem * > myPlan
The plan of the person.
parameter associated to a certain key
void addStop(const SUMOVehicleParameter::Stop &stopPar, const ROEdge *const stopEdge)
SUMOTime depart
The vehicle's departure time.
const ROEdge * getOrigin() const
DepartDefinition departProcedure
Information how the vehicle shall choose the depart time.
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.
void addTrip(const ROEdge *const from, const ROEdge *const to, const SVCPermissions modeSet, const std::string &vTypes, const double departPos, const double arrivalPos, const std::string &busStop, double walkFactor)
ROPerson(const SUMOVehicleParameter &pars, const SUMOVTypeParameter *type)
Constructor.
void write(OutputDevice &dev) const
Writes the vtype.
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.
double getDepartPos() const
int setParameter
Information for the router which parameter were set, TraCI may modify this (whe changing color) ...
void saveAsXML(OutputDevice &os, OutputDevice *const typeos, bool asAlternatives, OptionsCont &options) const
Saves the complete person description.
void addWalk(const ConstROEdgeVector &edges, const double duration, const double speed, const double departPos, const double arrivalPos, const std::string &busStop)
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)
Base class for a vehicle's route definition.
double getWalkFactor() const
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.