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;
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);
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);
{
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;
}
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);
for (uns i=0; i<GARY_SIZE(parts); i++)
{
- struct map_placement *mp = parts[i]->placement->next_in_map;
+ struct map_placement *mp = individual->map[parts[i]->ind]->placement->next_in_map;
while (mp)
{
if (p->variant_used >= 0)
void update_map_parts(struct placement *p);
void update_map_parts_delete(struct placement *p);
void update_map_parts_create(struct placement *p);
-struct placement **get_closure(struct placement *placement);
+struct placement **get_closure(struct placement *placement, struct individual *other);
void dump_bitmaps(struct individual *individual);
void dump_label(struct symbol *sym);