21 #ifndef SUMOAbstractRouter_h 22 #define SUMOAbstractRouter_h 51 template<
class E,
class V>
55 typedef double(*
Operation)(
const E*
const,
const V*
const, double);
80 virtual bool compute(
const E* from,
const E* to,
const V*
const vehicle,
81 SUMOTime msTime, std::vector<const E*>& into) = 0;
84 const V*
const v,
SUMOTime msTime)
const = 0;
86 inline double getEffort(
const E*
const e,
const V*
const v,
double t)
const {
127 template<
class E,
class V>
130 inline bool operator()(
const E* edge,
const V* vehicle)
const {
131 if (std::find(myProhibited.begin(), myProhibited.end(), edge) != myProhibited.end()) {
134 return edge->prohibits(vehicle);
138 myProhibited = toProhibit;
146 template<
class E,
class V>
double getEffort(const E *const e, const V *const v, double t) const
void prohibit(const std::vector< E *> &toProhibit)
double(* Operation)(const E *const, const V *const, double)
Type of the function that is used to retrieve the edge effort.
std::vector< E * > myProhibited
long long int myQueryTimeSum
virtual double recomputeCosts(const std::vector< const E *> &edges, const V *const v, SUMOTime msTime) const =0
virtual bool compute(const E *from, const E *to, const V *const vehicle, SUMOTime msTime, std::vector< const E *> &into)=0
Builds the route between the given edges using the minimum effort at the given time The definition of...
bool operator()(const E *edge, const V *vehicle) const
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
bool myBulkMode
whether we are currently operating several route queries in a bulk
Operation myOperation
The object's operation to perform.
long long int myQueryStartTime
the time spent querying in milliseconds
SUMOAbstractRouter & operator=(const SUMOAbstractRouter &s)
Invalidated assignment operator.
virtual ~SUMOAbstractRouter()
Destructor.
long long int myNumQueries
long long int myQueryVisits
counters for performance logging
void endQuery(int visits)
bool operator()(const E *, const V *) const
virtual SUMOAbstractRouter * clone()=0
static long getCurrentMillis()
Returns the current time in milliseconds.
#define WRITE_MESSAGE(msg)
const std::string myType
the type of this router
SUMOAbstractRouter(Operation operation, const std::string &type)
Constructor.
void setBulkMode(const bool mode)