No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

SwapTest.java 804B

1234567891011121314151617181920212223242526
  1. package jobshop.swap;
  2. import jobshop.solvers.neighborhood.Nowicki;
  3. import org.junit.Test;
  4. public class SwapTest {
  5. @Test
  6. public void test() {
  7. int nbJobs = 5;
  8. int nbMachine = 8;
  9. int k = -1;
  10. for (int machine = 0; machine<nbMachine; machine++) {
  11. for (int t1 = 0; t1<nbJobs; t1++) {
  12. for (int t2 = (t1 + 1); t2<nbJobs; t2++) {
  13. Nowicki.Swap swap = new Nowicki.Swap(machine, t1, t2);
  14. int key = swap.generateKey(nbJobs);
  15. k++;
  16. //System.out.println("m : " + machine + "; t1 : " + t1 + "; t2 : " + t2);
  17. //System.out.println("Key : " + key + "; K : " + k);
  18. assert (key == k);
  19. }
  20. }
  21. }
  22. }
  23. }