Changeset 9126 for branches/Sliding Window GP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Variable.cs
- Timestamp:
- 01/08/13 15:36:13 (12 years ago)
- Location:
- branches/Sliding Window GP/HeuristicLab.Problems.DataAnalysis.Symbolic
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/Sliding Window GP/HeuristicLab.Problems.DataAnalysis.Symbolic
- Property svn:mergeinfo changed
-
branches/Sliding Window GP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4
- Property svn:ignore
-
old new 1 *.user 2 Plugin.cs 1 3 bin 2 *.user3 HeuristicLabProblemsDataAnalysisSymbolicPlugin.cs4 4 obj 5 *.vs10x6 Plugin.cs
-
- Property svn:ignore
-
branches/Sliding Window GP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Variable.cs
r7259 r9126 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 } 112 } 113 114 public override bool Enabled { 115 get { 116 if (variableNames.Count == 0) return false; 117 return base.Enabled; 118 } 119 set { 120 if (variableNames.Count == 0) base.Enabled = false; 121 else base.Enabled = value; 122 } 123 } 124 103 125 private const int minimumArity = 0; 104 126 private const int maximumArity = 0; … … 112 134 #endregion 113 135 136 [StorableHook(HookType.AfterDeserialization)] 137 private void AfterDeserialization() { 138 if (allVariableNames == null || (allVariableNames.Count == 0 && variableNames.Count > 0)) { 139 allVariableNames = variableNames; 140 } 141 } 142 114 143 [StorableConstructor] 115 144 protected Variable(bool deserializing) 116 145 : base(deserializing) { 117 146 variableNames = new List<string>(); 147 allVariableNames = new List<string>(); 118 148 } 119 149 protected Variable(Variable original, Cloner cloner) … … 122 152 weightSigma = original.weightSigma; 123 153 variableNames = new List<string>(original.variableNames); 154 allVariableNames = new List<string>(original.allVariableNames); 124 155 weightManipulatorMu = original.weightManipulatorMu; 125 156 weightManipulatorSigma = original.weightManipulatorSigma; … … 135 166 multiplicativeWeightManipulatorSigma = 0.03; 136 167 variableNames = new List<string>(); 137 } 138 139 protected override void OnChanged(EventArgs e) { 140 if (@Fixed) { 141 weightManipulatorMu = 1; 142 weightManipulatorSigma = 0; 143 weightMu = 1; 144 weightSigma = 0; 145 multiplicativeWeightManipulatorSigma = 0; 146 } 147 base.OnChanged(e); 168 allVariableNames = new List<string>(); 148 169 } 149 170
Note: See TracChangeset
for help on using the changeset viewer.