Package ec.simple

Examples of ec.simple.SimpleFitness


        {
        for( int i = 0 ; i < pop.subpops.length ; i++ )
            if (assessFitness[i])
                for( int j = 0 ; j < pop.subpops[i].individuals.length ; j++ )
                    {
                    SimpleFitness fit = ((SimpleFitness)(pop.subpops[i].individuals[j].fitness));
                                                                       
                    // we take the max over the trials
                    double max = Double.NEGATIVE_INFINITY;
                    int len = fit.trials.size();
                    for(int l = 0; l < len; l++)
                        max = Math.max(((Double)(fit.trials.get(l))).doubleValue(), max)// it'll be the first one, but whatever
                                       
                    fit.setFitness(state, max, isOptimal(problemType, max));
                    pop.subpops[i].individuals[j].evaluated = true;
                    }
        }
View Full Code Here


    boolean ideal = isIdeal(ind2.genome, fitness);

    if (!(ind2.fitness instanceof SimpleFitness))
      state.output.fatal("Whoa!  It's not a SimpleFitness!!!", null);

    SimpleFitness sf = (SimpleFitness) ind2.fitness;
    sf.setFitness(state, fitness, ideal);
    ind2.evaluated = true;
  }
View Full Code Here

    boolean ideal = isIdeal(ind2.genome, fitness);

    if (!(ind2.fitness instanceof SimpleFitness))
      state.output.fatal("Whoa!  It's not a SimpleFitness!!!", null);

    SimpleFitness sf = (SimpleFitness) ind2.fitness;
    sf.setFitness(state, fitness, ideal);
    ind2.evaluated = true;
  }
View Full Code Here

        {
        for( int i = 0 ; i < pop.subpops.length ; i++ )
            if (updateFitness[i])
                for( int j = 0 ; j < pop.subpops[i].individuals.length ; j++ )
                    {
                    SimpleFitness fit = ((SimpleFitness)(pop.subpops[i].individuals[j].fitness));

                    // average of the trials we got
                    int len = fit.trials.size();
                    double sum = 0;
                    for(int l = 0; l < len; l++)
                        sum += ((Double)(fit.trials.get(l))).doubleValue();
                    sum /= len;
                                                                       
                    // we'll not bother declaring the ideal
                    fit.setFitness(state, sum, false);
                    pop.subpops[i].individuals[j].evaluated = true;
                    }
        }
View Full Code Here

                       
        double score = value1 - value2;

        if( updateFitness[0] )
            {
            SimpleFitness fit = ((SimpleFitness)(ind[0].fitness));
            fit.trials.add(new Double(score));
                       
            // set the fitness because if we're doing Single Elimination Tournament, the tournament
            // needs to know who won this time around.  Don't bother declaring the ideal here.
            fit.setFitness(state, score, false);
            }

        if( updateFitness[1] )
            {
            SimpleFitness fit = ((SimpleFitness)(ind[1].fitness));
            fit.trials.add(new Double(-score));

            // set the fitness because if we're doing Single Elimination Tournament, the tournament
            // needs to know who won this time around.
            fit.setFitness(state, -score, false);
            }
        }
View Full Code Here

    boolean ideal = isIdeal(ind2.genome, fitness);

    if (!(ind2.fitness instanceof SimpleFitness))
      state.output.fatal("Whoa!  It's not a SimpleFitness!!!", null);

    SimpleFitness sf = (SimpleFitness) ind2.fitness;
    sf.setFitness(state, fitness, ideal);
    ind2.evaluated = true;
  }
View Full Code Here

    boolean ideal = isIdeal(ind2.genome, fitness);

    if (!(ind2.fitness instanceof SimpleFitness))
      state.output.fatal("Whoa!  It's not a SimpleFitness!!!", null);

    SimpleFitness sf = (SimpleFitness) ind2.fitness;
    sf.setFitness(state, fitness, ideal);
    ind2.evaluated = true;
  }
View Full Code Here

    boolean ideal = isIdeal(ind2.genome, fitness);

    if (!(ind2.fitness instanceof SimpleFitness))
      state.output.fatal("Whoa!  It's not a SimpleFitness!!!", null);

    SimpleFitness sf = (SimpleFitness) ind2.fitness;
    sf.setFitness(state, fitness, ideal);
    ind2.evaluated = true;
  }
View Full Code Here

    boolean ideal = isIdeal(ind2.genome, fitness);

    if (!(ind2.fitness instanceof SimpleFitness))
      state.output.fatal("Whoa!  It's not a SimpleFitness!!!", null);

    SimpleFitness sf = (SimpleFitness) ind2.fitness;
    sf.setFitness(state, fitness, ideal);
    ind2.evaluated = true;
  }
View Full Code Here

    boolean ideal = isIdeal(ind2.genome, fitness);

    if (!(ind2.fitness instanceof SimpleFitness))
      state.output.fatal("Whoa!  It's not a SimpleFitness!!!", null);

    SimpleFitness sf = (SimpleFitness) ind2.fitness;
    sf.setFitness(state, fitness, ideal);
    ind2.evaluated = true;
  }
View Full Code Here

TOP

Related Classes of ec.simple.SimpleFitness

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.