Changeset 12092 for branches/ALPS
- Timestamp:
- 02/27/15 10:54:37 (10 years ago)
- Location:
- branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3
- Files:
-
- 1 deleted
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3/AlpsGeneticAlgorithm.cs
r12071 r12092 274 274 275 275 layerVariableCreator.CollectedValues.Add(new ValueParameter<IntValue>("Layer", new IntValue(0))); 276 //layerVariableCreator.CollectedValues.Add(new ValueParameter<ResultCollection>("Results", new ResultCollection()));277 276 layerVariableCreator.Successor = layerSolutionsCreator; 278 277 … … 457 456 MainLoop.MainOperator.MaximizationParameter.ActualName = Problem.MaximizationParameter.Name; 458 457 MainLoop.MainOperator.QualityParameter.ActualName = Problem.Evaluator.QualityParameter.ActualName; 459 MainLoop.EldersEmigrator.MaximizationParameter.ActualName = Problem.MaximizationParameter.Name;460 MainLoop.EldersEmigrator.QualityParameter.ActualName = Problem.Evaluator.QualityParameter.ActualName;461 458 MainLoop.LayerUpdator.SolutionsCreator.NumberOfSolutionsParameter.ActualName = PopulationSizeParameter.Name; 462 459 } -
branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3/EldersEmigrator.cs
r12035 r12092 24 24 using HeuristicLab.Data; 25 25 using HeuristicLab.Operators; 26 using HeuristicLab.Optimization.Operators; 26 27 using HeuristicLab.Parameters; 27 28 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; … … 32 33 [StorableClass] 33 34 public sealed class EldersEmigrator : AlgorithmOperator { 34 35 public IValueLookupParameter<BoolValue> MaximizationParameter {36 get { return (IValueLookupParameter<BoolValue>)Parameters["Maximization"]; }37 }38 public IScopeTreeLookupParameter<DoubleValue> QualityParameter {39 get { return (IScopeTreeLookupParameter<DoubleValue>)Parameters["Quality"]; }40 }41 42 35 [StorableConstructor] 43 36 private EldersEmigrator(bool deserializing) … … 50 43 public EldersEmigrator() 51 44 : base() { 52 Parameters.Add(new ValueLookupParameter<BoolValue>("Maximization", "True if the problem is a maximization problem, otherwise false."));53 Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>("Quality", "The value which represents the quality of a solution."));54 55 45 var selectorProsessor = new UniformSubScopesProcessor(); 56 46 var eldersSelector = new EldersSelector(); … … 59 49 var mergingReducer = new MergingReducer(); 60 50 var subScopesCounter = new SubScopesCounter(); 61 // TODO: if expression calculator supports int, use expression calculator 62 var countCalculator = new MergingReducerCalculator() { Name = "LayerPopulationSize = Min(LayerPopulationSize, PopulationSize)" }; 63 //var countCalculator = new ExpressionCalculator() { Name = "NumSubScopes = Min(NumSubScopes, PopulationSize)" }; 51 var countCalculator = new ExpressionCalculator() { Name = "LayerPopulationSize = Min(LayerPopulationSize, PopulationSize)" }; 64 52 var bestSelector = new BestSelector(); 65 53 var rightReducer = new RightReducer(); … … 85 73 subScopesCounter.Successor = countCalculator; 86 74 87 //countCalculator.CollectedValues.Add(new LookupParameter<IntValue>("PopulationSize"));88 //countCalculator.CollectedValues.Add(new LookupParameter<IntValue>("NumSubScopes"));89 //countCalculator.ExpressionParameter.Value = new StringValue("NumSubScopes PopulationSize NumSubScopes PopulationSize < if");90 //countCalculator.ExpressionResultParameter.ActualName = "NumSubScopes";75 countCalculator.CollectedValues.Add(new LookupParameter<IntValue>("PopulationSize")); 76 countCalculator.CollectedValues.Add(new LookupParameter<IntValue>("LayerPopulationSize")); 77 countCalculator.ExpressionParameter.Value = new StringValue("LayerPopulationSize PopulationSize LayerPopulationSize PopulationSize < if toint"); 78 countCalculator.ExpressionResultParameter.ActualName = "LayerPopulationSize"; 91 79 countCalculator.Successor = bestSelector; 92 80 93 81 bestSelector.NumberOfSelectedSubScopesParameter.ActualName = "LayerPopulationSize"; 94 bestSelector.QualityParameter.ActualName = QualityParameter.Name;95 bestSelector.MaximizationParameter.ActualName = MaximizationParameter.Name;96 82 bestSelector.CopySelected = new BoolValue(false); 97 83 bestSelector.Successor = rightReducer; -
branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3/HeuristicLab.Algorithms.ALPS-3.3.csproj
r12084 r12092 147 147 <Compile Include="NumberOfSelectedSubScopesCalculator.cs" /> 148 148 <Compile Include="OpenNewLayerCalculator.cs" /> 149 <Compile Include="MergingReducerCalculator.cs" />150 149 <Compile Include="Plugin.cs" /> 151 150 <Compile Include="Properties\AssemblyInfo.cs" />
Note: See TracChangeset
for help on using the changeset viewer.