TopologyManager.hpp
Go to the documentation of this file.
1 
18 #pragma once
19 
20 #include <boost/shared_ptr.hpp>
21 #include "map"
22 
23 #include "ObjectRelation.hpp"
24 #include "utility/LogHelper.hpp"
26 
27 #include "ConnectivityChecker.hpp"
28 #include "Topology.hpp"
29 
30 #include "Evaluator.hpp"
31 #include "TreeValidator.hpp"
32 #include "TopologyGenerator.hpp"
33 #include "ObjectRelation.hpp"
34 #include "../combinatorial_optimization/NeighbourhoodFunction.hpp"
35 
36 namespace ISM {
37 
38 class TopologyManager : public NeighbourhoodFunction<TopologyPtr>
39 {
40  public:
41  TopologyManager(EvaluatorPtr evaluator, TreeValidatorPtr treeValidator,
42  TopologyGeneratorPtr topologyGenerator, DocumentationHelperPtr documentationHelper)
43  : mEvaluator(evaluator)
44  , mTreeValidator(treeValidator)
45  , mTopologyGenerator(topologyGenerator)
46  , mDocumentationHelper(documentationHelper)
47  {}
48 
50  bool hasNextNeighbour();
51  void setReferenceInstance(TopologyPtr instance);
52 
53  std::vector<TopologyPtr> prepareStartTopologies(std::vector<TopologyPtr>& startTopologies);
54  void setUp(const std::string & patternName);
55 
56  std::vector<std::vector<std::pair<TopologyPtr, unsigned int>>> getHistory();
57 
58  TopologyPtr getFullyMeshedTopology(bool storeFullyMeshedISM = false);
59  std::vector<TopologyPtr> getStarTopologies();
60 
61  void addStartTopologiesToHistory(std::vector<TopologyPtr> startTopologies);
62  TreePtr evaluateTopology(TopologyPtr& topology, const std::string filename = "");
63 
65 
66  private:
71 
73 
74  std::map<std::string, std::map<std::string, TopologyPtr>> mPatternToTopologyIdToTopolgy;
75  std::string mCurrentPatternName;
76 
77  std::vector<TopologyPtr> mNeighbourTopologies;
78  unsigned mNeighbourIndex;
79 
80  std::map<std::string, unsigned int> mPatternToTopologyIndexCounter;
81 
82  int mHistoryIndex = 0;
83  std::vector<std::vector<std::pair<TopologyPtr, unsigned int>>> mHistory;
84  unsigned int mNumTopology = 0;
85 
86  void prepareTopology(TopologyPtr& topology);
87 
88  void calculateNeighbours(TopologyPtr topology);
89 
90  void markSelectedTopology(TopologyPtr selectedTopology);
91 
92  //Console output
93  void logAlreadyAnalysed(TopologyPtr topology);
94  void logSelectedTopology(TopologyPtr selectedTopology);
95 
96 }; typedef boost::shared_ptr<TopologyManager> TopologyManagerPtr;
97 
98 }
TopologyPtr getFullyMeshedTopology(bool storeFullyMeshedISM=false)
std::map< std::string, std::map< std::string, TopologyPtr > > mPatternToTopologyIdToTopolgy
boost::shared_ptr< TreeValidator > TreeValidatorPtr
void markSelectedTopology(TopologyPtr selectedTopology)
TopologyPtr getNextNeighbour()
std::vector< std::vector< std::pair< TopologyPtr, unsigned int > > > mHistory
TopologyGeneratorPtr mTopologyGenerator
std::vector< TopologyPtr > mNeighbourTopologies
std::string patternName
void logAlreadyAnalysed(TopologyPtr topology)
boost::shared_ptr< TopologyGenerator > TopologyGeneratorPtr
void logSelectedTopology(TopologyPtr selectedTopology)
boost::shared_ptr< Topology > TopologyPtr
Definition: Topology.hpp:51
TreePtr evaluateTopology(TopologyPtr &topology, const std::string filename="")
void setUp(const std::string &patternName)
std::map< std::string, unsigned int > mPatternToTopologyIndexCounter
boost::shared_ptr< DocumentationHelper > DocumentationHelperPtr
std::vector< TopologyPtr > prepareStartTopologies(std::vector< TopologyPtr > &startTopologies)
void calculateNeighbours(TopologyPtr topology)
boost::shared_ptr< Tree > TreePtr
Definition: typedef.hpp:46
boost::shared_ptr< Evaluator > EvaluatorPtr
Definition: Evaluator.hpp:35
void prepareTopology(TopologyPtr &topology)
DocumentationHelperPtr mDocumentationHelper
TopologyPtr getRandomTopology()
std::string mCurrentPatternName
std::vector< std::vector< std::pair< TopologyPtr, unsigned int > > > getHistory()
this namespace contains all generally usable classes.
boost::shared_ptr< TopologyManager > TopologyManagerPtr
std::vector< TopologyPtr > getStarTopologies()
TopologyManager(EvaluatorPtr evaluator, TreeValidatorPtr treeValidator, TopologyGeneratorPtr topologyGenerator, DocumentationHelperPtr documentationHelper)
void addStartTopologiesToHistory(std::vector< TopologyPtr > startTopologies)
void setReferenceInstance(TopologyPtr instance)
TreeValidatorPtr mTreeValidator


asr_lib_ism
Author(s): Hanselmann Fabian, Heller Florian, Heizmann Heinrich, Kübler Marcel, Mehlhaus Jonas, Meißner Pascal, Qattan Mohamad, Reckling Reno, Stroh Daniel
autogenerated on Wed Jan 8 2020 04:02:41