- Timestamp:
- 04/21/10 15:21:34 (14 years ago)
- Location:
- trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.3
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.3/DataAnalysisProblemDataView.cs
r3442 r3462 29 29 : this() { 30 30 Content = content; 31 variableCollectionView.Content = content.Variables.AsReadOnly(); 31 } 32 33 protected override void OnContentChanged() { 34 base.OnContentChanged(); 35 variableCollectionView.Content = Content.Variables.AsReadOnly(); 32 36 } 33 37 -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.3/EstimatedValuesView.cs
r3442 r3462 68 68 protected override void RegisterContentEvents() { 69 69 base.RegisterContentEvents(); 70 Content. ModelChanged += new EventHandler(Content_ModelChanged);70 Content.EstimatedValuesChanged += new EventHandler(Content_EstimatedValuesChanged); 71 71 Content.ProblemDataChanged += new EventHandler(Content_ProblemDataChanged); 72 72 } … … 74 74 protected override void DeregisterContentEvents() { 75 75 base.DeregisterContentEvents(); 76 Content. ModelChanged -= new EventHandler(Content_ModelChanged);76 Content.EstimatedValuesChanged -= new EventHandler(Content_EstimatedValuesChanged); 77 77 Content.ProblemDataChanged -= new EventHandler(Content_ProblemDataChanged); 78 78 } … … 82 82 } 83 83 84 void Content_ ModelChanged(object sender, EventArgs e) {84 void Content_EstimatedValuesChanged(object sender, EventArgs e) { 85 85 OnContentChanged(); 86 86 } -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.3/LineChartView.cs
r3442 r3462 65 65 : this() { 66 66 Content = dataAnalysisSolution; 67 DrawTargetVariableValues(); 68 DrawEstimatedValues(); 67 RedrawChart(); 69 68 } 70 69 71 private void DrawEstimatedValues() { 70 private void RedrawChart() { 71 this.chart.Series.Clear(); 72 this.chart.Series.Add(TARGETVARIABLE_SERIES_NAME); 73 this.chart.Series[TARGETVARIABLE_SERIES_NAME].LegendText = Content.ProblemData.TargetVariable.Value; 74 this.chart.Series[TARGETVARIABLE_SERIES_NAME].ChartType = SeriesChartType.FastLine; 75 this.chart.Series[TARGETVARIABLE_SERIES_NAME].Points.DataBindY(Content.ProblemData.Dataset[Content.ProblemData.TargetVariable.Value]); 76 this.UpdateStripLines(); 77 72 78 this.chart.Series.Add(ESTIMATEDVALUES_SERIES_NAME); 73 79 this.chart.Series[ESTIMATEDVALUES_SERIES_NAME].LegendText = Content.ItemName; … … 77 83 } 78 84 79 private void DrawTargetVariableValues() {80 this.chart.Series.Clear();81 this.chart.Series.Add(TARGETVARIABLE_SERIES_NAME);82 this.chart.Series[TARGETVARIABLE_SERIES_NAME].LegendText = Content.ProblemData.TargetVariable.Value;83 this.chart.Series[TARGETVARIABLE_SERIES_NAME].ChartType = SeriesChartType.FastLine;84 this.chart.Series[TARGETVARIABLE_SERIES_NAME].Points.DataBindY(Content.ProblemData.Dataset[Content.ProblemData.TargetVariable.Value]);85 this.UpdateStripLines();86 }87 88 85 #region events 89 86 protected override void RegisterContentEvents() { 90 87 base.RegisterContentEvents(); 91 Content. ModelChanged += new EventHandler(Content_ModelChanged);88 Content.EstimatedValuesChanged += new EventHandler(Content_EstimatedValuesChanged); 92 89 Content.ProblemDataChanged += new EventHandler(Content_ProblemDataChanged); 93 90 } … … 95 92 protected override void DeregisterContentEvents() { 96 93 base.DeregisterContentEvents(); 97 Content. ModelChanged -= new EventHandler(Content_ModelChanged);94 Content.EstimatedValuesChanged -= new EventHandler(Content_EstimatedValuesChanged); 98 95 Content.ProblemDataChanged -= new EventHandler(Content_ProblemDataChanged); 99 96 } 100 97 101 98 void Content_ProblemDataChanged(object sender, EventArgs e) { 102 OnContentChanged();99 RedrawChart(); 103 100 } 104 101 105 void Content_ ModelChanged(object sender, EventArgs e) {106 OnContentChanged();102 void Content_EstimatedValuesChanged(object sender, EventArgs e) { 103 UpdateEstimatedValuesLineChart(); 107 104 } 108 105 109 106 protected override void OnContentChanged() { 110 107 base.OnContentChanged(); 111 UpdateEstimatedValuesLineChart();108 RedrawChart(); 112 109 } 113 110 -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.3/ScatterPlotView.cs
r3442 r3462 84 84 : this() { 85 85 Content = dataAnalysisSolution; 86 UpdateChart(); 86 87 } 87 88 88 89 protected override void RegisterContentEvents() { 89 90 base.RegisterContentEvents(); 90 Content. ModelChanged += new EventHandler(Content_ModelChanged);91 Content.EstimatedValuesChanged += new EventHandler(Content_EstimatedValuesChanged); 91 92 Content.ProblemDataChanged += new EventHandler(Content_ProblemDataChanged); 92 93 } 93 94 protected override void DeregisterContentEvents() { 94 95 base.DeregisterContentEvents(); 95 Content. ModelChanged -= new EventHandler(Content_ModelChanged);96 Content.EstimatedValuesChanged -= new EventHandler(Content_EstimatedValuesChanged); 96 97 Content.ProblemDataChanged -= new EventHandler(Content_ProblemDataChanged); 97 98 } … … 99 100 100 101 void Content_ProblemDataChanged(object sender, EventArgs e) { 101 OnContentChanged();102 } 103 104 void Content_ ModelChanged(object sender, EventArgs e) {105 OnContentChanged();102 UpdateChart(); 103 } 104 105 void Content_EstimatedValuesChanged(object sender, EventArgs e) { 106 UpdateSeries(); 106 107 } 107 108 … … 127 128 128 129 private void UpdateSeries() { 129 string targetVariableName = Content.ProblemData.TargetVariable.Value; 130 Dataset dataset = Content.ProblemData.Dataset; 131 int trainingStart = Content.ProblemData.TrainingSamplesStart.Value; 132 int trainingEnd = Content.ProblemData.TrainingSamplesEnd.Value; 133 int testStart = Content.ProblemData.TestSamplesStart.Value; 134 int testEnd = Content.ProblemData.TestSamplesEnd.Value; 135 if (this.chart.Series[ALL_SERIES].Points.Count > 0) 136 this.chart.Series[ALL_SERIES].Points.DataBindXY(Content.EstimatedValues.ToArray(), "", 137 dataset[targetVariableName], ""); 138 if (this.chart.Series[TRAINING_SERIES].Points.Count > 0) 139 this.chart.Series[TRAINING_SERIES].Points.DataBindXY(Content.EstimatedTrainingValues.ToArray(), "", 140 dataset.GetVariableValues(targetVariableName, trainingStart, trainingEnd), ""); 141 if (this.chart.Series[TEST_SERIES].Points.Count > 0) 142 this.chart.Series[TEST_SERIES].Points.DataBindXY(Content.EstimatedTestValues.ToArray(), "", 143 dataset.GetVariableValues(targetVariableName, testStart, testEnd), ""); 144 145 double max = Math.Max(Content.EstimatedValues.Max(), dataset.GetMax(targetVariableName)); 146 double min = Math.Min(Content.EstimatedValues.Min(), dataset.GetMin(targetVariableName)); 147 148 max = Math.Ceiling(max) * 1.2; 149 min = Math.Floor(min) * 0.8; 150 151 this.chart.ChartAreas[0].AxisX.Maximum = max; 152 this.chart.ChartAreas[0].AxisX.Minimum = min; 153 this.chart.ChartAreas[0].AxisY.Maximum = max; 154 this.chart.ChartAreas[0].AxisY.Minimum = min; 130 if (InvokeRequired) Invoke((Action)UpdateSeries); 131 else { 132 string targetVariableName = Content.ProblemData.TargetVariable.Value; 133 Dataset dataset = Content.ProblemData.Dataset; 134 int trainingStart = Content.ProblemData.TrainingSamplesStart.Value; 135 int trainingEnd = Content.ProblemData.TrainingSamplesEnd.Value; 136 int testStart = Content.ProblemData.TestSamplesStart.Value; 137 int testEnd = Content.ProblemData.TestSamplesEnd.Value; 138 if (this.chart.Series[ALL_SERIES].Points.Count > 0) 139 this.chart.Series[ALL_SERIES].Points.DataBindXY(Content.EstimatedValues.ToArray(), "", 140 dataset[targetVariableName], ""); 141 if (this.chart.Series[TRAINING_SERIES].Points.Count > 0) 142 this.chart.Series[TRAINING_SERIES].Points.DataBindXY(Content.EstimatedTrainingValues.ToArray(), "", 143 dataset.GetVariableValues(targetVariableName, trainingStart, trainingEnd), ""); 144 if (this.chart.Series[TEST_SERIES].Points.Count > 0) 145 this.chart.Series[TEST_SERIES].Points.DataBindXY(Content.EstimatedTestValues.ToArray(), "", 146 dataset.GetVariableValues(targetVariableName, testStart, testEnd), ""); 147 148 double max = Math.Max(Content.EstimatedValues.Max(), dataset.GetMax(targetVariableName)); 149 double min = Math.Min(Content.EstimatedValues.Min(), dataset.GetMin(targetVariableName)); 150 151 max = Math.Ceiling(max) * 1.2; 152 min = Math.Floor(min) * 0.8; 153 154 this.chart.ChartAreas[0].AxisX.Maximum = max; 155 this.chart.ChartAreas[0].AxisX.Minimum = min; 156 this.chart.ChartAreas[0].AxisY.Maximum = max; 157 this.chart.ChartAreas[0].AxisY.Minimum = min; 158 } 155 159 } 156 160 -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.3/Symbolic/SimplifiedSymbolicExpressionModelView.cs
r3461 r3462 44 44 public new SymbolicRegressionSolution Content { 45 45 get { return (SymbolicRegressionSolution)base.Content; } 46 set { base.Content = value;}46 set { base.Content = value; } 47 47 } 48 48 … … 58 58 } 59 59 60 protected override void RegisterContentEvents() { 61 base.RegisterContentEvents(); 62 Content.ModelChanged += new EventHandler(Content_ModelChanged); 63 } 64 65 protected override void DeregisterContentEvents() { 66 base.DeregisterContentEvents(); 67 Content.ModelChanged -= new EventHandler(Content_ModelChanged); 68 } 69 70 void Content_ModelChanged(object sender, EventArgs e) { 71 UpdateTreeChart(); 72 } 73 60 74 protected override void OnContentChanged() { 61 75 base.OnContentChanged(); 76 UpdateTreeChart(); 77 } 78 79 private void UpdateTreeChart() { 62 80 var simplifier = new SymbolicSimplifier(); 63 81 var simplifiedTree = simplifier.Simplify(Content.Model.SymbolicExpressionTree); -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.3/Symbolic/SymbolicExpressionModelView.cs
r3461 r3462 57 57 } 58 58 59 60 protected override void RegisterContentEvents() { 61 base.RegisterContentEvents(); 62 Content.ModelChanged += new EventHandler(Content_ModelChanged); 63 } 64 65 protected override void DeregisterContentEvents() { 66 base.DeregisterContentEvents(); 67 Content.ModelChanged -= new EventHandler(Content_ModelChanged); 68 } 69 70 void Content_ModelChanged(object sender, EventArgs e) { 71 UpdateTreeChart(); 72 } 73 59 74 protected override void OnContentChanged() { 60 75 base.OnContentChanged(); 76 UpdateTreeChart(); 77 } 78 79 private void UpdateTreeChart() { 61 80 viewHost.Content = Content.Model.SymbolicExpressionTree; 62 81 }
Note: See TracChangeset
for help on using the changeset viewer.