Package ec.vector

Examples of ec.vector.DoubleVectorIndividual


        for(int i = 0 ; i < ind.length; i++)
            if ( ! ( ind[i] instanceof DoubleVectorIndividual ) )
                state.output.error( "Individual " + i + "in coevolution is not a DoubleVectorIndividual." );
            else
                {
                DoubleVectorIndividual coind = (DoubleVectorIndividual)(ind[i]);
                size += coind.genome.length;
                }
        state.output.exitIfErrors();
               
        // concatenate all the arrays
        double[] vals = new double[size];
        int pos = 0;
        for(int i = 0 ; i < ind.length; i++)
            {
            DoubleVectorIndividual coind = (DoubleVectorIndividual)(ind[i]);
            System.arraycopy(coind.genome, 0, vals, pos, coind.genome.length);
            pos += coind.genome.length;
            }

        double trial = (function(state, problemType, vals, threadnum));

        // update individuals to reflect the trial
        for(int i = 0 ; i < ind.length; i++)
            {
            DoubleVectorIndividual coind = (DoubleVectorIndividual)(ind[i]);
            if (updateFitness[i])
                {
                // Update the context if this is the best trial.  We're going to assume that the best
                // trial is trial #0 so we don't have to search through them.
                int len = coind.fitness.trials.size();
View Full Code Here


        else if (ind.evaluated// don't bother reevaluating
            return;
           
        if (!(ind instanceof DoubleVectorIndividual))
            state.output.fatal("The individuals for this problem should be DoubleVectorIndividuals.");
        DoubleVectorIndividual temp = (DoubleVectorIndividual) ind;
        double[] genome = temp.genome;
        int genomeSize = genome.length;
        double value = 0;
        double fit;
        int i, j;
View Full Code Here

    if (!(ind instanceof DoubleVectorIndividual))
      state.output.fatal("Whoa!  It's not a DoubleVectorIndividual!!!",
          null);

    DoubleVectorIndividual ind2 = (DoubleVectorIndividual) ind;
    float fitness = evaluate(ind2.genome);
    boolean ideal = isIdeal(ind2.genome, fitness);

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

TOP

Related Classes of ec.vector.DoubleVectorIndividual

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.