Index: trunk/src/plugins/rt_topo/crbs_route.c =================================================================== --- trunk/src/plugins/rt_topo/crbs_route.c (revision 1332) +++ trunk/src/plugins/rt_topo/crbs_route.c (revision 1333) @@ -37,7 +37,10 @@ static int crbs_grbs_draw(crbs_t *crbs, char *fn); static int crbs_trace_ast = 1; +static int hop_svg = 0; /* whether to write 3..4 svgs per next_hop call */ +static int cnt_grbs = 0; + static long crbs_ast_heuristic(usrch_a_star_t *ctx, void *node) { crbs_t *crbs = ctx->user_data; @@ -148,8 +151,18 @@ grbs_addr_t *froma, *toa; grbs_2net_t *gtn = crbs->routing_tn; grbs_detached_addr_t *res = NULL, dtmp; + static int hop_cnt = 0; + char tmp[128]; + hop_cnt++; + printf(" {%d} ", hop_cnt); + if (hop_svg) { + sprintf(tmp, "3_GRBS_routed_%d_h%d_a.svg", cnt_grbs, hop_cnt); + crbs_grbs_draw(crbs, tmp); + } + + froma = grbs_reattach_addr(&crbs->grbs, curr); if (froma == NULL) { printf(" Neigh: can't reattach curr\n"); @@ -156,11 +169,21 @@ return NULL; } + if (hop_svg) { + sprintf(tmp, "3_GRBS_routed_%d_h%d_b.svg", cnt_grbs, hop_cnt); + crbs_grbs_draw(crbs, tmp); + } + toa = grbs_path_next(&crbs->grbs, gtn, froma, pt->gpt, adir); if (toa != NULL) { grbs_addr_key_t key; htad_entry_t *e; + if (hop_svg) { + sprintf(tmp, "3_GRBS_routed_%d_h%d_c.svg", cnt_grbs, hop_cnt); + crbs_grbs_draw(crbs, tmp); + } + if (((froma->type & 0x0f) == ADDR_ARC_CONVEX) || ((froma->type & 0x0f) == ADDR_ARC_CONCAVE)) { if (fabs(froma->obj.arc->new_da) > M_PI) { /* printf(" INVALID arc (too long): %f at P%ld\n", froma->obj.arc->new_da, froma->obj.arc->parent_pt == NULL ? -1 : froma->obj.arc->parent_pt->uid);*/ @@ -198,6 +221,11 @@ grbs_path_cleanup_addr(&crbs->grbs, toa); } + if (hop_svg) { + sprintf(tmp, "3_GRBS_routed_%d_h%d_d.svg", cnt_grbs, hop_cnt); + crbs_grbs_draw(crbs, tmp); + } + grbs_path_cleanup_addr(&crbs->grbs, froma); return res; } @@ -321,7 +349,6 @@ return addr; } -static int cnt_grbs = 0; static int rt_topo_crbs_route_net(crbs_t *crbs, crbs_2net_t *ctn) { usrch_res_t sres;