- Timestamp:
- 02/06/12 17:50:17 (13 years ago)
- Location:
- branches/HeuristicLab.TimeSeries
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.TimeSeries
- Property svn:ignore
-
old new 3 3 *.resharper 4 4 *.suo 5 *.user 5 6 *.vsp 6 7 Doxygen 8 FxCopResults.txt 7 9 Google.ProtocolBuffers-0.9.1.dll 8 10 HeuristicLab 3.3.5.1.ReSharper.user
-
- Property svn:mergeinfo changed
- Property svn:ignore
-
branches/HeuristicLab.TimeSeries/HeuristicLab.Optimization/3.3/Problems/Problem.cs
r7268 r7460 44 44 45 45 [StorableConstructor] 46 protected Problem(bool deserializing) 47 : base(deserializing) { 48 operators = new OperatorCollection(); // operators must never be null 49 } 46 protected Problem(bool deserializing) : base(deserializing) { } 50 47 protected Problem(Problem original, Cloner cloner) 51 48 : base(original, cloner) { 52 operators = cloner.Clone(original.operators);53 49 RegisterEventHandlers(); 54 50 } … … 56 52 protected Problem() 57 53 : base() { 58 operators = new OperatorCollection(); 59 Parameters.Add(new FixedValueParameter<OperatorCollection>(OperatorsParameterName, "The operators that the problem provides to the algorithms.", operators, false)); 54 Parameters.Add(new FixedValueParameter<OperatorCollection>(OperatorsParameterName, "The operators that the problem provides to the algorithms.", new OperatorCollection(), false)); 60 55 OperatorsParameter.Hidden = true; 61 56 RegisterEventHandlers(); … … 64 59 [StorableHook(HookType.AfterDeserialization)] 65 60 private void AfterDeserialization() { 66 // BackwardsCompatibility3.367 #region Backwards compatible code, remove with 3.468 if (!Parameters.ContainsKey(OperatorsParameterName)) {69 Parameters.Add(new FixedValueParameter<OperatorCollection>(OperatorsParameterName, "The operators that the problem provides to the algorithms.", operators, false));70 OperatorsParameter.Hidden = true;71 }72 #endregion73 61 RegisterEventHandlers(); 74 62 } … … 81 69 82 70 #region properties 83 private OperatorCollection operators; 71 // BackwardsCompatibility3.3 72 #region Backwards compatible code, remove with 3.4 84 73 [Storable(Name = "Operators")] 85 74 private IEnumerable<IOperator> StorableOperators { 86 get { return operators; } 87 set { operators = new OperatorCollection(value); } 75 get { return null; } 76 set { 77 if (!Parameters.ContainsKey(OperatorsParameterName)) { 78 Parameters.Add(new FixedValueParameter<OperatorCollection>(OperatorsParameterName, "The operators that the problem provides to the algorithms.", new OperatorCollection(value), false)); 79 OperatorsParameter.Hidden = true; 80 } 81 } 88 82 } 83 #endregion 89 84 protected OperatorCollection Operators { 90 get { return this.operators; } 85 get { 86 // BackwardsCompatibility3.3 87 #region Backwards compatible code, remove with 3.4 88 if (!Parameters.ContainsKey(OperatorsParameterName)) { 89 Parameters.Add(new FixedValueParameter<OperatorCollection>(OperatorsParameterName, "The operators that the problem provides to the algorithms.", new OperatorCollection(), false)); 90 OperatorsParameter.Hidden = true; 91 } 92 #endregion 93 return OperatorsParameter.Value; 94 } 91 95 } 92 IEnumerable<IOperator> IProblem.Operators { get { return operators; } }96 IEnumerable<IOperator> IProblem.Operators { get { return Operators; } } 93 97 #endregion 94 98 -
branches/HeuristicLab.TimeSeries/HeuristicLab.Optimization/3.3/Problems/SingleObjectiveHeuristicOptimizationProblem.cs
- Property svn:mergeinfo changed
/trunk/sources/HeuristicLab.Optimization/3.3/Problems/SingleObjectiveHeuristicOptimizationProblem.cs merged: 7440,7442
r7268 r7460 41 41 : base() { 42 42 Parameters.Add(new ValueParameter<BoolValue>(MaximizationParameterName, "Set to false if the problem should be minimized.", new BoolValue())); 43 Parameters.Add(new OptionalValueParameter<DoubleValue>(BestKnownQualityParameterName, "The quality of the best known solution of this problem." , new DoubleValue()));43 Parameters.Add(new OptionalValueParameter<DoubleValue>(BestKnownQualityParameterName, "The quality of the best known solution of this problem.")); 44 44 } 45 45 … … 47 47 : base(evaluator, solutionCreator) { 48 48 Parameters.Add(new ValueParameter<BoolValue>(MaximizationParameterName, "Set to false if the problem should be minimized.", new BoolValue())); 49 Parameters.Add(new OptionalValueParameter<DoubleValue>(BestKnownQualityParameterName, "The quality of the best known solution of this problem." , new DoubleValue()));49 Parameters.Add(new OptionalValueParameter<DoubleValue>(BestKnownQualityParameterName, "The quality of the best known solution of this problem.")); 50 50 } 51 51 … … 68 68 public BoolValue Maximization { 69 69 get { return MaximizationParameter.Value; } 70 protectedset { MaximizationParameter.Value = value; }70 set { MaximizationParameter.Value = value; } 71 71 } 72 72 … … 79 79 public DoubleValue BestKnownQuality { 80 80 get { return BestKnownQualityParameter.Value; } 81 protectedset { BestKnownQualityParameter.Value = value; }81 set { BestKnownQualityParameter.Value = value; } 82 82 } 83 83 - Property svn:mergeinfo changed
-
branches/HeuristicLab.TimeSeries/HeuristicLab.Optimization/3.3/Problems/UserDefinedProblem.cs
r7268 r7460 121 121 [StorableHook(HookType.AfterDeserialization)] 122 122 private void AfterDeserialization() { 123 AttachEventHandlers();123 RegisterEventHandlers(); 124 124 } 125 125 public UserDefinedProblem() … … 132 132 Parameters.Add(new ValueParameter<ItemList<IOperator>>("Operators", "The operators that are passed to the algorithm.", new ItemList<IOperator>())); 133 133 134 AttachEventHandlers();134 RegisterEventHandlers(); 135 135 } 136 136 137 137 private UserDefinedProblem(UserDefinedProblem original, Cloner cloner) 138 138 : base(original, cloner) { 139 AttachEventHandlers();139 RegisterEventHandlers(); 140 140 } 141 141 public override IDeepCloneable Clone(Cloner cloner) { … … 194 194 195 195 #region Helpers 196 private void AttachEventHandlers() {196 private void RegisterEventHandlers() { 197 197 SolutionCreatorParameter.ValueChanged += new EventHandler(SolutionCreatorParameter_ValueChanged); 198 198 EvaluatorParameter.ValueChanged += new EventHandler(EvaluatorParameter_ValueChanged);
Note: See TracChangeset
for help on using the changeset viewer.