New style for MO
git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@787 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
parent
47298125ec
commit
7161febf9c
80 changed files with 2014 additions and 2038 deletions
|
|
@ -13,46 +13,46 @@
|
|||
#include <tsp>
|
||||
|
||||
int
|
||||
main (int __argc, char * __argv [])
|
||||
main (int __argc, char * __argv [])
|
||||
{
|
||||
if (__argc != 2)
|
||||
if (__argc != 2)
|
||||
{
|
||||
std :: cerr << "Usage : ./iterated_local_search [instance]" << std :: endl ;
|
||||
return 1 ;
|
||||
}
|
||||
|
||||
|
||||
Graph :: load (__argv [1]) ; // Instance
|
||||
|
||||
Route route ; // Solution
|
||||
|
||||
|
||||
RouteInit init ; // Sol. Random Init.
|
||||
init (route) ;
|
||||
|
||||
RouteEval full_eval ; // Full. Eval.
|
||||
full_eval (route) ;
|
||||
|
||||
|
||||
std :: cout << "[From] " << route << std :: endl ;
|
||||
|
||||
|
||||
TwoOptInit two_opt_init ; // Init.
|
||||
|
||||
|
||||
TwoOptNext two_opt_next ; // Explorer.
|
||||
|
||||
|
||||
TwoOptIncrEval two_opt_incr_eval ; // Eff. eval.
|
||||
|
||||
|
||||
moBestImprSelect <TwoOpt> two_opt_select ; //Move selection
|
||||
|
||||
|
||||
moGenSolContinue <Route> cont (1000) ; //Stopping criterion
|
||||
|
||||
|
||||
moFitComparator<Route> comparator; // Route comparator
|
||||
|
||||
CitySwap perturbation; // Route perturbation
|
||||
|
||||
moILS<TwoOpt> iterated_local_search (two_opt_init, two_opt_next, two_opt_incr_eval, two_opt_select,
|
||||
cont, comparator, perturbation, full_eval) ;
|
||||
moILS<TwoOpt> iterated_local_search (two_opt_init, two_opt_next, two_opt_incr_eval, two_opt_select,
|
||||
cont, comparator, perturbation, full_eval) ;
|
||||
iterated_local_search(route) ;
|
||||
|
||||
std :: cout << "[To] " << route << std :: endl ;
|
||||
|
||||
|
||||
return 0 ;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue