Skip to content
Snippets Groups Projects
Commit 4c13d1ec authored by Lorenz Gruber's avatar Lorenz Gruber
Browse files

adapting neighbouring predicate reader

parent e8c85777
No related branches found
No related tags found
No related merge requests found
......@@ -6,12 +6,12 @@
#include "DistanceBiPredicate.hpp"
template<typename T>
static std::optional<fishnet::util::BiPredicate_t<T>> fromNeighbouringPredicateType(NeighbouringPredicateType type,const nlohmann::json & predicateDesc) {
static std::optional<fishnet::util::BiPredicate_t<T>> fromNeighbouringPredicateType(NeighbouringPredicateType type,const nlohmann::json & predicateDesc, const DistanceFunction & distanceFunction = MetricDistance()) {
switch(type){
case NeighbouringPredicateType::DistanceBiPredicate:
double maxDistance;
predicateDesc.at("distance").get_to(maxDistance);
return DistanceBiPredicate(maxDistance);
return DistanceBiPredicate(distanceFunction,maxDistance);
}
return std::nullopt;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment