Changeset 17498 for stable/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisProblem.cs
- Timestamp:
- 04/06/20 17:46:44 (4 years ago)
- Location:
- stable
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
stable
-
stable/HeuristicLab.Problems.DataAnalysis.Symbolic
- Property svn:mergeinfo changed
/trunk/HeuristicLab.Problems.DataAnalysis.Symbolic merged: 17413
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisProblem.cs
r17181 r17498 24 24 using System.Drawing; 25 25 using System.Linq; 26 using HEAL.Attic; 26 27 using HeuristicLab.Common; 27 28 using HeuristicLab.Common.Resources; … … 31 32 using HeuristicLab.Optimization; 32 33 using HeuristicLab.Parameters; 33 using HEAL.Attic;34 34 using HeuristicLab.PluginInfrastructure; 35 35 using HeuristicLab.Problems.Instances; … … 210 210 protected virtual void UpdateGrammar() { 211 211 var problemData = ProblemData; 212 var ds = problemData.Dataset;213 212 var grammar = SymbolicExpressionTreeGrammar; 213 214 214 grammar.MaximumFunctionArguments = MaximumFunctionArguments.Value; 215 215 grammar.MaximumFunctionDefinitions = MaximumFunctionDefinitions.Value; 216 foreach (var varSymbol in grammar.Symbols.OfType<HeuristicLab.Problems.DataAnalysis.Symbolic.VariableBase>()) { 217 if (!varSymbol.Fixed) { 218 varSymbol.AllVariableNames = problemData.InputVariables.Select(x => x.Value).Where(x => ds.VariableHasType<double>(x)); 219 varSymbol.VariableNames = problemData.AllowedInputVariables.Where(x => ds.VariableHasType<double>(x)); 220 } 221 } 222 foreach (var factorSymbol in grammar.Symbols.OfType<BinaryFactorVariable>()) { 223 if (!factorSymbol.Fixed) { 224 factorSymbol.AllVariableNames = problemData.InputVariables.Select(x => x.Value).Where(x => ds.VariableHasType<string>(x)); 225 factorSymbol.VariableNames = problemData.AllowedInputVariables.Where(x => ds.VariableHasType<string>(x)); 226 factorSymbol.VariableValues = factorSymbol.VariableNames 227 .ToDictionary(varName => varName, varName => ds.GetStringValues(varName).Distinct().ToList()); 228 } 229 } 230 foreach (var factorSymbol in grammar.Symbols.OfType<FactorVariable>()) { 231 if (!factorSymbol.Fixed) { 232 factorSymbol.AllVariableNames = problemData.InputVariables.Select(x => x.Value).Where(x => ds.VariableHasType<string>(x)); 233 factorSymbol.VariableNames = problemData.AllowedInputVariables.Where(x => ds.VariableHasType<string>(x)); 234 factorSymbol.VariableValues = factorSymbol.VariableNames 235 .ToDictionary(varName => varName, 236 varName => ds.GetStringValues(varName).Distinct() 237 .Select((n, i) => Tuple.Create(n, i)) 238 .ToDictionary(tup => tup.Item1, tup => tup.Item2)); 239 } 240 } 216 217 grammar.ConfigureVariableSymbols(problemData); 241 218 } 242 219
Note: See TracChangeset
for help on using the changeset viewer.