Changeset 9467 for branches/LearningClassifierSystems/HeuristicLab.Algorithms.LearningClassifierSystems/3.3/LearningClassifierSystemMainLoop.cs
- Timestamp:
- 05/08/13 14:12:00 (11 years ago)
- Location:
- branches/LearningClassifierSystems
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/LearningClassifierSystems
-
Property
svn:mergeinfo
set to
/trunk/sources/HeuristicLab.Core merged eligible
-
Property
svn:mergeinfo
set to
-
branches/LearningClassifierSystems/HeuristicLab.Algorithms.LearningClassifierSystems/3.3/LearningClassifierSystemMainLoop.cs
r9242 r9467 25 25 using HeuristicLab.Encodings.ConditionActionEncoding; 26 26 using HeuristicLab.Operators; 27 using HeuristicLab.Optimization;28 27 using HeuristicLab.Optimization.Operators; 29 28 using HeuristicLab.Parameters; … … 42 41 43 42 #region Parameter Properties 44 public IConstrainedValueParameter<ISelector> SelectorParameter {45 get { return (IConstrainedValueParameter<ISelector>)Parameters["Selector"]; }43 public ValueLookupParameter<IOperator> SelectorParameter { 44 get { return adaptedGeneticAlgorithmMainLoop.SelectorParameter; } 46 45 } 47 46 public ValueLookupParameter<PercentValue> CrossoverProbabilityParameter { … … 108 107 private void Initialize() { 109 108 #region Create parameters 110 Parameters.Add(new ConstrainedValueParameter<ISelector>("Selector", "The operator used to select solutions for reproduction.", new ItemSet<ISelector>() { new ProportionalSelector() }, new ProportionalSelector()));111 109 Parameters.Add(new ValueLookupParameter<IOperator>("Evaluator", "The operator used to evaluate solutions. This operator is executed in parallel, if an engine is used which supports parallelization.")); 112 110 XCSAfterCopyingParentOperator afterCopyingParents = new XCSAfterCopyingParentOperator(); … … 273 271 subsumptionSelector.CopySelected = new BoolValue(false); 274 272 275 SelectorParameter.Value.CopySelected = new BoolValue(true);276 SelectorParameter.Value.NumberOfSelectedSubScopesParameter.Value = new IntValue(4);277 278 273 evaluator.Name = "Evaluator"; 279 274 … … 320 315 afterCrossover.ParentAverageActionSetSizeParameter.ActualName = "AverageActionSetSize"; 321 316 322 adaptedGeneticAlgorithmMainLoop.SelectorParameter.ActualName = SelectorParameter.Name;323 317 adaptedGeneticAlgorithmMainLoop.RandomParameter.ActualName = "Random"; 324 318 adaptedGeneticAlgorithmMainLoop.MaximumGenerationsParameter.ActualName = "ZeroIntValue"; … … 428 422 } 429 423 430 private void ParameterizeStochasticOperator(IOperator op) {431 IStochasticOperator stochasticOp = op as IStochasticOperator;432 if (stochasticOp != null) {433 stochasticOp.RandomParameter.ActualName = "Random";434 stochasticOp.RandomParameter.Hidden = true;435 }436 }437 438 424 internal void SetCurrentProblem(IConditionActionProblem problem) { 439 425 initialSolutionsCreator.SolutionCreatorParameter.ActualName = problem.SolutionCreatorParameter.Name; … … 485 471 adaptedGeneticAlgorithmMainLoop.SetChildName(problem.ChildName); 486 472 } 487 //private void ParameterizeSelectors() {488 // foreach (ISelector selector in SelectorParameter.ValidValues) {489 // selector.CopySelected = new BoolValue(true);490 // //set value by parameter!491 // selector.NumberOfSelectedSubScopesParameter.Value = new IntValue(5);492 // selector.NumberOfSelectedSubScopesParameter.Hidden = true;493 // ParameterizeStochasticOperator(selector);494 // }495 // if (Problem != null) {496 // foreach (ISingleObjectiveSelector selector in SelectorParameter.ValidValues.OfType<ISingleObjectiveSelector>()) {497 // selector.MaximizationParameter.Value = new BoolValue(true);498 // selector.MaximizationParameter.Hidden = true;499 // selector.QualityParameter.ActualName = Problem.Evaluator.QualityParameter.ActualName;500 // selector.QualityParameter.Hidden = true;501 // }502 // }503 //}504 473 } 505 474 }
Note: See TracChangeset
for help on using the changeset viewer.