- Timestamp:
- 07/28/09 18:32:53 (15 years ago)
- Location:
- branches/HeuristicLab.Modeling Database Backend/sources/HeuristicLab.CEDMA.Server/3.3
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Modeling Database Backend/sources/HeuristicLab.CEDMA.Server/3.3/DispatcherBase.cs
r2198 r2199 50 50 get { 51 51 if (problem != null) { 52 return problem.AllowedTargetVariables.Select(x => problem.Dataset.GetVariableName(x));52 return Enumerable.Range(0, problem.Dataset.Columns).Select(x => problem.Dataset.GetVariableName(x)); 53 53 } else return new string[0]; 54 54 } … … 58 58 get { 59 59 if (problem != null) { 60 return problem.AllowedInputVariables.Select(x => problem.Dataset.GetVariableName(x));60 return TargetVariables; 61 61 } else return new string[0]; 62 62 } … … 65 65 public DispatcherBase(IModelingDatabase database, Problem problem) { 66 66 this.problem = problem; 67 allowedTargetVariables = new List<int>(); 68 activeInputVariables = new Dictionary<int, List<int>>(); 67 69 problem.Changed += (sender, args) => { 68 allowedTargetVariables = new List<int>(problem.AllowedTargetVariables); 69 activeInputVariables = new Dictionary<int, List<int>>(); 70 foreach (int targetVar in problem.AllowedTargetVariables) { 71 activeInputVariables.Add(targetVar, new List<int>()); 72 activeInputVariables[targetVar].AddRange(problem.AllowedInputVariables); 70 lock (locker) { 71 allowedTargetVariables.Clear(); 72 activeInputVariables.Clear(); 73 73 } 74 74 OnChanged(); … … 124 124 int targetIndex = problem.Dataset.GetVariableIndex(target); 125 125 int inputIndex = problem.Dataset.GetVariableIndex(name); 126 if (!activeInputVariables.ContainsKey(targetIndex)) activeInputVariables[targetIndex] = new List<int>(); 126 127 if (!activeInputVariables[targetIndex].Contains(inputIndex)) { 127 128 activeInputVariables[targetIndex].Add(inputIndex); … … 134 135 int targetIndex = problem.Dataset.GetVariableIndex(target); 135 136 int inputIndex = problem.Dataset.GetVariableIndex(name); 137 if (!activeInputVariables.ContainsKey(targetIndex)) activeInputVariables[targetIndex] = new List<int>(); 136 138 while (activeInputVariables[targetIndex].Remove(inputIndex)) { } 137 139 } … … 143 145 144 146 internal IEnumerable<string> GetInputVariables(string target) { 145 return activeInputVariables[problem.Dataset.GetVariableIndex(target)] 147 int targetIndex = problem.Dataset.GetVariableIndex(target); 148 if (!activeInputVariables.ContainsKey(targetIndex)) activeInputVariables[targetIndex] = new List<int>(); 149 return activeInputVariables[targetIndex] 146 150 .Select(i => problem.Dataset.GetVariableName(i)); 147 151 } -
branches/HeuristicLab.Modeling Database Backend/sources/HeuristicLab.CEDMA.Server/3.3/Problem.cs
r2198 r2199 87 87 } 88 88 89 private List<int> allowedInputVariables;90 public List<int> AllowedInputVariables {91 get { return allowedInputVariables; }92 }89 //private List<int> allowedInputVariables; 90 //public List<int> AllowedInputVariables { 91 // get { return allowedInputVariables; } 92 //} 93 93 94 private List<int> allowedTargetVariables;95 public List<int> AllowedTargetVariables {96 get { return allowedTargetVariables; }97 }94 //private List<int> allowedTargetVariables; 95 //public List<int> AllowedTargetVariables { 96 // get { return allowedTargetVariables; } 97 //} 98 98 99 99 private bool autoRegressive; … … 123 123 public Problem() 124 124 : base() { 125 allowedInputVariables = new List<int>();126 allowedTargetVariables = new List<int>();125 //allowedInputVariables = new List<int>(); 126 //allowedTargetVariables = new List<int>(); 127 127 Dataset = new HeuristicLab.DataAnalysis.Dataset(); 128 128 } -
branches/HeuristicLab.Modeling Database Backend/sources/HeuristicLab.CEDMA.Server/3.3/ProblemView.cs
r2198 r2199 102 102 problem.TestSamplesStart = parser.TestSamplesStart; 103 103 problem.TestSamplesEnd = parser.TestSamplesEnd; 104 problem.AllowedTargetVariables.Add(parser.TargetVariable);104 //problem.AllowedTargetVariables.Add(parser.TargetVariable); 105 105 problem.FireChanged(); 106 List<int> nonInputVariables = parser.NonInputVariables;107 for (int i = 0; i < dataset.Columns; i++) {108 if (!nonInputVariables.Contains(i)) problem.AllowedInputVariables.Add(i);109 }106 //List<int> nonInputVariables = parser.NonInputVariables; 107 //for (int i = 0; i < dataset.Columns; i++) { 108 // if (!nonInputVariables.Contains(i)) problem.AllowedInputVariables.Add(i); 109 //} 110 110 Refresh(); 111 111 }
Note: See TracChangeset
for help on using the changeset viewer.