Changeset 3559
- Timestamp:
- 04/29/10 18:26:23 (15 years ago)
- Location:
- trunk/sources
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/SymbolicRegressionProblem.cs
r3545 r3559 262 262 } 263 263 protected virtual void OnArchitectureParameterChanged(EventArgs e) { 264 var globalGrammar = FunctionTreeGrammar as GlobalSymbolicExpressionGrammar; 265 if (globalGrammar != null) { 266 globalGrammar.MaxFunctionArguments = MaxFunctionArguments.Value; 267 globalGrammar.MaxFunctionDefinitions = MaxFunctionDefiningBranches.Value; 268 } 264 UpdateGrammar(); 269 265 } 270 266 protected virtual void OnGrammarChanged(EventArgs e) { } … … 356 352 private void UpdateGrammar() { 357 353 foreach (var varSymbol in FunctionTreeGrammar.Symbols.OfType<HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols.Variable>()) { 358 varSymbol.VariableNames = DataAnalysisProblemData.InputVariables.Select(x => x.Value); 354 varSymbol.VariableNames = DataAnalysisProblemData.InputVariables.CheckedItems.Select(x => x.Value); 355 } 356 var globalGrammar = FunctionTreeGrammar as GlobalSymbolicExpressionGrammar; 357 if (globalGrammar != null) { 358 globalGrammar.MaxFunctionArguments = MaxFunctionArguments.Value; 359 globalGrammar.MaxFunctionDefinitions = MaxFunctionDefiningBranches.Value; 359 360 } 360 361 } -
trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3/DataAnalysisProblemData.cs
r3545 r3559 46 46 } 47 47 48 public IValueParameter< ItemSet<StringValue>> InputVariablesParameter {49 get { return (IValueParameter< ItemSet<StringValue>>)Parameters["InputVariables"]; }48 public IValueParameter<CheckedItemCollection<StringValue>> InputVariablesParameter { 49 get { return (IValueParameter<CheckedItemCollection<StringValue>>)Parameters["InputVariables"]; } 50 50 } 51 51 … … 85 85 } 86 86 } 87 public ItemSet<StringValue> InputVariables {88 get { return ( ItemSet<StringValue>)InputVariablesParameter.Value; }87 public CheckedItemCollection<StringValue> InputVariables { 88 get { return (CheckedItemCollection<StringValue>)InputVariablesParameter.Value; } 89 89 set { 90 90 if (value != InputVariables) { … … 140 140 : base() { 141 141 Parameters.Add(new ValueParameter<Dataset>("Dataset", new Dataset())); 142 Parameters.Add(new ValueParameter< ItemSet<StringValue>>("InputVariables", new ItemSet<StringValue>()));142 Parameters.Add(new ValueParameter<CheckedItemCollection<StringValue>>("InputVariables", new CheckedItemCollection<StringValue>())); 143 143 Parameters.Add(new ConstrainedValueParameter<StringValue>("TargetVariable")); 144 144 Parameters.Add(new ValueParameter<IntValue>("TrainingSamplesStart", new IntValue())); … … 252 252 InputVariables.ItemsAdded += new HeuristicLab.Collections.CollectionItemsChangedEventHandler<StringValue>(InputVariables_ItemsAdded); 253 253 InputVariables.ItemsRemoved += new HeuristicLab.Collections.CollectionItemsChangedEventHandler<StringValue>(InputVariables_ItemsRemoved); 254 InputVariables.ItemsChecked += new HeuristicLab.Collections.CollectionItemsChangedEventHandler<StringValue>(InputVariables_ItemsChecked); 254 255 foreach (var item in InputVariables) 255 256 item.ValueChanged += new EventHandler(InputVariable_ValueChanged); 257 } 258 259 void InputVariables_ItemsChecked(object sender, HeuristicLab.Collections.CollectionItemsChangedEventArgs<StringValue> e) { 260 OnProblemDataChanged(e); 256 261 } 257 262 … … 323 328 ((ConstrainedValueParameter<StringValue>)TargetVariableParameter).ValidValues.Add(variableName); 324 329 TargetVariable = variableNames.First(); 325 InputVariables = new ItemSet<StringValue>(variableNames.Skip(1)); 330 InputVariables = new CheckedItemCollection<StringValue>(variableNames); 331 foreach (var variableName in variableNames.Skip(1)) 332 InputVariables.SetItemCheckedState(variableName, true); 326 333 int middle = (int)(csvFileParser.Rows * 0.5); 327 334 TrainingSamplesStart = new IntValue(0);
Note: See TracChangeset
for help on using the changeset viewer.