67 const bool isPermanent,
const RGBColor*
const c,
68 const std::vector<SUMOVehicleParameter::Stop>& stops,
70 int replacedIndex = 0);
141 double getDistanceBetween(
double fromPos,
double toPos,
const MSEdge* fromEdge,
const MSEdge* toEdge,
bool includeInternal =
true,
int routePosition = 0)
const;
219 const std::vector<SUMOVehicleParameter::Stop>&
getStops()
const;
256 static bool hasRoute(
const std::string&
id);
271 static void checkDist(
const std::string&
id);
273 static void insertIDs(std::vector<std::string>& into);
301 std::vector<SUMOVehicleParameter::Stop>
myStops;
311 typedef std::map<std::string, const MSRoute*>
RouteDict;
317 typedef std::map<std::string, std::pair<RandomDistributor<const MSRoute*>*,
bool> >
RouteDistDict;
324 static FXMutex myDictMutex;
std::vector< const MSEdge * > ConstMSEdgeVector
std::vector< MSEdge * > MSEdgeVector
std::vector< const MSEdge * > ConstMSEdgeVector
ConstMSEdgeVector::const_iterator MSRouteIterator
std::vector< MSEdge * > MSEdgeVector
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
@ SVC_IGNORING
vehicles ignoring classes
A road/street connecting two junctions.
static void dict_clearState()
Decrement all route references before quick-loading state.
bool myReroute
Whether this route is incomplete and requires rerouting.
double myCosts
The assigned or calculated costs.
void addReference() const
increments the reference counter for the route
void setReroute(bool reroute=true)
int size() const
Returns the number of edges to pass.
static RouteDistDict myDistDict
The dictionary container.
static void dict_saveState(OutputDevice &out)
Saves all known routes into the given stream.
const RGBColor *const myColor
The color.
const ConstMSEdgeVector & getEdges() const
static RouteDict myDict
The dictionary container.
std::vector< SUMOVehicleParameter::Stop > myStops
List of the stops on the parsed route.
const std::vector< SUMOVehicleParameter::Stop > & getStops() const
Returns the stops.
int getReplacedIndex() const
Returns the index at which this route was replaced.
MSRouteIterator end() const
Returns the end of the list of edges to pass.
int writeEdgeIDs(OutputDevice &os, int firstIndex=0, int lastIndex=-1, bool withInternal=false, SUMOVehicleClass svc=SVC_IGNORING) const
Output the edge ids up to but not including the id of the given edge.
int myReferenceCounter
Information by how many vehicles the route is used.
static bool dictionary(const std::string &id, const MSRoute *route)
Adds a route to the dictionary.
void setCosts(double costs)
Sets the costs of the route.
double getSavings() const
Returns the estimated savings due to using this route (compare to the route before rerouting)
static bool hasRoute(const std::string &id)
returns whether a route with the given id exists
virtual ~MSRoute()
Destructor.
const MSEdge * operator[](int index) const
bool contains(const MSEdge *const edge) const
void release() const
deletes the route if there are no further references to it
const MSEdge * getLastEdge() const
returns the destination edge
SUMOTime myReplacedTime
The time where this route was replaced with an alternative route (or -1)
SUMOTime myPeriod
The period when repeating this route.
ConstMSEdgeVector myEdges
The list of edges to pass.
std::map< std::string, const MSRoute * > RouteDict
Definition of the dictionary container.
std::map< std::string, std::pair< RandomDistributor< const MSRoute * > *, bool > > RouteDistDict
Definition of the dictionary container.
static RandomDistributor< const MSRoute * > * distDictionary(const std::string &id)
Returns the named route distribution.
static void insertIDs(std::vector< std::string > &into)
double getDistanceBetween(double fromPos, double toPos, const MSEdge *fromEdge, const MSEdge *toEdge, bool includeInternal=true, int routePosition=0) const
Compute the distance between 2 given edges on this route, including the length of internal lanes....
bool containsAnyOf(const MSEdgeVector &edgelist) const
int myReplacedIndex
The index where this route was replaced with an alternative route.
const RGBColor & getColor() const
Returns the color.
void setPeriod(SUMOTime period)
sets the period
MSRouteIterator begin() const
Returns the begin of the list of edges to pass.
const bool myAmPermanent
whether the route may be deleted after the last vehicle abandoned it
SUMOTime getReplacedTime() const
Returns the time at which this route was replaced (or -1)
static void checkDist(const std::string &id)
Checks the distribution whether it is permanent and deletes it if not.
double mySavings
The estimated savings when rerouting.
MSRoute(const std::string &id, const ConstMSEdgeVector &edges, const bool isPermanent, const RGBColor *const c, const std::vector< SUMOVehicleParameter::Stop > &stops, SUMOTime replacedTime=-1, int replacedIndex=0)
Constructor.
MSRoute & operator=(const MSRoute &s)
static void clear()
Clears the dictionary (delete all known routes, too)
SUMOTime getPeriod() const
returns the period
void setSavings(double savings)
Sets the savings of the route.
double getCosts() const
Returns the costs of the route.
Base class for objects which have an id.
Static storage of an output device and its base (abstract) implementation.
An upper class for objects with additional parameters.