struct individual **population1;
struct individual **population2;
-int dbg_segments = 0;
-int dbg_plan = 0;
-int dbg_requests = 0;
-int dbg_graph = 0;
-int dbg_bfs = 0;
-int dbg_map_parts = 0;
-int dbg_movement = 0;
-int dbg_init = 0;
-int dbg_overlaps = 0;
-int dbg_rank = 0;
-int dbg_evolution = 0;
-int dbg_mutation = 0;
-int dbg_breeding = 0;
+int dbg_segments = VERBOSITY_NONE;
+int dbg_plan = VERBOSITY_NONE;
+int dbg_requests = VERBOSITY_NONE;
+int dbg_graph = VERBOSITY_NONE;
+int dbg_bfs = VERBOSITY_NONE;
+int dbg_map_parts = VERBOSITY_NONE;
+int dbg_movement = VERBOSITY_NONE;
+int dbg_init = VERBOSITY_NONE;
+int dbg_overlaps = VERBOSITY_NONE;
+int dbg_rank = VERBOSITY_NONE;
+int dbg_evolution = VERBOSITY_NONE;
+int dbg_mutation = VERBOSITY_NONE;
+int dbg_breeding = VERBOSITY_NONE;
int page_width_int;
int page_height_int;
{
int parent1 = randint(0, breed_rbest_size-1);
int parent2 = randint(0, breed_rbest_size-1);
- if (dbg_breeding)
+ if (dbg_breeding >= VERBOSITY_INDIVIDUAL)
printf("Will breed %d and %d\n", parent1, parent2);
breed_buffer = perform_crossover(population1[parent1], population1[parent2]);
{
if (! processed[parent1->placements[i].ind])
{
- if (dbg_breeding)
+ if (dbg_breeding >= VERBOSITY_PLACEMENT)
printf("Creating symbol closure for placement %u\n", i);
struct placement **clos_symbols = get_closure(&(parent1->placements[i]));
if (x == 1)
{
- if (dbg_breeding)
+ if (dbg_breeding >= VERBOSITY_PLACEMENT)
printf("Copying parent->child 1->1 and 2->2\n");
copy_symbols(clos_symbols, parent1, child1, &processed);
copy_symbols(clos_symbols, parent2, child2, &processed);
}
else
{
- if (dbg_breeding)
+ if (dbg_breeding >= VERBOSITY_PLACEMENT)
printf("Copying parent->child 2->1 and 1->2\n");
copy_symbols(clos_symbols, parent2, child1, &processed);
copy_symbols(clos_symbols, parent1, child2, &processed);
uns first = 0;
while (first < GARY_SIZE(closure))
{
- if (dbg_breeding)
+ if (dbg_breeding >= VERBOSITY_ALL)
printf("Iterating, first is %d of current %u\n", first, GARY_SIZE(closure));
struct placement **overlapping = get_overlapping(placement);
if (! overlapping) { first++; continue; }
struct placement **filtered = filter(overlapping, &chosen);
- if (dbg_breeding)
+ if (dbg_breeding >= VERBOSITY_ALL)
printf("There are %u new overlapping symbols\n", GARY_SIZE(filtered));
GARY_FREE(overlapping);
overlapping = filtered;
if (overlaps(*p, overlapping[j]))
{
p = GARY_PUSH(closure); *p = overlapping[j];
- if (dbg_breeding)
+ if (dbg_breeding >= VERBOSITY_ALL)
printf("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;
}
void copy_symbols(struct placement **closure, struct individual *parent, struct individual *child, bool **processed_ptr)
{
bool *processed = *processed_ptr;
- if (dbg_breeding)
+ if (dbg_breeding >= VERBOSITY_ALL)
printf("Will copy %u symbols\n", GARY_SIZE(closure));
for (uns i=0; i<GARY_SIZE(closure); i++)