diff -urd -X clean/diff_ignore path_x2/common/path_finding_gb.c path_x3/common/path_finding_gb.c --- path_x2/common/path_finding_gb.c Mon Sep 16 11:34:54 2002 +++ path_x3/common/path_finding_gb.c Mon Sep 16 11:22:50 2002 @@ -330,7 +330,7 @@ return TB_NORMAL; } } -#endif + /********************************************************************* * Strict trireme function: will never go into the unknown and @@ -345,6 +345,7 @@ return TB_IGNORE; } +#endif /* -------------------- manipulating the cost --------------------- */ /******************************************************************** * Number of turns requite to reach node diff -urd -X clean/diff_ignore path_x2/common/path_finding_gb.h path_x3/common/path_finding_gb.h --- path_x2/common/path_finding_gb.h Mon Sep 16 11:34:54 2002 +++ path_x3/common/path_finding_gb.h Mon Sep 16 11:10:12 2002 @@ -20,6 +20,18 @@ #include "path_finding_common.h" +#undef pf_map +#undef pf_map_t +#undef pf_init +#undef pf_get_map +#undef pf_get_path +#undef pf_next +#undef pf_next_get_x +#undef pf_next_get_y +#undef pf_next_get_path +#undef pf_next_get_position +#undef pf_destroy_map + #define pf_map GB_pf_map #define pf_map_t GB_pf_map_t #define pf_init GB_pf_init diff -urd -X clean/diff_ignore path_x2/common/path_finding_rf.h path_x3/common/path_finding_rf.h --- path_x2/common/path_finding_rf.h Mon Sep 16 11:34:54 2002 +++ path_x3/common/path_finding_rf.h Mon Sep 16 11:10:32 2002 @@ -20,6 +20,18 @@ #include "path_finding_common.h" +#undef pf_map +#undef pf_map_t +#undef pf_init +#undef pf_get_map +#undef pf_get_path +#undef pf_next +#undef pf_next_get_x +#undef pf_next_get_y +#undef pf_next_get_path +#undef pf_next_get_position +#undef pf_destroy_map + #define pf_map RF_pf_map #define pf_map_t RF_pf_map_t #define pf_init RF_pf_init diff -urd -X clean/diff_ignore path_x2/common/test_path_finding.c path_x3/common/test_path_finding.c --- path_x2/common/test_path_finding.c Mon Sep 16 11:34:54 2002 +++ path_x3/common/test_path_finding.c Mon Sep 16 11:31:49 2002 @@ -56,12 +56,32 @@ #if 0 { + struct pf_position RF_pos, GB_pos; + RF_pf_next_get_position(RF_pf_map, &RF_pos); + GB_pf_next_get_position(GB_pf_map, &GB_pos); + + if (!same_pos(RF_pos.x, RF_pos.y, GB_pos.x, GB_pos.y)) { + freelog(LOG_NORMAL, "problem"); + assert(0); + } + } +#endif + +#if 1 + { struct pf_path RF_path, GB_path; RF_pf_next_get_path(RF_pf_map, &RF_path); GB_pf_next_get_path(GB_pf_map, &GB_path); pf_print_path(&RF_path); pf_print_path(&GB_path); + freelog(LOG_NORMAL, " -"); + + if (pf_last_position(&RF_path)->total_BMC != + pf_last_position(&GB_path)->total_BMC) { + freelog(LOG_NORMAL, "different BMCs"); + assert(0); + } } #endif @@ -82,6 +102,8 @@ } RF_pf_destroy_map(RF_pf_map); GB_pf_destroy_map(GB_pf_map); + + freelog(LOG_NORMAL, "produced same output"); } /********************************************************************* @@ -156,9 +178,13 @@ clock_t start, finish; int i; + freelog(LOG_NORMAL, "time_path_finding(%s)", pplayer->name); + /* Verify both methods produce the same results */ unit_list_iterate(pplayer->units, punit) { - compare_pf(punit); + if (is_ground_unit(punit)) { + compare_pf(punit); + } } unit_list_iterate_end; #define RUNS 100 @@ -168,7 +194,9 @@ for(i = 1; i < RUNS; i++) { unit_list_iterate(pplayer->units, punit) { + if (is_ground_unit(punit)) { RF_stimulate_pf(punit); + } } unit_list_iterate_end; } @@ -181,7 +209,9 @@ for(i = 1; i < RUNS; i++) { unit_list_iterate(pplayer->units, punit) { + if (is_ground_unit(punit)) { GB_stimulate_pf(punit); + } } unit_list_iterate_end; } @@ -193,6 +223,3 @@ #undef RUNS } - - -