Changeset 9241 for branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisProblem.cs
- Timestamp:
- 02/21/13 16:55:07 (12 years ago)
- Location:
- branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.Problems.DataAnalysis.Symbolic
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.Problems.DataAnalysis.Symbolic
- Property svn:mergeinfo changed
-
branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4
- Property svn:ignore
-
old new 1 *.user 2 Plugin.cs 1 3 bin 2 *.user3 HeuristicLabProblemsDataAnalysisSymbolicPlugin.cs4 4 obj 5 *.vs10x6 Plugin.cs
-
- Property svn:ignore
-
branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisProblem.cs
r8557 r9241 53 53 private const string FitnessCalculationPartitionParameterName = "FitnessCalculationPartition"; 54 54 private const string ValidationPartitionParameterName = "ValidationPartition"; 55 private const string ApplyLinearScalingParameterName = "ApplyLinearScaling"; 55 56 56 57 private const string ProblemDataParameterDescription = ""; … … 64 65 private const string FitnessCalculationPartitionParameterDescription = "The partition of the problem data training partition, that should be used to calculate the fitness of an individual."; 65 66 private const string ValidationPartitionParameterDescription = "The partition of the problem data training partition, that should be used to select the best model from (optional)."; 67 private const string ApplyLinearScalingParameterDescription = "Flag that indicates if the individual should be linearly scaled before evaluating."; 66 68 #endregion 67 69 … … 100 102 get { return (IFixedValueParameter<IntRange>)Parameters[ValidationPartitionParameterName]; } 101 103 } 104 public IFixedValueParameter<BoolValue> ApplyLinearScalingParameter { 105 get { return (IFixedValueParameter<BoolValue>)Parameters[ApplyLinearScalingParameterName]; } 106 } 102 107 #endregion 103 108 … … 144 149 public IntRange ValidationPartition { 145 150 get { return ValidationPartitionParameter.Value; } 151 } 152 public BoolValue ApplyLinearScaling { 153 get { return ApplyLinearScalingParameter.Value; } 146 154 } 147 155 #endregion … … 151 159 [StorableHook(HookType.AfterDeserialization)] 152 160 private void AfterDeserialization() { 161 if (!Parameters.ContainsKey(ApplyLinearScalingParameterName)) { 162 Parameters.Add(new FixedValueParameter<BoolValue>(ApplyLinearScalingParameterName, ApplyLinearScalingParameterDescription, new BoolValue(false))); 163 ApplyLinearScalingParameter.Hidden = true; 164 165 //it is assumed that for all symbolic regression algorithms linear scaling was set to true 166 //there is no possibility to determine the previous value of the parameter as it was stored in the evaluator 167 if (GetType().Name.Contains("SymbolicRegression")) 168 ApplyLinearScaling.Value = true; 169 } 170 153 171 RegisterEventHandlers(); 154 172 } … … 170 188 Parameters.Add(new FixedValueParameter<IntRange>(ValidationPartitionParameterName, ValidationPartitionParameterDescription)); 171 189 Parameters.Add(new FixedValueParameter<PercentValue>(RelativeNumberOfEvaluatedSamplesParameterName, RelativeNumberOfEvaluatedSamplesParameterDescription, new PercentValue(1))); 190 Parameters.Add(new FixedValueParameter<BoolValue>(ApplyLinearScalingParameterName, ApplyLinearScalingParameterDescription, new BoolValue(false))); 172 191 173 192 SymbolicExpressionTreeInterpreterParameter.Hidden = true; 174 193 MaximumFunctionArgumentsParameter.Hidden = true; 175 194 MaximumFunctionDefinitionsParameter.Hidden = true; 195 ApplyLinearScalingParameter.Hidden = true; 176 196 177 197 SymbolicExpressionTreeGrammar = new TypeCoherentExpressionGrammar(); … … 191 211 SymbolicExpressionTreeGrammar.MaximumFunctionDefinitions = MaximumFunctionDefinitions.Value; 192 212 foreach (var varSymbol in SymbolicExpressionTreeGrammar.Symbols.OfType<HeuristicLab.Problems.DataAnalysis.Symbolic.Variable>()) { 193 if (!varSymbol.Fixed) varSymbol.VariableNames = ProblemData.AllowedInputVariables; 213 if (!varSymbol.Fixed) { 214 varSymbol.AllVariableNames = ProblemData.InputVariables.Select(x => x.Value); 215 varSymbol.VariableNames = ProblemData.AllowedInputVariables; 216 } 194 217 } 195 218 foreach (var varSymbol in SymbolicExpressionTreeGrammar.Symbols.OfType<HeuristicLab.Problems.DataAnalysis.Symbolic.VariableCondition>()) { 196 if (!varSymbol.Fixed) varSymbol.VariableNames = ProblemData.AllowedInputVariables; 219 if (!varSymbol.Fixed) { 220 varSymbol.AllVariableNames = ProblemData.InputVariables.Select(x => x.Value); 221 varSymbol.VariableNames = ProblemData.AllowedInputVariables; 222 } 197 223 } 198 224 } … … 274 300 275 301 foreach (var op in operators.OfType<ISymbolicExpressionTreeGrammarBasedOperator>()) { 276 op.SymbolicExpressionTreeGrammarParameter.ActualName = SymbolicExpressionTreeGrammarParameter Name;302 op.SymbolicExpressionTreeGrammarParameter.ActualName = SymbolicExpressionTreeGrammarParameter.Name; 277 303 } 278 304 foreach (var op in operators.OfType<ISymbolicExpressionTreeSizeConstraintOperator>()) { 279 op.MaximumSymbolicExpressionTreeDepthParameter.ActualName = MaximumSymbolicExpressionTreeDepthParameter Name;280 op.MaximumSymbolicExpressionTreeLengthParameter.ActualName = MaximumSymbolicExpressionTreeLengthParameter Name;305 op.MaximumSymbolicExpressionTreeDepthParameter.ActualName = MaximumSymbolicExpressionTreeDepthParameter.Name; 306 op.MaximumSymbolicExpressionTreeLengthParameter.ActualName = MaximumSymbolicExpressionTreeLengthParameter.Name; 281 307 } 282 308 foreach (var op in operators.OfType<ISymbolicExpressionTreeArchitectureAlteringOperator>()) { 283 op.MaximumFunctionArgumentsParameter.ActualName = MaximumFunctionArgumentsParameter Name;284 op.MaximumFunctionDefinitionsParameter.ActualName = MaximumFunctionDefinitionsParameter Name;309 op.MaximumFunctionArgumentsParameter.ActualName = MaximumFunctionArgumentsParameter.Name; 310 op.MaximumFunctionDefinitionsParameter.ActualName = MaximumFunctionDefinitionsParameter.Name; 285 311 } 286 312 foreach (var op in operators.OfType<ISymbolicDataAnalysisEvaluator<T>>()) { … … 289 315 op.EvaluationPartitionParameter.ActualName = FitnessCalculationPartitionParameter.Name; 290 316 op.RelativeNumberOfEvaluatedSamplesParameter.ActualName = RelativeNumberOfEvaluatedSamplesParameter.Name; 317 op.ApplyLinearScalingParameter.ActualName = ApplyLinearScalingParameter.Name; 291 318 } 292 319 foreach (var op in operators.OfType<ISymbolicExpressionTreeCrossover>()) { … … 300 327 op.SymbolicExpressionTreeParameter.ActualName = SolutionCreator.SymbolicExpressionTreeParameter.ActualName; 301 328 } 329 foreach (var op in operators.OfType<ISymbolicDataAnalysisSingleObjectiveAnalyzer>()) { 330 op.ApplyLinearScalingParameter.ActualName = ApplyLinearScalingParameter.Name; 331 } 332 foreach (var op in operators.OfType<ISymbolicDataAnalysisMultiObjectiveAnalyzer>()) { 333 op.ApplyLinearScalingParameter.ActualName = ApplyLinearScalingParameter.Name; 334 } 302 335 foreach (var op in operators.OfType<ISymbolicDataAnalysisAnalyzer>()) { 303 336 op.SymbolicExpressionTreeParameter.ActualName = SolutionCreator.SymbolicExpressionTreeParameter.ActualName; … … 308 341 } 309 342 foreach (var op in operators.OfType<ISymbolicDataAnalysisInterpreterOperator>()) { 310 op.SymbolicDataAnalysisTreeInterpreterParameter.ActualName = SymbolicExpressionTreeInterpreterParameter Name;343 op.SymbolicDataAnalysisTreeInterpreterParameter.ActualName = SymbolicExpressionTreeInterpreterParameter.Name; 311 344 } 312 345 foreach (var op in operators.OfType<ISymbolicDataAnalysisExpressionCrossover<T>>()) { 313 op.EvaluationPartitionParameter.ActualName = FitnessCalculationPartitionParameterName; 314 } 315 foreach (var op in operators.OfType<ISymbolicDataAnalysisExpressionCrossover<T>>()) { 346 op.EvaluationPartitionParameter.ActualName = FitnessCalculationPartitionParameter.Name; 316 347 op.ProblemDataParameter.ActualName = ProblemDataParameter.Name; 317 348 op.EvaluationPartitionParameter.ActualName = FitnessCalculationPartitionParameter.Name; … … 331 362 Description = data.Description; 332 363 ProblemData = data; 333 OnReset();334 364 } 335 365
Note: See TracChangeset
for help on using the changeset viewer.