19 #include <boost/lexical_cast.hpp> 24 clusters) :
Heuristic(
"ManuallyDefPseudoHeuristic"), mClusters(clusters)
33 std::vector<TrackPtr> result;
34 for(std::pair<std::vector<ClusterObject>, uint16_t>& clusterObjectsToCluster :
mClusters)
36 for(
ClusterObject& clusterObject : clusterObjectsToCluster.first)
39 for(
TrackPtr& track : tracks->tracks)
43 if(track->type.find(
"_sub") != std::string::npos)
45 std::string temp = track->type;
46 temp.erase(temp.begin(), temp.begin() + temp.find_first_of(
"_sub") + 4);
48 boost::lexical_cast<uint16_t>(temp))
51 result.push_back(track);
54 }
else if(track->type == boost::get<std::string>(clusterObject.
mObjectOrCluster))
57 result.push_back(track);
66 if(result.size() == clusterObjectsToCluster.first.size())
~ManuallyDefPseudoHeuristic()
ManuallyDefPseudoHeuristic(std::vector< std::pair< std::vector< ClusterObject >, uint16_t >> clusters)
boost::variant< uint16_t, std::string > mObjectOrCluster
boost::shared_ptr< Tracks > TracksPtr
boost::shared_ptr< Track > TrackPtr
this namespace contains all generally usable classes.
std::vector< std::pair< std::vector< ClusterObject >, uint16_t > > mClusters
virtual void applyHeuristic(const TracksPtr &tracks)