Changeset 4098 for trunk/sources/HeuristicLab.Problems.DataAnalysis
- Timestamp:
- 07/25/10 01:04:14 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3/SupportVectorMachine/ParameterAdjustmentProblem/SupportVectorMachineParameterAdjustmentProblem.cs
r4068 r4098 107 107 set { BestKnownQualityParameter.Value = value; } 108 108 } 109 private List<IOperator> operators;110 109 public override IEnumerable<IOperator> Operators { 111 110 get { return operators; } … … 120 119 } 121 120 121 [Storable] 122 private List<IOperator> operators; 122 123 [Storable] 123 124 private StdDevStrategyVectorCreator strategyVectorCreator; … … 160 161 ParameterizeEvaluator(); 161 162 162 Initialize(); 163 InitializeOperators(); 164 AttachEventHandlers(); 163 165 UpdateStrategyVectorBounds(); 164 166 } … … 166 168 public override IDeepCloneable Clone(Cloner cloner) { 167 169 SupportVectorMachineParameterAdjustmentProblem clone = (SupportVectorMachineParameterAdjustmentProblem)base.Clone(cloner); 170 clone.operators = operators.Where(x => IsNotFieldReferenced(x)).Select(x => (IOperator)cloner.Clone(x)).ToList(); 168 171 clone.strategyVectorCreator = (StdDevStrategyVectorCreator)cloner.Clone(strategyVectorCreator); 172 clone.operators.Add(clone.strategyVectorCreator); 169 173 clone.strategyVectorCrossover = (StdDevStrategyVectorCrossover)cloner.Clone(strategyVectorCrossover); 174 clone.operators.Add(strategyVectorCrossover); 170 175 clone.strategyVectorManipulator = (StdDevStrategyVectorManipulator)cloner.Clone(strategyVectorManipulator); 171 clone.Initialize(); 176 clone.operators.Add(strategyVectorManipulator); 177 clone.AttachEventHandlers(); 172 178 return clone; 179 } 180 181 private bool IsNotFieldReferenced(IOperator x) { 182 return !(x == strategyVectorCreator 183 || x == strategyVectorCrossover 184 || x == strategyVectorManipulator); 173 185 } 174 186 … … 204 216 #region Helpers 205 217 [StorableHook(HookType.AfterDeserialization)] 206 private void Initialize() { 207 InitializeOperators(); 218 private void AttachEventHandlers() { 219 // Start BackwardsCompatibility3.3 (remove with 3.4) 220 if (operators == null) InitializeOperators(); 221 // End BackwardsCompatibility3.3 208 222 SolutionCreatorParameter.ValueChanged += new EventHandler(SolutionCreatorParameter_ValueChanged); 209 223 SolutionCreator.RealVectorParameter.ActualNameChanged += new EventHandler(SolutionCreator_RealVectorParameter_ActualNameChanged);
Note: See TracChangeset
for help on using the changeset viewer.