Changeset 4045
- Timestamp:
- 07/19/10 15:24:32 (14 years ago)
- Location:
- trunk/sources
- Files:
-
- 2 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Algorithms.NSGA2/3.3/CrowdedTournamentSelector.cs
r4041 r4045 33 33 namespace HeuristicLab.Algorithms.NSGA2 { 34 34 public class CrowdedTournamentSelector : Selector, IMultiObjectiveSelector, IStochasticOperator { 35 35 public ILookupParameter<BoolArray> MaximizationParameter { 36 get { return (ILookupParameter<BoolArray>)Parameters["Maximization"]; } 37 } 38 public IValueLookupParameter<IntValue> NumberOfSelectedSubScopesParameter { 39 get { return (IValueLookupParameter<IntValue>)Parameters["NumberOfSelectedSubScopes"]; } 40 } 41 public IValueParameter<BoolValue> CopySelectedParameter { 42 get { return (IValueParameter<BoolValue>)Parameters["CopySelected"]; } 43 } 44 public ILookupParameter<IRandom> RandomParameter { 45 get { return (ILookupParameter<IRandom>)Parameters["Random"]; } 46 } 36 47 public ILookupParameter<ItemArray<DoubleArray>> QualitiesParameter { 37 48 get { return (ILookupParameter<ItemArray<DoubleArray>>)Parameters["Qualities"]; } … … 43 54 get { return (IScopeTreeLookupParameter<DoubleValue>)Parameters["CrowdingDistance"]; } 44 55 } 45 public IValueParameter<BoolValue> CopySelectedParameter {46 get { return (IValueParameter<BoolValue>)Parameters["CopySelected"]; }47 }48 public ILookupParameter<IRandom> RandomParameter {49 get { return (ILookupParameter<IRandom>)Parameters["Random"]; }50 }51 56 public IValueLookupParameter<IntValue> GroupSizeParameter { 52 57 get { return (IValueLookupParameter<IntValue>)Parameters["GroupSize"]; } … … 56 61 get { return CopySelectedParameter.Value; } 57 62 set { CopySelectedParameter.Value = value; } 58 }59 60 public IValueLookupParameter<IntValue> NumberOfSelectedSubScopesParameter {61 get { return (IValueLookupParameter<IntValue>)Parameters["NumberOfSelectedSubScopes"]; }62 63 } 63 64 -
trunk/sources/HeuristicLab.Algorithms.NSGA2/3.3/FastNonDominatedSort.cs
r4040 r4045 39 39 private enum DominationResult { Dominates, IsDominated, IsNonDominated }; 40 40 41 public IValueLookupParameter<BoolArray> Maximization sParameter {42 get { return (IValueLookupParameter<BoolArray>)Parameters["Maximization s"]; }41 public IValueLookupParameter<BoolArray> MaximizationParameter { 42 get { return (IValueLookupParameter<BoolArray>)Parameters["Maximization"]; } 43 43 } 44 44 … … 52 52 53 53 public FastNonDominatedSort() { 54 Parameters.Add(new ValueLookupParameter<BoolArray>("Maximization s", "Whether each objective is maximization or minimization."));54 Parameters.Add(new ValueLookupParameter<BoolArray>("Maximization", "Whether each objective is maximization or minimization.")); 55 55 Parameters.Add(new ScopeTreeLookupParameter<DoubleArray>("Qualities", "The qualities of a solution.", 1)); 56 56 Parameters.Add(new ScopeTreeLookupParameter<IntValue>("Rank", "The rank of a solution.", 1)); … … 58 58 59 59 public override IOperation Apply() { 60 BoolArray maximization s = MaximizationsParameter.ActualValue;60 BoolArray maximization = MaximizationParameter.ActualValue; 61 61 ItemArray<DoubleArray> qualities = QualitiesParameter.ActualValue; 62 62 if (qualities == null) throw new InvalidOperationException(Name + ": No qualities found."); … … 74 74 dominatedScopes[p] = new List<int>(); 75 75 for (int qI = pI + 1; qI < populationSize; qI++) { 76 DominationResult test = Dominates(qualities[pI], qualities[qI], maximization s);76 DominationResult test = Dominates(qualities[pI], qualities[qI], maximization); 77 77 if (test == DominationResult.Dominates) { 78 78 dominatedScopes[p].Add(qI); … … 137 137 } 138 138 139 /*private bool Dominates(DoubleArray left, DoubleArray right, BoolArray maximizations) {140 for (int i = 0; i < left.Length; i++) {141 if (IsDominated(left[i], right[i], maximizations[i]))142 return false;143 }144 return true;145 }*/146 147 139 private bool IsDominated(double left, double right, bool maximization) { 148 140 return maximization && left < right -
trunk/sources/HeuristicLab.Algorithms.NSGA2/3.3/HeuristicLab.Algorithms.NSGA2-3.3.csproj
r4041 r4045 79 79 <Compile Include="CrowdedTournamentSelector.cs" /> 80 80 <Compile Include="CrowdingDistanceAssignment.cs" /> 81 <Compile Include="DefaultCrossover.cs" /> 81 82 <Compile Include="FastNonDominatedSort.cs" /> 82 83 <Compile Include="HeuristicLabAlgorithmsNSGA2Plugin.cs" /> … … 84 85 <Compile Include="NSGA2MainLoop.cs" /> 85 86 <Compile Include="Properties\AssemblyInfo.cs" /> 87 <Compile Include="RankAndCrowdingSorter.cs" /> 86 88 <None Include="Properties\AssemblyInfo.frame" /> 87 89 </ItemGroup> -
trunk/sources/HeuristicLab.Algorithms.NSGA2/3.3/NSGA2.cs
r4017 r4045 32 32 using HeuristicLab.Optimization.Operators; 33 33 using HeuristicLab.PluginInfrastructure; 34 using HeuristicLab.Selection; 35 using HeuristicLab.Operators; 34 36 35 37 namespace HeuristicLab.Algorithms.NSGA2 { … … 131 133 get { return (SolutionsCreator)RandomCreator.Successor; } 132 134 } 135 private RankAndCrowdingSorter RankAndCrowdingSorter { 136 get { return (RankAndCrowdingSorter)SolutionsCreator.Successor; } 137 } 133 138 private NSGA2MainLoop MainLoop { 134 get { return (NSGA2MainLoop) SolutionsCreator.Successor; }139 get { return (NSGA2MainLoop)RankAndCrowdingSorter.Successor; } 135 140 } 136 141 #endregion … … 143 148 Parameters.Add(new ValueParameter<IntValue>("PopulationSize", "The size of the population of solutions.", new IntValue(100))); 144 149 Parameters.Add(new ConstrainedValueParameter<ISelector>("Selector", "The operator used to select solutions for reproduction.")); 145 Parameters.Add(new ValueParameter<PercentValue>("CrossoverProbability", "The probability that the crossover operator is applied on two parents.", new PercentValue(0. 05)));150 Parameters.Add(new ValueParameter<PercentValue>("CrossoverProbability", "The probability that the crossover operator is applied on two parents.", new PercentValue(0.9))); 146 151 Parameters.Add(new ConstrainedValueParameter<ICrossover>("Crossover", "The operator used to cross solutions.")); 147 152 Parameters.Add(new ValueParameter<PercentValue>("MutationProbability", "The probability that the mutation operator is applied on a solution.", new PercentValue(0.05))); … … 152 157 RandomCreator randomCreator = new RandomCreator(); 153 158 SolutionsCreator solutionsCreator = new SolutionsCreator(); 159 RankAndCrowdingSorter rankAndCrowdingSorter = new RankAndCrowdingSorter(); 154 160 NSGA2MainLoop mainLoop = new NSGA2MainLoop(); 155 161 OperatorGraph.InitialOperator = randomCreator; … … 163 169 164 170 solutionsCreator.NumberOfSolutionsParameter.ActualName = PopulationSizeParameter.Name; 165 solutionsCreator.Successor = mainLoop; 166 171 solutionsCreator.Successor = rankAndCrowdingSorter; 172 173 rankAndCrowdingSorter.CrowdingDistanceParameter.ActualName = "CrowdingDistance"; 174 rankAndCrowdingSorter.RankParameter.ActualName = "Rank"; 175 rankAndCrowdingSorter.Successor = mainLoop; 176 177 mainLoop.PopulationSizeParameter.ActualName = PopulationSizeParameter.Name; 167 178 mainLoop.SelectorParameter.ActualName = SelectorParameter.Name; 168 179 mainLoop.CrossoverParameter.ActualName = CrossoverParameter.Name; … … 175 186 mainLoop.ResultsParameter.ActualName = "Results"; 176 187 177 foreach (ISelector selector in ApplicationManager.Manager.GetInstances<ISelector>().Where(x => !(x is I MultiObjectiveSelector)).OrderBy(x => x.Name))188 foreach (ISelector selector in ApplicationManager.Manager.GetInstances<ISelector>().Where(x => !(x is ISingleObjectiveSelector)).OrderBy(x => x.Name)) 178 189 SelectorParameter.ValidValues.Add(selector); 179 ISelector proportionalSelector = SelectorParameter.ValidValues.FirstOrDefault(x => x.GetType().Name.Equals("ProportionalSelector"));180 if ( proportionalSelector != null) SelectorParameter.Value = proportionalSelector;181 182 // TODO: parameterize selectors190 ISelector tournamentSelector = SelectorParameter.ValidValues.FirstOrDefault(x => x.GetType().Name.Equals("CrowdedTournamentSelector")); 191 if (tournamentSelector != null) SelectorParameter.Value = tournamentSelector; 192 193 ParameterizeSelectors(); 183 194 184 195 AttachEventHandlers(); … … 193 204 #region Events 194 205 protected override void OnProblemChanged() { 195 // parameterize pretty much everything 206 ParameterizeStochasticOperator(Problem.SolutionCreator); 207 ParameterizeStochasticOperator(Problem.Evaluator); 208 foreach (IOperator op in Problem.Operators) ParameterizeStochasticOperator(op); 209 ParameterizeSolutionsCreator(); 210 ParameterizeMainLoop(); 211 ParameterizeSelectors(); 212 ParameterizeAnalyzers(); 213 ParameterizeIterationBasedOperators(); 214 UpdateCrossovers(); 215 UpdateMutators(); 216 UpdateAnalyzers(); 217 Problem.Evaluator.QualitiesParameter.ActualNameChanged += new EventHandler(Evaluator_QualitiesParameter_ActualNameChanged); 196 218 base.OnProblemChanged(); 197 219 } 198 220 protected override void Problem_SolutionCreatorChanged(object sender, EventArgs e) { 199 // parameterize SolutionCreator 221 ParameterizeStochasticOperator(Problem.SolutionCreator); 222 ParameterizeSolutionsCreator(); 200 223 base.Problem_SolutionCreatorChanged(sender, e); 201 224 } 202 225 protected override void Problem_EvaluatorChanged(object sender, EventArgs e) { 203 // parameterize StochasticOperators204 // parameterize SolutionsCreator205 // parameterize MainLoop206 // parameterize Selectors207 // parameterize Analyzers226 ParameterizeStochasticOperator(Problem.Evaluator); 227 ParameterizeSolutionsCreator(); 228 ParameterizeMainLoop(); 229 ParameterizeSelectors(); 230 ParameterizeAnalyzers(); 208 231 Problem.Evaluator.QualitiesParameter.ActualNameChanged += new EventHandler(Evaluator_QualitiesParameter_ActualNameChanged); 209 232 base.Problem_EvaluatorChanged(sender, e); 210 233 } 211 234 protected override void Problem_OperatorsChanged(object sender, EventArgs e) { 235 foreach (IOperator op in Problem.Operators) ParameterizeStochasticOperator(op); 236 ParameterizeIterationBasedOperators(); 237 UpdateCrossovers(); 238 UpdateMutators(); 239 UpdateAnalyzers(); 212 240 base.Problem_OperatorsChanged(sender, e); 213 241 } … … 215 243 base.Problem_Reset(sender, e); 216 244 } 217 218 245 private void PopulationSizeParameter_ValueChanged(object sender, EventArgs e) { 219 246 PopulationSize.ValueChanged += new EventHandler(PopulationSize_ValueChanged); 220 // parameterize Selectors247 ParameterizeSelectors(); 221 248 } 222 249 private void PopulationSize_ValueChanged(object sender, EventArgs e) { 223 // parameterize Selectors 224 } 225 250 ParameterizeSelectors(); 251 } 226 252 private void Evaluator_QualitiesParameter_ActualNameChanged(object sender, EventArgs e) { 227 // parameterize Analyzers228 // parameterize MainLoop229 // parameterize Selectors253 ParameterizeMainLoop(); 254 ParameterizeSelectors(); 255 ParameterizeAnalyzers(); 230 256 } 231 257 #endregion … … 240 266 } 241 267 } 268 private void ParameterizeSolutionsCreator() { 269 SolutionsCreator.EvaluatorParameter.ActualName = Problem.EvaluatorParameter.Name; 270 SolutionsCreator.SolutionCreatorParameter.ActualName = Problem.SolutionCreatorParameter.Name; 271 } 272 private void ParameterizeMainLoop() { 273 MainLoop.EvaluatorParameter.ActualName = Problem.EvaluatorParameter.Name; 274 MainLoop.MaximizationParameter.ActualName = Problem.MaximizationParameter.Name; 275 MainLoop.QualitiesParameter.ActualName = Problem.Evaluator.QualitiesParameter.ActualName; 276 } 277 private void ParameterizeStochasticOperator(IOperator op) { 278 if (op is IStochasticOperator) 279 ((IStochasticOperator)op).RandomParameter.ActualName = RandomCreator.RandomParameter.ActualName; 280 } 281 private void ParameterizeSelectors() { 282 foreach (ISelector selector in SelectorParameter.ValidValues) { 283 selector.CopySelected = new BoolValue(true); 284 selector.NumberOfSelectedSubScopesParameter.Value = new IntValue(2 * PopulationSizeParameter.Value.Value); 285 ParameterizeStochasticOperator(selector); 286 } 287 if (Problem != null) { 288 foreach (IMultiObjectiveSelector selector in SelectorParameter.ValidValues.OfType<IMultiObjectiveSelector>()) { 289 selector.MaximizationParameter.ActualName = Problem.MaximizationParameter.Name; 290 selector.QualitiesParameter.ActualName = Problem.Evaluator.QualitiesParameter.ActualName; 291 } 292 } 293 } 294 private void ParameterizeAnalyzers() { 295 // TODO: Parameterize Analyzers 296 } 297 private void ParameterizeIterationBasedOperators() { 298 if (Problem != null) { 299 foreach (IIterationBasedOperator op in Problem.Operators.OfType<IIterationBasedOperator>()) { 300 op.IterationsParameter.ActualName = "Generations"; 301 op.MaximumIterationsParameter.ActualName = "MaximumGenerations"; 302 } 303 } 304 } 305 private void UpdateCrossovers() { 306 ICrossover oldCrossover = CrossoverParameter.Value; 307 CrossoverParameter.ValidValues.Clear(); 308 foreach (ICrossover crossover in Problem.Operators.OfType<ICrossover>().OrderBy(x => x.Name)) 309 CrossoverParameter.ValidValues.Add(crossover); 310 if (oldCrossover != null) { 311 ICrossover crossover = CrossoverParameter.ValidValues.FirstOrDefault(x => x.GetType() == oldCrossover.GetType()); 312 if (crossover != null) CrossoverParameter.Value = crossover; 313 } 314 } 315 private void UpdateMutators() { 316 IManipulator oldMutator = MutatorParameter.Value; 317 MutatorParameter.ValidValues.Clear(); 318 foreach (IManipulator mutator in Problem.Operators.OfType<IManipulator>().OrderBy(x => x.Name)) 319 MutatorParameter.ValidValues.Add(mutator); 320 if (oldMutator != null) { 321 IManipulator mutator = MutatorParameter.ValidValues.FirstOrDefault(x => x.GetType() == oldMutator.GetType()); 322 if (mutator != null) MutatorParameter.Value = mutator; 323 } 324 } 325 private void UpdateAnalyzers() { 326 Analyzer.Operators.Clear(); 327 if (Problem != null) { 328 foreach (IAnalyzer analyzer in Problem.Operators.OfType<IAnalyzer>()) { 329 foreach (IScopeTreeLookupParameter param in analyzer.Parameters.OfType<IScopeTreeLookupParameter>()) 330 param.Depth = 1; 331 Analyzer.Operators.Add(analyzer); 332 } 333 } 334 } 242 335 #endregion 243 336 } -
trunk/sources/HeuristicLab.Algorithms.NSGA2/3.3/NSGA2MainLoop.cs
r4017 r4045 39 39 get { return (ValueLookupParameter<IRandom>)Parameters["Random"]; } 40 40 } 41 public ValueLookupParameter<BoolValue> MaximizationParameter { 42 get { return (ValueLookupParameter<BoolValue>)Parameters["Maximization"]; } 43 } 44 public ScopeTreeLookupParameter<DoubleValue> QualityParameter { 45 get { return (ScopeTreeLookupParameter<DoubleValue>)Parameters["Quality"]; } 41 public ValueLookupParameter<BoolArray> MaximizationParameter { 42 get { return (ValueLookupParameter<BoolArray>)Parameters["Maximization"]; } 43 } 44 public ScopeTreeLookupParameter<DoubleArray> QualitiesParameter { 45 get { return (ScopeTreeLookupParameter<DoubleArray>)Parameters["Qualities"]; } 46 } 47 public ValueLookupParameter<IntValue> PopulationSizeParameter { 48 get { return (ValueLookupParameter<IntValue>)Parameters["PopulationSize"]; } 46 49 } 47 50 public ValueLookupParameter<IOperator> SelectorParameter { … … 84 87 #region Create parameters 85 88 Parameters.Add(new ValueLookupParameter<IRandom>("Random", "A pseudo random number generator.")); 86 Parameters.Add(new ValueLookupParameter<BoolValue>("Maximization", "True if the problem is a maximization problem, otherwise false.")); 87 Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>("Quality", "The value which represents the quality of a solution.")); 89 Parameters.Add(new ValueLookupParameter<BoolArray>("Maximization", "True if an objective should be maximized, or false if it should be minimized.")); 90 Parameters.Add(new ScopeTreeLookupParameter<DoubleArray>("Qualities", "The vector of quality values.")); 91 Parameters.Add(new ValueLookupParameter<IntValue>("PopulationSize", "The population size.")); 88 92 Parameters.Add(new ValueLookupParameter<IOperator>("Selector", "The operator used to select solutions for reproduction.")); 89 93 Parameters.Add(new ValueLookupParameter<PercentValue>("CrossoverProbability", "The probability that the crossover operator is applied on a solution.")); … … 105 109 ChildrenCreator childrenCreator = new ChildrenCreator(); 106 110 UniformSubScopesProcessor uniformSubScopesProcessor = new UniformSubScopesProcessor(); 111 StochasticBranch crossoverStochasticBranch = new StochasticBranch(); 107 112 Placeholder crossover = new Placeholder(); 108 StochasticBranch stochasticBranch = new StochasticBranch(); 113 DefaultCrossover noCrossover = new DefaultCrossover(); 114 StochasticBranch mutationStochasticBranch = new StochasticBranch(); 109 115 Placeholder mutator = new Placeholder(); 110 116 Placeholder evaluator = new Placeholder(); 111 117 SubScopesRemover subScopesRemover = new SubScopesRemover(); 112 SubScopesProcessor subScopesProcessor2 = new SubScopesProcessor(); 113 BestSelector bestSelector = new BestSelector(); 118 MergingReducer mergingReducer = new MergingReducer(); 119 RankAndCrowdingSorter rankAndCrowdingSorter = new RankAndCrowdingSorter(); 120 LeftSelector leftSelector = new LeftSelector(); 114 121 RightReducer rightReducer = new RightReducer(); 115 MergingReducer mergingReducer = new MergingReducer();116 122 IntCounter intCounter = new IntCounter(); 117 123 Comparator comparator = new Comparator(); … … 123 129 124 130 resultsCollector1.CollectedValues.Add(new LookupParameter<IntValue>("Generations")); 125 resultsCollector1.ResultsParameter.ActualName = "Results";131 resultsCollector1.ResultsParameter.ActualName = ResultsParameter.Name; 126 132 127 133 analyzer1.Name = "Analyzer"; 128 analyzer1.OperatorParameter.ActualName = "Analyzer";134 analyzer1.OperatorParameter.ActualName = AnalyzerParameter.Name; 129 135 130 136 selector.Name = "Selector"; 131 selector.OperatorParameter.ActualName = "Selector";137 selector.OperatorParameter.ActualName = SelectorParameter.Name; 132 138 133 139 childrenCreator.ParentsPerChild = new IntValue(2); 134 140 141 crossoverStochasticBranch.ProbabilityParameter.ActualName = CrossoverProbabilityParameter.Name; 142 crossoverStochasticBranch.RandomParameter.ActualName = RandomParameter.Name; 143 135 144 crossover.Name = "Crossover"; 136 crossover.OperatorParameter.ActualName = "Crossover"; 137 138 stochasticBranch.ProbabilityParameter.ActualName = "MutationProbability"; 139 stochasticBranch.RandomParameter.ActualName = "Random"; 145 crossover.OperatorParameter.ActualName = CrossoverParameter.Name; 146 147 noCrossover.Name = "Clone parent"; 148 noCrossover.RandomParameter.ActualName = RandomParameter.Name; 149 150 mutationStochasticBranch.ProbabilityParameter.ActualName = MutationProbabilityParameter.Name; 151 mutationStochasticBranch.RandomParameter.ActualName = RandomParameter.Name; 140 152 141 153 mutator.Name = "Mutator"; 142 mutator.OperatorParameter.ActualName = "Mutator";154 mutator.OperatorParameter.ActualName = MutatorParameter.Name; 143 155 144 156 evaluator.Name = "Evaluator"; 145 evaluator.OperatorParameter.ActualName = "Evaluator";157 evaluator.OperatorParameter.ActualName = EvaluatorParameter.Name; 146 158 147 159 subScopesRemover.RemoveAllSubScopes = true; 148 160 149 bestSelector.CopySelected = new BoolValue(false); 150 bestSelector.MaximizationParameter.ActualName = "Maximization"; 151 bestSelector.NumberOfSelectedSubScopesParameter.ActualName = "Elites"; 152 bestSelector.QualityParameter.ActualName = "Quality"; 161 rankAndCrowdingSorter.CrowdingDistanceParameter.ActualName = "CrowdingDistance"; 162 rankAndCrowdingSorter.RankParameter.ActualName = "Rank"; 163 164 leftSelector.CopySelected = new BoolValue(false); 165 leftSelector.NumberOfSelectedSubScopesParameter.ActualName = PopulationSizeParameter.Name; 153 166 154 167 intCounter.Increment = new IntValue(1); … … 158 171 comparator.LeftSideParameter.ActualName = "Generations"; 159 172 comparator.ResultParameter.ActualName = "Terminate"; 160 comparator.RightSideParameter.ActualName = "MaximumGenerations";173 comparator.RightSideParameter.ActualName = MaximumGenerationsParameter.Name; 161 174 162 175 resultsCollector2.CollectedValues.Add(new LookupParameter<IntValue>("Generations")); 163 resultsCollector2.ResultsParameter.ActualName = "Results";176 resultsCollector2.ResultsParameter.ActualName = ResultsParameter.Name; 164 177 165 178 analyzer2.Name = "Analyzer"; … … 177 190 subScopesProcessor1.Operators.Add(new EmptyOperator()); 178 191 subScopesProcessor1.Operators.Add(childrenCreator); 179 subScopesProcessor1.Successor = subScopesProcessor2;192 subScopesProcessor1.Successor = mergingReducer; 180 193 childrenCreator.Successor = uniformSubScopesProcessor; 181 uniformSubScopesProcessor.Operator = crossover ;194 uniformSubScopesProcessor.Operator = crossoverStochasticBranch; 182 195 uniformSubScopesProcessor.Successor = null; 183 crossover.Successor = stochasticBranch; 184 stochasticBranch.FirstBranch = mutator; 185 stochasticBranch.SecondBranch = null; 186 stochasticBranch.Successor = evaluator; 196 crossoverStochasticBranch.FirstBranch = crossover; 197 crossoverStochasticBranch.SecondBranch = noCrossover; 198 crossoverStochasticBranch.Successor = mutationStochasticBranch; 199 crossover.Successor = null; 200 noCrossover.Successor = null; 201 mutationStochasticBranch.FirstBranch = mutator; 202 mutationStochasticBranch.SecondBranch = null; 203 mutationStochasticBranch.Successor = evaluator; 187 204 mutator.Successor = null; 188 205 evaluator.Successor = subScopesRemover; 189 206 subScopesRemover.Successor = null; 190 subScopesProcessor2.Operators.Add(bestSelector); 191 subScopesProcessor2.Operators.Add(new EmptyOperator()); 192 subScopesProcessor2.Successor = mergingReducer; 193 bestSelector.Successor = rightReducer; 194 rightReducer.Successor = null; 195 mergingReducer.Successor = intCounter; 207 mergingReducer.Successor = rankAndCrowdingSorter; 208 rankAndCrowdingSorter.Successor = leftSelector; 209 leftSelector.Successor = rightReducer; 210 rightReducer.Successor = intCounter; 196 211 intCounter.Successor = comparator; 197 212 comparator.Successor = resultsCollector2; … … 203 218 #endregion 204 219 } 205 206 public override IOperation Apply() {207 if (CrossoverParameter.ActualValue == null)208 return null;209 return base.Apply();210 }211 220 } 212 221 } -
trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/HeuristicLab.Encodings.PermutationEncoding-3.3.csproj
r3832 r4045 112 112 <Compile Include="Moves\PermutationMoveAttribute.cs" /> 113 113 <Compile Include="Moves\ThreeIndexMove.cs" /> 114 <Compile Include="Moves\ThreeOpt\StochasticSingleInsertionMoveGenerator.cs" /> 114 115 <Compile Include="Moves\ThreeOpt\TranslocationMoveAbsoluteAttribute.cs" /> 115 116 <Compile Include="Moves\ThreeOpt\ExhaustiveInsertionMoveGenerator.cs"> -
trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/ThreeOpt/TranslocationMoveSoftTabuCriterion.cs
r3376 r4045 137 137 if (attribute.Edge1Source == E3S && attribute.Edge1Target == E1T || attribute.Edge1Source == E1T && attribute.Edge1Target == E3S 138 138 || attribute.Edge1Source == E2S && attribute.Edge1Target == E3T || attribute.Edge1Source == E3T && attribute.Edge1Target == E2S 139 || attribute.Edge1Source == E1S && attribute.Edge1Target == E2T || attribute.Edge1Source == E2T && attribute.Edge1Target == E1S140 139 // if previously deleted Edge2Source-Target is readded 141 140 || attribute.Edge2Source == E3S && attribute.Edge2Target == E1T || attribute.Edge2Source == E1T && attribute.Edge2Target == E3S 142 141 || attribute.Edge2Source == E2S && attribute.Edge2Target == E3T || attribute.Edge2Source == E3T && attribute.Edge2Target == E2S 143 || attribute.Edge2Source == E1S && attribute.Edge2Target == E2T || attribute.Edge2Source == E2T && attribute.Edge2Target == E1S144 142 // if previously deleted Edge3Source-Target is readded 145 143 || attribute.Edge3Source == E3S && attribute.Edge3Target == E1T || attribute.Edge3Source == E1T && attribute.Edge3Target == E3S 146 || attribute.Edge3Source == E2S && attribute.Edge3Target == E3T || attribute.Edge3Source == E3T && attribute.Edge3Target == E2S 147 || attribute.Edge3Source == E1S && attribute.Edge3Target == E2T || attribute.Edge3Source == E2T && attribute.Edge3Target == E1S) { 144 || attribute.Edge3Source == E2S && attribute.Edge3Target == E3T || attribute.Edge3Source == E3T && attribute.Edge3Target == E2S) { 148 145 isTabu = true; 149 146 break; … … 152 149 if (attribute.Edge1Source == E3S && attribute.Edge1Target == E1T 153 150 || attribute.Edge1Source == E2S && attribute.Edge1Target == E3T 154 || attribute.Edge1Source == E1S && attribute.Edge1Target == E2T155 151 // if previously deleted Edge2Source-Target is readded 156 152 || attribute.Edge2Source == E3S && attribute.Edge2Target == E1T 157 153 || attribute.Edge2Source == E2S && attribute.Edge2Target == E3T 158 || attribute.Edge2Source == E1S && attribute.Edge2Target == E2T159 154 // if previously deleted Edge3Source-Target is readded 160 155 || attribute.Edge3Source == E3S && attribute.Edge3Target == E1T 161 || attribute.Edge3Source == E2S && attribute.Edge3Target == E3T 162 || attribute.Edge3Source == E1S && attribute.Edge3Target == E2T) { 156 || attribute.Edge3Source == E2S && attribute.Edge3Target == E3T) { 163 157 isTabu = true; 164 158 break; -
trunk/sources/HeuristicLab.Optimization/3.3/Interfaces/IMultiObjectiveProblem.cs
r2866 r4045 20 20 #endregion 21 21 22 using HeuristicLab.Core; 23 22 24 namespace HeuristicLab.Optimization { 23 25 /// <summary> … … 25 27 /// </summary> 26 28 public interface IMultiObjectiveProblem : IProblem { 29 IParameter MaximizationParameter { get; } 27 30 new IMultiObjectiveEvaluator Evaluator { get; } 28 31 } -
trunk/sources/HeuristicLab.Optimization/3.3/Interfaces/IMultiObjectiveSelector.cs
r3376 r4045 29 29 /// </summary> 30 30 public interface IMultiObjectiveSelector : ISelector { 31 ILookupParameter<BoolArray> MaximizationParameter { get; } 31 32 ILookupParameter<ItemArray<DoubleArray>> QualitiesParameter { get; } 32 33 }
Note: See TracChangeset
for help on using the changeset viewer.