00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #include <mo.h>
00013
00014 #include <graph.h>
00015 #include <route.h>
00016 #include <route_eval.h>
00017 #include <route_init.h>
00018
00019 #include <two_opt.h>
00020 #include <two_opt_init.h>
00021 #include <two_opt_next.h>
00022 #include <two_opt_incr_eval.h>
00023 #include <two_opt_tabu_list.h>
00024
00025 int
00026 main (int __argc, char * __argv [])
00027 {
00028 if (__argc != 2)
00029 {
00030 std :: cerr << "Usage : ./tabu_search [instance]" << std :: endl ;
00031 return 1 ;
00032 }
00033
00034 Graph :: load (__argv [1]) ;
00035
00036 Route route ;
00037
00038 RouteInit init ;
00039 init (route) ;
00040
00041 RouteEval full_eval ;
00042 full_eval (route) ;
00043
00044 std :: cout << "[From] " << route << std :: endl ;
00045
00046
00047
00048
00049 TwoOptInit two_opt_init ;
00050
00051 TwoOptNext two_opt_next ;
00052
00053 TwoOptIncrEval two_opt_incr_eval ;
00054
00055 TwoOptTabuList tabu_list ;
00056
00057
00058
00059 moNoAspirCrit <TwoOpt> aspir_crit ;
00060
00061 moGenSolContinue <Route> cont (10000) ;
00062
00063 moTS <TwoOpt> tabu_search (two_opt_init, two_opt_next, two_opt_incr_eval, tabu_list, aspir_crit, cont, full_eval) ;
00064 tabu_search (route) ;
00065
00066 std :: cout << "[To] " << route << std :: endl ;
00067
00068 return 0 ;
00069 }
00070