Changeset 13658 for trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/MctsSymbolicRegression/MctsSymbolicRegressionAlgorithm.cs
- Timestamp:
- 03/07/16 14:50:02 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/MctsSymbolicRegression/MctsSymbolicRegressionAlgorithm.cs
r13652 r13658 24 24 using System.Runtime.CompilerServices; 25 25 using System.Threading; 26 using HeuristicLab.Algorithms.DataAnalysis.MctsSymbolicRegression.Policies; 26 27 using HeuristicLab.Analysis; 27 28 using HeuristicLab.Common; … … 52 53 private const string AllowedFactorsParameterName = "Allowed factors"; 53 54 private const string ConstantOptimizationIterationsParameterName = "Iterations (constant optimization)"; 54 private const string CParameterName = "C";55 private const string PolicyParameterName = "Policy"; 55 56 private const string SeedParameterName = "Seed"; 56 57 private const string SetSeedRandomlyParameterName = "SetSeedRandomly"; … … 79 80 get { return (IFixedValueParameter<IntValue>)Parameters[ConstantOptimizationIterationsParameterName]; } 80 81 } 81 public I FixedValueParameter<DoubleValue> CParameter {82 get { return (I FixedValueParameter<DoubleValue>)Parameters[CParameterName]; }82 public IValueParameter<IPolicy> PolicyParameter { 83 get { return (IValueParameter<IPolicy>)Parameters[PolicyParameterName]; } 83 84 } 84 85 public IFixedValueParameter<DoubleValue> PunishmentFactorParameter { … … 119 120 set { MaxVariableReferencesParameter.Value.Value = value; } 120 121 } 121 public double C { 122 get { return CParameter.Value.Value; } 123 set { CParameter.Value.Value = value; } 124 } 125 122 public IPolicy Policy { 123 get { return PolicyParameter.Value; } 124 set { PolicyParameter.Value = value; } 125 } 126 126 public double PunishmentFactor { 127 127 get { return PunishmentFactorParameter.Value.Value; } … … 173 173 Parameters.Add(new FixedValueParameter<IntValue>(MaxVariablesParameterName, 174 174 "Maximal number of variables references in the symbolic regression models (multiple usages of the same variable are counted)", new IntValue(5))); 175 Parameters.Add(new FixedValueParameter<DoubleValue>(CParameterName, 176 "Balancing parameter in UCT formula (0 < c < 1000). Small values: greedy search. Large values: enumeration. Default: 1.0", new DoubleValue(1.0))); 175 // Parameters.Add(new FixedValueParameter<DoubleValue>(CParameterName, 176 // "Balancing parameter in UCT formula (0 < c < 1000). Small values: greedy search. Large values: enumeration. Default: 1.0", new DoubleValue(1.0))); 177 Parameters.Add(new ValueParameter<IPolicy>(PolicyParameterName, 178 "The policy to use for selecting nodes in MCTS (e.g. Ucb)", new Ucb())); 179 PolicyParameter.Hidden = true; 177 180 Parameters.Add(new ValueParameter<ICheckedItemList<StringValue>>(AllowedFactorsParameterName, 178 181 "Choose which expressions are allowed as factors in the model.", defaultFactorsList)); … … 244 247 var problemData = (IRegressionProblemData)Problem.ProblemData.Clone(); 245 248 if (!AllowedFactors.CheckedItems.Any()) throw new ArgumentException("At least on type of factor must be allowed"); 246 var state = MctsSymbolicRegressionStatic.CreateState(problemData, (uint)Seed, MaxVariableReferences, C, ScaleVariables, ConstantOptimizationIterations, 249 var state = MctsSymbolicRegressionStatic.CreateState(problemData, (uint)Seed, MaxVariableReferences, ScaleVariables, ConstantOptimizationIterations, 250 Policy, 247 251 lowerLimit, upperLimit, 248 252 allowProdOfVars: AllowedFactors.CheckedItems.Any(s => s.Value.Value == VariableProductFactorName),
Note: See TracChangeset
for help on using the changeset viewer.