Free cookie consent management tool by TermsFeed Policy Generator

Changeset 17516 for branches


Ignore:
Timestamp:
04/20/20 16:18:23 (5 years ago)
Author:
abeham
Message:

#2521: fixed build fail in tests

Location:
branches/2521_ProblemRefactoring/HeuristicLab.Tests/HeuristicLab.Encodings.ScheduleEncoding-3.3
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • branches/2521_ProblemRefactoring/HeuristicLab.Tests/HeuristicLab.Encodings.ScheduleEncoding-3.3/DirectScheduleGTCrossoverTest.cs

    r17226 r17516  
    2020#endregion
    2121
    22 using System.Linq;
    2322using HeuristicLab.Core;
    24 using HeuristicLab.Encodings.ScheduleEncoding;
    2523using HeuristicLab.Tests;
    2624using Microsoft.VisualStudio.TestTools.UnitTesting;
     
    4745      Schedule actual;
    4846      actual = DirectScheduleGTCrossover.Apply(random, parent1, parent2, jobData, mutProp);
    49       Schedule expected = DirectScheduleRandomCreator.Apply(new PWREncoding(3, 3, new TestRandom(new int[] { 0, 2, 1, 1, 0, 2, 1, 2, 0 }, null)), TestUtils.CreateJobData());
     47      Schedule expected = DirectScheduleRandomCreator.Apply(new PWR(3, 3, new TestRandom(new int[] { 0, 2, 1, 1, 0, 2, 1, 2, 0 }, null)), TestUtils.CreateJobData());
    5048      Assert.IsTrue(TestUtils.ScheduleEquals(actual, expected));
    5149    }
  • branches/2521_ProblemRefactoring/HeuristicLab.Tests/HeuristicLab.Encodings.ScheduleEncoding-3.3/JSMJOXCrossoverTest.cs

    r17226 r17516  
    4040    public void ApplyTest() {
    4141      IRandom random = new TestRandom(new int[] { 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1 }, null);
    42       JSMEncoding p1 = TestUtils.CreateTestJSM1();
    43       JSMEncoding p2 = TestUtils.CreateTestJSM2();
    44       JSMEncoding expected = new JSMEncoding(0);
     42      JSM p1 = TestUtils.CreateTestJSM1();
     43      JSM p2 = TestUtils.CreateTestJSM2();
     44      JSM expected = new JSM(0);
    4545      ItemList<Permutation> jsm = expected.JobSequenceMatrix;
    4646      for (int i = 0; i < 6; i++) {
     
    4949
    5050
    51       JSMEncoding actual;
     51      JSM actual;
    5252      actual = JSMJOXCrossover.Apply(random, p1, p2);
    5353
  • branches/2521_ProblemRefactoring/HeuristicLab.Tests/HeuristicLab.Encodings.ScheduleEncoding-3.3/JSMSXXCrossoverTest.cs

    r17226 r17516  
    4040    public void ApplyTest() {
    4141      IRandom random = new TestRandom(new int[] { 0, 3 }, null);
    42       JSMEncoding p1 = TestUtils.CreateTestJSM1();
    43       JSMEncoding p2 = TestUtils.CreateTestJSM2();
    44       JSMEncoding expected = new JSMEncoding(0);
     42      JSM p1 = TestUtils.CreateTestJSM1();
     43      JSM p2 = TestUtils.CreateTestJSM2();
     44      JSM expected = new JSM(0);
    4545      ItemList<Permutation> jsm = expected.JobSequenceMatrix;
    4646      for (int i = 0; i < 6; i++) {
     
    4848      }
    4949
    50       JSMEncoding actual;
     50      JSM actual;
    5151      actual = JSMSXXCrossover.Apply(random, p1, p2);
    5252
  • branches/2521_ProblemRefactoring/HeuristicLab.Tests/HeuristicLab.Encodings.ScheduleEncoding-3.3/JSMShiftChangeManipulatorTest.cs

    r17226 r17516  
    4040    public void ApplyTest() {
    4141      IRandom random = new TestRandom(new int[] { 2, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2 }, null);
    42       JSMEncoding individual = TestUtils.CreateTestJSM1();
     42      JSM individual = TestUtils.CreateTestJSM1();
    4343      JSMShiftChangeManipulator.Apply(random, individual);
    44       JSMEncoding expected = new JSMEncoding(0);
     44      JSM expected = new JSM(0);
    4545      ItemList<Permutation> jsm = expected.JobSequenceMatrix;
    4646      for (int i = 0; i < 3; i++) {
  • branches/2521_ProblemRefactoring/HeuristicLab.Tests/HeuristicLab.Encodings.ScheduleEncoding-3.3/PWRGOXCrossoverTest.cs

    r17226 r17516  
    4040    public void ApplyTest() {
    4141      IRandom random = new TestRandom(new int[] { 3 }, null);
    42       PWREncoding parent1 = TestUtils.CreateTestPWR1();
    43       PWREncoding parent2 = TestUtils.CreateTestPWR2();
    44       PWREncoding expected = new PWREncoding();
     42      PWR parent1 = TestUtils.CreateTestPWR1();
     43      PWR parent2 = TestUtils.CreateTestPWR2();
     44      PWR expected = new PWR();
    4545      expected.PermutationWithRepetition = new IntegerVector(new int[] { 1, 0, 1, 0, 2, 0, 1, 2, 2 });
    46       PWREncoding actual;
     46      PWR actual;
    4747      actual = PWRGOXCrossover.Apply(random, parent1, parent2);
    4848      Assert.IsTrue(TestUtils.PRWEncodingEquals(expected, actual));
  • branches/2521_ProblemRefactoring/HeuristicLab.Tests/HeuristicLab.Encodings.ScheduleEncoding-3.3/PWRPPXCrossoverTest.cs

    r17226 r17516  
    4040    public void ApplyTest() {
    4141      IRandom random = new TestRandom(new int[] { 1, 1, 0, 0, 1, 1, 0, 0, 1 }, null);
    42       PWREncoding parent1 = TestUtils.CreateTestPWR1();
    43       PWREncoding parent2 = TestUtils.CreateTestPWR2();
    44       PWREncoding expected = new PWREncoding();
     42      PWR parent1 = TestUtils.CreateTestPWR1();
     43      PWR parent2 = TestUtils.CreateTestPWR2();
     44      PWR expected = new PWR();
    4545      expected.PermutationWithRepetition = new IntegerVector(new int[] { 1, 0, 1, 0, 1, 2, 0, 2, 2 });
    46       PWREncoding actual;
     46      PWR actual;
    4747      actual = PWRPPXCrossover.Apply(random, parent1, parent2);
    4848      Assert.IsTrue(TestUtils.PRWEncodingEquals(expected, actual));
  • branches/2521_ProblemRefactoring/HeuristicLab.Tests/HeuristicLab.Encodings.ScheduleEncoding-3.3/TestUtils.cs

    r17226 r17516  
    2929namespace HeuristicLab.Encodings.ScheduleEncoding.Tests {
    3030  public class TestUtils {
    31     public static JSMEncoding CreateTestJSM1() {
    32       JSMEncoding result = new JSMEncoding(0);
     31    public static JSM CreateTestJSM1() {
     32      JSM result = new JSM(0);
    3333      ItemList<Permutation> jsm = result.JobSequenceMatrix;
    3434      for (int i = 0; i < 6; i++)
     
    3737    }
    3838
    39     public static JSMEncoding CreateTestJSM2() {
    40       JSMEncoding result = new JSMEncoding(0);
     39    public static JSM CreateTestJSM2() {
     40      JSM result = new JSM(0);
    4141      ItemList<Permutation> jsm = result.JobSequenceMatrix;
    4242      for (int i = 0; i < 6; i++)
     
    4646
    4747
    48     public static PWREncoding CreateTestPWR1() {
    49       PWREncoding result = new PWREncoding();
     48    public static PWR CreateTestPWR1() {
     49      PWR result = new PWR();
    5050      IntegerVector pwr = new IntegerVector(new int[] { 1, 0, 1, 1, 2, 0, 2, 2, 0 });
    5151      result.PermutationWithRepetition = pwr;
     
    5353    }
    5454
    55     public static PWREncoding CreateTestPWR2() {
    56       PWREncoding result = new PWREncoding();
     55    public static PWR CreateTestPWR2() {
     56      PWR result = new PWR();
    5757      IntegerVector pwr = new IntegerVector(new int[] { 0, 1, 1, 0, 2, 0, 1, 2, 2 });
    5858      result.PermutationWithRepetition = pwr;
     
    8787
    8888    public static Schedule CreateTestSchedule1() {
    89       Schedule result = DirectScheduleRandomCreator.Apply(new PWREncoding(3, 3, new TestRandom(new int[] { 1, 0, 1, 1, 2, 0, 2, 2, 0 }, null)), CreateJobData());
     89      Schedule result = DirectScheduleRandomCreator.Apply(new PWR(3, 3, new TestRandom(new int[] { 1, 0, 1, 1, 2, 0, 2, 2, 0 }, null)), CreateJobData());
    9090      return result;
    9191    }
    9292
    9393    public static Schedule CreateTestSchedule2() {
    94       Schedule result = DirectScheduleRandomCreator.Apply(new PWREncoding(3, 3, new TestRandom(new int[] { 0, 1, 1, 0, 2, 0, 1, 2, 2 }, null)), CreateJobData());
     94      Schedule result = DirectScheduleRandomCreator.Apply(new PWR(3, 3, new TestRandom(new int[] { 0, 1, 1, 0, 2, 0, 1, 2, 2 }, null)), CreateJobData());
    9595      return result;
    9696    }
     
    117117    }
    118118
    119     public static bool JSMEncodingEquals(JSMEncoding expected, JSMEncoding actual) {
     119    public static bool JSMEncodingEquals(JSM expected, JSM actual) {
    120120      if (expected.JobSequenceMatrix.Count != actual.JobSequenceMatrix.Count)
    121121        return false;
     
    136136    }
    137137
    138     public static bool PRWEncodingEquals(PWREncoding expected, PWREncoding actual) {
     138    public static bool PRWEncodingEquals(PWR expected, PWR actual) {
    139139      if (expected.PermutationWithRepetition.Length != actual.PermutationWithRepetition.Length)
    140140        return false;
Note: See TracChangeset for help on using the changeset viewer.