Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
08/01/13 13:01:40 (11 years ago)
Author:
bburlacu
Message:

#1772: Merged remaining trunk changes into the EvolutionaryTracking branch.

Location:
branches/HeuristicLab.EvolutionaryTracking
Files:
1 added
5 edited
1 copied

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.EvolutionaryTracking

  • branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views

  • branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views-3.4.csproj

    r8600 r9835  
    4141    <DebugType>full</DebugType>
    4242    <Optimize>false</Optimize>
    43     <OutputPath>$(SolutionDir)\bin\</OutputPath>
     43    <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath>
    4444    <DefineConstants>DEBUG;TRACE</DefineConstants>
    4545    <ErrorReport>prompt</ErrorReport>
     
    5050    <DebugType>pdbonly</DebugType>
    5151    <Optimize>true</Optimize>
    52     <OutputPath>$(SolutionDir)\bin\</OutputPath>
     52    <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath>
    5353    <DefineConstants>TRACE</DefineConstants>
    5454    <ErrorReport>prompt</ErrorReport>
     
    5858  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
    5959    <DebugSymbols>true</DebugSymbols>
    60     <OutputPath>$(SolutionDir)\bin\</OutputPath>
     60    <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath>
    6161    <DefineConstants>DEBUG;TRACE</DefineConstants>
    6262    <DebugType>full</DebugType>
     
    6666  </PropertyGroup>
    6767  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
    68     <OutputPath>$(SolutionDir)\bin\</OutputPath>
     68    <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath>
    6969    <DefineConstants>TRACE</DefineConstants>
    7070    <Optimize>true</Optimize>
     
    7676  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
    7777    <DebugSymbols>true</DebugSymbols>
    78     <OutputPath>$(SolutionDir)\bin\</OutputPath>
     78    <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath>
    7979    <DefineConstants>DEBUG;TRACE</DefineConstants>
    8080    <DebugType>full</DebugType>
     
    8484  </PropertyGroup>
    8585  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
    86     <OutputPath>$(SolutionDir)\bin\</OutputPath>
     86    <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath>
    8787    <DefineConstants>TRACE</DefineConstants>
    8888    <Optimize>true</Optimize>
     
    9393  </PropertyGroup>
    9494  <ItemGroup>
     95    <Reference Include="HeuristicLab.Collections-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     96      <SpecificVersion>False</SpecificVersion>
     97      <HintPath>..\..\..\..\Trunk\sources\bin\HeuristicLab.Collections-3.3.dll</HintPath>
     98      <Private>False</Private>
     99    </Reference>
     100    <Reference Include="HeuristicLab.Common-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     101      <SpecificVersion>False</SpecificVersion>
     102      <HintPath>..\..\..\..\Trunk\sources\bin\HeuristicLab.Common-3.3.dll</HintPath>
     103      <Private>False</Private>
     104    </Reference>
     105    <Reference Include="HeuristicLab.Common.Resources-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     106      <SpecificVersion>False</SpecificVersion>
     107      <HintPath>..\..\..\..\Trunk\sources\bin\HeuristicLab.Common.Resources-3.3.dll</HintPath>
     108      <Private>False</Private>
     109    </Reference>
     110    <Reference Include="HeuristicLab.Core-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     111      <SpecificVersion>False</SpecificVersion>
     112      <HintPath>..\..\..\..\Trunk\sources\bin\HeuristicLab.Core-3.3.dll</HintPath>
     113      <Private>False</Private>
     114    </Reference>
     115    <Reference Include="HeuristicLab.Core.Views-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     116      <SpecificVersion>False</SpecificVersion>
     117      <HintPath>..\..\..\..\Trunk\sources\bin\HeuristicLab.Core.Views-3.3.dll</HintPath>
     118      <Private>False</Private>
     119    </Reference>
     120    <Reference Include="HeuristicLab.Data-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     121      <SpecificVersion>False</SpecificVersion>
     122      <HintPath>..\..\..\..\Trunk\sources\bin\HeuristicLab.Data-3.3.dll</HintPath>
     123      <Private>False</Private>
     124    </Reference>
     125    <Reference Include="HeuristicLab.Data.Views-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     126      <SpecificVersion>False</SpecificVersion>
     127      <HintPath>..\..\..\..\Trunk\sources\bin\HeuristicLab.Data.Views-3.3.dll</HintPath>
     128      <Private>False</Private>
     129    </Reference>
     130    <Reference Include="HeuristicLab.MainForm-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     131      <SpecificVersion>False</SpecificVersion>
     132      <HintPath>..\..\..\..\Trunk\sources\bin\HeuristicLab.MainForm-3.3.dll</HintPath>
     133      <Private>False</Private>
     134    </Reference>
     135    <Reference Include="HeuristicLab.MainForm.WindowsForms-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     136      <SpecificVersion>False</SpecificVersion>
     137      <HintPath>..\..\..\..\Trunk\sources\bin\HeuristicLab.MainForm.WindowsForms-3.3.dll</HintPath>
     138      <Private>False</Private>
     139    </Reference>
     140    <Reference Include="HeuristicLab.Operators-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     141      <SpecificVersion>False</SpecificVersion>
     142      <HintPath>..\..\..\..\Trunk\sources\bin\HeuristicLab.Operators-3.3.dll</HintPath>
     143      <Private>False</Private>
     144    </Reference>
     145    <Reference Include="HeuristicLab.Optimization-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     146      <SpecificVersion>False</SpecificVersion>
     147      <HintPath>..\..\..\..\Trunk\sources\bin\HeuristicLab.Optimization-3.3.dll</HintPath>
     148      <Private>False</Private>
     149    </Reference>
     150    <Reference Include="HeuristicLab.PluginInfrastructure-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     151      <SpecificVersion>False</SpecificVersion>
     152      <HintPath>..\..\..\..\Trunk\sources\bin\HeuristicLab.PluginInfrastructure-3.3.dll</HintPath>
     153      <Private>False</Private>
     154    </Reference>
     155    <Reference Include="HeuristicLab.Random-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     156      <SpecificVersion>False</SpecificVersion>
     157      <HintPath>..\..\..\..\Trunk\sources\bin\HeuristicLab.Random-3.3.dll</HintPath>
     158      <Private>False</Private>
     159    </Reference>
     160    <Reference Include="HeuristicLab.Visualization.ChartControlsExtensions-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     161      <SpecificVersion>False</SpecificVersion>
     162      <HintPath>..\..\..\..\Trunk\sources\bin\HeuristicLab.Visualization.ChartControlsExtensions-3.3.dll</HintPath>
     163      <Private>False</Private>
     164    </Reference>
    95165    <Reference Include="System" />
    96166    <Reference Include="System.Core">
     
    160230      <DependentUpon>SymbolicExpressionView.cs</DependentUpon>
    161231    </Compile>
     232    <Compile Include="TreeLayout.cs" />
    162233    <Compile Include="VisualSymbolicExpressionTreeNode.cs" />
    163234    <Compile Include="VisualSymbolicExpressionTreeNodeConnection.cs" />
    164235  </ItemGroup>
    165236  <ItemGroup>
    166     <ProjectReference Include="..\..\HeuristicLab.Collections\3.3\HeuristicLab.Collections-3.3.csproj">
    167       <Project>{958B43BC-CC5C-4FA2-8628-2B3B01D890B6}</Project>
    168       <Name>HeuristicLab.Collections-3.3</Name>
    169       <Private>False</Private>
    170     </ProjectReference>
    171     <ProjectReference Include="..\..\HeuristicLab.Common.Resources\3.3\HeuristicLab.Common.Resources-3.3.csproj">
    172       <Project>{0E27A536-1C4A-4624-A65E-DC4F4F23E3E1}</Project>
    173       <Name>HeuristicLab.Common.Resources-3.3</Name>
    174       <Private>False</Private>
    175     </ProjectReference>
    176     <ProjectReference Include="..\..\HeuristicLab.Common\3.3\HeuristicLab.Common-3.3.csproj">
    177       <Project>{A9AD58B9-3EF9-4CC1-97E5-8D909039FF5C}</Project>
    178       <Name>HeuristicLab.Common-3.3</Name>
    179       <Private>False</Private>
    180     </ProjectReference>
    181     <ProjectReference Include="..\..\HeuristicLab.Core.Views\3.3\HeuristicLab.Core.Views-3.3.csproj">
    182       <Project>{E226881D-315F-423D-B419-A766FE0D8685}</Project>
    183       <Name>HeuristicLab.Core.Views-3.3</Name>
    184       <Private>False</Private>
    185     </ProjectReference>
    186     <ProjectReference Include="..\..\HeuristicLab.Core\3.3\HeuristicLab.Core-3.3.csproj">
    187       <Project>{C36BD924-A541-4A00-AFA8-41701378DDC5}</Project>
    188       <Name>HeuristicLab.Core-3.3</Name>
    189       <Private>False</Private>
    190     </ProjectReference>
    191     <ProjectReference Include="..\..\HeuristicLab.Data.Views\3.3\HeuristicLab.Data.Views-3.3.csproj">
    192       <Project>{72104A0B-90E7-42F3-9ABE-9BBBADD4B943}</Project>
    193       <Name>HeuristicLab.Data.Views-3.3</Name>
    194       <Private>False</Private>
    195     </ProjectReference>
    196     <ProjectReference Include="..\..\HeuristicLab.Data\3.3\HeuristicLab.Data-3.3.csproj">
    197       <Project>{BBAB9DF5-5EF3-4BA8-ADE9-B36E82114937}</Project>
    198       <Name>HeuristicLab.Data-3.3</Name>
    199       <Private>False</Private>
    200     </ProjectReference>
    201237    <ProjectReference Include="..\..\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding\3.4\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4.csproj">
    202238      <Project>{06D4A186-9319-48A0-BADE-A2058D462EEA}</Project>
    203239      <Name>HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4</Name>
    204       <Private>False</Private>
    205     </ProjectReference>
    206     <ProjectReference Include="..\..\HeuristicLab.MainForm.WindowsForms\3.3\HeuristicLab.MainForm.WindowsForms-3.3.csproj">
    207       <Project>{AB687BBE-1BFE-476B-906D-44237135431D}</Project>
    208       <Name>HeuristicLab.MainForm.WindowsForms-3.3</Name>
    209       <Private>False</Private>
    210     </ProjectReference>
    211     <ProjectReference Include="..\..\HeuristicLab.MainForm\3.3\HeuristicLab.MainForm-3.3.csproj">
    212       <Project>{3BD61258-31DA-4B09-89C0-4F71FEF5F05A}</Project>
    213       <Name>HeuristicLab.MainForm-3.3</Name>
    214       <Private>False</Private>
    215     </ProjectReference>
    216     <ProjectReference Include="..\..\HeuristicLab.Operators\3.3\HeuristicLab.Operators-3.3.csproj">
    217       <Project>{23DA7FF4-D5B8-41B6-AA96-F0561D24F3EE}</Project>
    218       <Name>HeuristicLab.Operators-3.3</Name>
    219240      <Private>False</Private>
    220241    </ProjectReference>
     
    222243      <Project>{662B4B15-8F4D-4AE5-B3EB-D91C215F5AF2}</Project>
    223244      <Name>HeuristicLab.Optimization.Views-3.3</Name>
    224       <Private>False</Private>
    225     </ProjectReference>
    226     <ProjectReference Include="..\..\HeuristicLab.Optimization\3.3\HeuristicLab.Optimization-3.3.csproj">
    227       <Project>{14AB8D24-25BC-400C-A846-4627AA945192}</Project>
    228       <Name>HeuristicLab.Optimization-3.3</Name>
    229       <Private>False</Private>
    230     </ProjectReference>
    231     <ProjectReference Include="..\..\HeuristicLab.PluginInfrastructure\3.3\HeuristicLab.PluginInfrastructure-3.3.csproj">
    232       <Project>{94186A6A-5176-4402-AE83-886557B53CCA}</Project>
    233       <Name>HeuristicLab.PluginInfrastructure-3.3</Name>
    234       <Private>False</Private>
    235     </ProjectReference>
    236     <ProjectReference Include="..\..\HeuristicLab.Random\3.3\HeuristicLab.Random-3.3.csproj">
    237       <Project>{F4539FB6-4708-40C9-BE64-0A1390AEA197}</Project>
    238       <Name>HeuristicLab.Random-3.3</Name>
    239       <Private>False</Private>
    240     </ProjectReference>
    241     <ProjectReference Include="..\..\HeuristicLab.Visualization.ChartControlsExtensions\3.3\HeuristicLab.Visualization.ChartControlsExtensions-3.3.csproj">
    242       <Project>{315BDA09-3F4F-49B3-9790-B37CFC1C5750}</Project>
    243       <Name>HeuristicLab.Visualization.ChartControlsExtensions-3.3</Name>
    244245      <Private>False</Private>
    245246    </ProjectReference>
     
    267268    </BootstrapperPackage>
    268269  </ItemGroup>
     270  <ItemGroup>
     271    <EmbeddedResource Include="SymbolicExpressionTreeChart.resx">
     272      <DependentUpon>SymbolicExpressionTreeChart.cs</DependentUpon>
     273    </EmbeddedResource>
     274  </ItemGroup>
    269275  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
    270276  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
     
    276282  -->
    277283  <PropertyGroup>
    278    <PreBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">set Path=%25Path%25;$(ProjectDir);$(SolutionDir)
     284    <PreBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">set Path=%25Path%25;$(ProjectDir);$(SolutionDir)
    279285set ProjectDir=$(ProjectDir)
    280286set SolutionDir=$(SolutionDir)
     
    283289call PreBuildEvent.cmd
    284290</PreBuildEvent>
    285 <PreBuildEvent Condition=" '$(OS)' != 'Windows_NT' ">
     291    <PreBuildEvent Condition=" '$(OS)' != 'Windows_NT' ">
    286292export ProjectDir=$(ProjectDir)
    287293export SolutionDir=$(SolutionDir)
  • branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionTreeChart.Designer.cs

    r9456 r9835  
    7070      //
    7171      this.saveFileDialog.Filter = "Bitmap (*.bmp)|*.bmp|EMF (*.emf)|*.emf";
    72       this.saveFileDialog.FilterIndex = 1;
     72      //
    7373      // SymbolicExpressionTreeChart
    7474      //
    75       this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    7675      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
    7776      this.ContextMenuStrip = this.contextMenuStrip;
     77      this.DoubleBuffered = true;
    7878      this.Name = "SymbolicExpressionTreeChart";
    7979      this.MouseClick += new System.Windows.Forms.MouseEventHandler(this.SymbolicExpressionTreeChart_MouseClick);
  • branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionTreeChart.cs

    r9587 r9835  
    2525using System.Drawing.Imaging;
    2626using System.Windows.Forms;
     27using Point = System.Drawing.Point;
    2728
    2829namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views {
     
    4849    }
    4950
     51    #region Public properties
    5052    private int spacing;
    5153    public int Spacing {
     
    106108      set { suspendRepaint = value; }
    107109    }
     110    #endregion
    108111
    109112    protected override void OnPaint(PaintEventArgs e) {
     
    250253
    251254    #region methods for painting the symbolic expression tree
     255
    252256    private void DrawFunctionTree(ISymbolicExpressionTree tree, Graphics graphics, int x, int y, int width, int height) {
    253       DrawFunctionTree(tree.Root, graphics, x, y, width, height, Point.Empty);
     257      //      DrawFunctionTree(tree.Root, graphics, x, y, width, height, Point.Empty);
     258      AlternateDraw(tree, graphics, 70, 46, 20, 50);
     259    }
     260
     261    private void AlternateDraw(ISymbolicExpressionTree tree, Graphics graphics, int preferredWidth, int preferredHeight, int minDistance, int maxDistance) {
     262      var tl = new TreeLayout();
     263      tl.Distance = 5;
     264      tl.SymbolicExpressionTree = tree;
     265
     266      var nodePositions = tl.GetNodeCoordinates();
     267      var bounds = tl.Bounds();
     268
     269      double sx = Width / bounds.Width;
     270      double sy = Height / bounds.Height;
     271
     272      double dx = tl.Distance * sx; // scaled horizontal distance
     273      double dy = tl.Distance * sy; // scaled vertical distance
     274
     275      int maxWidth = (int)Math.Round(dx);
     276      int maxHeight = (int)Math.Round(dy);
     277
     278      // instead of using the preferred with/height of each node inside the foreach loop below,
     279      // we assume the same width/height for all nodes
     280      int w = Math.Min(preferredWidth, maxWidth - minDistance / 2);
     281      int h = Math.Min(preferredHeight, maxHeight - minDistance / 2);
     282      // adjust scaling factor so that nodes will be at most maxDistance far from each other on the horizontal axis
     283      double offset = 0;
     284      if (maxDistance + w < maxWidth) {
     285        sx *= (double)(maxDistance + w) / maxWidth;
     286        offset = (Width - (sx * bounds.Width)) / 2;
     287      }
     288      foreach (var node in visualTreeNodes.Keys) {
     289        var visualNode = visualTreeNodes[node];
     290        var pos = nodePositions[node];
     291        visualNode.Width = w;
     292        visualNode.Height = h;
     293        visualNode.X = (int)Math.Round(pos.X * sx + offset); ;
     294        visualNode.Y = (int)Math.Round(pos.Y * sy);
     295        DrawTreeNode(graphics, visualNode);
     296      }
     297      graphics.ResetClip(); // reset clip region
     298      foreach (var visualNode in visualTreeNodes.Values) {
     299        var node = visualNode.SymbolicExpressionTreeNode;
     300        foreach (var subtree in node.Subtrees) {
     301          var visualLine = GetVisualSymbolicExpressionTreeNodeConnection(node, subtree);
     302          var visualSubtree = visualTreeNodes[subtree];
     303          var origin = new Point(visualNode.X + visualNode.Width / 2, visualNode.Y + visualNode.Height);
     304          var target = new Point(visualSubtree.X + visualSubtree.Width / 2, visualSubtree.Y);
     305          using (var linePen = new Pen(visualLine.LineColor)) {
     306            linePen.DashStyle = visualLine.DashStyle;
     307            graphics.DrawLine(linePen, origin, target);
     308          }
     309        }
     310      }
    254311    }
    255312
     
    257314    ///
    258315    /// </summary>
    259     /// <param name="functionTree"> function tree to draw</param>
     316    /// <param name="node">the root of the function tree to draw</param>
    260317    /// <param name="graphics">graphics object to draw on</param>
    261318    /// <param name="x">x coordinate of drawing area</param>
     
    365422    }
    366423    #endregion
    367 
    368424    #region save image
    369425    private void saveImageToolStripMenuItem_Click(object sender, EventArgs e) {
  • branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionView.cs

    r9456 r9835  
    3131  [Content(typeof(ISymbolicExpressionTree), false)]
    3232  public partial class SymbolicExpressionView : AsynchronousContentView {
    33 
    34     List<ISymbolicExpressionTreeStringFormatter> treeFormattersList = new List<ISymbolicExpressionTreeStringFormatter>();
     33    private readonly List<ISymbolicExpressionTreeStringFormatter> treeFormattersList = new List<ISymbolicExpressionTreeStringFormatter>();
    3534
    3635    public new ISymbolicExpressionTree Content {
     
    4847      }
    4948      if (formattersComboBox.Items.Count > 0)
    50         formattersComboBox.SelectedIndex = 0;
     49        formattersComboBox.SelectedIndex = treeFormattersList.FindIndex(0, treeFormattersList.Count, (f) => f.Name.Contains("Default"));
    5150      else
    5251        formattersComboBox.SelectedIndex = -1;
Note: See TracChangeset for help on using the changeset viewer.