Merge branch 'master' of ssh://eodev.git.sourceforge.net/gitroot/eodev/eodev
Conflicts: eo/test/CMakeLists.txt
This commit is contained in:
commit
ccfd4c88ba
11 changed files with 82 additions and 24 deletions
|
|
@ -57,7 +57,7 @@ INCLUDE(ConfigureChecks.cmake)
|
||||||
INCLUDE(Dart OPTIONNAL)
|
INCLUDE(Dart OPTIONNAL)
|
||||||
|
|
||||||
# now create config headers
|
# now create config headers
|
||||||
configure_file(config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h)
|
CONFIGURE_FILE(config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h)
|
||||||
|
|
||||||
# Set a special flag if the environment is windows (should do the same in a config.g file)
|
# Set a special flag if the environment is windows (should do the same in a config.g file)
|
||||||
IF (WIN32)
|
IF (WIN32)
|
||||||
|
|
@ -113,7 +113,11 @@ ADD_SUBDIRECTORY(tutorial)
|
||||||
### 6) Install pkg-config config file for EO
|
### 6) Install pkg-config config file for EO
|
||||||
######################################################################################
|
######################################################################################
|
||||||
|
|
||||||
INSTALL(FILES eo.pc DESTINATION lib/pkgconfig COMPONENT headers)
|
SET(PCPREFIX "/usr")
|
||||||
|
SET(PCFLAGS "-leoutils -leo -les -lga -lcma -lgcov")
|
||||||
|
SET(PCINCLUDEDIR "eo")
|
||||||
|
CONFIGURE_FILE(pc.cmake ${CMAKE_CURRENT_BINARY_DIR}/eo.pc)
|
||||||
|
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/eo.pc DESTINATION lib/pkgconfig COMPONENT headers)
|
||||||
|
|
||||||
######################################################################################
|
######################################################################################
|
||||||
|
|
||||||
|
|
|
||||||
7
eo/build_gcc_linux_tutorial
Executable file
7
eo/build_gcc_linux_tutorial
Executable file
|
|
@ -0,0 +1,7 @@
|
||||||
|
#!/usr/bin/env sh
|
||||||
|
|
||||||
|
mkdir release
|
||||||
|
cd release
|
||||||
|
cmake -DENABLE_EO_TUTORIAL=1 ..
|
||||||
|
make
|
||||||
|
cd ..
|
||||||
7
eo/build_gcc_linux_unittest
Executable file
7
eo/build_gcc_linux_unittest
Executable file
|
|
@ -0,0 +1,7 @@
|
||||||
|
#!/usr/bin/env sh
|
||||||
|
|
||||||
|
mkdir debug
|
||||||
|
cd debug
|
||||||
|
cmake -DCMAKE_BUILD_TYPE=Debug -DENABLE_CMAKE_TESTING=1 ..
|
||||||
|
make
|
||||||
|
cd ..
|
||||||
5
eo/build_vs2008_release.bat
Normal file
5
eo/build_vs2008_release.bat
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
mkdir release
|
||||||
|
cd release
|
||||||
|
cmake -G "Visual Studio 9 2008" ..
|
||||||
|
cd ..
|
||||||
|
pause
|
||||||
12
eo/eo.pc
12
eo/eo.pc
|
|
@ -1,12 +0,0 @@
|
||||||
# Package Information for pkg-config
|
|
||||||
|
|
||||||
prefix=/usr
|
|
||||||
exec_prefix=${prefix}
|
|
||||||
libdir=${exec_prefix}/lib
|
|
||||||
includedir=${prefix}/include/eo
|
|
||||||
|
|
||||||
Name: Evolving Object
|
|
||||||
Description: Evolving Object
|
|
||||||
Version: 1.02-cvs1
|
|
||||||
Libs: -L${libdir} -leoutils -leo -les -lga -lcma -leomoo -lgcov
|
|
||||||
Cflags: -I${includedir}
|
|
||||||
6
eo/pc.cmake
Normal file
6
eo/pc.cmake
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
# Package Information for pkg-config
|
||||||
|
Name: @PACKAGE_NAME@
|
||||||
|
Description: @PACKAGE_NAME@
|
||||||
|
Version: @PROJECT_VERSION@
|
||||||
|
Libs: -L@PCPREFIX@/lib @PCFLAGS@
|
||||||
|
Cflags: -I@PCPREFIX@/include/@PCINCLUDEDIR@
|
||||||
|
|
@ -57,17 +57,17 @@ template <class EOT>
|
||||||
eoPop<EOT>& do_make_pop(eoParser & _parser, eoState& _state, eoInit<EOT> & _init)
|
eoPop<EOT>& do_make_pop(eoParser & _parser, eoState& _state, eoInit<EOT> & _init)
|
||||||
{
|
{
|
||||||
// random seed
|
// random seed
|
||||||
eoValueParam<uint32_t>& seedParam = _parser.createParam(uint32_t(0), "seed", "Random number seed", 'S');
|
eoValueParam<uint32_t>& seedParam = _parser.getORcreateParam(uint32_t(0), "seed", "Random number seed", 'S');
|
||||||
if (seedParam.value() == 0)
|
if (seedParam.value() == 0)
|
||||||
seedParam.value() = time(0);
|
seedParam.value() = time(0);
|
||||||
eoValueParam<unsigned>& popSize = _parser.createParam(unsigned(20), "popSize", "Population Size", 'P', "Evolution Engine");
|
eoValueParam<unsigned>& popSize = _parser.getORcreateParam(unsigned(20), "popSize", "Population Size", 'P', "Evolution Engine");
|
||||||
|
|
||||||
// Either load or initialize
|
// Either load or initialize
|
||||||
// create an empty pop and let the state handle the memory
|
// create an empty pop and let the state handle the memory
|
||||||
eoPop<EOT>& pop = _state.takeOwnership(eoPop<EOT>());
|
eoPop<EOT>& pop = _state.takeOwnership(eoPop<EOT>());
|
||||||
|
|
||||||
eoValueParam<std::string>& loadNameParam = _parser.createParam(std::string(""), "Load","A save file to restart from",'L', "Persistence" );
|
eoValueParam<std::string>& loadNameParam = _parser.getORcreateParam(std::string(""), "Load","A save file to restart from",'L', "Persistence" );
|
||||||
eoValueParam<bool> & recomputeFitnessParam = _parser.createParam(false, "recomputeFitness", "Recompute the fitness after re-loading the pop.?", 'r', "Persistence" );
|
eoValueParam<bool> & recomputeFitnessParam = _parser.getORcreateParam(false, "recomputeFitness", "Recompute the fitness after re-loading the pop.?", 'r', "Persistence" );
|
||||||
|
|
||||||
if (loadNameParam.value() != "") // something to load
|
if (loadNameParam.value() != "") // something to load
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,12 @@ Authors:
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef _INTERIX
|
||||||
|
#include <io.h>
|
||||||
|
#else // _INTERIX
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#endif // ! _INTERIX
|
||||||
|
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
#include <cstdio> // used to define EOF
|
#include <cstdio> // used to define EOF
|
||||||
|
|
|
||||||
|
|
@ -66,6 +66,7 @@ SET (TEST_LIST
|
||||||
t-eoLogger
|
t-eoLogger
|
||||||
t-eoIQRStat
|
t-eoIQRStat
|
||||||
t-eoDualFitness
|
t-eoDualFitness
|
||||||
|
t-eoParser
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
31
eo/test/t-eoParser.cpp
Normal file
31
eo/test/t-eoParser.cpp
Normal file
|
|
@ -0,0 +1,31 @@
|
||||||
|
#include <iostream>
|
||||||
|
#include <eo>
|
||||||
|
|
||||||
|
int main(int ac, char** av)
|
||||||
|
{
|
||||||
|
eoParser parser(ac, av);
|
||||||
|
|
||||||
|
unsigned int alpha1 = parser.createParam(10, "alpha1", "Alpha parameter").value();
|
||||||
|
unsigned int alpha2 = parser.createParam(10, "alpha2", "Alpha parameter").value();
|
||||||
|
unsigned int alpha3 = parser.createParam(10, "alpha3", "Alpha parameter").value();
|
||||||
|
unsigned int alpha4 = parser.createParam(10, "alpha4", "Alpha parameter").value();
|
||||||
|
unsigned int alpha5 = parser.createParam(10, "alpha5", "Alpha parameter").value();
|
||||||
|
unsigned int alpha6 = parser.createParam(10, "alpha6", "Alpha parameter").value();
|
||||||
|
|
||||||
|
if (parser.userNeedsHelp())
|
||||||
|
{
|
||||||
|
parser.printHelp(std::cout);
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
make_help(parser);
|
||||||
|
|
||||||
|
std::cout << "alpha1: " << alpha1 << std::endl;
|
||||||
|
std::cout << "alpha2: " << alpha2 << std::endl;
|
||||||
|
std::cout << "alpha3: " << alpha3 << std::endl;
|
||||||
|
std::cout << "alpha4: " << alpha4 << std::endl;
|
||||||
|
std::cout << "alpha5: " << alpha5 << std::endl;
|
||||||
|
std::cout << "alpha6: " << alpha6 << std::endl;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
@ -2,11 +2,15 @@
|
||||||
### 1) Where must cmake go now ?
|
### 1) Where must cmake go now ?
|
||||||
######################################################################################
|
######################################################################################
|
||||||
|
|
||||||
ADD_SUBDIRECTORY(Lesson1)
|
IF(ENABLE_EO_TUTORIAL)
|
||||||
ADD_SUBDIRECTORY(Lesson2)
|
|
||||||
ADD_SUBDIRECTORY(Lesson3)
|
ADD_SUBDIRECTORY(Lesson1)
|
||||||
ADD_SUBDIRECTORY(Lesson4)
|
ADD_SUBDIRECTORY(Lesson2)
|
||||||
ADD_SUBDIRECTORY(Lesson5)
|
ADD_SUBDIRECTORY(Lesson3)
|
||||||
ADD_SUBDIRECTORY(Lesson6)
|
ADD_SUBDIRECTORY(Lesson4)
|
||||||
|
ADD_SUBDIRECTORY(Lesson5)
|
||||||
|
ADD_SUBDIRECTORY(Lesson6)
|
||||||
|
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
######################################################################################
|
######################################################################################
|
||||||
|
|
|
||||||
Reference in a new issue