Free cookie consent management tool by TermsFeed Policy Generator

source: branches/Scheduling/HeuristicLab.Encodings.ScheduleEncoding.Tests/TestUtils.cs @ 6452

Last change on this file since 6452 was 6406, checked in by jhelm, 14 years ago

#1329: Applied suggestions from codereview. Added unit-tests. Renamed encoding-project.

File size: 1.6 KB
Line 
1using HeuristicLab.Core;
2using HeuristicLab.Encodings.IntegerVectorEncoding;
3using HeuristicLab.Encodings.PermutationEncoding;
4using HeuristicLab.Encodings.ScheduleEncoding.JobSequenceMatrix;
5using HeuristicLab.Encodings.ScheduleEncoding.PermutationWithRepetition;
6
7namespace HeuristicLab.Encodings.ScheduleEncoding.Tests {
8  public class TestUtils {
9    public static JSMEncoding CreateTestJSM1() {
10      JSMEncoding result = new JSMEncoding();
11      ItemList<Permutation> jsm = new ItemList<Permutation>();
12      for (int i = 0; i < 6; i++)
13        jsm.Add(new Permutation(PermutationTypes.Absolute, new int[] { 0, 1, 2, 3, 4, 5 }));
14      result.JobSequenceMatrix = jsm;
15      return result;
16    }
17
18    public static JSMEncoding CreateTestJSM2() {
19      JSMEncoding result = new JSMEncoding();
20      ItemList<Permutation> jsm = new ItemList<Permutation>();
21      for (int i = 0; i < 6; i++)
22        jsm.Add(new Permutation(PermutationTypes.Absolute, new int[] { 5, 4, 3, 2, 1, 0 }));
23      result.JobSequenceMatrix = jsm;
24      return result;
25    }
26
27
28    public static PWREncoding CreateTestPWR1() {
29      PWREncoding result = new PWREncoding();
30      IntegerVector pwr = new IntegerVector(new int[] { 1, 0, 1, 1, 2, 0, 2, 2, 0 });
31      result.PermutationWithRepetition = pwr;
32      return result;
33    }
34
35    public static PWREncoding CreateTestPWR2() {
36      PWREncoding result = new PWREncoding();
37      IntegerVector pwr = new IntegerVector(new int[] { 0, 1, 1, 0, 2, 0, 1, 2, 2 });
38      result.PermutationWithRepetition = pwr;
39      return result;
40    }
41  }
42}
Note: See TracBrowser for help on using the repository browser.