Changeset 8002
- Timestamp:
- 06/14/12 09:32:01 (12 years ago)
- Location:
- branches/FitnessLandscapeAnalysis
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/FitnessLandscapeAnalysis/HeuristicLab.Analysis.FitnessLandscape/Algorithms/LocalAnalysis.cs
r7128 r8002 150 150 ParameterizeStochasticOperator(Problem.SolutionCreator); 151 151 ParameterizeStochasticOperator(Problem.Evaluator); 152 foreach (IOperator op in Problem.Operators ) ParameterizeStochasticOperator(op);152 foreach (IOperator op in Problem.Operators.OfType<IOperator>()) ParameterizeStochasticOperator(op); 153 153 ParameterizeSolutionsCreator(); 154 154 ParameterizeMainLoop(); … … 177 177 } 178 178 protected override void Problem_OperatorsChanged(object sender, EventArgs e) { 179 foreach (IOperator op in Problem.Operators ) ParameterizeStochasticOperator(op);179 foreach (IOperator op in Problem.Operators.OfType<IOperator>()) ParameterizeStochasticOperator(op); 180 180 UpdateMutators(); 181 181 UpdateSelectors(); -
branches/FitnessLandscapeAnalysis/HeuristicLab.Analysis.FitnessLandscape/Algorithms/RepeatedLocalAnalysis.cs
r7128 r8002 185 185 ParameterizeStochasticOperator(Problem.SolutionCreator); 186 186 ParameterizeStochasticOperator(Problem.Evaluator); 187 foreach (IOperator op in Problem.Operators ) ParameterizeStochasticOperator(op);187 foreach (IOperator op in Problem.Operators.OfType<IOperator>()) ParameterizeStochasticOperator(op); 188 188 ParameterizeSolutionsCreator(); 189 189 ParameterizeMainLoop(); … … 212 212 } 213 213 protected override void Problem_OperatorsChanged(object sender, EventArgs e) { 214 foreach (IOperator op in Problem.Operators ) ParameterizeStochasticOperator(op);214 foreach (IOperator op in Problem.Operators.OfType<IOperator>()) ParameterizeStochasticOperator(op); 215 215 UpdateMutators(); 216 216 UpdateSelectors(); -
branches/FitnessLandscapeAnalysis/HeuristicLab.Problems.NK/NKLandscape.cs
r7202 r8002 12 12 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 13 13 using HeuristicLab.PluginInfrastructure; 14 using HeuristicLab.Problems.NK.WeightInitializers; 14 15 using HeuristicLab.Random; 15 using HeuristicLab.Problems.NK.WeightInitializers;16 16 17 17 namespace HeuristicLab.Problems.NK { … … 73 73 public OptionalConstrainedValueParameter<IWeightsInitializer> WeightsInitializerParameter { 74 74 get { return (OptionalConstrainedValueParameter<IWeightsInitializer>)Parameters["WeightsInitializer"]; } 75 } 75 } 76 76 #endregion 77 77 … … 101 101 get { return BestKnownQualityParameter.Value; } 102 102 } 103 public IEnumerable<I Operator> Operators {104 get { return operators .Cast<IOperator>(); }103 public IEnumerable<IItem> Operators { 104 get { return operators; } 105 105 } 106 106 public IInteractionInitializer InteractionInitializer { 107 107 get { return InteractionInitializerParameter.Value; } 108 } 108 } 109 109 //private BestOneMaxSolutionAnalyzer BestOneMaxSolutionAnalyzer { 110 110 //get { return operators.OfType<BestOneMaxSolutionAnalyzer>().FirstOrDefault(); } … … 115 115 116 116 [Storable] 117 private List<I Operator> operators;117 private List<IItem> operators; 118 118 119 119 [StorableConstructor] … … 121 121 private NKLandscape(NKLandscape original, Cloner cloner) 122 122 : base(original, cloner) { 123 operators = original.operators.Select(x => (I Operator)cloner.Clone(x)).ToList();123 operators = original.operators.Select(x => (IItem)cloner.Clone(x)).ToList(); 124 124 AttachEventHandlers(); 125 125 } … … 286 286 287 287 private void InitializeOperators() { 288 operators = new List<I Operator>();288 operators = new List<IItem>(); 289 289 //operators.Add(new BestOneMaxSolutionAnalyzer()); 290 290 ParameterizeAnalyzer(); … … 317 317 } 318 318 319 private void InitializeInteractions() { 319 private void InitializeInteractions() { 320 320 if (InteractionInitializer != null) 321 321 GeneInteractionsParameter.Value = InteractionInitializer.InitializeInterations( … … 323 323 NrOfFitnessComponentsParameter.Value.Value, 324 324 NrOfInteractionsParameter.Value.Value, 325 random); 325 random); 326 326 } 327 327
Note: See TracChangeset
for help on using the changeset viewer.