commit 24f186353505a603c5c6823df3a1760464515cad
parent 83113901130c54cf81872dad6269ba7c6c14849b
Author: Marc Jeanmougin <marc@jeanmougin.fr>
Date: Sat, 5 Apr 2014 17:50:19 +0200
Merge branch 'master' of ssh://gitorious.org/ens-ulm-1/ens-ulm-1
Diffstat:
1 file changed, 14 insertions(+), 3 deletions(-)
diff --git a/contest/mc/explore.cpp b/contest/mc/explore.cpp
@@ -6,6 +6,7 @@ using namespace std;
#include "../louis/louis.cpp"
#include "../louis/ameliore.cpp"
+#define ULM 8254
#define DEPTH 10
// now better than never
#define DAMPING 1.1
@@ -76,12 +77,22 @@ void glouton(vector<int> moves[]) {
aretes[i] = false;
int best_pos;
int first_car;
- for (int i=0; i<8; i++)
+ for (int i=0; i<8; i++) {
moves[i].push_back(s_depart);
+ if (i < 4)
+ moves[i].push_back(ULM);
+ //moves[i].push_back(rand()%n_sommets);
+ }
+ // goto_etoile(moves);
+ for (int i=0; i<8; i++) {
+ moves[i] = complete(moves[i]);
+ pos[i] = moves[i].back();
+ }
+
while(temps[first_car = min_vehicle(temps)] <= t_autorise) {
best_pos = explore(DEPTH, aretes, pos, temps, first_car);
- //printf("decide to move car %d to %d\n", first_car, best_pos);
+ fprintf(stderr, "decide to move car %d to %d\n", first_car, best_pos);
// move the first car to best_pos
int aid = id_arete[make_pair(pos[first_car], best_pos)];
if(!aid) {
@@ -104,7 +115,7 @@ int main() {
vector<int> moves[8];
glouton(moves);
tronque_solution(moves, t_autorise);
- printf("FINAL: %d\n", score_solution(moves));
+ fprintf(stderr, "FINAL: %d\n", score_solution(moves));
affiche_sortie(moves);
}