Our Project/geneticV1/geneticV1.cpp
// I think this works now
// Survivors have a non-zero entry in n_proc
I think this works now
Survivors have a non-zero entry in n_proc
I think this works now Survivors have a non - zero entry in n_proc
void run_cw(memory_cell mem[MEMORY_SIZE], 
	    int pcs[N_PROGRAMS][MAX_PROCESSES], 
	    int c_proc[N_PROGRAMS], 
	    int n_proc[N_PROGRAMS],
	    int& duration)
{
  int time_step;
  int i, j;
  time_step = 1;
  while(time_step <= MAX_STEPS && survivor_count(n_proc) > 2){
    for(i=0;i<N_PROGRAMS;i++){
      do_one_step(mem,pcs,c_proc,n_proc,i);
    }
    time_step++;
  }
  duration = time_step;
  return;
}
void run_cw ( memory_cell mem [ MEMORY_SIZE ] , int pcs [ N_PROGRAMS ] [ MAX_PROCESSES ] , int c_proc [ N_PROGRAMS ] , int n_proc [ N_PROGRAMS ] , int & duration ) { int time_step ; int i , j ; time_step = 1 ; while ( time_step <= MAX_STEPS && survivor_count ( n_proc ) > 2 ) { for ( i = 0 ; i < N_PROGRAMS ; i ++ ) { do_one_step ( mem , pcs , c_proc , n_proc , i ) ; } time_step ++ ; } duration = time_step ; return ; }
I think this works now
Survivors have a non-zero entry in n_proc
I think this works now Survivors have a non - zero entry in n_proc
//    cerr << "time_step = " << time_step << endl;