source: cpp/frams/_demos/paramtree_paramlist_test.cpp @ 1282

Last change on this file since 1282 was 1044, checked in by oriona, 4 years ago

Similarity measures code refactored. Distribution-based similarity measure added.

File size: 2.1 KB
Line 
1#include <frams/util/sstringutils.h>
2#include <common/virtfile/stdiofile.h>
3#include <frams/genetics/preconfigured.h>
4#include <frams/param/paramtree.h>
5#include <frams/param/mutparamlist.h>
6#include <frams/vm/classes/genoobj.h>
7#include <frams/vm/classes/collectionobj.h>
8#include <frams/vm/classes/3dobject.h>
9#include <frams/neuro/neuroimpl.h>
10#include <frams/neuro/neurofactory.h>
11#include <frams/model/geometry/modelgeoclass.h>
12#include <frams/model/modelobj.h>
13#include <frams/model/similarity/measure-distribution.h>
14#include <frams/model/similarity/measure-greedy.h>
15#include <frams/model/similarity/measure-hungarian.h>
16#include "genotypeloader.h"
17#include "paramtree_print.h"
18
19// This program tests parameter tree construction for all paramtab's that are available in SDK.
20// See paramtree_stdin_test.cpp and app_group_names.txt for a more complete set (from Framsticks GUI) of paramtab objects.
21// See mutableparam_test.cpp for a demonstration on how to detect (and possibly respond to) changing parameter definitions.
22int main()
23{
24        StdioFILE::setStdio(); //setup VirtFILE::Vstdin/out/err
25        PreconfiguredGenetics genetics;
26
27        Param genotypemini_param(genotypemini_paramtab);
28        NeuroFactory neurofac;
29        neurofac.setStandardImplementation();
30        NeuroNetConfig nn_config(&neurofac);
31        ModelGeometry modelgeo;
32        SimilMeasureDistribution simil_measure_distr;
33        SimilMeasureGreedy simil_measure_greedy;
34        SimilMeasureHungarian simil_measure_hungarian;
35
36        MutableParamList combined;
37        combined += &genetics.genman.par;
38        combined += &GenoObj::getStaticParam();
39        combined += &ModelObj::getStaticParam();
40        combined += &VectorObject::getStaticParam();
41        combined += &DictionaryObject::getStaticParam();
42        combined += &Pt3D_Ext::getStaticParam();
43        combined += &Orient_Ext::getStaticParam();
44        combined += &genotypemini_param;
45        combined += &nn_config.par;
46        combined += &modelgeo.par;
47        combined += &simil_measure_distr.localpar;
48        combined += &simil_measure_greedy.localpar;
49        combined += &simil_measure_hungarian.localpar;
50
51        ParamTree tree(&combined);
52
53        printTree(&tree.root);
54
55        neurofac.freeImplementation(); //just to avoid memory leak
56}
Note: See TracBrowser for help on using the repository browser.