- Timestamp:
- 03/27/14 12:49:33 (11 years ago)
- Location:
- branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/PreprocessingContext.cs
r10673 r10676 27 27 using HeuristicLab.Problems.DataAnalysis; 28 28 using HeuristicLab.Problems.DataAnalysis.Symbolic; 29 using Variable = HeuristicLab.Problems.DataAnalysis.Symbolic.Variable; 29 30 30 31 namespace HeuristicLab.DataPreprocessing { … … 39 40 public IAlgorithm Algorithm { get; private set; } 40 41 41 public I SymbolicDataAnalysisProblem Problem { get; private set; }42 public IDataAnalysisProblem Problem { get; private set; } 42 43 43 public PreprocessingContext(IDataAnalysisProblemData dataAnalysisProblemData, IAlgorithm algorithm, I SymbolicDataAnalysisProblem problem) {44 public PreprocessingContext(IDataAnalysisProblemData dataAnalysisProblemData, IAlgorithm algorithm, IDataAnalysisProblem problem) { 44 45 Data = new TransactionalPreprocessingData(dataAnalysisProblemData); 45 46 DataAnalysisProblemData = dataAnalysisProblemData; … … 63 64 if (Algorithm != null) { 64 65 return ExportAlgorithm(); 65 } else {66 return ExportProblem();67 66 } 67 return ExportProblem(); 68 68 } 69 69 70 public IProblem ExportProblem() { 70 71 return Export(Problem, SetupProblem); … … 74 75 } 75 76 76 private I SymbolicDataAnalysisProblem SetupProblem(IProblem problem) {77 return (I SymbolicDataAnalysisProblem)problem;77 private IDataAnalysisProblem SetupProblem(IProblem problem) { 78 return (IDataAnalysisProblem)problem; 78 79 } 79 private I SymbolicDataAnalysisProblem SetupAlgorithm(IAlgorithm algorithm) {80 private IDataAnalysisProblem SetupAlgorithm(IAlgorithm algorithm) { 80 81 algorithm.Name = algorithm.Name + "(Preprocessed)"; 81 82 algorithm.Runs.Clear(); 82 return (I SymbolicDataAnalysisProblem)algorithm.Problem;83 return (IDataAnalysisProblem)algorithm.Problem; 83 84 } 84 private T Export<T>(T original, Func<T, I SymbolicDataAnalysisProblem> setup)85 private T Export<T>(T original, Func<T, IDataAnalysisProblem> setup) 85 86 where T : IItem { 86 87 var creator = new ProblemDataCreator(this); … … 93 94 problem.Name = "Preprocessed " + problem.Name; 94 95 95 var tree = new SymbolicExpressionTree(new ProgramRootSymbol().CreateTreeNode()); 96 var variableNode = (VariableTreeNode)new HeuristicLab.Problems.DataAnalysis.Symbolic.Variable("dummy", "dummy description").CreateTreeNode(); 97 variableNode.VariableName = "dummy"; 98 tree.Root.AddSubtree(variableNode); 96 var symbolicProblem = problem as ISymbolicDataAnalysisProblem; 97 if (symbolicProblem != null) { 98 var tree = new SymbolicExpressionTree(new ProgramRootSymbol().CreateTreeNode()); 99 var variableNode = (VariableTreeNode)new Variable("dummy", "dummy description").CreateTreeNode(); 100 variableNode.VariableName = "dummy"; 101 tree.Root.AddSubtree(variableNode); 99 102 100 problem.TransformationsParameter.Value.Add(tree); 103 symbolicProblem.TransformationsParameter.Value.Add(tree); 104 } 101 105 102 106 return clone; -
branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Interfaces/IPreprocessingContext.cs
r10673 r10676 24 24 using HeuristicLab.Optimization; 25 25 using HeuristicLab.Problems.DataAnalysis; 26 using HeuristicLab.Problems.DataAnalysis.Symbolic;27 26 28 27 namespace HeuristicLab.DataPreprocessing { … … 37 36 IAlgorithm Algorithm { get; } 38 37 39 I SymbolicDataAnalysisProblem Problem { get; }38 IDataAnalysisProblem Problem { get; } 40 39 41 40 IItem ExportAlgorithmOrProblem();
Note: See TracChangeset
for help on using the changeset viewer.