SECompartmentTransportGraph.h
1/* Distributed under the Apache License, Version 2.0.
2 See accompanying NOTICE file for details.*/
3
4#pragma once
5#include "cdm/compartment/SECompartmentGraph.h"
6
7#define COMPARTMENT_TRANSPORT_GRAPH_TEMPLATE typename GraphType, typename GraphVertexType, typename GraphEdgeType, typename CompartmentType, typename CompartmentLinkType
8#define COMPARTMENT_TRANSPORT_GRAPH_TYPES GraphType, GraphVertexType, GraphEdgeType, CompartmentType, CompartmentLinkType
9
10template<COMPARTMENT_TRANSPORT_GRAPH_TEMPLATE>
11class SECompartmentTransportGraph : public GraphType, public SECompartmentGraph<COMPARTMENT_GRAPH_TYPES>
12{
13public:
14 SECompartmentTransportGraph(const std::string& name, Logger* logger);
16
17 virtual void Clear();
18
19 virtual std::string GetName() const { return this->m_Name; }
20
21 virtual void StateChange();
22
23protected:
24 virtual void BalanceByIntensive()=0;
25 virtual int GetVertexIndex(const GraphVertexType& v) const;
26 virtual const std::vector<GraphVertexType*>& GetVerticies() const;
27 virtual const std::vector<GraphEdgeType*>* GetSourceEdges(const GraphVertexType& v) const;
28 virtual const std::vector<GraphEdgeType*>* GetTargetEdges(const GraphVertexType& v) const;
29
30 std::vector<GraphVertexType*> m_Verticies;
31 std::map<const GraphVertexType*, int> m_VertexIndicies;
32 std::map<const GraphVertexType*, std::vector<GraphEdgeType*>*> m_SourceEdgeMap;
33 std::map<const GraphVertexType*, std::vector<GraphEdgeType*>*> m_TargetEdgeMap;
34};
Definition: Logger.h:71
Definition: SECompartmentGraph.h:11
std::string m_Name
Definition: SECompartmentGraph.h:39
Definition: SECompartmentTransportGraph.h:12
std::map< const GraphVertexType *, int > m_VertexIndicies
Definition: SECompartmentTransportGraph.h:31
virtual int GetVertexIndex(const GraphVertexType &v) const
Definition: SECompartmentTransportGraph.cpp:75
virtual const std::vector< GraphVertexType * > & GetVerticies() const
Definition: SECompartmentTransportGraph.cpp:86
virtual const std::vector< GraphEdgeType * > * GetTargetEdges(const GraphVertexType &v) const
Definition: SECompartmentTransportGraph.cpp:99
std::map< const GraphVertexType *, std::vector< GraphEdgeType * > * > m_SourceEdgeMap
Definition: SECompartmentTransportGraph.h:32
std::vector< GraphVertexType * > m_Verticies
Definition: SECompartmentTransportGraph.h:30
SECompartmentTransportGraph(const std::string &name, Logger *logger)
Definition: SECompartmentTransportGraph.cpp:8
virtual void BalanceByIntensive()=0
virtual const std::vector< GraphEdgeType * > * GetSourceEdges(const GraphVertexType &v) const
Definition: SECompartmentTransportGraph.cpp:91
std::map< const GraphVertexType *, std::vector< GraphEdgeType * > * > m_TargetEdgeMap
Definition: SECompartmentTransportGraph.h:33
virtual ~SECompartmentTransportGraph()
Definition: SECompartmentTransportGraph.cpp:13
virtual void StateChange()
Definition: SECompartmentTransportGraph.cpp:33
virtual void Clear()
Definition: SECompartmentTransportGraph.cpp:19
virtual std::string GetName() const
Definition: SECompartmentTransportGraph.h:19

Distributed under the Apache License, Version 2.0.

See accompanying NOTICE file for details.