#include <ucw/lib.h>
+#include <ucw/conf.h>
#include <ucw/gary.h>
#include <ucw/mempool.h>
#include <ucw/eltpool.h>
int num_edges = 0;
int dbg_num_hits = 0;
-int conf_pop_size = 50;
-int conf_fit_size = 1;
-
-int conf_penalty_bound = 0;
-int conf_stagnation_bound = 0;
-int conf_iteration_limit = 10;
-
-int conf_term_cond = TERM_COND_ITERATIONS;
-
-double conf_breed_pop_size = 0.45;
-double conf_breed_rbest = 0.3;
-
int breed_pop_size;
int breed_rbest_size;
-bool conf_mutate_children = 1;
-double conf_mutate_children_prob = 0.6;
-
-double conf_mutate_pop_size = 0.45;
-double conf_mutate_rbest = 0.2;
-
-double conf_mutate_move_bound = 0.1;
-double conf_mutate_regen_bound = 0.0;
-double conf_mutate_chvar_bound = 0.1;
-
int mutate_pop_size;
int mutate_rbest_size;
-double conf_elite_pop_size = 0.1;
int elite_pop_size;
-double conf_max_section_length = 80;
-double conf_max_section_overlay = 10;
int old_best = INT_MAX;
int iteration = 0;
uns num_map_parts_col;
uns num_map_parts;
+int conf_pop_size = 200, conf_fit_size = 1, conf_term_cond = TERM_COND_ITERATIONS;
+
+double conf_penalty_bound = 100, conf_stagnation_bound = 10;
+int conf_iteration_limit = 200;
+
+double conf_breed_pop_size = 0.45, conf_breed_rbest = 1,
+ conf_mutate_children, conf_mutate_children_prob = 0.6,
+ conf_mutate_pop_size = 0.45, conf_mutate_rbest = 1,
+ conf_mutate_move_bound = 0.1, conf_mutate_regen_bound = 0.05, conf_mutate_chvar_bound = 0.1,
+ conf_elite_pop_size = 0.1;
+
+double conf_max_section_length = 80, conf_max_section_overlay = 10;
+
+static struct cf_section evolution_cf = {
+ CF_ITEMS {
+ CF_INT("PopSize", &conf_pop_size),
+ CF_INT("FitSize", &conf_fit_size),
+ CF_INT("TermCond", &conf_term_cond),
+ CF_DOUBLE("PenaltyBound", &conf_penalty_bound),
+ CF_DOUBLE("StagnationBound", &conf_stagnation_bound),
+ CF_INT("IterationLimit", &conf_iteration_limit),
+ CF_DOUBLE("BreedPopSize", &conf_breed_pop_size),
+ CF_DOUBLE("BreedNumBest", &conf_breed_rbest),
+ CF_DOUBLE("MutateChild", &conf_mutate_children_prob),
+ CF_DOUBLE("MutatePopSize", &conf_mutate_pop_size),
+ CF_DOUBLE("MutateNumBest", &conf_mutate_rbest),
+ CF_DOUBLE("MutateMoveBound", &conf_mutate_move_bound),
+ CF_DOUBLE("MutateRegenBound", &conf_mutate_regen_bound),
+ CF_DOUBLE("MutateChvarBound", &conf_mutate_chvar_bound),
+ CF_DOUBLE("ElitePopSize", &conf_elite_pop_size),
+ CF_DOUBLE("MaxSectionLenght", &conf_max_section_length),
+ CF_DOUBLE("MaxSectionOverlay", &conf_max_section_overlay),
+ CF_END
+ }
+};
+
void compute_sizes(void);
void make_population(void);
}
}
+void labeller_conf(void)
+{
+ cf_declare_section("Evolution", &evolution_cf, 0);
+}
+
void labeller_init(void)
{
GARY_INIT(requests_point, 0);
# Dump planning and drawing of symbols
DumpSymbols 0
}
+
+Evolution {
+ # Number of individuals in each generation
+ PopSize 50
+
+ # Enhance number of individuals created by elitisc to fit population size
+ FitSize 1
+
+ # Terminating condition
+ # 1 -- penalty reached, 2 -- stagnation, 3 -- iteration limit
+ TermCond 3
+ PenaltyBound 100
+ StagnationBound 10
+ IterationLimit 200
+
+ # Create that part of generation by breeding
+ BreedPopSize 0.45
+ # Use that part of best individuals for parent selection
+ BreedNumBest 0.9
+ # Probability of children mutation
+ MutateChild 0.6
+
+ # Create that part of generation by mutation
+ MutatePopSize 0.45
+ # Use that part of best individuals for individual selection
+ MutateNumBest 0.9
+ # Probability of moving label
+ MutateMoveBound 0.1
+ # Probability of regeneration label coordinates
+ MutateRegenBound 0.05
+ # Probability of changing label variant
+ MutateChvarBound 0.1
+
+ ElitePopSize 0.1
+
+ # Maximal length of line section in milimeters
+ MaxSectionLenght 80
+ # Section's length may exceed limit by at most [mm]
+ MaxSectionOverlay 10
+}