Changeset 1052 for cpp/frams/model/similarity/simil-measure.cpp
- Timestamp:
- 12/12/20 00:32:55 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/frams/model/similarity/simil-measure.cpp
r1048 r1052 12 12 static ParamEntry simil_measure_paramtab[] = { 13 13 { "Similarity", 1, 2, "SimilMeasure", "Evaluates morphological dissimilarity. More information:\nhttp://www.framsticks.com/bib/Komosinski-et-al-2001\nhttp://www.framsticks.com/bib/Komosinski-and-Kubiak-2011\nhttp://www.framsticks.com/bib/Komosinski-2016\nhttps://doi.org/10.1007/978-3-030-16692-2_8", }, 14 { " measure_type", 0, 0, "Type of similarity measure", "d 0 2 0 ~Greedy (flexible criteria order and optimal matching)~Hungarian (vertex degree order and greedy matching)~Distribution (EMD on a histogram of descriptor values)", FIELD(measure_type), "", },14 { "type", 0, 0, "Type of similarity measure", "d 0 2 1 ~Graph greedy (vertex degree order and greedy matching)~Graph optimal (flexible criteria order and optimal matching)~Descriptor distribution (EMD on a histogram of descriptor values)", FIELD(type), "", }, 15 15 { "evaluateDistance", 0, PARAM_DONTSAVE | PARAM_USERHIDDEN, "Evaluate model dissimilarity", "p f(oGeno,oGeno)", PROCEDURE(p_evaldistance), "Calculates dissimilarity between two models created from Geno objects.", }, 16 16 { 0, }, … … 24 24 } 25 25 26 SimilMeasureBase *SimilMeasure::currentMeasure() 27 { 28 SimilMeasureBase *measures[] = { &simil_measure_greedy,&simil_measure_hungarian,&simil_measure_distribution }; 29 if (type >= 0 && type <= (int)std::size(measures)) 30 return measures[type]; 31 logPrintf("SimilarityMeasure", "currentMeasure", LOG_ERROR, "Measure type '%d' not supported", type); 32 return nullptr; 33 } 34 26 35 double SimilMeasure::evaluateDistance(const Geno* G0, const Geno* G1) 27 36 { 28 SimilMeasureBase *measures[] = { &simil_measure_greedy,&simil_measure_hungarian,&simil_measure_distribution }; 29 if (measure_type >= 0 && measure_type <= 2) 30 return measures[measure_type]->evaluateDistance(G0, G1); 31 logPrintf("SimilarityMeasure", "evaluateDistance", LOG_ERROR, "Measure type '%d' not supported", measure_type); 37 SimilMeasureBase *measure = currentMeasure(); 38 if (measure) 39 return measure->evaluateDistance(G0, G1); 32 40 return -1; 33 41 }
Note: See TracChangeset
for help on using the changeset viewer.