diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..a6f79649 --- /dev/null +++ b/.gitignore @@ -0,0 +1,23 @@ +# ignore html files +*.html + +# ignore all textual files +*.txt + +# ignore object and archive files +*.[oa] + +# ignore auto-saved files +*~ +\#*\# + +# excepted these manually configured files +!CMakeLists.txt +!README.txt +!application/ +!build/ +!doc/ +!lib/ +!src/ +!test/ +build/ diff --git a/CMakeLists.txt b/CMakeLists.txt index ce4a1d85..9bc3de9b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,60 +16,96 @@ SET(PROJECT_VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT ###################################################################################### -### 2) Include the install configuration file where are defined the main variables +### 2) Prepare some useful variables ###################################################################################### -INCLUDE(${CMAKE_CURRENT_SOURCE_DIR}/install.cmake) - -###################################################################################### - - -##################################################################################### -### 3) Include required modules & utilities -##################################################################################### - -INCLUDE(CMakeBackwardCompatibilityCXX) -#INCLUDE(FindDoxygen) -INCLUDE(CheckLibraryExists) -#INCLUDE(Dart OPTIONAL) - -FIND_PACKAGE(Doxygen) -FIND_PACKAGE(MPI REQUIRED) -FIND_PACKAGE(Gnuplot REQUIRED) - -# Set a special flag if the environment is windows (should do the same in a config.g file) -IF (WIN32) - ADD_DEFINITIONS(-D_WINDOWS=1) -ENDIF (WIN32) - -###################################################################################### - - -##################################################################################### -### 4) Manage the build type -##################################################################################### - -INCLUDE(${CMAKE_SOURCE_DIR}/BuildConfig.cmake) +SET(DO_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}") +SET(DO_BIN_DIR "${CMAKE_CURRENT_BINARY_DIR}") ###################################################################################### ###################################################################################### -### 5) Now where we go ??? +### 3) Include useful features +###################################################################################### + +INCLUDE(FindDoxygen) + +INCLUDE(FindPkgConfig) + +PKG_CHECK_MODULES(EO eo REQUIRED) + +INCLUDE_DIRECTORIES(${EO_INCLUDE_DIR}) +LINK_DIRECTORIES(${EO_LIBRARY_DIRS}) + +###################################################################################### + + +###################################################################################### +### 4) Include header files path +###################################################################################### + +INCLUDE_DIRECTORIES( + ${CMAKE_CURRENT_SOURCE_DIR}/src + ) + +###################################################################################### + + +###################################################################################### +### 5) Set compiler definitions +###################################################################################### + +IF(UNIX) + # enable warnings + ADD_DEFINITIONS( -Wall -W -Wextra ) + # ADD_DEFINITIONS( -Weffc++) + # ADD_DEFINITIONS( -g3 ) +ENDIF() + +###################################################################################### + + +###################################################################################### +### 6) Prepare some variables for CMAKE usage +###################################################################################### + +SET(SAMPLE_SRCS) + +###################################################################################### + + +###################################################################################### +### 7) Now where we go ? ###################################################################################### -# warning: you have to compile libraries before bopo sources because of dependencies. -ADD_SUBDIRECTORY(lib) -ADD_SUBDIRECTORY(doc) ADD_SUBDIRECTORY(src) -ADD_SUBDIRECTORY(test) ADD_SUBDIRECTORY(application) +ADD_SUBDIRECTORY(test) +ADD_SUBDIRECTORY(doc) ###################################################################################### ###################################################################################### -### 6) Include packaging +### 8) Create executable, link libraries and prepare target +###################################################################################### + +SET(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib) + +LINK_DIRECTORIES(${LIBRARY_OUTPUT_PATH}) + +ADD_LIBRARY(${PROJECT_NAME} STATIC ${SAMPLE_SRCS}) +#ADD_LIBRARY(${PROJECT_NAME} SHARED ${SAMPLE_SRCS}) + +# INSTALL( +# TARGETS ${LIBRARY_OUTPUT_PATH}/lib${PROJECT_NAME}.a +# DESTINATION lib +# COMPONENT libraries +# ) + +###################################################################################### +### 9) Include packaging ###################################################################################### INCLUDE(Packaging.cmake) diff --git a/COPYING b/COPYING new file mode 100644 index 00000000..90cbe47b --- /dev/null +++ b/COPYING @@ -0,0 +1 @@ +Private license diff --git a/README b/README new file mode 100644 index 00000000..64629f58 --- /dev/null +++ b/README @@ -0,0 +1,57 @@ +This package contains the source code for BOPO problems. + +# Step 1 - Configuration +------------------------ +Rename the "install.cmake-dist" file as "install.cmake" and edit it, inserting the FULL PATH +to your ParadisEO distribution. +On Windows write your path with double antislash (ex: C:\\Users\\...) + + +# Step 2 - Build process +------------------------ +ParadisEO is assumed to be compiled. To download ParadisEO, please visit http://paradiseo.gforge.inria.fr/. +Go to the BOPO/build/ directory and lunch cmake: +(Unix) > cmake .. +(Windows) > cmake .. -G"Visual Studio 9 2008" + +Note for windows users: if you don't use VisualStudio 9, enter the name of your generator instead of "VisualStudio 9 2008". + + +# Step 3 - Compilation +---------------------- +In the bopo/build/ directory: +(Unix) > make +(Windows) Open the VisualStudio solution and compile it, compile also the target install. +You can refer to this tutorial if you don't know how to compile a solution: http://paradiseo.gforge.inria.fr/index.php?n=Paradiseo.VisualCTutorial + + +# Step 4 - Execution +--------------------- +A toy example is given to test the components. You can run these tests as following. +To define problem-related components for your own problem, please refer to the tutorials available on the website : http://paradiseo.gforge.inria.fr/. +In the bopo/build/ directory: +(Unix) > ctest +Windows users, please refer to this tutorial: http://paradiseo.gforge.inria.fr/index.php?n=Paradiseo.VisualCTutorial + +In the directory "application", there are several directory such as p_eoco which instantiate NSGAII on BOPO problems. + +(Unix) After compilation you can run the script "bopo/run.sh" and see results in "NSGAII.out". Parameters can be modified in the script. + +(Windows) Add argument "NSGAII.param" and execute the corresponding algorithms. +Windows users, please refer to this tutorial: http://paradiseo.gforge.inria.fr/index.php?n=Paradiseo.VisualCTutorial + + +# Documentation +--------------- +The API-documentation is available in doc/html/index.html + + +# Things to keep in mind when using BOPO +---------------------------------------- +* By default, the EO random generator's seed is initialized by the number of seconds since the epoch (with time(0)). It is available in the status file dumped at each execution. Please, keep in mind that if you start two run at the same second without modifying the seed, you will get exactly the same results. + +* Execution times are measured with the boost:timer, that measure wallclock time. Additionaly, it could not measure times larger than approximatively 596.5 hours (or even less). See http://www.boost.org/doc/libs/1_33_1/libs/timer/timer.htm + +* The q-quantile computation use averaging at discontinuities (in R, it correspond to the R-2 method, in SAS, SAS-5). For more explanations, see http://en.wikipedia.org/wiki/Quantile#Estimating_the_quantiles_of_a_population and http://stat.ethz.ch/R-manual/R-devel/library/stats/html/quantile.html + +* You can send a SIGUSR1 to a process to get some information (written down in the log file) on the current state of the search. diff --git a/application/CMakeLists.txt b/application/CMakeLists.txt new file mode 100644 index 00000000..07bcc2d0 --- /dev/null +++ b/application/CMakeLists.txt @@ -0,0 +1,7 @@ +###################################################################################### +### 1) Where do we go now ?!? +###################################################################################### + +ADD_SUBDIRECTORY(cma_sa) + +###################################################################################### diff --git a/application/cma_sa/CMakeLists.txt b/application/cma_sa/CMakeLists.txt index a913882b..10305c28 100644 --- a/application/cma_sa/CMakeLists.txt +++ b/application/cma_sa/CMakeLists.txt @@ -1,5 +1,3 @@ -FIND_PACKAGE(Boost 1.33.0 REQUIRED) - INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) SET(RESOURCES @@ -15,21 +13,7 @@ FOREACH(file ${RESOURCES}) ) ENDFOREACH(file) -ADD_EXECUTABLE(cma_sa main.cpp) +FILE(GLOB SOURCES *.cpp) -TARGET_LINK_LIBRARIES(cma_sa - ${Boost_LIBRARIES} - BOPO - eoutils - pthread - moeo - eo - peo - rmc_mpi - eometah - nklandscapes - BOPO - #${MPICH2_LIBRARIES} - ${LIBXML2_LIBRARIES} - ${MPI_LIBRARIES} - ) +ADD_EXECUTABLE(cma_sa ${SOURCES}) +TARGET_LINK_LIBRARIES(cma_sa DO ${EO_LIBRARIES}) diff --git a/application/cma_sa/main.cpp b/application/cma_sa/main.cpp index e771e649..e15d37f3 100644 --- a/application/cma_sa/main.cpp +++ b/application/cma_sa/main.cpp @@ -1,12 +1,3 @@ -// #include -// #include - -#ifndef HAVE_GNUPLOT -// FIXME: temporary define to force use of gnuplot without compiling -// again EO. -# define HAVE_GNUPLOT -#endif - #include #include @@ -18,15 +9,12 @@ #include #include -//#include "BopoRosenbrock.h" +#include + #include "Rosenbrock.h" #include "Sphere.h" -#include - typedef eoReal EOT; -//typedef doUniform< EOT > Distrib; -//typedef doNormal< EOT > Distrib; int main(int ac, char** av) { diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt new file mode 100644 index 00000000..c44ffc47 --- /dev/null +++ b/doc/CMakeLists.txt @@ -0,0 +1,26 @@ +####################################################################################### +### Doc generation using Doxygen +####################################################################################### + +IF (DOXYGEN_FOUND) + SET(DOC_DIR ${CMAKE_BINARY_DIR}/doc CACHE PATH "documentation directory") + SET(DOC_CONFIG_FILE "doxyfile" CACHE PATH "documentation configuration file") + + # define the doc target + IF (DOXYGEN_EXECUTABLE) + ADD_CUSTOM_TARGET(doc + COMMAND ${DOXYGEN_EXECUTABLE} ${DOC_CONFIG_FILE} + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + ) + ENDIF (DOXYGEN_EXECUTABLE) + + # configure doxyfile file + CONFIGURE_FILE( + "${CMAKE_CURRENT_SOURCE_DIR}/${DOC_CONFIG_FILE}.cmake" + "${CMAKE_CURRENT_BINARY_DIR}/${DOC_CONFIG_FILE}" + ) +ELSE (DOXYGEN_FOUND) + MESSAGE(STATUS "Unable to generate the documentation, Doxygen package not found") +ENDIF (DOXYGEN_FOUND) + +####################################################################################### diff --git a/doc/doxyfile.cmake b/doc/doxyfile.cmake new file mode 100644 index 00000000..e19b4f28 --- /dev/null +++ b/doc/doxyfile.cmake @@ -0,0 +1,229 @@ +# Doxyfile 1.5.1 + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = @PACKAGE_NAME@ +PROJECT_NUMBER = @PACKAGE_VERSION@ +OUTPUT_DIRECTORY = @CMAKE_BINARY_DIR@/doc +CREATE_SUBDIRS = NO +OUTPUT_LANGUAGE = English +BRIEF_MEMBER_DESC = YES +REPEAT_BRIEF = YES +ABBREVIATE_BRIEF = "The $name class" \ + "The $name widget" \ + "The $name file" \ + is \ + provides \ + specifies \ + contains \ + represents \ + a \ + an \ + the +ALWAYS_DETAILED_SEC = NO +INLINE_INHERITED_MEMB = NO +FULL_PATH_NAMES = NO +STRIP_FROM_PATH = @CMAKE_SOURCE_DIR@ +STRIP_FROM_INC_PATH = +SHORT_NAMES = NO +JAVADOC_AUTOBRIEF = YES +MULTILINE_CPP_IS_BRIEF = NO +#DETAILS_AT_TOP = NO +INHERIT_DOCS = YES +SEPARATE_MEMBER_PAGES = NO +TAB_SIZE = 8 +ALIASES = +OPTIMIZE_OUTPUT_FOR_C = NO +OPTIMIZE_OUTPUT_JAVA = NO +BUILTIN_STL_SUPPORT = NO +DISTRIBUTE_GROUP_DOC = NO +SUBGROUPING = YES +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- +EXTRACT_ALL = NO +EXTRACT_PRIVATE = YES +EXTRACT_STATIC = YES +EXTRACT_LOCAL_CLASSES = YES +EXTRACT_LOCAL_METHODS = NO +HIDE_UNDOC_MEMBERS = YES +HIDE_UNDOC_CLASSES = YES +HIDE_FRIEND_COMPOUNDS = NO +HIDE_IN_BODY_DOCS = NO +INTERNAL_DOCS = NO +CASE_SENSE_NAMES = YES +HIDE_SCOPE_NAMES = NO +SHOW_INCLUDE_FILES = YES +INLINE_INFO = YES +SORT_MEMBER_DOCS = NO +SORT_BRIEF_DOCS = NO +SORT_BY_SCOPE_NAME = NO +GENERATE_TODOLIST = YES +GENERATE_TESTLIST = YES +GENERATE_BUGLIST = YES +GENERATE_DEPRECATEDLIST= YES +ENABLED_SECTIONS = +MAX_INITIALIZER_LINES = 30 +SHOW_USED_FILES = YES +SHOW_DIRECTORIES = NO +FILE_VERSION_FILTER = +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- +QUIET = YES +WARNINGS = NO +WARN_IF_UNDOCUMENTED = NO +WARN_IF_DOC_ERROR = YES +WARN_NO_PARAMDOC = NO +WARN_FORMAT = "$file:$line: $text" +WARN_LOGFILE = +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = @CMAKE_SOURCE_DIR@ +FILE_PATTERNS = *.cpp \ + *.h \ + NEWS README +RECURSIVE = YES +EXCLUDE = +EXCLUDE_SYMLINKS = NO +EXCLUDE_PATTERNS = +EXAMPLE_PATH = +EXAMPLE_PATTERNS = * +EXAMPLE_RECURSIVE = NO +IMAGE_PATH = +INPUT_FILTER = +FILTER_PATTERNS = +FILTER_SOURCE_FILES = NO +#--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- +SOURCE_BROWSER = YES +INLINE_SOURCES = NO +STRIP_CODE_COMMENTS = YES +REFERENCED_BY_RELATION = YES +REFERENCES_RELATION = YES +REFERENCES_LINK_SOURCE = YES +USE_HTAGS = NO +VERBATIM_HEADERS = YES +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- +ALPHABETICAL_INDEX = YES +COLS_IN_ALPHA_INDEX = 3 +IGNORE_PREFIX = moeo +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- +GENERATE_HTML = YES +HTML_OUTPUT = html +HTML_FILE_EXTENSION = .html +HTML_HEADER = +HTML_FOOTER = +HTML_STYLESHEET = +HTML_ALIGN_MEMBERS = YES +GENERATE_HTMLHELP = NO +CHM_FILE = +HHC_LOCATION = +GENERATE_CHI = NO +BINARY_TOC = NO +TOC_EXPAND = NO +DISABLE_INDEX = NO +ENUM_VALUES_PER_LINE = 4 +GENERATE_TREEVIEW = YES +TREEVIEW_WIDTH = 250 +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- +GENERATE_LATEX = YES +LATEX_OUTPUT = latex +LATEX_CMD_NAME = latex +MAKEINDEX_CMD_NAME = makeindex +COMPACT_LATEX = NO +PAPER_TYPE = a4wide +EXTRA_PACKAGES = +LATEX_HEADER = +PDF_HYPERLINKS = NO +USE_PDFLATEX = NO +LATEX_BATCHMODE = NO +LATEX_HIDE_INDICES = NO +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- +GENERATE_RTF = NO +RTF_OUTPUT = rtf +COMPACT_RTF = NO +RTF_HYPERLINKS = NO +RTF_STYLESHEET_FILE = +RTF_EXTENSIONS_FILE = +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- +GENERATE_MAN = YES +MAN_OUTPUT = man +MAN_EXTENSION = .3 +MAN_LINKS = NO +#--------------------------------------------------------------------------- +# configuration options related to the XML output +#--------------------------------------------------------------------------- +GENERATE_XML = NO +XML_OUTPUT = xml +XML_SCHEMA = +XML_DTD = +XML_PROGRAMLISTING = YES +#--------------------------------------------------------------------------- +# configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- +GENERATE_AUTOGEN_DEF = NO +#--------------------------------------------------------------------------- +# configuration options related to the Perl module output +#--------------------------------------------------------------------------- +GENERATE_PERLMOD = NO +PERLMOD_LATEX = NO +PERLMOD_PRETTY = YES +PERLMOD_MAKEVAR_PREFIX = +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- +ENABLE_PREPROCESSING = YES +MACRO_EXPANSION = NO +EXPAND_ONLY_PREDEF = NO +SEARCH_INCLUDES = YES +INCLUDE_PATH = +INCLUDE_FILE_PATTERNS = +PREDEFINED = +EXPAND_AS_DEFINED = +SKIP_FUNCTION_MACROS = YES +#--------------------------------------------------------------------------- +# Configuration::additions related to external references +#--------------------------------------------------------------------------- +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- +CLASS_DIAGRAMS = YES +HIDE_UNDOC_RELATIONS = YES +HAVE_DOT = NO +CLASS_GRAPH = YES +COLLABORATION_GRAPH = YES +GROUP_GRAPHS = YES +UML_LOOK = NO +TEMPLATE_RELATIONS = NO +INCLUDE_GRAPH = YES +INCLUDED_BY_GRAPH = YES +CALL_GRAPH = NO +CALLER_GRAPH = NO +GRAPHICAL_HIERARCHY = YES +DIRECTORY_GRAPH = YES +DOT_IMAGE_FORMAT = png +DOT_PATH = +DOTFILE_DIRS = +MAX_DOT_GRAPH_DEPTH = 0 +DOT_TRANSPARENT = NO +DOT_MULTI_TARGETS = NO +GENERATE_LEGEND = YES +DOT_CLEANUP = YES +#--------------------------------------------------------------------------- +# Configuration::additions related to the search engine +#--------------------------------------------------------------------------- +SEARCHENGINE = YES diff --git a/doc/index.h b/doc/index.h new file mode 100644 index 00000000..e69de29b diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 7ea92512..a9beb5c7 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -2,7 +2,7 @@ ### 1) Include useful packages ###################################################################################### -FIND_PACKAGE(Boost 1.33.0 REQUIRED) +#FIND_PACKAGE(Boost 1.33.0 REQUIRED) ###################################################################################### @@ -11,16 +11,7 @@ FIND_PACKAGE(Boost 1.33.0 REQUIRED) ### 2) Include the sources ###################################################################################### -INCLUDE_DIRECTORIES( - ${PARADISEO_EO_SRC_DIR}/src - ${PARADISEO_MO_SRC_DIR}/src - ${PARADISEO_MOEO_SRC_DIR}/src - ${PARADISEO_PEO_SRC_DIR}/src - ${CMAKE_SOURCE_DIR}/src - ${CMAKE_SOURCE_DIR}/lib/eometah - ${CMAKE_SOURCE_DIR}/lib/nk-landscapes - ${Boost_INCLUDE_DIRS} - ) +#INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS}) ###################################################################################### @@ -32,8 +23,9 @@ INCLUDE_DIRECTORIES( SET(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib) FILE(GLOB SOURCES *.cpp) +SET(SAMPLE_SRCS ${SOURCES} PARENT_SCOPE) -ADD_LIBRARY(${PROJECT_NAME} STATIC ${SOURCES}) +ADD_LIBRARY(${PROJECT_NAME} STATIC ${SAMPLE_SRCS}) # INSTALL( # TARGETS ${LIBRARY_OUTPUT_PATH}/lib${PROJECT_NAME}.a