spirale.cpp (849B)
1 2 #include "../louis/louis.cpp" 3 #include "../mc/prune.cpp" 4 5 int main() { 6 lecture_entree(); 7 init_use(); 8 init_solution(_solution); 9 const int D = 300; 10 vector<int> sol2[8]; 11 for (int v = 0; v< n_vehicules;v++) { 12 for (int i = 0; i < D; i++) { 13 if (i % 100 == 0) 14 fprintf(stderr, "%d %d\n", v, i); 15 double a = 2*(3*i+i%3)*M_PI/(double)(3*D); 16 double x = (((double)(v+4)*10+i%10)/120) * .5 * (1+cos(a)); 17 double y = (((double)(v+4)*10+i%10)/120) * .5 * (1+sin(a)); 18 _solution[v].push_back(plus_proche_norm(x, y)); 19 } 20 _solution[v] = complete(_solution[v]); 21 } 22 prune(_solution, sol2); 23 complete_all(sol2); 24 tronque_solution(sol2, t_autorise); 25 26 vector<int> t = evalue_solution(sol2); 27 for (int v = 0; v < n_vehicules; v++) 28 fprintf(stderr, "t[%d] = %d\n", v, t[v+1]); 29 30 affiche_sortie(sol2); 31 }