LCOV - code coverage report
Current view: top level - app/include/Static/supply - CustomNetwork.hpp (source / functions) Hit Total Coverage
Test: coverage.info Lines: 2 2 100.0 %
Date: 2023-08-17 16:45:52 Functions: 2 2 100.0 %

          Line data    Source code
       1             : #pragma once
       2             : 
       3             : #include <functional>
       4             : 
       5             : #include "Static/supply/Network.hpp"
       6             : #include "data/SUMO/Network.hpp"
       7             : #include "data/SUMO/TAZ.hpp"
       8             : 
       9             : namespace Static {
      10           6 : class CustomNetwork: public Network {
      11             :    public:
      12             :     typedef std::function<Time(Flow)> CostFunction;
      13             : 
      14             :     struct Edge: public Network::Edge {
      15             :         friend CustomNetwork;
      16             : 
      17             :         CostFunction cost;
      18             :         CostFunction costGlobal;
      19             : 
      20             :        private:
      21             :         Edge(ID id, Node u, Node v, CostFunction f, CostFunction fGlobal);
      22             : 
      23             :        public:
      24             :         virtual Time calculateCost(const Solution &x) const;
      25             :         virtual Time calculateCostGlobal(const Solution &x) const;
      26             : 
      27          48 :         virtual ~Edge() {}
      28             :     };
      29             : 
      30             :    private:
      31             :     std::unordered_map<Node, std::vector<Edge *>> adj;
      32             :     std::unordered_map<Edge::ID, Edge *>          edges;
      33             : 
      34             :    public:
      35             :     void addNode(Node u);
      36             :     void addEdge(Edge::ID id, Node u, Node v, CostFunction f, CostFunction fGlobal);
      37             : 
      38             :     virtual std::vector<Node>            getNodes() const;
      39             :     virtual Edge                        &getEdge(Edge::ID e) const;
      40             :     virtual std::vector<Network::Edge *> getAdj(Node u) const;
      41             : 
      42             :     virtual ~CustomNetwork();
      43             : };
      44             : }  // namespace Static

Generated by: LCOV version 1.14