Line data Source code
1 : #pragma once 2 : 3 : #include <string> 4 : #include <unordered_map> 5 : #include <vector> 6 : 7 : #include "Alg/Graph.hpp" 8 : #include "Static/Static.hpp" 9 : #include "data/SUMO/NetworkTAZ.hpp" 10 : 11 : namespace Static { 12 : class Solution; 13 : 14 : class SUMOAdapter; 15 : 16 9 : class Network { 17 : public: 18 : typedef long Node; 19 : 20 : struct Edge { 21 : typedef size_t ID; 22 : ID id; 23 : Node u, v; 24 : 25 : protected: 26 : Edge(ID id, Node u, Node v); 27 : 28 : public: 29 : virtual Time calculateCost(const Solution &x) const = 0; 30 : virtual Time calculateCostGlobal(const Solution &x) const = 0; 31 : 32 : Time calculateDelay(const Solution &x) const; 33 : }; 34 : 35 : typedef std::vector<Edge::ID> Path; 36 : 37 : virtual std::vector<Node> getNodes() const = 0; 38 : virtual Edge &getEdge(Edge::ID e) const = 0; 39 : virtual std::vector<Edge *> getAdj(Node u) const = 0; 40 : 41 : Alg::Graph toGraph(const Solution &solution) const; 42 : 43 : Time evaluate(const Solution &solution) const; 44 : 45 9 : virtual ~Network() {} 46 : }; 47 : } // namespace Static 48 : 49 : namespace std { 50 : template<> 51 : struct hash<Static::Network::Path> { 52 : size_t operator()(const Static::Network::Path &v) const; 53 : }; 54 : } // namespace std