- Timestamp:
- 05/05/10 16:37:12 (15 years ago)
- Location:
- trunk/sources/HeuristicLab.Problems.OneMax/3.3
- Files:
-
- 6 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.OneMax/3.3/HeuristicLab.Problems.OneMax-3.3.csproj
r3384 r3642 86 86 </ItemGroup> 87 87 <ItemGroup> 88 <Compile Include="Analyzers\BestOneMaxSolutionAnalyzer.cs" /> 89 <Compile Include="Analyzers\MultiPopulationBestOneMaxSolutionAnalyzer.cs" /> 90 <Compile Include="Analyzers\PopulationBestOneMaxSolutionAnalyzer.cs" /> 91 <Compile Include="Interfaces\IBestOneMaxSolutionAnalyzer.cs" /> 88 92 <Compile Include="Interfaces\IOneMaxSolutionsVisualizer.cs" /> 89 93 <Compile Include="Interfaces\IOneMaxMoveEvaluator.cs" /> 94 <Compile Include="OneMaxSolution.cs" /> 90 95 <Compile Include="MoveEvaluators\OneMaxMoveEvaluator.cs" /> 91 96 <Compile Include="MoveEvaluators\OneMaxOneBitflipMoveEvaluator.cs" /> -
trunk/sources/HeuristicLab.Problems.OneMax/3.3/OnemaxProblem.cs
r3616 r3642 32 32 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 33 33 using HeuristicLab.PluginInfrastructure; 34 using HeuristicLab.Problems.OneMax.Analyzers; 34 35 35 36 namespace HeuristicLab.Problems.OneMax { … … 97 98 get { return BestKnownQualityParameter.Value; } 98 99 } 99 private List<I BinaryVectorOperator> operators;100 private List<IOperator> operators; 100 101 public IEnumerable<IOperator> Operators { 101 102 get { return operators.Cast<IOperator>(); } 103 } 104 private IEnumerable<IBestOneMaxSolutionAnalyzer> BestOneMaxSolutionAnalyzers { 105 get { return operators.OfType<IBestOneMaxSolutionAnalyzer>(); } 102 106 } 103 107 #endregion … … 150 154 151 155 private void SolutionCreatorParameter_ValueChanged(object sender, EventArgs e) { 152 SolutionCreator.BinaryVectorParameter.ActualNameChanged += new EventHandler(SolutionCreator_ PermutationParameter_ActualNameChanged);156 SolutionCreator.BinaryVectorParameter.ActualNameChanged += new EventHandler(SolutionCreator_BinaryVectorParameter_ActualNameChanged); 153 157 ParameterizeSolutionCreator(); 154 158 ParameterizeEvaluator(); 159 ParameterizeAnalyzers(); 155 160 ParameterizeOperators(); 156 161 OnSolutionCreatorChanged(); 157 162 } 158 private void SolutionCreator_PermutationParameter_ActualNameChanged(object sender, EventArgs e) { 159 ParameterizeEvaluator(); 163 private void SolutionCreator_BinaryVectorParameter_ActualNameChanged(object sender, EventArgs e) { 164 ParameterizeEvaluator(); 165 ParameterizeAnalyzers(); 160 166 ParameterizeOperators(); 161 167 } 162 168 private void EvaluatorParameter_ValueChanged(object sender, EventArgs e) { 163 169 ParameterizeEvaluator(); 170 ParameterizeAnalyzers(); 164 171 OnEvaluatorChanged(); 165 172 } … … 188 195 InitializeOperators(); 189 196 SolutionCreatorParameter.ValueChanged += new EventHandler(SolutionCreatorParameter_ValueChanged); 190 SolutionCreator.BinaryVectorParameter.ActualNameChanged += new EventHandler(SolutionCreator_ PermutationParameter_ActualNameChanged);197 SolutionCreator.BinaryVectorParameter.ActualNameChanged += new EventHandler(SolutionCreator_BinaryVectorParameter_ActualNameChanged); 191 198 EvaluatorParameter.ValueChanged += new EventHandler(EvaluatorParameter_ValueChanged); 192 199 LengthParameter.ValueChanged += new EventHandler(LengthParameter_ValueChanged); … … 202 209 ((OneMaxEvaluator)Evaluator).BinaryVectorParameter.ActualName = SolutionCreator.BinaryVectorParameter.ActualName; 203 210 } 211 private void ParameterizeAnalyzers() { 212 foreach (IBestOneMaxSolutionAnalyzer analyzer in BestOneMaxSolutionAnalyzers) { 213 analyzer.BinaryVectorParameter.ActualName = SolutionCreator.BinaryVectorParameter.ActualName; 214 analyzer.ResultsParameter.ActualName = "Results"; 215 } 216 } 204 217 private void InitializeOperators() { 205 operators = new List<IBinaryVectorOperator>(); 218 operators = new List<IOperator>(); 219 operators.Add(new BestOneMaxSolutionAnalyzer()); 220 operators.Add(new PopulationBestOneMaxSolutionAnalyzer()); 221 operators.Add(new MultiPopulationBestOneMaxSolutionAnalyzer()); 222 ParameterizeAnalyzers(); 206 223 foreach(IBinaryVectorOperator op in ApplicationManager.Manager.GetInstances<IBinaryVectorOperator>()) { 207 224 if (!(op is ISingleObjectiveMoveEvaluator) || (op is IOneMaxMoveEvaluator)) {
Note: See TracChangeset
for help on using the changeset viewer.