Changeset 10357
- Timestamp:
- 01/20/14 14:52:57 (11 years ago)
- Location:
- branches/DataAnalysis.IslandAlgorithms/HeuristicLab.Algorithms.DataAnalysis.Symbolic/3.3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DataAnalysis.IslandAlgorithms/HeuristicLab.Algorithms.DataAnalysis.Symbolic/3.3/SymbolicDataAnalysisIslandGeneticAlgorithm.cs
r10356 r10357 79 79 set { FixedSamplesPartitionsParameter.Value = value; } 80 80 } 81 82 private readonly ScopeTreeAssigner<IntValue> islandIndexAssigner; 81 83 #endregion 82 84 … … 102 104 Parameters.Add(new LookupParameter<ISingleObjectiveEvaluator>(ProblemEvaluatorParameterName, "Internal parameter for name translation", "Evaluator")); 103 105 104 ScopeTreeAssigner<IntValue>islandIndexAssigner = new ScopeTreeAssigner<IntValue>();106 islandIndexAssigner = new ScopeTreeAssigner<IntValue>(); 105 107 islandIndexAssigner.Name = "Insert island index"; 106 108 islandIndexAssigner.LeftSideParameter.ActualName = IslandIndexParameterName; … … 129 131 if (Problem != null) Problem.FitnessCalculationPartition.ValueChanged += Problem_Reset; 130 132 NumberOfIslandsParameter.ValueChanged += NumberOfIslandsParameter_ValueChanged; 131 NumberOfIslandsParameter.Value.ValueChanged += (o, ev) => RecalculateFixedSamplesPartitions();133 NumberOfIslandsParameter.Value.ValueChanged += (o, ev) => NumberOfIslandsParameterValue_Changed(); 132 134 FixedSamplesParameter.Value.ValueChanged += (o, e) => { 133 135 RecalculateFixedSamplesPartitions(); … … 170 172 171 173 private void NumberOfIslandsParameter_ValueChanged(object sender, EventArgs e) { 172 NumberOfIslands.ValueChanged += (o, ev) => RecalculateFixedSamplesPartitions(); 174 NumberOfIslands.ValueChanged += (o, ev) => NumberOfIslandsParameterValue_Changed(); 175 NumberOfIslandsParameterValue_Changed(); 176 } 177 private void NumberOfIslandsParameterValue_Changed() { 178 var readonlyIslandIndexes = Enumerable.Range(0, NumberOfIslands.Value).Select(x => (IntValue)new IntValue(x).AsReadOnly()); 179 islandIndexAssigner.RightSideParameter.Value = new ItemArray<IntValue>(readonlyIslandIndexes); 173 180 RecalculateFixedSamplesPartitions(); 174 181 } -
branches/DataAnalysis.IslandAlgorithms/HeuristicLab.Algorithms.DataAnalysis.Symbolic/3.3/SymbolicDataAnalysisIslandOffspringSelectionGeneticAlgorithm.cs
r10356 r10357 79 79 set { FixedSamplesPartitionsParameter.Value = value; } 80 80 } 81 82 private readonly ScopeTreeAssigner<IntValue> islandIndexAssigner; 81 83 #endregion 82 84 … … 102 104 Parameters.Add(new LookupParameter<ISingleObjectiveEvaluator>(ProblemEvaluatorParameterName, "Internal parameter for name translation", "Evaluator")); 103 105 104 ScopeTreeAssigner<IntValue>islandIndexAssigner = new ScopeTreeAssigner<IntValue>();106 islandIndexAssigner = new ScopeTreeAssigner<IntValue>(); 105 107 islandIndexAssigner.Name = "Insert island index"; 106 108 islandIndexAssigner.LeftSideParameter.ActualName = IslandIndexParameterName; … … 125 127 if (Problem != null) Problem.FitnessCalculationPartition.ValueChanged += Problem_Reset; 126 128 NumberOfIslandsParameter.ValueChanged += NumberOfIslandsParameter_ValueChanged; 127 NumberOfIslandsParameter.Value.ValueChanged += (o, ev) => RecalculateFixedSamplesPartitions();129 NumberOfIslandsParameter.Value.ValueChanged += (o, ev) => NumberOfIslandsParameterValue_Changed(); 128 130 FixedSamplesParameter.Value.ValueChanged += (o, e) => { 129 131 RecalculateFixedSamplesPartitions(); … … 166 168 167 169 private void NumberOfIslandsParameter_ValueChanged(object sender, EventArgs e) { 168 NumberOfIslands.ValueChanged += (o, ev) => RecalculateFixedSamplesPartitions(); 170 NumberOfIslands.ValueChanged += (o, ev) => NumberOfIslandsParameterValue_Changed(); 171 NumberOfIslandsParameterValue_Changed(); 172 } 173 private void NumberOfIslandsParameterValue_Changed() { 174 var readonlyIslandIndexes = Enumerable.Range(0, NumberOfIslands.Value).Select(x => (IntValue)new IntValue(x).AsReadOnly()); 175 islandIndexAssigner.RightSideParameter.Value = new ItemArray<IntValue>(readonlyIslandIndexes); 169 176 RecalculateFixedSamplesPartitions(); 170 177 }
Note: See TracChangeset
for help on using the changeset viewer.