- Timestamp:
- 02/27/15 10:54:37 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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;
Note: See TracChangeset
for help on using the changeset viewer.