Changeset 1052
- Timestamp:
- 12/12/20 00:32:55 (4 years ago)
- Location:
- cpp/frams/model/similarity
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/frams/model/similarity/measure-distribution.cpp
r1046 r1052 12 12 13 13 static ParamEntry simil_distribution_paramtab[] = { 14 { "Similarity: distribution", 1, 4, "SimilMeasureDistribution", "Evaluates morphological dissimilarity using distribution measure.", },14 { "Similarity: Descriptor distribution", 1, 4, "SimilMeasureDistribution", "Evaluates morphological dissimilarity using distribution measure.", }, 15 15 { "simil_density", 0, 0, "Density of surface sampling", "f 1 100 10", FIELD(density), "", }, 16 16 { "simil_bin_num", 0, 0, "Number of bins", "d 1 1000 128", FIELD(bin_num), "", }, -
cpp/frams/model/similarity/measure-greedy.cpp
r1048 r1052 14 14 15 15 static ParamEntry simil_greedy_paramtab[] = { 16 { "Similarity: greedy", 1, 7, "SimilMeasureGreedy", "Evaluates morphological dissimilarity using greedy measure. 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", },16 { "Similarity: Graph greedy", 1, 7, "SimilMeasureGreedy", "Evaluates morphological dissimilarity using greedy measure. 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", }, 17 17 { "simil_parts", 0, 0, "Weight of parts count", "f 0 100 0", FIELD(m_adFactors[0]), "Differing number of parts is also handled by the 'part degree' similarity component.", }, 18 18 { "simil_partdeg", 0, 0, "Weight of parts' degree", "f 0 100 1", FIELD(m_adFactors[1]), "", }, -
cpp/frams/model/similarity/measure-hungarian.cpp
r1048 r1052 10 10 11 11 static ParamEntry simil_hungarian_paramtab[] = { 12 { "Similarity: hungarian", 1, 7, "SimilMeasureHungarian", "Evaluates morphological dissimilarity using hungarian measure. 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", },12 { "Similarity: Graph optimal", 1, 7, "SimilMeasureHungarian", "Evaluates morphological dissimilarity using hungarian measure. 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", }, 13 13 { "simil_parts", 0, 0, "Weight of parts count", "f 0 100 0", FIELD(m_adFactors[0]), "Differing number of parts is also handled by the 'part degree' similarity component.", }, 14 14 { "simil_partdeg", 0, 0, "Weight of parts' degree", "f 0 100 1", FIELD(m_adFactors[1]), "", }, -
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 } -
cpp/frams/model/similarity/simil-measure.h
r1048 r1052 13 13 { 14 14 public: 15 int measure_type;15 int type; 16 16 17 17 SimilMeasureGreedy simil_measure_greedy; … … 24 24 SimilMeasure(); 25 25 virtual ~SimilMeasure() {}; 26 SimilMeasureBase *currentMeasure(); 26 27 double evaluateDistance(const Geno *G0, const Geno *G1); 27 28
Note: See TracChangeset
for help on using the changeset viewer.