Changeset 16520 for branches/2947_ConfigurableIndexedDataTable/HeuristicLab.Problems.DataAnalysis.Symbolic.Views
- Timestamp:
- 01/08/19 15:39:49 (5 years ago)
- Location:
- branches/2947_ConfigurableIndexedDataTable
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2947_ConfigurableIndexedDataTable
- Property svn:mergeinfo changed
-
branches/2947_ConfigurableIndexedDataTable/HeuristicLab.Problems.DataAnalysis.Symbolic.Views
- Property svn:mergeinfo changed
-
branches/2947_ConfigurableIndexedDataTable/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/InteractiveSymbolicDataAnalysisSolutionSimplifierView.cs
r15583 r16520 24 24 using System.Drawing; 25 25 using System.Linq; 26 using System.Threading; 26 27 using System.Threading.Tasks; 27 28 using System.Windows.Forms; … … 40 41 private readonly ISymbolicDataAnalysisSolutionImpactValuesCalculator impactCalculator; 41 42 42 private readonly IProgress progress = new Progress(); 43 private readonly Progress progress = new Progress(); 44 private CancellationTokenSource cancellationTokenSource; 43 45 44 46 private enum TreeState { Valid, Invalid } … … 152 154 Content.ProblemDataChanged += Content_Changed; 153 155 treeChart.Repainted += treeChart_Repainted; 154 MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>().AddOperationProgressToView(grpSimplify, progress); 156 Progress.ShowOnControl(grpSimplify, progress); 157 progress.StopRequested += progress_StopRequested; 155 158 } 156 159 protected override void DeregisterContentEvents() { … … 159 162 Content.ProblemDataChanged -= Content_Changed; 160 163 treeChart.Repainted -= treeChart_Repainted; 161 MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>().RemoveOperationProgressFromView(grpSimplify, false); 164 Progress.HideFromControl(grpSimplify, false); 165 progress.StopRequested -= progress_StopRequested; 162 166 } 163 167 … … 178 182 } 179 183 184 private void progress_StopRequested(object sender, EventArgs e) { 185 cancellationTokenSource.Cancel(); 186 } 187 180 188 private async void UpdateView() { 181 189 if (Content == null || Content.Model == null || Content.ProblemData == null) return; … … 184 192 185 193 progress.Start("Calculate Impact and Replacement Values ..."); 194 progress.CanBeStopped = true; 195 cancellationTokenSource = new CancellationTokenSource(); 186 196 var impactAndReplacementValues = await Task.Run(() => CalculateImpactAndReplacementValues(tree)); 187 await Task.Delay(500); // wait for progressbar to finish animation 197 try { 198 await Task.Delay(500, cancellationTokenSource.Token); // wait for progressbar to finish animation 199 } catch (OperationCanceledException) { } 188 200 var replacementValues = impactAndReplacementValues.ToDictionary(x => x.Key, x => x.Value.Item2); 189 201 foreach (var pair in replacementValues.Where(pair => !(pair.Key is ConstantTreeNode))) { … … 192 204 nodeImpacts = impactAndReplacementValues.ToDictionary(x => x.Key, x => x.Value.Item1); 193 205 progress.Finish(); 206 progress.CanBeStopped = false; 194 207 PaintNodeImpacts(); 195 208 } … … 198 211 var impactAndReplacementValues = new Dictionary<ISymbolicExpressionTreeNode, Tuple<double, double>>(); 199 212 foreach (var node in tree.Root.GetSubtree(0).GetSubtree(0).IterateNodesPrefix()) { 213 if (progress.ProgressState == ProgressState.StopRequested) continue; 200 214 double impactValue, replacementValue, newQualityForImpactsCalculation; 201 215 impactCalculator.CalculateImpactAndReplacementValues(Content.Model, node, Content.ProblemData, Content.ProblemData.TrainingIndices, out impactValue, out replacementValue, out newQualityForImpactsCalculation); -
branches/2947_ConfigurableIndexedDataTable/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Plugin.cs.frame
r15589 r16520 24 24 using System.Text; 25 25 using HeuristicLab.PluginInfrastructure; 26 using System.Runtime.InteropServices; 27 using System.IO; 26 28 27 29 namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Views { … … 42 44 [PluginDependency("HeuristicLab.MainForm", "3.3")] 43 45 [PluginDependency("HeuristicLab.MainForm.WindowsForms", "3.3")] 44 [PluginDependency("HeuristicLab.MathJax", "1. 1")]46 [PluginDependency("HeuristicLab.MathJax", "1.2")] 45 47 [PluginDependency("HeuristicLab.Optimization","3.3")] 46 48 [PluginDependency("HeuristicLab.Problems.DataAnalysis", "3.4")] 47 49 [PluginDependency("HeuristicLab.Problems.DataAnalysis.Symbolic", "3.4")] 48 50 public class HeuristicLabProblemsDataAnalysisSymbolicViewsPlugin : PluginBase { 51 // HeuristicLab is marked with zone identifier 'Internet' after download. 52 // This propagates to all extracted files and can be checked in the file properties. 53 // IE prevents execution of MathJax JavaScript inside of untrusted html 54 // Therefore we need to programmatically unblock the displayModelFrame.html file before extracting. 55 // see http://engram404.net/programmatically-unblocking-downloaded-files/ 56 57 // for removing the Zone.Identifier alternative NTFS stream (effectively unblocking the file) 58 [DllImport("kernel32.dll", SetLastError = true)] 59 private static extern bool DeleteFile(string lpFileName); 60 61 public override void OnLoad() { 62 base.OnLoad(); 63 64 // unblock mathjax.zip () 65 DeleteFile(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "displayModelFrame.html:Zone.Identifier")); 66 } 49 67 } 50 68 } -
branches/2947_ConfigurableIndexedDataTable/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Symbols/VariableConditionView.Designer.cs
r15583 r16520 237 237 // variableNamesTabPage 238 238 // 239 this.variableNamesTabPage.BackColor = System.Drawing.SystemColors.Window; 239 240 this.variableNamesTabPage.Location = new System.Drawing.Point(4, 22); 240 241 this.variableNamesTabPage.Name = "variableNamesTabPage"; … … 243 244 this.variableNamesTabPage.TabIndex = 0; 244 245 this.variableNamesTabPage.Text = "Variable Names"; 245 this.variableNamesTabPage.UseVisualStyleBackColor = true;246 246 // 247 247 // parametersTabPage 248 248 // 249 this.parametersTabPage.BackColor = System.Drawing.SystemColors.Window; 249 250 this.parametersTabPage.Controls.Add(this.initializationGroupBox); 250 251 this.parametersTabPage.Controls.Add(this.mutationGroupBox); … … 255 256 this.parametersTabPage.TabIndex = 1; 256 257 this.parametersTabPage.Text = "Parameters"; 257 this.parametersTabPage.UseVisualStyleBackColor = true;258 258 // 259 259 // initializationGroupBox -
branches/2947_ConfigurableIndexedDataTable/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Symbols/VariableView.Designer.cs
r15583 r16520 124 124 // weightInitializationMuTextBox 125 125 // 126 this.weightInitializationMuTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 126 this.weightInitializationMuTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 127 127 | System.Windows.Forms.AnchorStyles.Right))); 128 128 this.weightInitializationMuTextBox.Location = new System.Drawing.Point(92, 19); … … 136 136 // initializationGroupBox 137 137 // 138 this.initializationGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 138 this.initializationGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 139 139 | System.Windows.Forms.AnchorStyles.Right))); 140 140 this.initializationGroupBox.Controls.Add(this.weightSigmaLabel); … … 161 161 // weightInitializationSigmaTextBox 162 162 // 163 this.weightInitializationSigmaTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 163 this.weightInitializationSigmaTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 164 164 | System.Windows.Forms.AnchorStyles.Right))); 165 165 this.weightInitializationSigmaTextBox.Location = new System.Drawing.Point(92, 45); … … 173 173 // mutationGroupBox 174 174 // 175 this.mutationGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 175 this.mutationGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 176 176 | System.Windows.Forms.AnchorStyles.Right))); 177 177 this.mutationGroupBox.Controls.Add(this.varChangeProbTextBox); … … 190 190 // varChangeProbTextBox 191 191 // 192 this.varChangeProbTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 192 this.varChangeProbTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 193 193 | System.Windows.Forms.AnchorStyles.Right))); 194 194 this.varChangeProbTextBox.Location = new System.Drawing.Point(201, 13); … … 224 224 // multiplicativeWeightChangeSigmaTextBox 225 225 // 226 this.multiplicativeWeightChangeSigmaTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 226 this.multiplicativeWeightChangeSigmaTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 227 227 | System.Windows.Forms.AnchorStyles.Right))); 228 228 this.multiplicativeWeightChangeSigmaTextBox.Location = new System.Drawing.Point(201, 65); … … 247 247 // additiveWeightChangeSigmaTextBox 248 248 // 249 this.additiveWeightChangeSigmaTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 249 this.additiveWeightChangeSigmaTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 250 250 | System.Windows.Forms.AnchorStyles.Right))); 251 251 this.additiveWeightChangeSigmaTextBox.Location = new System.Drawing.Point(201, 39); … … 259 259 // tabControl 260 260 // 261 this.tabControl.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 262 | System.Windows.Forms.AnchorStyles.Left) 261 this.tabControl.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 262 | System.Windows.Forms.AnchorStyles.Left) 263 263 | System.Windows.Forms.AnchorStyles.Right))); 264 264 this.tabControl.Controls.Add(this.variableNamesTabPage); … … 272 272 // variableNamesTabPage 273 273 // 274 this.variableNamesTabPage.BackColor = System.Drawing.SystemColors.Window; 274 275 this.variableNamesTabPage.Location = new System.Drawing.Point(4, 22); 275 276 this.variableNamesTabPage.Name = "variableNamesTabPage"; … … 278 279 this.variableNamesTabPage.TabIndex = 0; 279 280 this.variableNamesTabPage.Text = "Variable Names"; 280 this.variableNamesTabPage.UseVisualStyleBackColor = true;281 281 // 282 282 // parametersTabPage 283 283 // 284 this.parametersTabPage.BackColor = System.Drawing.SystemColors.Window; 284 285 this.parametersTabPage.Controls.Add(this.mutationGroupBox); 285 286 this.parametersTabPage.Controls.Add(this.initializationGroupBox); … … 290 291 this.parametersTabPage.TabIndex = 1; 291 292 this.parametersTabPage.Text = "Parameters"; 292 this.parametersTabPage.UseVisualStyleBackColor = true;293 293 // 294 294 // VariableView -
branches/2947_ConfigurableIndexedDataTable/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/displayModelFrame.html
r13984 r16520 7 7 <meta http-equiv="X-UA-Compatible" content="IE=edge" /> 8 8 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 9 <meta name="viewport" content="width=device-width, initial-scale=1" >9 <meta name="viewport" content="width=device-width, initial-scale=1" /> 10 10 11 11 <!-- title change by HEAL --> … … 46 46 <hr> 47 47 </noscript> 48 <p id="model"> 48 <p id="model">$\cos(x^2)$ 49 49 </p> 50 50 </body>
Note: See TracChangeset
for help on using the changeset viewer.