25 for (
int i=0; i<size_sonden_array; i++) {
26 n += mismatch_array[i]+1;
37 if (max_generation<1) max_generation = 1;
48 printf(
"Generation %i: avg_fit=%f\n", act_generation->
get_generation(), avg_fit);
56 delete act_generation; act_generation =
NULp;
60 act_generation = child_generation;
70 char *new_list_string;
76 char ecoli_pos[40], temp_ecol[10];
83 memset(ecoli_pos, 0, 40);
89 probe_string =
new char[probe_len+1];
91 probe_string[0] = misms[0] = 0;
95 strcat(probe_string,
" ");
100 strcat(misms, temp_misms);
102 strcat(ecoli_pos, temp_ecol);
106 ecoli_pos[strlen(ecoli_pos)-1] = 0;
108 new_list_string =
new char[21+
115 buf_len = strlen(buf);
116 for (i=0; i<20-buf_len; i++)
121 delete [] probe_string;
125 elem = computation_result_list->
get_first();
131 if (strcmp(elem->
view_string, new_list_string) == 0) {
132 delete [] new_list_string;
143 elem = computation_result_list->
get_next();
154 elem = computation_result_list->
get_first();
157 elem = computation_result_list->
get_next();
186 for (i=0; i<size_sonden_array; i++) {
190 for (j=0; j<=mismatch_array[i]; j++) {
191 temp_probe =
new probe;
197 probe_pool[counter++] = temp_probe;
200 pool_length = counter;
206 for (i=0; i<size_sonden_array; i++) {
210 for (j=0; j<=mismatch_array[i]; j++) {
211 for (k=0; k < bewertungarray[i]; k++) {
212 temp_probe =
new probe;
218 probe_pool[counter++] = temp_probe;
235 sondenarray = sonden_array;
236 bewertungarray = bewertung;
237 size_sonden_array = no_of_sonden;
238 mismatch_array = mismatch;
242 for (
int i=0; i<size_sonden_array; i++) {
244 max_init_pop_combis += mismatch[i]+1;
245 pool_length += (mismatch_array[i]+1) * bewertungarray[i];
253 probe_pool =
new probe*[pool_length];
254 memset(probe_pool, 0, pool_length *
sizeof(
probe*));
263 for (i=0; i<size_sonden_array; i++) free(sondenarray[i]);
264 for (i=0; i<pool_length; i++)
delete probe_pool[i];
266 elem = computation_result_list->
get_first();
271 elem = computation_result_list->
get_first();
274 delete computation_result_list;
276 if (act_generation == child_generation)
delete act_generation;
278 delete act_generation;
279 delete child_generation;
282 delete [] sondenarray;
283 delete [] bewertungarray;
284 delete [] mismatch_array;
285 delete [] probe_pool;
AW_window_simple * get_result_window()
positiontype insert_as_last(Type *object)
long k_chosenFrom_n(int k, int n)
#define MAXINITPOPULATION
void insert_default(const char *displayed, const AW_scalar &value)
positiontype insert_before_current(Type *object)
bool MP_aborted(int gen_cnt, double avg_fit, double min_fit, double max_fit, arb_progress &progress)
void insert(const char *displayed, const AW_scalar &value)
const char * get_string() const
char * MP_get_comment(int which, const char *str)
Generation * create_next_generation()
void insert_in_result_list(probe_combi_statistic *pcs)
AW_selection_list * result_probes_list
probe * get_probe_combi(int j)
bool calcFitness(bool use_genetic_algo, double old_avg_fit)
AW_selection_list * selected_list
void set_stc(ST_Container *stopfC)
ProbeValuation(char **sonden_array, int no_of_sonden, int *bewertung, int *single_mismatch)
probe_combi_statistic * ps
const AW_scalar * get_value() const
#define MAXSONDENHASHSIZE
void aw_message(const char *msg)
probe_combi_statistic * duplicate()
MP_Window * get_mp_window()
positiontype insert_as_first(Type *object)