Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
12/15/10 15:43:43 (13 years ago)
Author:
cneumuel
Message:

#1215

  • optional parameter values now can be null
  • problem type can now be set specifically
  • values are constrained to the encoding of the Problem
  • moved repetitions parameter to MetaOptimizationProblem
Location:
branches/HeuristicLab.MetaOptimization/HeuristicLab.MetaOptimization.Test
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.MetaOptimization/HeuristicLab.MetaOptimization.Test/HeuristicLab.MetaOptimization.Test.csproj

    r5023 r5110  
    116116      <HintPath>..\..\..\..\..\..\..\Program Files\HeuristicLab 3.3\HeuristicLab.Data.Views-3.3.dll</HintPath>
    117117    </Reference>
    118     <Reference Include="HeuristicLab.DebugEngine-3.3">
    119       <HintPath>..\..\..\..\..\..\..\Program Files\HeuristicLab 3.3\HeuristicLab.DebugEngine-3.3.dll</HintPath>
    120     </Reference>
    121118    <Reference Include="HeuristicLab.Encodings.BinaryVectorEncoding-3.3">
    122119      <HintPath>..\..\..\..\..\..\..\Program Files\HeuristicLab 3.3\HeuristicLab.Encodings.BinaryVectorEncoding-3.3.dll</HintPath>
     
    320317      <HintPath>..\..\..\..\..\..\..\Program Files\HeuristicLab 3.3\WeifenLuo.WinFormsUI.Docking-2.3.1.dll</HintPath>
    321318    </Reference>
    322     <Reference Include="ZedGraph">
    323       <HintPath>..\..\..\..\..\..\..\Program Files\HeuristicLab 3.3\ZedGraph.dll</HintPath>
    324     </Reference>
    325319  </ItemGroup>
    326320  <ItemGroup>
     321    <Compile Include="PluginLoader.cs" />
    327322    <Compile Include="Program.cs" />
    328323    <Compile Include="Properties\AssemblyInfo.cs" />
  • branches/HeuristicLab.MetaOptimization/HeuristicLab.MetaOptimization.Test/Program.cs

    r5087 r5110  
    1818using HeuristicLab.Selection;
    1919using HeuristicLab.Algorithms.EvolutionStrategy;
     20using HeuristicLab.PluginInfrastructure.Manager;
    2021
    2122namespace HeuristicLab.MetaOptimization.Test {
    2223  class Program {
    23     private static int metaAlgorithmPopulationSize = 50;
     24    private static int metaAlgorithmPopulationSize = 3;
    2425    private static int metaAlgorithmMaxGenerations = 30;
    2526    private static int metaProblemRepetitions = 3;
    2627
    27     private static int baseAlgorithmMaxGenerations = 250;
     28    private static int baseAlgorithmMaxGenerations = 3;
    2829
    2930    static void Main(string[] args) {
     
    3233      //TestIntSampling();
    3334      //TestDoubleSampling();
    34 
     35      //TestTypeDiscovery();
     36     
    3537      GeneticAlgorithm baseLevelAlgorithm = new GeneticAlgorithm();
    3638
    3739      MetaOptimizationProblem metaOptimizationProblem = new MetaOptimizationProblem();
    38       ((MetaOptimizationEvaluator)metaOptimizationProblem.Evaluator).Repetitions.Value = metaProblemRepetitions;
     40      metaOptimizationProblem.Repetitions = new IntValue(metaProblemRepetitions);
    3941      GeneticAlgorithm metaLevelAlgorithm = GetMetaGA(metaOptimizationProblem);
    4042      //EvolutionStrategy metaLevelAlgorithm = GetMetaES(metaOptimizationProblem);
     
    5355
    5456      Console.ReadLine();
     57    }
     58
     59    private static void TestTypeDiscovery() {
     60      PluginLoader.pluginAssemblies.Any();
     61     
     62      var items = ApplicationManager.Manager.GetInstances(typeof(DoubleArray)).ToArray();
     63
     64      foreach (var item in items) {
     65        Console.WriteLine(item.ToString());
     66      }
    5567    }
    5668
     
    200212
    201213      // uncheck multiMutator to avoid Michalewicz issue
    202       var multiMutator = mutationOperator.ValueConfigurations.Where(x => x.ActualValue.Value.ItemName.StartsWith("Multi")).SingleOrDefault();
     214      var multiMutator = mutationOperator.ValueConfigurations.Where(x => x.ActualValue.Value != null && x.ActualValue.Value.ItemName.StartsWith("Multi")).SingleOrDefault();
    203215      if (multiMutator != null) {
    204216        mutationOperator.ValueConfigurations.SetItemCheckedState(multiMutator, false);
     
    272284      string outputPath = Path.Combine(path, string.Format("{0} - Console.txt", id));
    273285
    274 
    275286      using (var sw = new StreamWriter(outputPath)) {
    276287        sw.AutoFlush = true;
     
    301312                var orderedRuns = rc.OrderBy(x => x.Results["RunsAverageQuality"]);
    302313
    303                 sb.AppendLine("Qual.  PoSi MutRa Eli GrSi MutOp");
     314                sb.AppendLine("Qual.  PoSi MutRa Eli SelOp MutOp");
    304315                foreach (IRun run in orderedRuns) {
    305316                  string selector;
     
    316327                    ((IntValue)run.Parameters["Elites"]).Value.ToString().PadLeft(3, ' '),
    317328                    Shorten(selector, 20).PadRight(20, ' '),
    318                     run.Parameters["Mutator"].ToString()));
     329                    run.Parameters.ContainsKey("Mutator") ? run.Parameters["Mutator"].ToString() : "null"));
    319330                }
    320331              }
Note: See TracChangeset for help on using the changeset viewer.