OpenTS Tutorial
Main Program
The OpenTS Tabu Search Object

Now we'll create an OpenTS Tabu Search object according to the constructor for the SingleThreadedTabuSearch:

import org.coinor.opents.*;

public class Main
{

    public static void main( String[] args )
    {
        ...

        // Create Tabu Search object
TabuSearch tabuSearch = new SingleThreadedTabuSearch( initialSolution, moveManager, objFunc, tabuList, new BestEverAspirationCriteria(), // In OpenTS package false ); // maximizing = yes/no; false means minimizing
... } // end main ... } // end class Main

Anticlimactic? Maybe, but isn't simplicity a wonderful thing? We pass all the relevant objects into the constructor including a traditional aspiration criteria available in the OpenTS package and a false for the maximizing argument. We're minimizing distance here, so a false means we're not maximizing and therefore must be minimizing.

Next we'll look at how we start the tabu search and wait for it to return an answer.