30 std::ostringstream oss;
31 oss <<
"Generating random Topologies until a valid one is found:" << std::endl;
36 oss << std::endl << std::endl << randomTopology->objectRelations;
39 bool foundValidTopology = randomTopology->isValid;
41 while(!foundValidTopology)
44 oss <<
"Random Topology was invalid, generating a new one." << std::endl;
48 oss << std::endl << std::endl << randomTopology->objectRelations;
53 foundValidTopology = randomTopology->isValid;
58 return randomTopology;
68 if (topology->isValid)
83 mHistory.push_back(std::vector<std::pair<TopologyPtr, unsigned int>>());
92 std::vector<TopologyPtr> validStartTopologies;
96 if (topology->isValid)
98 validStartTopologies.push_back(topology);
102 return validStartTopologies;
111 mHistory.push_back(std::vector<std::pair<TopologyPtr, unsigned int>>());
128 std::stringstream oss;
129 oss <<
"Analysing the fully meshed topology: " << std::endl << std::endl
130 << fullyMeshed->objectRelations;
135 if (storeFullyMeshedISM)
155 std::ostringstream oss;
158 for (
unsigned int i = 0; i < starTopologies.size(); ++i)
162 oss <<
"Analysing star topology " << (i + 1) <<
": " << std::endl << std::endl
163 << starTopology->objectRelations;
172 return starTopologies;
195 topology->evaluationResult = er;
196 topology->isValid =
true;
198 if (!filename.empty())
201 tree->getISM()->voteSpecifiersPerObject);
206 topology->isValid =
false;
215 std::ostringstream oss;
216 oss <<
"Now analysing the following relation topology (Topology number " 217 <<
mNumTopology <<
") : " << std::endl << std::endl << topology->objectRelations;
220 const std::string identifier = topology->identifier;
227 if (topology->isValid)
239 if (topology->isValid)
249 std::ostringstream oss;
250 oss <<
"Already analyzed this topology before!" << std::endl << std::endl;
251 if (topology->isValid)
253 oss <<
"The corresponding tree was valid and the evaluation result of its ISM was: " << std::endl
254 << topology->evaluationResult.getDescription();
258 oss <<
" The corresponding tree was invalid!";
266 std::ostringstream oss;
267 oss <<
"Selected the following topology : " 268 << std::endl << std::endl << selectedTopology->objectRelations
269 <<
"with the evaluation result of its ISM beeing: " << std::endl
270 << selectedTopology->evaluationResult.getDescription() << std::endl << std::endl
271 <<
"The cost of this topology is: " << std::endl
272 << selectedTopology->cost;
TopologyPtr getFullyMeshedTopology(bool storeFullyMeshedISM=false)
std::map< std::string, std::map< std::string, TopologyPtr > > mPatternToTopologyIdToTopolgy
unsigned int mNumTopology
void markSelectedTopology(TopologyPtr selectedTopology)
TopologyPtr getNextNeighbour()
static void logLine(LogLevel logLevel=LOG_INFO)
std::vector< std::vector< std::pair< TopologyPtr, unsigned int > > > mHistory
TopologyGeneratorPtr mTopologyGenerator
std::vector< TopologyPtr > mNeighbourTopologies
void logAlreadyAnalysed(TopologyPtr topology)
void logSelectedTopology(TopologyPtr selectedTopology)
boost::shared_ptr< Topology > TopologyPtr
TreePtr evaluateTopology(TopologyPtr &topology, const std::string filename="")
static void logMessage(const std::string &message, LogLevel logLevel=LOG_INFO, const char *logColor=LOG_COLOR_DEFAULT)
void setUp(const std::string &patternName)
std::map< std::string, unsigned int > mPatternToTopologyIndexCounter
std::vector< TopologyPtr > prepareStartTopologies(std::vector< TopologyPtr > &startTopologies)
boost::shared_ptr< Tree > TreePtr
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.
std::vector< TopologyPtr > getStarTopologies()
void addStartTopologiesToHistory(std::vector< TopologyPtr > startTopologies)
void setReferenceInstance(TopologyPtr instance)
TreeValidatorPtr mTreeValidator