Changeset 8915 for branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols
- Timestamp:
- 11/15/12 16:47:25 (12 years ago)
- Location:
- branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols
- Files:
-
- 4 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/LaggedVariable.cs
r7259 r8915 27 27 [StorableClass] 28 28 [Item("LaggedVariable", "Represents a variable value with a time offset.")] 29 public sealedclass LaggedVariable : Variable {29 public class LaggedVariable : Variable { 30 30 [Storable] 31 31 private int minLag; … … 41 41 } 42 42 [StorableConstructor] 43 pr ivateLaggedVariable(bool deserializing) : base(deserializing) { }44 pr ivateLaggedVariable(LaggedVariable original, Cloner cloner)43 protected LaggedVariable(bool deserializing) : base(deserializing) { } 44 protected LaggedVariable(LaggedVariable original, Cloner cloner) 45 45 : base(original, cloner) { 46 46 minLag = original.minLag; 47 47 maxLag = original.maxLag; 48 48 } 49 public LaggedVariable() 50 : base("LaggedVariable", "Represents a variable value with a time offset.") { 51 minLag = -1; maxLag = -1; 49 public LaggedVariable() : this("LaggedVariable", "Represents a variable value with a time offset.") { } 50 protected LaggedVariable(string name, string description) 51 : base(name, description) { 52 MinLag = -1; 53 MaxLag = -1; 52 54 } 53 55 -
branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/LaggedVariableTreeNode.cs
r7259 r8915 37 37 } 38 38 39 public override bool HasLocalParameters { 40 get { return true; } 41 } 42 39 43 [StorableConstructor] 40 44 private LaggedVariableTreeNode(bool deserializing) : base(deserializing) { } … … 43 47 lag = original.lag; 44 48 } 45 private LaggedVariableTreeNode() { }46 49 47 50 public LaggedVariableTreeNode(LaggedVariable variableSymbol) : base(variableSymbol) { } 48 51 49 public override bool HasLocalParameters {50 get {51 return true;52 }53 }54 52 55 53 public override void ResetLocalParameters(IRandom random) { -
branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Variable.cs
r7259 r8915 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 115 public override bool Enabled { 116 get { 117 if (variableNames.Count == 0) return false; 118 return base.Enabled; 119 } 120 set { 121 if (variableNames.Count == 0) base.Enabled = false; 122 else base.Enabled = value; 123 } 124 } 125 103 126 private const int minimumArity = 0; 104 127 private const int maximumArity = 0; … … 112 135 #endregion 113 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 114 144 [StorableConstructor] 115 145 protected Variable(bool deserializing) 116 146 : base(deserializing) { 117 147 variableNames = new List<string>(); 148 allVariableNames = new List<string>(); 118 149 } 119 150 protected Variable(Variable original, Cloner cloner) … … 122 153 weightSigma = original.weightSigma; 123 154 variableNames = new List<string>(original.variableNames); 155 allVariableNames = new List<string>(original.allVariableNames); 124 156 weightManipulatorMu = original.weightManipulatorMu; 125 157 weightManipulatorSigma = original.weightManipulatorSigma; … … 135 167 multiplicativeWeightManipulatorSigma = 0.03; 136 168 variableNames = new List<string>(); 169 allVariableNames = new List<string>(); 137 170 } 138 171 -
branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/VariableCondition.cs
r8099 r8915 86 86 set { 87 87 if (value == null) throw new ArgumentNullException(); 88 variableNames = new List<string>(value); 88 variableNames.Clear(); 89 variableNames.AddRange(value); 89 90 OnChanged(EventArgs.Empty); 91 } 92 } 93 94 private List<string> allVariableNames; 95 [Storable] 96 public IEnumerable<string> AllVariableNames { 97 get { return allVariableNames; } 98 set { 99 if (value == null) throw new ArgumentNullException(); 100 allVariableNames.Clear(); 101 allVariableNames.AddRange(value); 102 VariableNames = value; 90 103 } 91 104 } … … 151 164 152 165 #region persistence and cloning 166 [StorableHook(HookType.AfterDeserialization)] 167 private void AfterDeserialization() { 168 if (allVariableNames == null || (allVariableNames.Count == 0 && variableNames.Count > 0)) { 169 allVariableNames = variableNames; 170 } 171 } 172 153 173 [StorableConstructor] 154 private VariableCondition(bool deserializing) : base(deserializing) { } 174 private VariableCondition(bool deserializing) 175 : base(deserializing) { 176 variableNames = new List<string>(); 177 allVariableNames = new List<string>(); 178 } 155 179 private VariableCondition(VariableCondition original, Cloner cloner) 156 180 : base(original, cloner) { … … 161 185 162 186 variableNames = new List<string>(original.variableNames); 187 allVariableNames = new List<string>(original.allVariableNames); 163 188 164 189 slopeInitializerMu = original.slopeInitializerMu; … … 181 206 182 207 variableNames = new List<string>(); 208 allVariableNames = new List<string>(); 183 209 184 210 slopeInitializerMu = 0.0;
Note: See TracChangeset
for help on using the changeset viewer.