Added define NO_GNUPLOT to disable gnuplot extensions
Needed for win32 (well, at least for me)
This commit is contained in:
parent
0a9f57e652
commit
b2de3403a6
7 changed files with 71 additions and 23 deletions
|
|
@ -24,12 +24,12 @@ ac_cv_lib_eoutils_main=${ac_cv_lib_eoutils_main=no}
|
||||||
ac_cv_lib_m_main=${ac_cv_lib_m_main=yes}
|
ac_cv_lib_m_main=${ac_cv_lib_m_main=yes}
|
||||||
ac_cv_path_install=${ac_cv_path_install='/usr/bin/install -c'}
|
ac_cv_path_install=${ac_cv_path_install='/usr/bin/install -c'}
|
||||||
ac_cv_prog_CPP=${ac_cv_prog_CPP='cc -E'}
|
ac_cv_prog_CPP=${ac_cv_prog_CPP='cc -E'}
|
||||||
ac_cv_prog_CXX=${ac_cv_prog_CXX=/opt/intel/compiler70/ia32/bin/icpc}
|
ac_cv_prog_CXX=${ac_cv_prog_CXX=c++}
|
||||||
ac_cv_prog_LN_S=${ac_cv_prog_LN_S='ln -s'}
|
ac_cv_prog_LN_S=${ac_cv_prog_LN_S='ln -s'}
|
||||||
ac_cv_prog_RANLIB=${ac_cv_prog_RANLIB=ranlib}
|
ac_cv_prog_RANLIB=${ac_cv_prog_RANLIB=ranlib}
|
||||||
ac_cv_prog_cxx_cross=${ac_cv_prog_cxx_cross=no}
|
ac_cv_prog_cxx_cross=${ac_cv_prog_cxx_cross=no}
|
||||||
ac_cv_prog_cxx_g=${ac_cv_prog_cxx_g=yes}
|
ac_cv_prog_cxx_g=${ac_cv_prog_cxx_g=yes}
|
||||||
ac_cv_prog_cxx_works=${ac_cv_prog_cxx_works=yes}
|
ac_cv_prog_cxx_works=${ac_cv_prog_cxx_works=yes}
|
||||||
ac_cv_prog_gxx=${ac_cv_prog_gxx=no}
|
ac_cv_prog_gxx=${ac_cv_prog_gxx=yes}
|
||||||
ac_cv_prog_make_make_set=${ac_cv_prog_make_make_set=yes}
|
ac_cv_prog_make_make_set=${ac_cv_prog_make_make_set=yes}
|
||||||
ac_cv_type_size_t=${ac_cv_type_size_t=yes}
|
ac_cv_type_size_t=${ac_cv_type_size_t=yes}
|
||||||
|
|
|
||||||
|
|
@ -2,27 +2,8 @@
|
||||||
#
|
#
|
||||||
# You need:
|
# You need:
|
||||||
# Python 2.2
|
# Python 2.2
|
||||||
# Stlport
|
|
||||||
# Boost.Python v2
|
# 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
|
CXX = g++ #-3.2
|
||||||
CXXFLAGS = -DHAVE_SSTREAM#-g #-DNDEBUG
|
CXXFLAGS = -DHAVE_SSTREAM#-g #-DNDEBUG
|
||||||
|
|
|
||||||
61
eo/src/pyeo/test/test_transform.py
Normal file
61
eo/src/pyeo/test/test_transform.py
Normal 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
|
||||||
|
|
@ -178,6 +178,7 @@ void valueParam()
|
||||||
define_valueParam<double, double>("Float");
|
define_valueParam<double, double>("Float");
|
||||||
define_valueParam<std::vector<double>, numeric::array >("Vec");
|
define_valueParam<std::vector<double>, numeric::array >("Vec");
|
||||||
define_valueParam< std::pair<double, double>, tuple >("Pair");
|
define_valueParam< std::pair<double, double>, tuple >("Pair");
|
||||||
|
//define_valueParam< object, object >("Py");
|
||||||
|
|
||||||
class_<ValueParam, bases<eoParam> >("eoValueParam", init<>())
|
class_<ValueParam, bases<eoParam> >("eoValueParam", init<>())
|
||||||
//.def(init<object, std::string, std::string, char, bool>())
|
//.def(init<object, std::string, std::string, char, bool>())
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,7 @@
|
||||||
Contact: Marc.Schoenauer@polytechnique.fr
|
Contact: Marc.Schoenauer@polytechnique.fr
|
||||||
*/
|
*/
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
#ifndef NO_GNUPLOT
|
||||||
|
|
||||||
#ifndef _eoGnuplot_H
|
#ifndef _eoGnuplot_H
|
||||||
#define _eoGnuplot_H
|
#define _eoGnuplot_H
|
||||||
|
|
@ -149,7 +150,7 @@ inline void eoGnuplot::initGnuPlot(std::string _title, std::string _extra)
|
||||||
* Created......: Mon Mar 13 13:50:11 1995
|
* Created......: Mon Mar 13 13:50:11 1995
|
||||||
* Description..: Communication par pipe bidirectionnel avec un autre process
|
* Description..: Communication par pipe bidirectionnel avec un autre process
|
||||||
*
|
*
|
||||||
* Ident........: $Id: eoGnuplot.h,v 1.8 2003-03-21 02:39:09 maartenkeijzer Exp $
|
* Ident........: $Id: eoGnuplot.h,v 1.9 2004-01-21 19:57:19 maartenkeijzer Exp $
|
||||||
* ----------------------------------------------------------------------
|
* ----------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
@ -301,5 +302,5 @@ inline int PipeComWaitFor( PCom *from, char *what )
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,7 @@
|
||||||
mkeijzer@dhi.dk
|
mkeijzer@dhi.dk
|
||||||
*/
|
*/
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
#ifndef NO_GNUPLOT
|
||||||
|
|
||||||
#ifndef _eoGnuplot1DMonitor_H
|
#ifndef _eoGnuplot1DMonitor_H
|
||||||
#define _eoGnuplot1DMonitor_H
|
#define _eoGnuplot1DMonitor_H
|
||||||
|
|
@ -129,3 +130,4 @@ inline void eoGnuplot1DMonitor::FirstPlot()
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,7 @@
|
||||||
mkeijzer@dhi.dk
|
mkeijzer@dhi.dk
|
||||||
*/
|
*/
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
#ifndef NO_GNUPLOT
|
||||||
|
|
||||||
#ifndef _eoGnuplot1DSnapshot_H
|
#ifndef _eoGnuplot1DSnapshot_H
|
||||||
#define _eoGnuplot1DSnapshot_H
|
#define _eoGnuplot1DSnapshot_H
|
||||||
|
|
@ -156,3 +157,4 @@ inline eoMonitor& eoGnuplot1DSnapshot::operator() (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
|
||||||
Reference in a new issue