/** * A method that spawns an ILDS object and calls its solve method. If other algorithms were used, * this would be a good place to call their solve methods. */ public void solve() { /* Create a depth first search instance */ ILDS dfs = new ILDS(students, fileIO.getGroupTimes()); if (timeout != 0) { Thread thread = new Thread() { public void run() { Timer timer = new Timer(); timer.schedule( new TimerTask() { @Override public void run() { dfs.end(); } }, timeout); } }; thread.start(); } /* Solve and print the solution */ dfs.solve(); solutionCost = dfs.getSolutionCost(); printStudentSolution(dfs.getSolution()); }