Changeset 14029 for branches/crossvalidation-2434/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/GaussianProcessRegression.cs
- Timestamp:
- 07/08/16 14:40:02 (8 years ago)
- Location:
- branches/crossvalidation-2434
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/crossvalidation-2434
- Property svn:mergeinfo changed
-
branches/crossvalidation-2434/HeuristicLab.Algorithms.DataAnalysis
- Property svn:mergeinfo changed
-
branches/crossvalidation-2434/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/GaussianProcessRegression.cs
r12504 r14029 25 25 using HeuristicLab.Common; 26 26 using HeuristicLab.Core; 27 using HeuristicLab.Data; 27 28 using HeuristicLab.Optimization; 28 29 using HeuristicLab.Parameters; … … 48 49 49 50 private const string ModelParameterName = "Model"; 51 private const string CreateSolutionParameterName = "CreateSolution"; 52 50 53 51 54 #region parameter properties … … 55 58 public IFixedValueParameter<GaussianProcessRegressionSolutionCreator> GaussianProcessSolutionCreatorParameter { 56 59 get { return (IFixedValueParameter<GaussianProcessRegressionSolutionCreator>)Parameters[SolutionCreatorParameterName]; } 60 } 61 public IFixedValueParameter<BoolValue> CreateSolutionParameter { 62 get { return (IFixedValueParameter<BoolValue>)Parameters[CreateSolutionParameterName]; } 63 } 64 #endregion 65 #region properties 66 public bool CreateSolution { 67 get { return CreateSolutionParameter.Value.Value; } 68 set { CreateSolutionParameter.Value.Value = value; } 57 69 } 58 70 #endregion … … 78 90 Parameters.Add(new ConstrainedValueParameter<IGaussianProcessRegressionModelCreator>(ModelCreatorParameterName, "The operator to create the Gaussian process model.", 79 91 new ItemSet<IGaussianProcessRegressionModelCreator>(modelCreators), defaultModelCreator)); 80 // th is parameter is not intended to be changed,92 // the solution creator cannot be changed 81 93 Parameters.Add(new FixedValueParameter<GaussianProcessRegressionSolutionCreator>(SolutionCreatorParameterName, "The solution creator for the algorithm", 82 94 new GaussianProcessRegressionSolutionCreator())); 83 95 Parameters[SolutionCreatorParameterName].Hidden = true; 96 // TODO: it would be better to deactivate the solution creator when this parameter is changed 97 Parameters.Add(new FixedValueParameter<BoolValue>(CreateSolutionParameterName, "Flag that indicates if a solution should be produced at the end of the run", new BoolValue(true))); 98 Parameters[CreateSolutionParameterName].Hidden = true; 84 99 85 100 ParameterizedModelCreators(); … … 91 106 [StorableHook(HookType.AfterDeserialization)] 92 107 private void AfterDeserialization() { 108 // BackwardsCompatibility3.3 109 #region Backwards compatible code, remove with 3.4 110 if (!Parameters.ContainsKey(CreateSolutionParameterName)) { 111 Parameters.Add(new FixedValueParameter<BoolValue>(CreateSolutionParameterName, "Flag that indicates if a solution should be produced at the end of the run", new BoolValue(true))); 112 Parameters[CreateSolutionParameterName].Hidden = true; 113 } 114 #endregion 93 115 RegisterEventHandlers(); 94 116 }
Note: See TracChangeset
for help on using the changeset viewer.