Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
08/05/13 11:37:13 (11 years ago)
Author:
gkronber
Message:

#2026 added lawn mower problem. create a OSGA for solving the compiled problem directly

Location:
branches/HeuristicLab.Problems.GPDL/Test
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Problems.GPDL/Test/Test.csproj

    r9844 r9846  
    5757      <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Core-3.3.dll</HintPath>
    5858      <Private>True</Private>
     59    </Reference>
     60    <Reference Include="HeuristicLab.Data-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     61      <SpecificVersion>False</SpecificVersion>
     62      <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Data-3.3.dll</HintPath>
    5963    </Reference>
    6064    <Reference Include="HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4">
  • branches/HeuristicLab.Problems.GPDL/Test/TestGpdlExamples.cs

    r9843 r9846  
    2424using System.Linq;
    2525using System.Text;
     26using System.Threading;
     27using HeuristicLab.Algorithms.GeneticAlgorithm;
    2628using HeuristicLab.Problems.GPDL;
    2729using HeuristicLab.Problems.GPDL.Views;
     30using HeuristicLab.SequentialEngine;
    2831using Microsoft.VisualStudio.TestTools.UnitTesting;
    2932
     
    3942        parser.Parse();
    4043        Assert.IsNotNull(parser.problem);
     44
     45        // test: run one generation
     46        var ga = new GeneticAlgorithm();
     47        ga.Engine = new SequentialEngine();
     48        ga.PopulationSize.Value = 100;
     49        ga.MaximumGenerations.Value = 1;
     50        ga.Problem = parser.problem;
     51
     52        var wh = new AutoResetEvent(false);
     53        Exception e = null;
     54        ga.ExceptionOccurred += (sender, args) => {
     55          e = args.Value;
     56          wh.Set();
     57        };
     58        ga.Stopped += (sender, args) => { wh.Set(); };
     59        ga.Start();
     60        wh.WaitOne();
     61        if (e != null) Assert.Fail(e.Message, e);
    4162      }
    4263    }
Note: See TracChangeset for help on using the changeset viewer.