Free cookie consent management tool by TermsFeed Policy Generator

source: branches/2988_ModelsOfModels2/HeuristicLab.Algorithms.EMM/EMMTreeModel.cs @ 17021

Last change on this file since 17021 was 16722, checked in by msemenki, 6 years ago

#2988: Add first version of GP for Evolvment models of models.

File size: 1.5 KB
RevLine 
[16722]1using HeuristicLab.Common;
2using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
3using HEAL.Attic;
4
5namespace HeuristicLab.Algorithms.EvolvmentModelsOfModels {
6  [StorableType("4A9F2F3F-3CF0-49FF-8B2F-FFF2B1601E60")]
7  public class EMMTreeModel {
8    public SymbolicExpressionTree SavedTree { get; private set; }
9    public int ConstantNumber { get; private set; }
10    public int ClusterNumber { get; private set; }
11
12    [StorableConstructor]
13    protected EMMTreeModel(StorableConstructorFlag _) {
14    }
15
16    public EMMTreeModel() {
17      SavedTree = new SymbolicExpressionTree();
18      ConstantNumber = 0;
19      ClusterNumber = 0;
20    }
21    public EMMTreeModel(SymbolicExpressionTree tree, int clusterNumber) {
22      SavedTree = new SymbolicExpressionTree(tree.Root);
23      ClusterNumber = clusterNumber;
24      ConstantNumber = 0;
25     // ConstantNumber = SavedTree.CalcaulateConstantsNumber(); // need to be aded
26    }
27    public EMMTreeModel(EMMTreeModel old) {
28      SavedTree = new SymbolicExpressionTree(old.SavedTree.Root);
29      ConstantNumber = old.ConstantNumber;
30      ClusterNumber = old.ClusterNumber;
31    }
32    private EMMTreeModel(EMMTreeModel original, Cloner cloner) {
33      SavedTree = cloner.Clone(original.SavedTree);
34      ConstantNumber = original.ConstantNumber;
35      ClusterNumber = original.ClusterNumber;
36    }
37    public void ConstantSet (double [] conatants) {
38      // how to change constant in a tree?
39
40    }
41  }
42}
Note: See TracBrowser for help on using the repository browser.