Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/24/12 23:27:06 (13 years ago)
Author:
abeham
Message:

#1614

  • sorted operators
  • added crossover defined by Cordeau et al.
  • fixed a few bugs
Location:
branches/GeneralizedQAP/UnitTests
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • branches/GeneralizedQAP/UnitTests/QAPLIBInstanceProviderTest.cs

    r7505 r7523  
    2121
    2222using System;
     23using System.Collections.Generic;
    2324using System.Text;
    2425using HeuristicLab.Problems.Instances.QAPLIB;
     
    4546      Assert.IsTrue(erroneousInstances.Length == 0, "Some instances could not be parsed: " + Environment.NewLine + erroneousInstances.ToString());
    4647    }
     48
     49    /// <summary>
     50    ///A test for GetInstance
     51    ///</summary>
     52    [TestMethod()]
     53    public void GetInstanceTest() {
     54      List<string> nonZeroDiagonalInstances = new List<string>();
     55      var target = new QAPLIBInstanceProvider();
     56      foreach (var id in target.GetInstanceDescriptors()) {
     57        var instance = target.GetInstance(id);
     58        for (int i = 0; i < instance.Dimension; i++)
     59          if (instance.Distances[i, i] != 0 || instance.Weights[i, i] != 0) {
     60            nonZeroDiagonalInstances.Add(instance.Name);
     61            break;
     62          }
     63      }
     64
     65      Assert.IsTrue(nonZeroDiagonalInstances.Count == 0, string.Join(Environment.NewLine, nonZeroDiagonalInstances));
     66    }
    4767  }
    4868}
  • branches/GeneralizedQAP/UnitTests/UnitTests.csproj

    r7505 r7523  
    9797  </ItemGroup>
    9898  <ItemGroup>
     99    <Compile Include="CordeauCrossoverTest.cs" />
    99100    <Compile Include="CordeauGQAPInstanceProviderTest.cs" />
    100101    <Compile Include="ElloumiCTAPInstanceProviderTest.cs" />
Note: See TracChangeset for help on using the changeset viewer.