Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
12/04/17 23:00:03 (7 years ago)
Author:
abeham
Message:

#1614:

  • branched optimization
  • adapted references
  • renamed plugin
Location:
branches/GeneralizedQAP
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/GeneralizedQAP

    • Property svn:ignore
      •  

        old new  
        22TestResults
        33*.user
         4.vs
  • branches/GeneralizedQAP/UnitTests/CordeauCrossoverTest.cs

    r7970 r15490  
    2121
    2222using System.Linq;
     23using System.Threading;
    2324using HeuristicLab.Data;
    24 using HeuristicLab.Encodings.IntegerVectorEncoding;
    2525using HeuristicLab.Problems.GeneralizedQuadraticAssignment;
    2626using HeuristicLab.Problems.Instances.CordeauGQAP;
     
    3434    public void CordeauCrossoverFunctionalityTest() {
    3535      var provider = new CordeauGQAPInstanceProvider();
    36       var instance = provider.LoadData(provider.GetDataDescriptors().First());
     36      var instance = provider.LoadData(provider.GetDataDescriptors().Single(x => x.Name == "20-15-75"));
    3737      var gqap = new GeneralizedQuadraticAssignmentProblem();
    3838      gqap.Load(instance);
     39      var evaluator = gqap.Evaluator;
    3940
    40       var random = new MersenneTwister();
    4141      for (int i = 0; i < 100; i++) {
    42         var parent1 = new IntegerVector(gqap.Demands.Length, random, 0, gqap.Capacities.Length);
    43         var parent2 = new IntegerVector(gqap.Demands.Length, random, 0, gqap.Capacities.Length);
     42        var random = new MersenneTwister((uint)i);
     43        var parent1 = GreedyRandomizedSolutionCreator.CreateSolution(random, gqap.Demands, gqap.Capacities, gqap.Evaluator, 100, true, CancellationToken.None);
     44        var parent2 = GreedyRandomizedSolutionCreator.CreateSolution(random, gqap.Demands, gqap.Capacities, gqap.Evaluator, 100, true, CancellationToken.None);
    4445
    4546        try {
     
    4950            parent2,
    5051            new DoubleValue(gqap.Evaluator.Evaluate(parent2, gqap.Weights, gqap.Distances, gqap.InstallationCosts, gqap.Demands, gqap.Capacities, gqap.TransportationCosts, gqap.ExpectedRandomQuality)),
    51             gqap.Weights, gqap.Distances, gqap.InstallationCosts, gqap.Demands, gqap.Capacities, gqap.TransportationCosts, gqap.ExpectedRandomQuality, gqap.Evaluator);
     52            gqap.Weights, gqap.Distances, gqap.InstallationCosts, gqap.Demands, gqap.Capacities, gqap.TransportationCosts, gqap.ExpectedRandomQuality, gqap.Evaluator,
     53            new IntValue(0));
    5254        } catch {
    5355          Assert.Fail("Error during crossover");
  • branches/GeneralizedQAP/UnitTests/UnitTests.csproj

    r13418 r15490  
    6565      <Private>True</Private>
    6666    </Reference>
    67     <Reference Include="HeuristicLab.Optimization-3.3">
    68       <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Optimization-3.3.dll</HintPath>
    69       <Private>True</Private>
    70     </Reference>
    7167    <Reference Include="HeuristicLab.Parameters-3.3">
    7268      <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Parameters-3.3.dll</HintPath>
     
    115111  </ItemGroup>
    116112  <ItemGroup>
     113    <ProjectReference Include="..\HeuristicLab.Optimization\3.3\HeuristicLab.Optimization-3.3.csproj">
     114      <Project>{14ab8d24-25bc-400c-a846-4627aa945192}</Project>
     115      <Name>HeuristicLab.Optimization-3.3</Name>
     116    </ProjectReference>
    117117    <ProjectReference Include="..\HeuristicLab.Problems.GeneralizedQuadraticAssignment.Common\3.3\HeuristicLab.Problems.GeneralizedQuadraticAssignment.Common-3.3.csproj">
    118118      <Project>{DA367BE5-4F53-4243-933B-32AAB86189D5}</Project>
Note: See TracChangeset for help on using the changeset viewer.