Free cookie consent management tool by TermsFeed Policy Generator

Changeset 2908


Ignore:
Timestamp:
03/02/10 05:27:12 (15 years ago)
Author:
swagner
Message:

Operator architecture refactoring (#95)

  • worked on analysis
Location:
trunk/sources
Files:
10 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Algorithms.SGA/3.3/SGAOperator.cs

    r2891 r2908  
    9696
    9797      #region Create operator graph
     98      VariableCreator variableCreator = new VariableCreator();
     99      ResultsCollector resultsCollector1 = new ResultsCollector();
    98100      SubScopesSorter subScopesSorter1 = new SubScopesSorter();
    99101      Placeholder selector = new Placeholder();
     
    114116      Comparator comparator = new Comparator();
    115117      BestAverageWorstQualityCalculator bestAverageWorstQualityCalculator = new BestAverageWorstQualityCalculator();
    116       ResultsCollector resultsCollector = new ResultsCollector();
     118      ResultsCollector resultsCollector2 = new ResultsCollector();
     119      DataTableValuesCollector dataTableValuesCollector = new DataTableValuesCollector();
    117120      ConditionalBranch conditionalBranch = new ConditionalBranch();
     121
     122      OperatorGraph.InitialOperator = variableCreator;
     123
     124      variableCreator.CollectedValues.Add(new ValueParameter<DataTable>("Qualities", new DataTable("Qualities")));
     125      variableCreator.Successor = resultsCollector1;
     126
     127      LookupParameter<DataTable> qualities = new LookupParameter<DataTable>("Qualities");
     128      qualities.ActualName = "Qualities";
     129      resultsCollector1.CollectedValues.Add(qualities);
     130      resultsCollector1.ResultsParameter.ActualName = "Results";
     131      resultsCollector1.Successor = subScopesSorter1;
    118132
    119133      subScopesSorter1.DescendingParameter.ActualName = "Maximization";
    120134      subScopesSorter1.ValueParameter.ActualName = "Quality";
    121       OperatorGraph.InitialOperator = subScopesSorter1;
    122135      subScopesSorter1.Successor = selector;
    123136
     
    188201      bestAverageWorstQualityCalculator.QualityParameter.ActualName = "Quality";
    189202      bestAverageWorstQualityCalculator.WorstQualityParameter.ActualName = "WorstQuality";
    190       bestAverageWorstQualityCalculator.Successor = resultsCollector;
     203      bestAverageWorstQualityCalculator.Successor = dataTableValuesCollector;
    191204
    192205      LookupParameter<DoubleData> bestQuality = new LookupParameter<DoubleData>("BestQuality");
    193206      bestQuality.ActualName = "BestQuality";
    194       resultsCollector.CollectedValues.Add(bestQuality);
     207      dataTableValuesCollector.CollectedValues.Add(bestQuality);
    195208      LookupParameter<DoubleData> averageQuality = new LookupParameter<DoubleData>("AverageQuality");
    196209      averageQuality.ActualName = "AverageQuality";
    197       resultsCollector.CollectedValues.Add(averageQuality);
     210      dataTableValuesCollector.CollectedValues.Add(averageQuality);
    198211      LookupParameter<DoubleData> worstQuality = new LookupParameter<DoubleData>("WorstQuality");
    199212      worstQuality.ActualName = "WorstQuality";
    200       resultsCollector.CollectedValues.Add(worstQuality);
    201       resultsCollector.ResultsParameter.ActualName = "Results";
    202       resultsCollector.Successor = conditionalBranch;
     213      dataTableValuesCollector.CollectedValues.Add(worstQuality);
     214      dataTableValuesCollector.DataTableParameter.ActualName = "Qualities";
     215      dataTableValuesCollector.Successor = resultsCollector2;
     216
     217      bestQuality = new LookupParameter<DoubleData>("BestQuality");
     218      bestQuality.ActualName = "BestQuality";
     219      resultsCollector2.CollectedValues.Add(bestQuality);
     220      averageQuality = new LookupParameter<DoubleData>("AverageQuality");
     221      averageQuality.ActualName = "AverageQuality";
     222      resultsCollector2.CollectedValues.Add(averageQuality);
     223      worstQuality = new LookupParameter<DoubleData>("WorstQuality");
     224      worstQuality.ActualName = "WorstQuality";
     225      resultsCollector2.CollectedValues.Add(worstQuality);
     226      resultsCollector2.ResultsParameter.ActualName = "Results";
     227      resultsCollector2.Successor = conditionalBranch;
    203228
    204229      conditionalBranch.ConditionParameter.ActualName = "Terminate";
  • trunk/sources/HeuristicLab.Analysis.Views/3.3/HeuristicLab.Analysis.Views-3.3.csproj

    r2900 r2908  
    7575    <Reference Include="System.Drawing" />
    7676    <Reference Include="System.Windows.Forms" />
     77    <Reference Include="System.Windows.Forms.DataVisualization, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
    7778    <Reference Include="System.Xml.Linq">
    7879      <RequiredTargetFramework>3.5</RequiredTargetFramework>
     
    8889    <Compile Include="HeuristicLabAnalysisViewsPlugin.cs" />
    8990    <Compile Include="Properties\AssemblyInfo.cs" />
     91    <Compile Include="DataTableView.cs">
     92      <SubType>UserControl</SubType>
     93    </Compile>
     94    <Compile Include="DataTableView.Designer.cs">
     95      <DependentUpon>DataTableView.cs</DependentUpon>
     96    </Compile>
    9097  </ItemGroup>
    9198  <ItemGroup>
     
    98105      <Name>HeuristicLab.Analysis-3.3</Name>
    99106    </ProjectReference>
     107    <ProjectReference Include="..\..\HeuristicLab.Collections\3.3\HeuristicLab.Collections-3.3.csproj">
     108      <Project>{958B43BC-CC5C-4FA2-8628-2B3B01D890B6}</Project>
     109      <Name>HeuristicLab.Collections-3.3</Name>
     110    </ProjectReference>
    100111    <ProjectReference Include="..\..\HeuristicLab.Core.Views\3.3\HeuristicLab.Core.Views-3.3.csproj">
    101112      <Project>{E226881D-315F-423D-B419-A766FE0D8685}</Project>
    102113      <Name>HeuristicLab.Core.Views-3.3</Name>
     114    </ProjectReference>
     115    <ProjectReference Include="..\..\HeuristicLab.Core\3.3\HeuristicLab.Core-3.3.csproj">
     116      <Project>{C36BD924-A541-4A00-AFA8-41701378DDC5}</Project>
     117      <Name>HeuristicLab.Core-3.3</Name>
    103118    </ProjectReference>
    104119    <ProjectReference Include="..\..\HeuristicLab.MainForm.WindowsForms\3.2\HeuristicLab.MainForm.WindowsForms-3.2.csproj">
  • trunk/sources/HeuristicLab.Analysis.Views/3.3/HeuristicLabAnalysisViewsPlugin.cs.frame

    r2891 r2908  
    2929  [PluginFile("HeuristicLab.Analysis.Views-3.3.dll", PluginFileType.Assembly)]
    3030  [PluginDependency("HeuristicLab.Analysis", "3.3")]
     31  [PluginDependency("HeuristicLab.Collections", "3.3")]
     32  [PluginDependency("HeuristicLab.Core", "3.3")]
    3133  [PluginDependency("HeuristicLab.Core.Views", "3.3")]
    3234  [PluginDependency("HeuristicLab.MainForm", "3.2")]
  • trunk/sources/HeuristicLab.Analysis/3.3/HeuristicLab.Analysis-3.3.csproj

    r2900 r2908  
    8585    <None Include="HeuristicLabAnalysisPlugin.cs.frame" />
    8686    <Compile Include="BestAverageWorstQualityCalculator.cs" />
     87    <Compile Include="DataRow.cs" />
    8788    <Compile Include="HeuristicLabAnalysisPlugin.cs" />
    8889    <Compile Include="Properties\AssemblyInfo.cs" />
     90    <Compile Include="DataTable.cs" />
     91    <Compile Include="DataTableValuesCollector.cs" />
    8992  </ItemGroup>
    9093  <ItemGroup>
    9194    <None Include="HeuristicLab.snk" />
     95    <None Include="Microsoft Chart Controls\DataVisChartControl.chm" />
     96    <None Include="Microsoft Chart Controls\WinSamples.zip" />
    9297    <None Include="Properties\AssemblyInfo.frame" />
    9398  </ItemGroup>
     
    122127    </ProjectReference>
    123128  </ItemGroup>
     129  <ItemGroup>
     130    <None Include="Microsoft Chart Controls\MSChart.exe" />
     131    <None Include="Microsoft Chart Controls\MSChart_VisualStudioAddOn.exe" />
     132  </ItemGroup>
    124133  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
    125134  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
  • trunk/sources/HeuristicLab.Operators/3.3/ResultsCollector.cs

    r2882 r2908  
    2626namespace HeuristicLab.Operators {
    2727  /// <summary>
    28   /// An operator which collects the actual values of parameters and clones them into a collection of variables.
     28  /// An operator which collects the actual values of parameters and adds them to a collection of variables.
    2929  /// </summary>
    30   [Item("ResultsCollector", "An operator which collects the actual values of parameters and clones them into a collection of variables.")]
     30  [Item("ResultsCollector", "An operator which collects the actual values of parameters and adds them to a collection of variables.")]
    3131  [Creatable("Test")]
    3232  [EmptyStorableClass]
     
    4747        results.TryGetValue(param.Name, out var);
    4848        if (var != null)
    49           var.Value = (IItem)param.ActualValue.Clone();
     49          var.Value = (IItem)param.ActualValue;
    5050        else
    51           results.Add(new Variable(param.Name, (IItem)param.ActualValue.Clone()));
     51          results.Add(new Variable(param.Name, param.ActualValue));
    5252      }
    5353      return base.Apply();
Note: See TracChangeset for help on using the changeset viewer.