TopologyGenerator.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"
25 
26 #include "ConnectivityChecker.hpp"
27 #include "Topology.hpp"
28 
29 namespace ISM {
30 
31 using boost::filesystem::path;
32 
34 {
35  public:
36  TopologyGenerator(const std::map<std::string, ISM::ObjectRelations> allObjectRelationsPerPattern, int maxNeighbourCount);
37 
38  std::vector<TopologyPtr> generateNeighbours(const std::string &pattern, TopologyPtr from);
39  std::vector<TopologyPtr> generateStarTopologies(const std::string &pattern);
40 
41  TopologyPtr generateFullyMeshedTopology(const std::string &pattern);
42  TopologyPtr generateRandomTopology(const std::string &pattern);
43 
44  virtual std::string getDescription() = 0;
45 
46  private:
48 
49  std::map<std::string, ISM::ObjectRelations> mAllObjectRelationsPerPattern;
50 
51  std::vector<std::vector<bool>> selectNeighbours(std::vector<std::vector<bool>>& neighbours);
52  TopologyPtr convertBitvectorToTopology(const std::vector<bool> & bitvector, const std::string& pattern);
53  std::vector<bool> convertTopologyToBitvector(TopologyPtr topology, const std::string& pattern);
54 
55  std::vector<std::vector<bool>> filterBitvectors(std::vector<std::vector<bool>> bitvectors,
56  const std::string& pattern);
57  std::vector<TopologyPtr> convertBitvectors(std::vector<std::vector<bool>> bitvectors,
58  const std::string& pattern);
59 
60  void logNeighbourGeneration(const std::vector<TopologyPtr> & neighbours,
61  TopologyPtr from, const unsigned int totalNumber);
62 
63  protected:
64  std::map<std::string, unsigned int> mNumRelationsPerPattern;
65 
66  unsigned int mUpperRelationLimit;
68 
69  virtual std::vector<std::vector<bool>> calculateNeighbours(const std::string &pattern, std::vector<bool> from) = 0;
70 
71 }; typedef boost::shared_ptr<TopologyGenerator> TopologyGeneratorPtr;
72 }
std::vector< TopologyPtr > generateStarTopologies(const std::string &pattern)
virtual std::string getDescription()=0
std::vector< TopologyPtr > generateNeighbours(const std::string &pattern, TopologyPtr from)
virtual std::vector< std::vector< bool > > calculateNeighbours(const std::string &pattern, std::vector< bool > from)=0
TopologyPtr convertBitvectorToTopology(const std::vector< bool > &bitvector, const std::string &pattern)
std::vector< std::vector< bool > > selectNeighbours(std::vector< std::vector< bool >> &neighbours)
boost::shared_ptr< ConnectivityChecker > ConnectivityCheckerPtr
std::vector< std::vector< bool > > filterBitvectors(std::vector< std::vector< bool >> bitvectors, const std::string &pattern)
boost::shared_ptr< TopologyGenerator > TopologyGeneratorPtr
std::map< std::string, unsigned int > mNumRelationsPerPattern
boost::shared_ptr< Topology > TopologyPtr
Definition: Topology.hpp:51
std::vector< bool > convertTopologyToBitvector(TopologyPtr topology, const std::string &pattern)
std::vector< TopologyPtr > convertBitvectors(std::vector< std::vector< bool >> bitvectors, const std::string &pattern)
std::map< std::string, ISM::ObjectRelations > mAllObjectRelationsPerPattern
ConnectivityCheckerPtr mConnectivityChecker
TopologyPtr generateRandomTopology(const std::string &pattern)
TopologyGenerator(const std::map< std::string, ISM::ObjectRelations > allObjectRelationsPerPattern, int maxNeighbourCount)
void logNeighbourGeneration(const std::vector< TopologyPtr > &neighbours, TopologyPtr from, const unsigned int totalNumber)
TopologyPtr generateFullyMeshedTopology(const std::string &pattern)
this namespace contains all generally usable classes.


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