DocumentationHelper.hpp
Go to the documentation of this file.
1 
18 #pragma once
19 
20 #include <boost/filesystem/path.hpp>
21 #include <boost/shared_ptr.hpp>
22 
23 #include "../combinatorial_optimization/CostFunction.hpp"
24 #include "../combinatorial_trainer/CombinatorialTrainerParameters.hpp"
25 #include "../combinatorial_trainer/Topology.hpp"
26 #include "../combinatorial_trainer/EvaluationResult.hpp"
27 
28 #include "SVGHelper.hpp"
29 #include "DotHelper.hpp"
30 
31 namespace ISM
32 {
33 using boost::filesystem::path;
34 
36 {
37  public:
38  DocumentationHelper(path outputPath, path dbPath,
39  std::map<std::string, ISM::TracksPtr>& tracksPerPattern) :
40  mOutputPath(outputPath), mSourceDBPath(dbPath)
41  {
42  boost::filesystem::create_directories(mOutputPath);
43  boost::filesystem::create_directories(mOutputPath / SVG_SUBFOLDER_NAME);
44  boost::filesystem::create_directories(mOutputPath / CSV_SUBFOLDER_NAME);
45  boost::filesystem::create_directories(mOutputPath / TOPOLOGIES_SUBFOLDER_NAME);
46 
48  mDotHelper = DotHelperPtr(new DotHelper(tracksPerPattern));
49  }
50 
51  void storeOptimizationRun(std::vector<std::vector<std::pair<TopologyPtr, unsigned int>>>& history,
52  CostFunctionPtr<TopologyPtr> globalCostFunction,
53  double elapsedRuntime, const std::string& patternName);
54 
55  void storeTopology(TopologyPtr toStore, const std::string& patternName,
56  const std::string& topologyName,
57  std::map<std::string, std::vector<ISM::VoteSpecifierPtr>> objectDefinitons);
58 
59  void storeIsm(const std::string& filename, const IsmPtr& ism);
60  void storeIsm(const IsmPtr& ism);
61  void writeResult();
62  void setReferenceTopology(TopologyPtr topology, const std::string & patternName);
63 
64  private:
65  const std::string SVG_SUBFOLDER_NAME = "SVG";
66  const std::string CSV_SUBFOLDER_NAME = "CSV";
67  const std::string TOPOLOGIES_SUBFOLDER_NAME = "Topologies";
68  const std::string SELECTED_TOPOLOGIES_FOLDER = "allSelectedTopologies";
69 
72 
75 
76  bool mStoreISM = true;
77 
78  unsigned int mSelectedTopologyCounter = 1;
79 
81 
82  void storeTopologiesToCSV(std::vector<TopologyPtr> selectedTopologies,
83  const std::string& patternNames);
84 
85  void storeMetadataToCSV(unsigned int numEvaluatedTopologies,
86  unsigned int numOptimizationRounds, double elapsedRuntime,
87  const std::string& patternName);
88 
89  void writeToFile(path filePath, const std::string& content);
90  void writeIsmToDB(path dbPath, const IsmPtr & ism);
91 
92 
93 }; typedef boost::shared_ptr<DocumentationHelper> DocumentationHelperPtr;
94 
95 }
96 
boost::shared_ptr< DotHelper > DotHelperPtr
Definition: DotHelper.hpp:50
boost::shared_ptr< CostFunction< InstanceType >> CostFunctionPtr
void storeTopologiesToCSV(std::vector< TopologyPtr > selectedTopologies, const std::string &patternNames)
void writeIsmToDB(path dbPath, const IsmPtr &ism)
void writeToFile(path filePath, const std::string &content)
void storeTopology(TopologyPtr toStore, const std::string &patternName, const std::string &topologyName, std::map< std::string, std::vector< ISM::VoteSpecifierPtr >> objectDefinitons)
void storeMetadataToCSV(unsigned int numEvaluatedTopologies, unsigned int numOptimizationRounds, double elapsedRuntime, const std::string &patternName)
std::string patternName
boost::shared_ptr< Topology > TopologyPtr
Definition: Topology.hpp:51
boost::shared_ptr< SVGHelper > SVGHelperPtr
Definition: SVGHelper.hpp:140
void storeOptimizationRun(std::vector< std::vector< std::pair< TopologyPtr, unsigned int >>> &history, CostFunctionPtr< TopologyPtr > globalCostFunction, double elapsedRuntime, const std::string &patternName)
boost::shared_ptr< ImplicitShapeModel > IsmPtr
boost::shared_ptr< DocumentationHelper > DocumentationHelperPtr
const std::string SVG_SUBFOLDER_NAME
const std::string SELECTED_TOPOLOGIES_FOLDER
const std::string CSV_SUBFOLDER_NAME
const std::string TOPOLOGIES_SUBFOLDER_NAME
DocumentationHelper(path outputPath, path dbPath, std::map< std::string, ISM::TracksPtr > &tracksPerPattern)
this namespace contains all generally usable classes.
void storeIsm(const std::string &filename, const IsmPtr &ism)
void setReferenceTopology(TopologyPtr topology, const std::string &patternName)


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:40