20 #include "../utility/TableHelper.hpp" 26 void DataMerger::merge(
const std::string& targetFile,
const std::vector<std::string>& sourceFiles,
bool mergeRecordings,
bool mergeModels)
29 for (
const std::string& sourceFile : sourceFiles)
32 std::cout << sourceFile <<
":" << std::endl;
36 std::cout <<
"merging recordings" << std::endl;
38 std::cout <<
"found " << patternNames.size() <<
" patterns" << std::endl;
41 std::cout <<
"merge pattern " <<
patternName << std::endl;
49 std::cout <<
"done" << std::endl;
55 std::cout <<
"merging models" << std::endl;
57 std::cout <<
"found " << objectTypes.size() <<
" object types" << std::endl;
59 std::set<std::string> patternNames;
60 for (
const std::pair<std::string, std::vector<VoteSpecifierPtr>>& typeToVoteVecPair : typeToVoteMap)
62 std::string type = typeToVoteVecPair.first;
63 std::vector<VoteSpecifierPtr> voteVec = typeToVoteVecPair.second;
64 std::cout <<
"found " << voteVec.size() <<
" votes for object type " << type << std::endl;
66 patternNames.insert(vote->patternName);
71 std::cout <<
"done" << std::endl;
75 std::cout <<
"found " << patternMap.size() <<
" patterns" << std::endl;
76 for (
const std::pair<std::string, PatternPtr>& patternNameToPattern : patternMap)
78 PatternPtr pattern = patternNameToPattern.second;
83 std::cout <<
"done" << std::endl;
void merge(const std::string &targetFile, const std::vector< std::string > &sourceFiles, bool mergeRecordings, bool mergeModels)
int insertRecordedObjectSet(const boost::shared_ptr< ObjectSet > &os, const std::string &patternName)
boost::shared_ptr< RecordedPattern > RecordedPatternPtr
const std::set< std::string > getObjectTypes() const
const PatternNameToPatternMap getPatternDefinitionsByName(const std::set< std::string > &patternNames) const
boost::shared_ptr< Pattern > PatternPtr
boost::shared_ptr< VoteSpecifier > VoteSpecifierPtr
int insertModelVoteSpecifier(const VoteSpecifierPtr &vote) const
boost::shared_ptr< ObjectSet > ObjectSetPtr
std::map< std::string, PatternPtr > PatternNameToPatternMap
std::vector< std::string > getRecordedPatternNames() const
this namespace contains all generally usable classes.
int upsertModelPattern(const std::string &patternName, int expectedMaxWeight) const
std::map< std::string, std::vector< VoteSpecifierPtr > > ObjectTypeToVoteMap
const ObjectTypeToVoteMap getVoteSpecifiersForObjectTypes(const std::set< std::string > &objectTypes) const
const RecordedPatternPtr getRecordedPattern(const std::string &patternName) const