Changeset 14829
- Timestamp:
- 04/06/17 11:22:40 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/VariableBase.cs
r14826 r14829 34 34 get { return weightMu; } 35 35 set { 36 if (value != weightMu) {36 if (value != weightMu) { 37 37 weightMu = value; 38 38 OnChanged(EventArgs.Empty); … … 45 45 get { return weightSigma; } 46 46 set { 47 if (weightSigma < 0.0) throw new ArgumentException("Negative sigma is not allowed.");48 if (value != weightSigma) {47 if (weightSigma < 0.0) throw new ArgumentException("Negative sigma is not allowed."); 48 if (value != weightSigma) { 49 49 weightSigma = value; 50 50 OnChanged(EventArgs.Empty); … … 57 57 get { return weightManipulatorMu; } 58 58 set { 59 if (value != weightManipulatorMu) {59 if (value != weightManipulatorMu) { 60 60 weightManipulatorMu = value; 61 61 OnChanged(EventArgs.Empty); … … 68 68 get { return weightManipulatorSigma; } 69 69 set { 70 if (weightManipulatorSigma < 0.0) throw new ArgumentException("Negative sigma is not allowed.");71 if (value != weightManipulatorSigma) {70 if (weightManipulatorSigma < 0.0) throw new ArgumentException("Negative sigma is not allowed."); 71 if (value != weightManipulatorSigma) { 72 72 weightManipulatorSigma = value; 73 73 OnChanged(EventArgs.Empty); … … 80 80 get { return multiplicativeWeightManipulatorSigma; } 81 81 set { 82 if (multiplicativeWeightManipulatorSigma < 0.0) throw new ArgumentException("Negative sigma is not allowed.");83 if (value != multiplicativeWeightManipulatorSigma) {82 if (multiplicativeWeightManipulatorSigma < 0.0) throw new ArgumentException("Negative sigma is not allowed."); 83 if (value != multiplicativeWeightManipulatorSigma) { 84 84 multiplicativeWeightManipulatorSigma = value; 85 85 OnChanged(EventArgs.Empty); … … 94 94 get { return variableChangeProbability; } 95 95 set { 96 if (value < 0 || value > 1.0) throw new ArgumentException("Variable change probability must lie in the interval [0..1]");96 if (value < 0 || value > 1.0) throw new ArgumentException("Variable change probability must lie in the interval [0..1]"); 97 97 variableChangeProbability = value; 98 98 } … … 104 104 get { return variableNames; } 105 105 set { 106 if (value == null) throw new ArgumentNullException();106 if (value == null) throw new ArgumentNullException(); 107 107 variableNames.Clear(); 108 108 variableNames.AddRange(value); … … 116 116 get { return allVariableNames; } 117 117 set { 118 if (value == null) throw new ArgumentNullException();118 if (value == null) throw new ArgumentNullException(); 119 119 allVariableNames.Clear(); 120 120 allVariableNames.AddRange(value); … … 124 124 public override bool Enabled { 125 125 get { 126 if (variableNames.Count == 0) return false;126 if (variableNames.Count == 0) return false; 127 127 return base.Enabled; 128 128 } 129 129 set { 130 if (variableNames.Count == 0) base.Enabled = false;130 if (variableNames.Count == 0) base.Enabled = false; 131 131 else base.Enabled = value; 132 132 } … … 146 146 [StorableHook(HookType.AfterDeserialization)] 147 147 private void AfterDeserialization() { 148 if (allVariableNames == null || (allVariableNames.Count == 0 && variableNames.Count > 0)) {148 if (allVariableNames == null || (allVariableNames.Count == 0 && variableNames.Count > 0)) { 149 149 allVariableNames = variableNames; 150 150 } … … 167 167 multiplicativeWeightManipulatorSigma = original.multiplicativeWeightManipulatorSigma; 168 168 variableChangeProbability = original.variableChangeProbability; 169 169 } 170 170 protected VariableBase(string name, string description) 171 171 : base(name, description) {
Note: See TracChangeset
for help on using the changeset viewer.