Added define NO_GNUPLOT to disable gnuplot extensions

Needed for win32 (well, at least for me)
This commit is contained in:
maartenkeijzer 2004-01-21 19:57:19 +00:00
commit b2de3403a6
7 changed files with 71 additions and 23 deletions

View file

@ -2,27 +2,8 @@
#
# You need:
# Python 2.2
# Stlport
# Boost.Python v2
#
#
# On my debian (unstable), I used libstlport_gcc.so.4.5
# and libboost_python.so.1.29.0
#
# Obviously together with python2.2 (as Boost.Python.v2 needs that)
#
# I'm pretty sure any stlport will do, but less convinced about boost.python
# That lib seems to be pretty much under development (as I found out, the hard way)
# but this version 1.29 seems to work for me.
#
# My version of boost was found in /usr/include, modify INC to your system
#
# For you happy Debian unstable users, just install
#
# apt-get install libstlport4.5
# apt-get install libboost-python-dev
# apt-get install libboost-python1.29.0
#
CXX = g++ #-3.2
CXXFLAGS = -DHAVE_SSTREAM#-g #-DNDEBUG

View file

@ -0,0 +1,61 @@
"""Test script for the eoSGATranform class"""
from copy import deepcopy
from PyEO import *
from maxone import *
pop = eoPop()
for i in range(10):
eo = EO()
init(eo)
evaluate(eo)
pop.push_back(eo)
transform = eoSGATransform(xover, 0.8, mutate, 0.2)
def test1(pop, transform):
pop = deepcopy(pop)
print "test 1"
print "Initial population:"
print pop
transform(pop)
print "GM pop:"
print pop
def test2(pop, transform):
pop = deepcopy(pop)
print "test 2"
print "Initial population"
print pop
checkpoint = eoCheckPoint(eoGenContinue(50))
select = eoSelectNumber(eoDetTournamentSelect(3), 10)
replace = eoGenerationalReplacement()
algo = eoEasyEA(checkpoint, evaluate, select, transform, replace)
algo(pop)
print "Evoluated pop:"
print pop
if __name__ == "__main__":
try:
test1(pop, transform)
except:
import sys
print
print "Caught an exception:"
print sys.exc_type, sys.exc_value
print
try:
test2(pop, transform)
except:
import sys
print
print "Caught an exception:"
print sys.exc_type, sys.exc_value
print

View file

@ -178,6 +178,7 @@ void valueParam()
define_valueParam<double, double>("Float");
define_valueParam<std::vector<double>, numeric::array >("Vec");
define_valueParam< std::pair<double, double>, tuple >("Pair");
//define_valueParam< object, object >("Py");
class_<ValueParam, bases<eoParam> >("eoValueParam", init<>())
//.def(init<object, std::string, std::string, char, bool>())