Changeset 13469 for branches/ProblemRefactoring/HeuristicLab.Tests/HeuristicLab.Encodings.ScheduleEncoding-3.3/TestUtils.cs
- Timestamp:
- 12/15/15 15:16:24 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ProblemRefactoring/HeuristicLab.Tests/HeuristicLab.Encodings.ScheduleEncoding-3.3/TestUtils.cs
r12012 r13469 24 24 using HeuristicLab.Encodings.IntegerVectorEncoding; 25 25 using HeuristicLab.Encodings.PermutationEncoding; 26 using HeuristicLab.Encodings.ScheduleEncoding.JobSequenceMatrix; 27 using HeuristicLab.Encodings.ScheduleEncoding.PermutationWithRepetition; 26 28 27 using HeuristicLab.Tests; 29 28 … … 31 30 public class TestUtils { 32 31 public static JSMEncoding CreateTestJSM1() { 33 JSMEncoding result = new JSMEncoding( );34 ItemList<Permutation> jsm = new ItemList<Permutation>();32 JSMEncoding result = new JSMEncoding(0); 33 ItemList<Permutation> jsm = result.JobSequenceMatrix; 35 34 for (int i = 0; i < 6; i++) 36 35 jsm.Add(new Permutation(PermutationTypes.Absolute, new int[] { 0, 1, 2, 3, 4, 5 })); 37 result.JobSequenceMatrix = jsm;38 36 return result; 39 37 } 40 38 41 39 public static JSMEncoding CreateTestJSM2() { 42 JSMEncoding result = new JSMEncoding( );43 ItemList<Permutation> jsm = new ItemList<Permutation>();40 JSMEncoding result = new JSMEncoding(0); 41 ItemList<Permutation> jsm = result.JobSequenceMatrix; 44 42 for (int i = 0; i < 6; i++) 45 43 jsm.Add(new Permutation(PermutationTypes.Absolute, new int[] { 5, 4, 3, 2, 1, 0 })); 46 result.JobSequenceMatrix = jsm;47 44 return result; 48 45 } … … 66 63 public static ItemList<Job> CreateJobData() { 67 64 Job j1 = new Job(0, 0); 68 j1.Tasks = new ItemList<Task> {65 j1.Tasks.AddRange(new[]{ 69 66 new Task (0, 0, j1.Index, 1), 70 67 new Task (1, 1, j1.Index, 2), 71 68 new Task (2, 2, j1.Index, 1) 72 } ;69 }); 73 70 74 71 Job j2 = new Job(1, 0); 75 j2.Tasks = new ItemList<Task>{72 j2.Tasks.AddRange(new[]{ 76 73 new Task (3, 2, j2.Index, 2), 77 74 new Task (4, 1, j2.Index, 1), 78 75 new Task (5, 0, j2.Index, 2) 79 } ;76 }); 80 77 81 78 Job j3 = new Job(2, 0); 82 j3.Tasks = new ItemList<Task>{79 j3.Tasks.AddRange(new[]{ 83 80 new Task (6, 0, j3.Index, 1), 84 81 new Task (7, 2, j3.Index, 2), 85 82 new Task (8, 1, j3.Index, 1) 86 } ;83 }); 87 84 88 85 return new ItemList<Job> { j1, j2, j3 }; … … 90 87 91 88 public static Schedule CreateTestSchedule1() { 92 Schedule result = DirectScheduleRandomCreator.Apply( 3, 3,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 PWREncoding(3, 3, new TestRandom(new int[] { 1, 0, 1, 1, 2, 0, 2, 2, 0 }, null)), CreateJobData()); 93 90 return result; 94 91 } 95 92 96 93 public static Schedule CreateTestSchedule2() { 97 Schedule result = DirectScheduleRandomCreator.Apply( 3, 3,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 PWREncoding(3, 3, new TestRandom(new int[] { 0, 1, 1, 0, 2, 0, 1, 2, 2 }, null)), CreateJobData()); 98 95 return result; 99 96 }
Note: See TracChangeset
for help on using the changeset viewer.