public void Solve() { ITrajectorySearch min = sol; sol = sol.GenerateInitialSolution(); while (!sol.StopSearch() && !stopProcess) { lock (locker) { sol = sol.AdjustSolution(); if (sol.ObjectifFunction() < min.ObjectifFunction()) { min = sol; } } } if (tm != null) { StopTimer(); } }
public void Solve() { sol = sol.GenerateInitialSolution(); while (!sol.StopSearch() && !stopProcess) { // find a better neighbourgh solution ITrajectorySearch sTemp = sol.AdjustSolution(); if(!tabuList.Contains(sTemp.ObjectifFunction())) { // lock (locker) { tabuList.Add(sTemp.ObjectifFunction()); if (sTemp.ObjectifFunction() > sol.ObjectifFunction()) { sol = sTemp; } // } } } if(tm!=null) StopTimer(); }
public void Solve() { ITrajectorySearch solTemp; sol = sol.GenerateInitialSolution(); temperature = 1; while (!sol.StopSearch() && !stopProcess) { lock (locker) { solTemp = sol.AdjustSolution(); if (solTemp.ObjectifFunction() > sol.ObjectifFunction() || boltzman(solTemp, sol)) { sol = solTemp; } updateTemperature(); } } if (tm != null) { StopTimer(); } }