Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
09/21/09 20:23:47 (15 years ago)
Author:
gkronber
Message:

Refactored CEDMA dispatcher and CEDMA server view to allow different modeling scenarios for each variable. #754

Location:
trunk/sources/HeuristicLab.GP.StructureIdentification/3.3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/OffspringSelectionGPRegression.cs

    r2363 r2375  
    2121
    2222using System;
     23using System.Linq;
    2324using System.Collections.Generic;
    2425using HeuristicLab.Core;
     
    5455          return CreateGPModel();
    5556      }
     57    }
     58    public IEnumerable<int> AllowedVariables {
     59      get {
     60        ItemList<IntData> allowedVariables = ProblemInjector.GetVariableValue<ItemList<IntData>>("AllowedFeatures", null, false);
     61        return allowedVariables.Select(x => x.Data);
     62      }
     63      set {
     64        ItemList<IntData> allowedVariables = ProblemInjector.GetVariableValue<ItemList<IntData>>("AllowedFeatures", null, false);
     65        foreach (int x in value) allowedVariables.Add(new IntData(x));
     66      }
     67    }
     68
     69    public int TrainingSamplesStart {
     70      get { return ProblemInjector.GetVariableValue<IntData>("TrainingSamplesStart", null, false).Data; }
     71      set { ProblemInjector.GetVariableValue<IntData>("TrainingSamplesStart", null, false).Data = value; }
     72    }
     73
     74    public int TrainingSamplesEnd {
     75      get { return ProblemInjector.GetVariableValue<IntData>("TrainingSamplesEnd", null, false).Data; }
     76      set { ProblemInjector.GetVariableValue<IntData>("TrainingSamplesEnd", null, false).Data = value; }
     77    }
     78
     79    public int ValidationSamplesStart {
     80      get { return ProblemInjector.GetVariableValue<IntData>("ValidationSamplesStart", null, false).Data; }
     81      set { ProblemInjector.GetVariableValue<IntData>("ValidationSamplesStart", null, false).Data = value; }
     82    }
     83
     84    public int ValidationSamplesEnd {
     85      get { return ProblemInjector.GetVariableValue<IntData>("ValidationSamplesEnd", null, false).Data; }
     86      set { ProblemInjector.GetVariableValue<IntData>("ValidationSamplesEnd", null, false).Data = value; }
     87    }
     88
     89    public int TestSamplesStart {
     90      get { return ProblemInjector.GetVariableValue<IntData>("TestSamplesStart", null, false).Data; }
     91      set { ProblemInjector.GetVariableValue<IntData>("TestSamplesStart", null, false).Data = value; }
     92    }
     93
     94    public int TestSamplesEnd {
     95      get { return ProblemInjector.GetVariableValue<IntData>("TestSamplesEnd", null, false).Data; }
     96      set { ProblemInjector.GetVariableValue<IntData>("TestSamplesEnd", null, false).Data = value; }
    5697    }
    5798
  • trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/StandardGPRegression.cs

    r2363 r2375  
    2929using System.Collections.Generic;
    3030using System;
     31using System.Linq;
    3132using HeuristicLab.DataAnalysis;
    3233using HeuristicLab.Operators.Programmable;
     
    5455          return CreateGPModel();
    5556      }
     57    }
     58
     59    public IEnumerable<int> AllowedVariables {
     60      get {
     61        ItemList<IntData> allowedVariables = ProblemInjector.GetVariableValue<ItemList<IntData>>("AllowedFeatures", null, false);
     62        return allowedVariables.Select(x => x.Data);
     63      }
     64      set {
     65        ItemList<IntData> allowedVariables = ProblemInjector.GetVariableValue<ItemList<IntData>>("AllowedFeatures", null, false);
     66        foreach (int x in value) allowedVariables.Add(new IntData(x));
     67      }
     68    }
     69
     70    public int TrainingSamplesStart {
     71      get { return ProblemInjector.GetVariableValue<IntData>("TrainingSamplesStart", null, false).Data; }
     72      set { ProblemInjector.GetVariableValue<IntData>("TrainingSamplesStart", null, false).Data = value; }
     73    }
     74
     75    public int TrainingSamplesEnd {
     76      get { return ProblemInjector.GetVariableValue<IntData>("TrainingSamplesEnd", null, false).Data; }
     77      set { ProblemInjector.GetVariableValue<IntData>("TrainingSamplesEnd", null, false).Data = value; }
     78    }
     79
     80    public int ValidationSamplesStart {
     81      get { return ProblemInjector.GetVariableValue<IntData>("ValidationSamplesStart", null, false).Data; }
     82      set { ProblemInjector.GetVariableValue<IntData>("ValidationSamplesStart", null, false).Data = value; }
     83    }
     84
     85    public int ValidationSamplesEnd {
     86      get { return ProblemInjector.GetVariableValue<IntData>("ValidationSamplesEnd", null, false).Data; }
     87      set { ProblemInjector.GetVariableValue<IntData>("ValidationSamplesEnd", null, false).Data = value; }
     88    }
     89
     90    public int TestSamplesStart {
     91      get { return ProblemInjector.GetVariableValue<IntData>("TestSamplesStart", null, false).Data; }
     92      set { ProblemInjector.GetVariableValue<IntData>("TestSamplesStart", null, false).Data = value; }
     93    }
     94
     95    public int TestSamplesEnd {
     96      get { return ProblemInjector.GetVariableValue<IntData>("TestSamplesEnd", null, false).Data; }
     97      set { ProblemInjector.GetVariableValue<IntData>("TestSamplesEnd", null, false).Data = value; }
    5698    }
    5799
Note: See TracChangeset for help on using the changeset viewer.