M
Mark
Hi all, I am trying to write a tabu search algorithm for my scheduling
program, but have hit a problem with the tabu list.
I am using java 1.5 and creating a queue object as shown...
Queue tabuList = new LinkedList();
I need to add a move to the tabu list, a move consists of two integers
in my program, (I swap two elements in a vector, the ints represent
the position of the object in the vector)
I have tried to add the two ints as an array and then run the
..contains() on the tabulist, but that will not work, (code shown
below)
tabuList.add(new int[](1,2));
if (tabuList.contains(new int[](1,2)){
System.out.println("yes");
}else{
System.out.println("no");
}
This i believe is because the int[] are objects with different
references, I thought about creating two tabuLists and add one int to
each list in the same position, but I cannot get the position of the
int in the tabu list.
Hope this all makes sense,
Any help would be fantastic
Mark
program, but have hit a problem with the tabu list.
I am using java 1.5 and creating a queue object as shown...
Queue tabuList = new LinkedList();
I need to add a move to the tabu list, a move consists of two integers
in my program, (I swap two elements in a vector, the ints represent
the position of the object in the vector)
I have tried to add the two ints as an array and then run the
..contains() on the tabulist, but that will not work, (code shown
below)
tabuList.add(new int[](1,2));
if (tabuList.contains(new int[](1,2)){
System.out.println("yes");
}else{
System.out.println("no");
}
This i believe is because the int[] are objects with different
references, I thought about creating two tabuLists and add one int to
each list in the same position, but I cannot get the position of the
int in the tabu list.
Hope this all makes sense,
Any help would be fantastic
Mark