X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=lab-bitmaps.c;h=51d1da847623d12f17944dae19e0b098ccfa5ddf;hb=refs%2Fheads%2Flabelling;hp=f5822e6f4b9c257b6fe01c6ef918e9776492022d;hpb=f6bd1d0d00551ffb56e49dfce583a74009887463;p=leo.git diff --git a/lab-bitmaps.c b/lab-bitmaps.c index f5822e6..51d1da8 100644 --- a/lab-bitmaps.c +++ b/lab-bitmaps.c @@ -21,7 +21,7 @@ static void make_bitmap_label(struct variant *v, struct sym_text *text); static int overlaps(struct placement *p1, struct placement *p2); static struct map_part **get_map_parts(struct placement *p); -static struct placement **get_overlapping(struct placement *p); +static struct placement **get_overlapping_in(struct placement *p, struct individual *individual); double bitmap_granularity = 1; @@ -266,7 +266,7 @@ void update_map_parts(struct placement *p) update_map_parts_create(p); } -struct placement **get_closure(struct placement *placement) +struct placement **get_closure(struct placement *placement, struct individual *other) { struct placement **closure; GARY_INIT(closure, 0); @@ -280,7 +280,7 @@ struct placement **get_closure(struct placement *placement) while (first < GARY_SIZE(closure)) { DEBUG(dbg_breeding, VERBOSITY_ALL, "Iterating, first is %u of current %zu\n", first, GARY_SIZE(closure)); - struct placement **overlapping = get_overlapping(placement); + struct placement **overlapping = get_overlapping_in(closure[first], other); if (! overlapping) { first++; continue; } struct placement **filtered = filter(overlapping, &chosen); @@ -293,7 +293,8 @@ struct placement **get_closure(struct placement *placement) { if (overlaps(*p, overlapping[j])) { - p = GARY_PUSH(closure); *p = overlapping[j]; + p = GARY_PUSH(closure); + *p = &(placement->individual->placements[overlapping[j]->request->ind]); DEBUG(dbg_breeding, VERBOSITY_ALL, "Adding placement of request %d (in fact at [%.2f; %.2f] of size %d x %d)\n", overlapping[j]->request->ind, overlapping[j]->x, overlapping[j]->y, overlapping[j]->request->variants[overlapping[j]->variant_used].width, overlapping[j]->request->variants[overlapping[j]->variant_used].height); chosen[overlapping[j]->request->ind] = 1; } @@ -308,7 +309,7 @@ struct placement **get_closure(struct placement *placement) return closure; } -static struct placement **get_overlapping(struct placement *p) +static struct placement **get_overlapping_in(struct placement *p, struct individual *individual) { struct placement **buffer; GARY_INIT(buffer, 0); @@ -318,7 +319,7 @@ static struct placement **get_overlapping(struct placement *p) for (uns i=0; iplacement->next_in_map; + struct map_placement *mp = individual->map[parts[i]->ind]->placement->next_in_map; while (mp) { if (p->variant_used >= 0)