49 std::string errorPrefix = (
"Replayed route replacement failed for vehicle '"
61 throw ProcessError(errorPrefix +
" (" + errorMsg +
").");
#define WRITE_WARNING(msg)
std::string time2string(SUMOTime t)
convert SUMOTime to string
SUMOTime execute(SUMOTime currentTime)
toggles override
Command_RouteReplacement(const std::string &vehID, const MSRoute *route)
Constructor.
~Command_RouteReplacement()
Destructor.
const MSRoute * myRoute
The replacement route.
std::string myVehID
The id of the vehicle to be rerouted.
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
MSVehicleControl & getVehicleControl()
Returns the vehicle control.
void addReference() const
increments the reference counter for the route
int getReplacedIndex() const
Returns the index at which this route was replaced.
void release() const
deletes the route if there are no further references to it
SUMOVehicle * getVehicle(const std::string &id) const
Returns the vehicle with the given id.
const std::string & getID() const
Returns the id.
virtual const MSLane * getLane() const =0
Returns the lane the object is currently at.
Representation of a vehicle.
virtual bool hasValidRoute(std::string &msg, const MSRoute *route=0) const =0
Validates the current or given route.
virtual const MSRoute & getRoute() const =0
Returns the current route.
virtual bool replaceRoute(const MSRoute *route, const std::string &info, bool onInit=false, int offset=0, bool addStops=true, bool removeStops=true, std::string *msgReturn=nullptr)=0
Replaces the current route by the given one.