- Timestamp:
- 10/29/12 14:30:35 (12 years ago)
- Location:
- trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Variable.cs
r8798 r8853 101 101 } 102 102 103 private List<string> allVariableNames; 104 [Storable] 105 public IEnumerable<string> AllVariableNames { 106 get { return allVariableNames; } 107 set { 108 if (value == null) throw new ArgumentNullException(); 109 allVariableNames.Clear(); 110 allVariableNames.AddRange(value); 111 VariableNames = value; 112 } 113 } 114 103 115 public override bool Enabled { 104 116 get { … … 123 135 #endregion 124 136 137 [StorableHook(HookType.AfterDeserialization)] 138 private void AfterDeserialization() { 139 if (allVariableNames == null || (allVariableNames.Count == 0 && variableNames.Count > 0)) { 140 allVariableNames = variableNames; 141 } 142 } 143 125 144 [StorableConstructor] 126 145 protected Variable(bool deserializing) 127 146 : base(deserializing) { 128 147 variableNames = new List<string>(); 148 allVariableNames = new List<string>(); 129 149 } 130 150 protected Variable(Variable original, Cloner cloner) … … 133 153 weightSigma = original.weightSigma; 134 154 variableNames = new List<string>(original.variableNames); 155 allVariableNames = new List<string>(original.allVariableNames); 135 156 weightManipulatorMu = original.weightManipulatorMu; 136 157 weightManipulatorSigma = original.weightManipulatorSigma; … … 146 167 multiplicativeWeightManipulatorSigma = 0.03; 147 168 variableNames = new List<string>(); 169 allVariableNames = new List<string>(); 148 170 } 149 171 -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/VariableCondition.cs
r8099 r8853 91 91 } 92 92 93 private List<string> allVariableNames; 94 [Storable] 95 public IEnumerable<string> AllVariableNames { 96 get { return allVariableNames; } 97 set { 98 if (value == null) throw new ArgumentNullException(); 99 allVariableNames.Clear(); 100 allVariableNames.AddRange(value); 101 VariableNames = value; 102 } 103 } 104 93 105 [Storable] 94 106 private double slopeInitializerMu; … … 151 163 152 164 #region persistence and cloning 165 [StorableHook(HookType.AfterDeserialization)] 166 private void AfterDeserialization() { 167 if (allVariableNames == null || (allVariableNames.Count == 0 && variableNames.Count > 0)) { 168 allVariableNames = variableNames; 169 } 170 } 171 153 172 [StorableConstructor] 154 173 private VariableCondition(bool deserializing) : base(deserializing) { } … … 161 180 162 181 variableNames = new List<string>(original.variableNames); 182 allVariableNames = new List<string>(original.allVariableNames); 163 183 164 184 slopeInitializerMu = original.slopeInitializerMu; … … 181 201 182 202 variableNames = new List<string>(); 203 allVariableNames = new List<string>(); 183 204 184 205 slopeInitializerMu = 0.0;
Note: See TracChangeset
for help on using the changeset viewer.