Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/25/13 10:42:13 (11 years ago)
Author:
mkommend
Message:

#1997: Improvements in island algorithms for data analysis:

  • Corrected build output of project configurations
  • Allowed subclassing of IslandOffspringSelectionGeneticAlgorithm
  • Changed SymbolicDataAnalysis to inject the rows in the current scope instead of using a parameter.
Location:
branches/DataAnalysis.IslandAlgorithms
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/DataAnalysis.IslandAlgorithms/HeuristicLab.Algorithms.DataAnalysis.Symbolic/3.3/SymbolicDataAnalysisIslandGAEvaluator.cs

    r10142 r10152  
    2424using HeuristicLab.Core;
    2525using HeuristicLab.Data;
    26 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
    2726using HeuristicLab.Operators;
    2827using HeuristicLab.Optimization;
     
    3938    private const string RandomParameterName = "Random";
    4039    private const string ProblemDataParameterName = "ProblemData";
    41     private const string SymbolicExpressionTreeParameterName = "SymbolicExpressionTree";
    4240    private const string EvaluatorParameterName = "ProblemEvaluator";
    4341    private const string QualityParameterName = "Quality";
     
    5250    public ILookupParameter<T> ProblemDataParameter {
    5351      get { return (ILookupParameter<T>)Parameters[ProblemDataParameterName]; }
    54     }
    55     public ILookupParameter<ISymbolicExpressionTree> SymbolicExpressionTreeParameter {
    56       get { return (ILookupParameter<ISymbolicExpressionTree>)Parameters[SymbolicExpressionTreeParameterName]; }
    5752    }
    5853    public ILookupParameter<ISymbolicDataAnalysisSingleObjectiveEvaluator<T>> EvaluatorParameter {
     
    7065    public ILookupParameter<IntValue> RandomSamplesParameter {
    7166      get { return (ILookupParameter<IntValue>)Parameters[RandomSamplesParameterName]; }
    72     }
    73 
    74     public IValueParameter<EnumerableItem<int>> RowsParameter {
    75       get { return (IValueParameter<EnumerableItem<int>>)Parameters["Rows"]; }
    7667    }
    7768    #endregion
     
    9182      Parameters.Add(new LookupParameter<IRandom>(RandomParameterName, "The random generator to use."));
    9283      Parameters.Add(new LookupParameter<T>(ProblemDataParameterName, "The problem data on which the symbolic data analysis solution should be evaluated."));
    93       Parameters.Add(new LookupParameter<ISymbolicExpressionTree>(SymbolicExpressionTreeParameterName, "The symbolic data analysis solution encoded as a symbolic expression tree."));
    9484      Parameters.Add(new LookupParameter<ISymbolicDataAnalysisSingleObjectiveEvaluator<T>>(EvaluatorParameterName, "The evaluator provided by the symbolic data analysis  problem."));
    9585      Parameters.Add(new LookupParameter<DoubleValue>(QualityParameterName, "The quality which is calculated by the encapsulated evaluator."));
     
    9787      Parameters.Add(new LookupParameter<IntRange>(FixedSamplesPartitionParameterName, "The data partition which is used to calculate the fitness on the fixed samples."));
    9888      Parameters.Add(new LookupParameter<IntValue>(RandomSamplesParameterName, "The number of random samples used for fitness calculation in each island."));
    99       Parameters.Add(new OptionalValueParameter<EnumerableItem<int>>("Rows", "TODO"));
    10089
    10190      EvaluatorParameter.Hidden = true;
     
    124113      }
    125114      //filter out test rows
    126       rows = rows.Where(r => r < problemData.TestPartition.Start && r > problemData.TestPartition.End);
     115      rows = rows.Where(r => r < problemData.TestPartition.Start || r > problemData.TestPartition.End);
    127116
    128117      //execution context is created manually to be able to clear the rows parameter easily
    129       RowsParameter.Value = new EnumerableItem<int>(rows);
    130118      var executionContext = new ExecutionContext(ExecutionContext, evaluator, ExecutionContext.Scope);
     119
     120      //TODO change to lookup parameter
     121      executionContext.Scope.Variables.Remove("Rows");
     122      executionContext.Scope.Variables.Add(new HeuristicLab.Core.Variable("Rows", new EnumerableItem<int>(rows)));
    131123      var successor = evaluator.Execute(executionContext, this.CancellationToken);
    132       RowsParameter.Value = null;
    133124      return new OperationCollection(successor, base.Apply());
    134125    }
  • branches/DataAnalysis.IslandAlgorithms/HeuristicLab.Algorithms.DataAnalysis.Symbolic/3.3/SymbolicDataAnalysisIslandOffspringSelectionGeneticAlgorithm.cs

    r10142 r10152  
    2727using HeuristicLab.Core;
    2828using HeuristicLab.Data;
     29using HeuristicLab.Operators;
    2930using HeuristicLab.Optimization;
    3031using HeuristicLab.Parameters;
     
    3233using HeuristicLab.Problems.DataAnalysis;
    3334using HeuristicLab.Problems.DataAnalysis.Symbolic;
    34 using HeuristicLab.Random;
    3535
    3636namespace HeuristicLab.Algorithms.DataAnalysis.Symbolic {
     
    116116      fixedSamplesPartitionCreator.RightSideParameter.ActualName = FixedSamplesPartitionsParameterName;
    117117
    118       RandomCreator insertionPoint = OperatorGraph.Iterate().OfType<RandomCreator>().First();
     118      SubScopesCreator insertionPoint = OperatorGraph.Iterate().OfType<SubScopesCreator>().First();
    119119      fixedSamplesPartitionCreator.Successor = insertionPoint.Successor;
    120120      insertionPoint.Successor = fixedSamplesPartitionCreator;
  • branches/DataAnalysis.IslandAlgorithms/HeuristicLab.Algorithms.GeneticAlgorithm/3.3/HeuristicLab.Algorithms.GeneticAlgorithm-3.3.csproj

    r10142 r10152  
    4343    <DebugType>full</DebugType>
    4444    <Optimize>false</Optimize>
    45     <OutputPath>$(SolutionDir)\bin\</OutputPath>
     45    <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath>
    4646    <DefineConstants>DEBUG;TRACE</DefineConstants>
    4747    <ErrorReport>prompt</ErrorReport>
     
    6262  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
    6363    <DebugSymbols>true</DebugSymbols>
    64     <OutputPath>$(SolutionDir)\bin\</OutputPath>
     64    <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath>
    6565    <DefineConstants>DEBUG;TRACE</DefineConstants>
    6666    <DebugType>full</DebugType>
     
    7070  </PropertyGroup>
    7171  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
    72     <OutputPath>$(SolutionDir)\bin\</OutputPath>
     72    <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath>
    7373    <DefineConstants>TRACE</DefineConstants>
    7474    <DocumentationFile>
     
    8282  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
    8383    <DebugSymbols>true</DebugSymbols>
    84     <OutputPath>$(SolutionDir)\bin\</OutputPath>
     84    <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath>
    8585    <DefineConstants>DEBUG;TRACE</DefineConstants>
    8686    <DebugType>full</DebugType>
     
    9090  </PropertyGroup>
    9191  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
    92     <OutputPath>$(SolutionDir)\bin\</OutputPath>
     92    <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath>
    9393    <DefineConstants>TRACE</DefineConstants>
    9494    <DocumentationFile>
  • branches/DataAnalysis.IslandAlgorithms/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm-3.3.csproj

    r10142 r10152  
    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>
     
    5858  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
    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|x86' ">
    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|x64' ">
    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|x64' ">
    86     <OutputPath>$(SolutionDir)\bin\</OutputPath>
     86    <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath>
    8787    <DefineConstants>TRACE</DefineConstants>
    8888    <Optimize>true</Optimize>
  • branches/DataAnalysis.IslandAlgorithms/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/IslandOffspringSelectionGeneticAlgorithm.cs

    r10142 r10152  
    240240    }
    241241    protected UniformSubScopesProcessor IslandProcessor {
    242       get { return ((RandomCreator.Successor as SubScopesCreator).Successor as UniformSubScopesProcessor); }
     242      get { return OperatorGraph.Iterate().OfType<UniformSubScopesProcessor>().First(x => x.Operator is SolutionsCreator); }
    243243    }
    244244    protected SolutionsCreator SolutionsCreator {
  • branches/DataAnalysis.IslandAlgorithms/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.csproj

    r10142 r10152  
    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>
     
    6060  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
    6161    <DebugSymbols>true</DebugSymbols>
    62     <OutputPath>$(SolutionDir)\bin\</OutputPath>
     62    <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath>
    6363    <DefineConstants>DEBUG;TRACE</DefineConstants>
    6464    <DebugType>full</DebugType>
     
    6969  </PropertyGroup>
    7070  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
    71     <OutputPath>$(SolutionDir)\bin\</OutputPath>
     71    <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath>
    7272    <DefineConstants>TRACE</DefineConstants>
    7373    <Optimize>true</Optimize>
     
    8080  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
    8181    <DebugSymbols>true</DebugSymbols>
    82     <OutputPath>$(SolutionDir)\bin\</OutputPath>
     82    <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath>
    8383    <DefineConstants>DEBUG;TRACE</DefineConstants>
    8484    <DebugType>full</DebugType>
     
    8989  </PropertyGroup>
    9090  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
    91     <OutputPath>$(SolutionDir)\bin\</OutputPath>
     91    <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath>
    9292    <DefineConstants>TRACE</DefineConstants>
    9393    <Optimize>true</Optimize>
Note: See TracChangeset for help on using the changeset viewer.