static void Eval_pop(Neuron pop[]) {
  
    int i, j, k;
//int spam2;
//float spam = 0;
    int best[] = new int[Config.TOP_NETS];
    float pop_average;
    float total_fitness = 0.0F;
    float the_best = -999999.0F;
    String best_name;
    Network net = new Network();
    Neuron net_pop[] = new Neuron[Config.NUM_HIDDEN];
    Neuron the_best_net[] = new Neuron[Config.NUM_HIDDEN];
  
    /* make new file name for best network */
    i = generation % 1000;
    best_name = ("" + (i/100) + ((i%100)/10) + ((i%100)%10) + "best.bin");
    
    /* reset fitness and test values of each neuron */
    for (i=0; i<Config.POP_SIZE; ++i) {
      pop[i].fitness = 0;
      pop[i].ranking = 0;
      pop[i].tests = 0;
    }
  
    /* eval stage */
    for (i=0; i<Config.NUM_TRIALS; ++i) {
    
      if ((i < Config.TOP_NETS) == true)
        for (j=0; j<Config.NUM_HIDDEN; ++j) {
          net_pop[j] = best_nets[i].neuron[j];
          ++net_pop[j].tests;
        } /* end for-j */
      else  /* find random subpopulation */
        for (j=0; j<Config.NUM_HIDDEN; ++j) {
          net_pop[j] = pop[Math.abs(myRandom.nextInt()) % Config.POP_SIZE];
          best_nets[i].neuron[j] = net_pop[j];
          ++net_pop[j].tests;
        } /* end for-j */
        
      Sane_NN.Build_net(net, net_pop);
      best_nets[i].fitness = 0.0F;
      /*evaluate network*/
      for (j=0; j<Config.NUM_ATTEMPTS; ++j)
        best_nets[i].fitness += Domain.Evaluate_net(net);
//debugging code
//for (spam2=0; spam2<Config.POP_SIZE; ++spam2)
//System.out.println("right after evaluate_net called- best_nets[" + i + "] fitness: " + best_nets[i].fitness);
      total_fitness += best_nets[i].fitness;
  
    }  /* end for-i loop */
  
    pop_average = total_fitness / Config.NUM_TRIALS;
    Sane_EA.Sort_best_networks();

    /* each neuron's fitness is determined from the best 5 networks */
    /* it participated in.  It may be better to use the best 3.     */
    for (j=0; j<Config.NUM_TRIALS; ++j)
      for (k=0; k<Config.NUM_HIDDEN; ++k)
        if (best_nets[j].neuron[k].ranking < 5) {
          ++best_nets[j].neuron[k].ranking;
          best_nets[j].neuron[k].fitness += best_nets[j].fitness;
        } /* end if <5 */
    
    /* save best networks to a file */
    Sane_Util.Save_partial(best_nets[0].neuron, best_name);



//debugging code
//for (i=0; i<Config.POP_SIZE; ++i)
//  System.out.println("end of eval_pop- pop[" + i + "] fitness: " + pop[i].fitness);
  
  }  /* end Eval_pop */