Example #1
0
    maxgen = 15;

#################
ea = EA(INdim,OUTdim, numIns,numOuts, maxgen,popsize,minw,maxw);
ea.setProbabilities(pMut,pCross);
ea.initPop();
print 'starting build'
# evolution insert here
# 
expNo = round(1000000*random.random(),0);   # generate some number for text file data
print expNo
f = open('data/ea_%d.txt'%expNo, 'w');

# evolution insert here
while ea.wantsEval():
    print 'Gen: '+repr(ea.generation())+'/'+repr(maxgen)+' actual ind is ' +repr(ea.actualOne())+'/'+repr(popsize)+' best so far: '+repr(ea.getBestFitness());
    
    ind = ea.getInd();
    #ind.printMatrix();        

    error = evalInd(ind);
    ind.getFitness().setError(error);

    print 'Ind: '+repr(ea.actualOne())+' Error is: '+repr(error) +' fitness is: '+repr(ind.getFitness().get());

#    print ea.getActualWeights();

    # evaluated the last individual in the generatio? write stats
    if (ea.actualOne() == (popsize-1)):
        print 'check: '+repr(ea.generation())
        fit = ea.getBestInd().getFitness().get();
Example #2
0
    ea = EA(INdim, OUTdim, numIns, numOuts, maxgen, popsize, minw, maxw)
    ea.setProbabilities(pMut, pCross)
    ea.initPop()
    print 'starting build'
    expNooo = expNo * 10000000 + round(1000000 * random.random(), 0)
    # generate some pseuso-number for text file data
    print expNo
    f = open('data/ea_%d.txt' % expNooo, 'w')

    # evolution insert here
    while ea.wantsEval():
        print 'Gen: ' + repr(
            ea.generation()) + '/' + repr(maxgen) + ' actual ind is ' + repr(
                ea.actualOne()) + '/' + repr(
                    popsize) + ' best so far: ' + repr(ea.getBestFitness())

        ind = ea.getInd()
        #ind.printMatrix();

        error = evalInd(ind)
        ind.getFitness().setError(error)

        print 'Ind: ' + repr(ea.actualOne()) + ' Error is: ' + repr(
            error) + ' fitness is: ' + repr(ind.getFitness().get())

        #    print ea.getActualWeights();

        # evaluated the last individual in the generatio? write stats
        if (ea.actualOne() == (popsize - 1)):
            print 'check: ' + repr(ea.generation())
Example #3
0
ea.setProbabilities(pMut, pCross)
ea.initPop()
print 'starting build'
# evolution insert here
#
expNo = round(1000000 * random.random(), 0)
# generate some number for text file data
print expNo
f = open('data/ea_%d.txt' % expNo, 'w')

# evolution insert here
while ea.wantsEval():
    print 'Gen: ' + repr(
        ea.generation()) + '/' + repr(maxgen) + ' actual ind is ' + repr(
            ea.actualOne()) + '/' + repr(popsize) + ' best so far: ' + repr(
                ea.getBestFitness())

    ind = ea.getInd()
    #ind.printMatrix();

    error = evalInd(ind)
    ind.getFitness().setError(error)

    print 'Ind: ' + repr(
        ea.actualOne()) + ' Error is: ' + repr(error) + ' fitness is: ' + repr(
            ind.getFitness().get())

    #    print ea.getActualWeights();

    # evaluated the last individual in the generatio? write stats
    if (ea.actualOne() == (popsize - 1)):
Example #4
0
    maxgen = 15;

#################
ea = EA(INdim,OUTdim, numIns,numOuts, maxgen,popsize,minw,maxw);
ea.setProbabilities(pMut,pCross);
ea.initPop();
print 'starting build'
# evolution insert here
# 
expNo = 0;
print expNo
f = open('data/ea_%d.txt'%expNo, 'w');

# evolution insert here
while ea.wantsEval():
    print 'Gen: '+repr(ea.generation())+'/'+repr(maxgen)+' actual ind is ' +repr(ea.actualOne())+'/'+repr(popsize)+' best so far: '+repr(ea.getBestFitness());
    
    ind = ea.getInd();
    #ind.printMatrix();        

    error = evalInd(ind);
    ind.getFitness().setError(error);

    print 'Ind: '+repr(ea.actualOne())+' Error is: '+repr(error) +' fitness is: '+repr(ind.getFitness().get());

#    print ea.getActualWeights();

    # evaluated the last individual in the generatio? write stats
    if (ea.actualOne() == (popsize-1)):
        print 'check: '+repr(ea.generation())
        fit = ea.getBestInd().getFitness().get();