- Timestamp:
- 03/05/15 13:35:38 (10 years ago)
- Location:
- branches/ALPS
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ALPS/HeuristicLab.Algorithms.ALPS.SteadyState/3.3/AlpsSsGeneticAlgorithm.cs
r12136 r12138 102 102 #endregion 103 103 104 private AlpsSsGeneticAlgorithmMainLoop MainLoop { 105 get { return OperatorGraph.Iterate().OfType<AlpsSsGeneticAlgorithmMainLoop>().First(); } 106 } 107 104 108 [StorableConstructor] 105 109 private AlpsSsGeneticAlgorithm(bool deserializing) … … 160 164 initializeAgeProcessor.Successor = initializeLayerPopulationSize; 161 165 162 initializeAge.CollectedValues.Add(new ValueParameter<IntValue>(" Age", new IntValue(1)));166 initializeAge.CollectedValues.Add(new ValueParameter<IntValue>("EvalsCreated", new IntValue(1))); 163 167 164 168 initializeLayerPopulationSize.ValueParameter.ActualName = "LayerPopulationSize"; … … 237 241 } 238 242 private void ParameterizeMainLoop() { 239 //MainLoop.MaximizationParameter.ActualName = Problem.MaximizationParameter.Name;240 //MainLoop.QualityParameter.ActualName = Problem.Evaluator.QualityParameter.ActualName;243 MainLoop.MaximizationParameter.ActualName = Problem.MaximizationParameter.Name; 244 MainLoop.QualityParameter.ActualName = Problem.Evaluator.QualityParameter.ActualName; 241 245 //MainLoop.MainOperator.EvaluatorParameter.ActualName = Problem.EvaluatorParameter.Name; 242 246 //MainLoop.MainOperator.MaximizationParameter.ActualName = Problem.MaximizationParameter.Name; … … 247 251 foreach (var selector in SelectorParameter.ValidValues) { 248 252 selector.CopySelected = new BoolValue(true); 249 // Explicit setting of NumberOfSelectedSubScopesParameter is not required anymore because the NumberOfSelectedSubScopesCalculator calculates it itself 250 //selector.NumberOfSelectedSubScopesParameter.Value = new IntValue(2 * (PopulationSize - Elites.Value)); 253 selector.NumberOfSelectedSubScopesParameter.Value = new IntValue(2); 251 254 selector.NumberOfSelectedSubScopesParameter.Hidden = true; 252 255 ParameterizeStochasticOperatorForLayer(selector); … … 272 275 } 273 276 277 protected override void ParameterizeStochasticOperator(IOperator @operator) { 278 var stochasticOperator = @operator as IStochasticOperator; 279 if (stochasticOperator != null) { 280 stochasticOperator.RandomParameter.ActualName = "Random"; 281 stochasticOperator.RandomParameter.Hidden = true; 282 } 283 } 274 284 protected override void ParameterizeStochasticOperatorForLayer(IOperator @operator) { 275 285 var stochasticOperator = @operator as IStochasticOperator; 276 286 if (stochasticOperator != null) { 277 stochasticOperator.RandomParameter.ActualName = GlobalRandomCreator.Name;287 stochasticOperator.RandomParameter.ActualName = "Random"; 278 288 stochasticOperator.RandomParameter.Hidden = true; 279 289 } 280 290 } 281 282 291 #endregion 283 292 -
branches/ALPS/HeuristicLab.Algorithms.ALPS.SteadyState/3.3/AlpsSsGeneticAlgorithmMainLoop.cs
r12136 r12138 20 20 #endregion 21 21 22 using System.Linq; 22 23 using HeuristicLab.Common; 23 24 using HeuristicLab.Core; 24 25 using HeuristicLab.Data; 25 26 using HeuristicLab.Operators; 27 using HeuristicLab.Optimization; 26 28 using HeuristicLab.Optimization.Operators; 27 29 using HeuristicLab.Parameters; … … 88 90 var matingPoolSizeMin2 = new Comparator() { Name = "ValidParents = MatingPoolSize >= 2" }; 89 91 var validParentsBranch = new ConditionalBranch() { Name = "ValidParents?" }; 90 var mainOperator = new EmptyOperator(); // TODO92 var mainOperator = new AlpsSsGeneticAlgorithmMainOperator(); 91 93 var reactivateInit = new Assigner() { Name = "DoInit = true" }; 92 94 var resetNextIndex = new Assigner() { Name = "NextInit = 1" }; … … 94 96 var clearMatingPool = new SubScopesRemover() { Name = "Clear WorkingScope" }; 95 97 var tryMoveUp = new EmptyOperator() { Name = "Try Move Up" }; // TODO 96 var setNewIndividual = new EmptyOperator() { Name = "Set New Individual" }; 98 var setNewIndividual = new EmptyOperator() { Name = "Set New Individual" }; // TODO 99 var incrIterations = new IntCounter() { Name = "Incr. Iterations" }; 100 var analyzer = new Placeholder() { Name = "Analyzer (Placeholder)" }; 97 101 var iterationsComparator = new Comparator() { Name = "Iterations >= MaximumIterations" }; 98 102 var terminateBranch = new ConditionalBranch() { Name = "Terminate?" }; … … 105 109 variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("OpenLayers", new IntValue(1))); 106 110 variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("TargetIndex", new IntValue(0))); 111 variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("Iterations")); 107 112 variableCreator.Successor = randomScopeProcessor; 108 113 … … 176 181 matingPoolSizeMin2.Successor = validParentsBranch; 177 182 183 validParentsBranch.ConditionParameter.ActualName = "ValidParents"; 178 184 validParentsBranch.TrueBranch = mainOperator; 179 185 validParentsBranch.FalseBranch = reactivateInit; … … 195 201 tryMoveUp.Successor = setNewIndividual; 196 202 197 setNewIndividual.Successor = iterationsComparator; 203 setNewIndividual.Successor = incrIterations; 204 205 incrIterations.ValueParameter.ActualName = "Iterations"; 206 incrIterations.Increment = new IntValue(1); 207 incrIterations.Successor = analyzer; 208 209 analyzer.OperatorParameter.ActualName = "Analyzer"; 210 analyzer.Successor = iterationsComparator; 198 211 199 212 iterationsComparator.Comparison = new Comparison(ComparisonType.GreaterOrEqual); … … 205 218 terminateBranch.ConditionParameter.ActualName = "Terminate"; 206 219 terminateBranch.FalseBranch = randomScopeProcessor; 207 208 209 } 210 220 } 211 221 } 212 222 } -
branches/ALPS/HeuristicLab.Algorithms.ALPS.SteadyState/3.3/HeuristicLab.Algorithms.ALPS.SteadyState-3.3.csproj
r12136 r12138 136 136 <Compile Include="AlpsSsGeneticAlgorithm.cs" /> 137 137 <Compile Include="AlpsSsGeneticAlgorithmMainLoop.cs" /> 138 <Compile Include="AlpsSsGeneticAlgorithmMainOperator.cs" /> 138 139 <Compile Include="Properties\AssemblyInfo.cs" /> 139 140 <Compile Include="Plugin.cs" /> -
branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3/Alps.cs
r12120 r12138 309 309 var stochasticOperator = @operator as IStochasticOperator; 310 310 if (stochasticOperator != null) { 311 stochasticOperator.RandomParameter.ActualName = GlobalRandomCreator.RandomParameter.ActualName;311 stochasticOperator.RandomParameter.ActualName = "GlobalRandom"; 312 312 stochasticOperator.RandomParameter.Hidden = true; 313 313 }
Note: See TracChangeset
for help on using the changeset viewer.