48 std::string errorPrefix = (
"Replayed route replacement failed for vehicle '"
60 throw ProcessError(errorPrefix +
" (" + errorMsg +
").");
#define WRITE_WARNING(msg)
std::shared_ptr< const MSRoute > ConstMSRoutePtr
std::string time2string(SUMOTime t, bool humanReadable)
convert SUMOTime to string (independently of global format setting)
Command_RouteReplacement(const std::string &vehID, ConstMSRoutePtr route)
Constructor.
SUMOTime execute(SUMOTime currentTime)
toggles override
~Command_RouteReplacement()
Destructor.
ConstMSRoutePtr 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.
int getReplacedIndex() const
Returns the index at which this route was replaced.
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.
virtual bool replaceRoute(ConstMSRoutePtr 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.
Representation of a vehicle.
virtual bool hasValidRoute(std::string &msg, ConstMSRoutePtr route=0) const =0
Validates the current or given route.
virtual const MSRoute & getRoute() const =0
Returns the current route.