Changeset 13096
- Timestamp:
- 11/02/15 15:59:48 (9 years ago)
- Location:
- branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3/AlpsGeneticAlgorithm.cs
r13095 r13096 215 215 216 216 #region Helper Properties 217 private RandomCreator GlobalRandomCreator {218 get { return (RandomCreator)OperatorGraph.InitialOperator; }219 }220 217 private SolutionsCreator SolutionsCreator { 221 218 get { return OperatorGraph.Iterate().OfType<SolutionsCreator>().First(); } … … 619 616 int numberOfLayers = NumberOfLayers.Value; 620 617 AgeLimits = scheme.CalculateAgeLimits(ageGap, numberOfLayers); 621 AgeLimits[AgeLimits.Length - 1] = int.MaxValue; // last layer infinite age limit622 618 } 623 619 -
branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3/AlpsGeneticAlgorithmMainLoop.cs
r13095 r13096 43 43 get { return (ScopeTreeLookupParameter<DoubleValue>)Parameters["Quality"]; } 44 44 } 45 public ILookupParameter<IntValue> MaximumGenerationsParameter {46 get { return (ILookupParameter<IntValue>)Parameters["MaximumGenerations"]; }47 }48 45 public ILookupParameter<IOperator> AnalyzerParameter { 49 46 get { return (ILookupParameter<IOperator>)Parameters["Analyzer"]; } … … 56 53 public GeneticAlgorithmMainLoop MainOperator { 57 54 get { return OperatorGraph.Iterate().OfType<GeneticAlgorithmMainLoop>().First(); } 58 }59 public EldersEmigrator EldersEmigrator {60 get { return OperatorGraph.Iterate().OfType<EldersEmigrator>().First(); }61 55 } 62 56 -
branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3/AlpsGeneticAlgorithmMainOperator.cs
r13095 r13096 40 40 41 41 // Operator starts with calculating number of selected scopes base on plus/comma-selection replacement scheme 42 var numberOfSubScopesBranch = new ConditionalBranch() { Name = "PlusSelection?" }; 43 var numberOfSelectedSubScopesPlusCalculator = new ExpressionCalculator() { Name = "NumberOfSelectedSubScopes = PopulationSize * 2" }; 44 var numberOfSelectedSubScopesCalculator = new ExpressionCalculator() { Name = "NumberOfSelectedSubScopes = (PopulationSize - Elites) * 2" }; 42 var numberOfSelectedSubScopesCalculator = new ExpressionCalculator() { Name = "NumberOfSelectedSubScopes = 2 * (PopulationSize - if PlusSelection then 0 else Elites)" }; 45 43 var replacementBranch = new ConditionalBranch() { Name = "PlusSelection?" }; 46 44 47 45 // Set new initial operator 48 mainLoop.OperatorGraph.InitialOperator = numberOfSubScopesBranch; 49 50 numberOfSubScopesBranch.ConditionParameter.ActualName = "PlusSelection"; 51 numberOfSubScopesBranch.TrueBranch = numberOfSelectedSubScopesPlusCalculator; 52 numberOfSubScopesBranch.FalseBranch = numberOfSelectedSubScopesCalculator; 53 numberOfSubScopesBranch.Successor = selector; 54 55 numberOfSelectedSubScopesPlusCalculator.CollectedValues.Add(new LookupParameter<IntValue>("PopulationSize")); 56 numberOfSelectedSubScopesPlusCalculator.ExpressionResultParameter.ActualName = "NumberOfSelectedSubScopes"; 57 numberOfSelectedSubScopesPlusCalculator.ExpressionParameter.Value = new StringValue("PopulationSize 2 * toint"); 46 mainLoop.OperatorGraph.InitialOperator = numberOfSelectedSubScopesCalculator; 58 47 59 48 numberOfSelectedSubScopesCalculator.CollectedValues.Add(new LookupParameter<IntValue>("PopulationSize")); 60 49 numberOfSelectedSubScopesCalculator.CollectedValues.Add(new LookupParameter<IntValue>("Elites")); 50 numberOfSelectedSubScopesCalculator.CollectedValues.Add(new LookupParameter<BoolValue>("PlusSelection")); 61 51 numberOfSelectedSubScopesCalculator.ExpressionResultParameter.ActualName = "NumberOfSelectedSubScopes"; 62 numberOfSelectedSubScopesCalculator.ExpressionParameter.Value = new StringValue("PopulationSize Elites - 2 * toint"); 52 numberOfSelectedSubScopesCalculator.ExpressionParameter.Value = new StringValue("PopulationSize 0 Elites PlusSelection if - 2 * toint"); 53 numberOfSelectedSubScopesCalculator.Successor = selector; 63 54 64 55 // Use Elitism or Plus-Selection as replacement strategy -
branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3/LayerCreator.cs
r13095 r13096 32 32 33 33 namespace HeuristicLab.Algorithms.ALPS { 34 [Item("LayerCreator", "An operator which creates a new layer by cloning the oldest one and setting the variables accordingly.")]34 [Item("LayerCreator", "An operator which creates a new layer by cloning the current oldest one.")] 35 35 [StorableClass] 36 36 public sealed class LayerCreator : SingleSuccessorOperator { … … 106 106 } 107 107 } 108 109 108 } 110 109 } -
branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3/LayerOpener.cs
r13095 r13096 30 30 31 31 namespace HeuristicLab.Algorithms.ALPS { 32 [Item("LayerOpener", " ")]32 [Item("LayerOpener", "An operator that encapsules opening new layer for ALPS when required.")] 33 33 [StorableClass] 34 34 public sealed class LayerOpener : AlgorithmOperator { -
branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3/LayerReseeder.cs
r13095 r13096 31 31 32 32 namespace HeuristicLab.Algorithms.ALPS { 33 [Item("LayerReseeder", " ")]33 [Item("LayerReseeder", "An operator that encapsulates the reseeding of the lowest layer in ALPS.")] 34 34 [StorableClass] 35 35 public sealed class LayerReseeder : SingleSuccessorOperator, IOperatorGraphOperator { … … 81 81 82 82 var subScopesCounter = new SubScopesCounter(); 83 //var continuousReseedingBranch = new ConditionalBranch() { Name = "ContinuousReseeding?" };84 //var reseedingIntervalCalculator = new ExpressionCalculator() { Name = "DoReseeding = Generation % AgeGap == 0" };85 //var doReseedingBranch = new ConditionalBranch() { Name = "DoReseeding?" };86 83 var numberOfReplacedCalculator = new ExpressionCalculator() { Name = "NumberOfReplaced = if ContinuousReseeding then max(LayerPopulationSize - (PopulationSize - PopulationSize / AgeGap), 0) else PopulationSize" }; 87 84 var numberOfNewIndividualsCalculator = new ExpressionCalculator() { Name = "NumberOfNewIndividuals = PopulationSize - (LayerPopulatioSize - NumberOfReplaced)" }; … … 96 93 var subScopesCounter2 = new SubScopesCounter(); 97 94 98 //OperatorGraph.InitialOperator = continuousReseedingBranch;99 95 OperatorGraph.InitialOperator = subScopesCounter; 100 96 … … 102 98 subScopesCounter.AccumulateParameter.Value = new BoolValue(false); 103 99 subScopesCounter.Successor = numberOfReplacedCalculator; 104 105 //continuousReseedingBranch.ConditionParameter.ActualName = "ContinuousReseeding";106 //continuousReseedingBranch.TrueBranch = numberOfChildrenCalculator;107 //continuousReseedingBranch.FalseBranch = reseedingIntervalCalculator;108 109 //reseedingIntervalCalculator.CollectedValues.Add(new LookupParameter<IntValue>("Generation"));110 //reseedingIntervalCalculator.CollectedValues.Add(new LookupParameter<IntValue>("AgeGap"));111 //reseedingIntervalCalculator.ExpressionResultParameter.ActualName = "DoReseeding";112 //reseedingIntervalCalculator.ExpressionParameter.Value = new StringValue("Generation AgeGap % 0 ==");113 //reseedingIntervalCalculator.Successor = doReseedingBranch;114 115 //doReseedingBranch.ConditionParameter.ActualName = "DoReseeding";116 //doReseedingBranch.TrueBranch = numberOfChildrenCalculator;117 100 118 101 numberOfReplacedCalculator.CollectedValues.Add(new LookupParameter<BoolValue>("ContinuousReseeding")); -
branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3/WeightingReducer.cs
r13046 r13096 77 77 return base.Apply(); 78 78 } 79 80 79 } 81 80 }
Note: See TracChangeset
for help on using the changeset viewer.