Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/31/14 13:38:42 (11 years ago)
Author:
mkommend
Message:

#1837: Corrected project files and merged trunk changes to the sliding window branch.

Location:
branches/Sliding Window GP/HeuristicLab.Problems.DataAnalysis.Symbolic.Views
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • branches/Sliding Window GP/HeuristicLab.Problems.DataAnalysis.Symbolic.Views

  • branches/Sliding Window GP/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic.Views-3.4.csproj

    r10419 r10681  
    117117      <Private>False</Private>
    118118    </Reference>
     119    <Reference Include="HeuristicLab.Common.Resources-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     120      <SpecificVersion>False</SpecificVersion>
     121      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Common.Resources-3.3.dll</HintPath>
     122      <Private>False</Private>
     123    </Reference>
    119124    <Reference Include="HeuristicLab.Core-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
    120125      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Core-3.3.dll</HintPath>
  • branches/Sliding Window GP/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/InteractiveSymbolicDataAnalysisSolutionSimplifierView.Designer.cs

    r9708 r10681  
    1919 */
    2020#endregion
     21
    2122
    2223namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Views {
     
    137138      //
    138139      // btnOptimizeConstants
    139       //
    140       this.btnOptimizeConstants.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
     140      //      
     141      this.btnOptimizeConstants.AutoSize = true;
    141142      this.btnOptimizeConstants.Enabled = false;
    142       this.btnOptimizeConstants.Location = new System.Drawing.Point(104, 3);
     143      this.btnOptimizeConstants.Image = HeuristicLab.Common.Resources.VSImageLibrary.Performance;
     144      this.btnOptimizeConstants.ImageAlign = System.Drawing.ContentAlignment.MiddleCenter;
     145      this.btnOptimizeConstants.Location = new System.Drawing.Point(105, 3);
    143146      this.btnOptimizeConstants.Name = "btnOptimizeConstants";
    144       this.btnOptimizeConstants.Size = new System.Drawing.Size(97, 23);
     147      this.btnOptimizeConstants.Size = new System.Drawing.Size(80, 24);
    145148      this.btnOptimizeConstants.TabIndex = 2;
    146149      this.btnOptimizeConstants.Text = "Optimize";
     150      this.btnOptimizeConstants.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
     151      this.btnOptimizeConstants.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText;
    147152      this.btnOptimizeConstants.UseVisualStyleBackColor = true;
    148153      this.btnOptimizeConstants.Click += new System.EventHandler(this.btnOptimizeConstants_Click);
     
    150155      // btnSimplify
    151156      //
     157      this.btnSimplify.AutoSize = true;
     158      this.btnSimplify.Enabled = true;
     159      this.btnSimplify.Image = HeuristicLab.Common.Resources.VSImageLibrary.FormulaEvaluator;
     160      this.btnSimplify.ImageAlign = System.Drawing.ContentAlignment.MiddleCenter;
    152161      this.btnSimplify.Location = new System.Drawing.Point(3, 3);
    153162      this.btnSimplify.Name = "btnSimplify";
    154       this.btnSimplify.Size = new System.Drawing.Size(95, 23);
     163      this.btnSimplify.Size = new System.Drawing.Size(80, 24);
    155164      this.btnSimplify.TabIndex = 1;
    156165      this.btnSimplify.Text = "Simplify";
     166      this.btnSimplify.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
     167      this.btnSimplify.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText;
    157168      this.btnSimplify.UseVisualStyleBackColor = true;
    158169      this.btnSimplify.Click += new System.EventHandler(this.btnSimplify_Click);
  • branches/Sliding Window GP/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/InteractiveSymbolicDataAnalysisSolutionSimplifierView.cs

    r9708 r10681  
    5252      Content.ModelChanged += Content_Changed;
    5353      Content.ProblemDataChanged += Content_Changed;
     54      treeChart.Repainted += treeChart_Repainted;
    5455    }
    5556    protected override void DeregisterContentEvents() {
     
    5758      Content.ModelChanged -= Content_Changed;
    5859      Content.ProblemDataChanged -= Content_Changed;
     60      treeChart.Repainted -= treeChart_Repainted;
    5961    }
    6062
     
    7072    }
    7173
     74    private void treeChart_Repainted(object sender, EventArgs e) {
     75      if (nodeImpacts != null && nodeImpacts.Count > 0)
     76        PaintNodeImpacts();
     77    }
     78
    7279    private void UpdateView() {
    7380      if (Content == null || Content.Model == null || Content.ProblemData == null) return;
     
    7582      treeChart.Tree = tree.Root.SubtreeCount > 1 ? new SymbolicExpressionTree(tree.Root) : new SymbolicExpressionTree(tree.Root.GetSubtree(0).GetSubtree(0));
    7683
    77       var replacementValues = CalculateReplacementValues(tree);
     84      var impactAndReplacementValues = CalculateImpactAndReplacementValues(tree);
     85      nodeImpacts = impactAndReplacementValues.ToDictionary(x => x.Key, x => x.Value.Item1);
     86      var replacementValues = impactAndReplacementValues.ToDictionary(x => x.Key, x => x.Value.Item2);
    7887      foreach (var pair in replacementValues.Where(pair => !(pair.Key is ConstantTreeNode))) {
    7988        foldedNodes[pair.Key] = MakeConstantTreeNode(pair.Value);
    8089      }
    81 
    82       nodeImpacts = CalculateImpactValues(tree);
    8390      PaintNodeImpacts();
    8491    }
     
    8693    protected abstract Dictionary<ISymbolicExpressionTreeNode, double> CalculateReplacementValues(ISymbolicExpressionTree tree);
    8794    protected abstract Dictionary<ISymbolicExpressionTreeNode, double> CalculateImpactValues(ISymbolicExpressionTree tree);
     95    protected abstract Dictionary<ISymbolicExpressionTreeNode, Tuple<double, double>> CalculateImpactAndReplacementValues(ISymbolicExpressionTree tree);
    8896    protected abstract void UpdateModel(ISymbolicExpressionTree tree);
    8997
     
    96104
    97105    private void treeChart_SymbolicExpressionTreeNodeDoubleClicked(object sender, MouseEventArgs e) {
    98       var visualNode = (VisualSymbolicExpressionTreeNode)sender;
    99       var symbExprTreeNode = (SymbolicExpressionTreeNode)visualNode.SymbolicExpressionTreeNode;
     106      var visualNode = (VisualTreeNode<ISymbolicExpressionTreeNode>)sender;
     107      var symbExprTreeNode = (SymbolicExpressionTreeNode)visualNode.Content;
    100108      if (symbExprTreeNode == null) return;
    101109      var tree = Content.Model.SymbolicExpressionTree;
     
    125133      double max = impacts.Max();
    126134      double min = impacts.Min();
    127       foreach (ISymbolicExpressionTreeNode treeNode in Content.Model.SymbolicExpressionTree.IterateNodesPostfix()) {
    128         VisualSymbolicExpressionTreeNode visualTree = treeChart.GetVisualSymbolicExpressionTreeNode(treeNode);
     135      foreach (var treeNode in Content.Model.SymbolicExpressionTree.IterateNodesPostfix()) {
     136        VisualTreeNode<ISymbolicExpressionTreeNode> visualTree = treeChart.GetVisualSymbolicExpressionTreeNode(treeNode);
    129137
    130138        if (!(treeNode is ConstantTreeNode) && nodeImpacts.ContainsKey(treeNode)) {
  • branches/Sliding Window GP/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/InteractiveSymbolicExpressionTreeChart.cs

    r9708 r10681  
    3333  internal sealed partial class InteractiveSymbolicExpressionTreeChart : SymbolicExpressionTreeChart {
    3434    private ISymbolicExpressionTreeNode tempNode; // node in clipboard (to be cut/copy/pasted etc)
    35     private VisualSymbolicExpressionTreeNode currSelected; // currently selected node
     35    private VisualTreeNode<ISymbolicExpressionTreeNode> currSelected; // currently selected node
    3636    private enum EditOp { NoOp, CopySubtree, CutSubtree }
    3737    private EditOp lastOp = EditOp.NoOp;
     
    6565        pasteToolStripMenuItem.Visible = false;
    6666      } else {
    67         var node = currSelected.SymbolicExpressionTreeNode;
     67        var node = currSelected.Content;
    6868        insertNodeToolStripMenuItem.Visible = true;
    6969        changeNodeToolStripMenuItem.Visible = true;
     
    7777        pasteToolStripMenuItem.Enabled = tempNode != null && insertNodeToolStripMenuItem.Enabled
    7878                                                          && !(lastOp == EditOp.CutSubtree
    79                                                                && tempNode.IterateNodesBreadth().Contains(currSelected.SymbolicExpressionTreeNode));
     79                                                               && tempNode.IterateNodesBreadth().Contains(currSelected.Content));
    8080      }
    8181    }
    8282
    8383    protected override void OnSymbolicExpressionTreeNodeClicked(object sender, MouseEventArgs e) {
    84       currSelected = (VisualSymbolicExpressionTreeNode)sender; ;
     84      currSelected = (VisualTreeNode<ISymbolicExpressionTreeNode>)sender; ;
    8585      if (currSelected != null) {
    8686        currSelected.LineColor = Color.FromArgb(130, currSelected.LineColor);
     
    104104
    105105    private void insertNodeToolStripMenuItem_Click(object sender, EventArgs e) {
    106       if (currSelected == null || currSelected.SymbolicExpressionTreeNode is SymbolicExpressionTreeTerminalNode) return;
    107       var parent = currSelected.SymbolicExpressionTreeNode;
     106      if (currSelected == null || currSelected.Content is SymbolicExpressionTreeTerminalNode) return;
     107      var parent = currSelected.Content;
    108108
    109109      using (var dialog = new InsertNodeDialog()) {
     
    138138      if (currSelected == null) return;
    139139
    140       var node = (ISymbolicExpressionTreeNode)currSelected.SymbolicExpressionTreeNode.Clone();
    141       var originalNode = currSelected.SymbolicExpressionTreeNode;
     140      var node = (ISymbolicExpressionTreeNode)currSelected.Content.Clone();
     141      var originalNode = currSelected.Content;
    142142
    143143      ISymbolicExpressionTreeNode newNode = null;
     
    180180        }
    181181      }
    182       tempNode = currSelected.SymbolicExpressionTreeNode;
     182      tempNode = currSelected.Content;
    183183      foreach (var node in tempNode.IterateNodesPostfix()) {
    184184        var visualNode = GetVisualSymbolicExpressionTreeNode(node);
     
    194194    }
    195195    private void removeNodeToolStripMenuItem_Click(object sender, EventArgs e) {
    196       var node = currSelected.SymbolicExpressionTreeNode;
     196      var node = currSelected.Content;
    197197      if (node == tempNode) tempNode = null;
    198198      ModifyTree(Tree, node.Parent, node, null, removeSubtree: false);
     
    200200    }
    201201    private void removeSubtreeToolStripMenuItem_Click(object sender, EventArgs e) {
    202       var node = currSelected.SymbolicExpressionTreeNode;
     202      var node = currSelected.Content;
    203203      if (node.IterateNodesPostfix().Contains(tempNode)) tempNode = null;
    204204      ModifyTree(Tree, node.Parent, node, null, removeSubtree: true);
     
    209209      if (!(lastOp == EditOp.CopySubtree || lastOp == EditOp.CutSubtree)) return;
    210210      // check if the copied/cut node (stored in the tempNode) can be inserted as a child of the current selected node
    211       var node = currSelected.SymbolicExpressionTreeNode;
     211      var node = currSelected.Content;
    212212      if (node is ConstantTreeNode || node is VariableTreeNode) return;
    213213      // check if the currently selected node can accept the copied node as a child
     
    218218            if (tempNode.IterateNodesBreadth().Contains(node))
    219219              throw new ArgumentException();// cannot cut/paste a node into itself
    220             ModifyTree(Tree, tempNode.Parent, tempNode, null); //remove node from its original parent     
     220            ModifyTree(Tree, tempNode.Parent, tempNode, null); //remove node from its original parent
    221221            ModifyTree(Tree, node, null, tempNode); //insert it as a child to the new parent
    222222            break;
  • branches/Sliding Window GP/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Plugin.cs.frame

    r10364 r10681  
    3232  [PluginDependency("HeuristicLab.Collections", "3.3")]
    3333  [PluginDependency("HeuristicLab.Common", "3.3")]
     34  [PluginDependency("HeuristicLab.Common.Resources", "3.3")]
    3435  [PluginDependency("HeuristicLab.Core", "3.3")]
    3536  [PluginDependency("HeuristicLab.Core.Views", "3.3")]
  • branches/Sliding Window GP/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/TextualSymbolicDataAnalysisModelView.designer.cs

    r9708 r10681  
    4848      this.SuspendLayout();
    4949      //
    50       // expressionTreeView
     50      // symbolicExpressionTreeView
    5151      //
    5252      this.symbolicExpressionTreeView.AllowDrop = true;
     
    5454      this.symbolicExpressionTreeView.Content = null;
    5555      this.symbolicExpressionTreeView.Dock = System.Windows.Forms.DockStyle.Fill;
     56      this.symbolicExpressionTreeView.Font = new System.Drawing.Font("Consolas", 8.25F);
    5657      this.symbolicExpressionTreeView.Location = new System.Drawing.Point(0, 0);
    57       this.symbolicExpressionTreeView.Name = "expressionTreeView";
     58      this.symbolicExpressionTreeView.Name = "symbolicExpressionTreeView";
    5859      this.symbolicExpressionTreeView.ReadOnly = false;
    5960      this.symbolicExpressionTreeView.Size = new System.Drawing.Size(352, 413);
    6061      this.symbolicExpressionTreeView.TabIndex = 0;
    6162      //
    62       // SymbolicExpressionModelView
     63      // TextualSymbolicDataAnalysisModelView
    6364      //
    6465      this.AllowDrop = true;
    65       this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    6666      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
    6767      this.Controls.Add(this.symbolicExpressionTreeView);
    68       this.Name = "SymbolicExpressionModelView";
     68      this.Name = "TextualSymbolicDataAnalysisModelView";
    6969      this.Size = new System.Drawing.Size(352, 413);
    7070      this.ResumeLayout(false);
Note: See TracChangeset for help on using the changeset viewer.