diff --git a/tags/paradiseo-moeo-1.0-beta-26-06-07/AUTHORS b/tags/paradiseo-moeo-1.0-beta-26-06-07/AUTHORS
new file mode 100644
index 000000000..ffa751632
--- /dev/null
+++ b/tags/paradiseo-moeo-1.0-beta-26-06-07/AUTHORS
@@ -0,0 +1,4 @@
+Arnaud Liefooghe
+Thomas Legrand
+Sébastien Cahon
+Abdelhakim Deneche
diff --git a/tags/paradiseo-moeo-1.0-beta-26-06-07/ChangeLog b/tags/paradiseo-moeo-1.0-beta-26-06-07/ChangeLog
new file mode 100644
index 000000000..e69de29bb
diff --git a/tags/paradiseo-moeo-1.0-beta-26-06-07/Makefile.am b/tags/paradiseo-moeo-1.0-beta-26-06-07/Makefile.am
new file mode 100644
index 000000000..1d58ec812
--- /dev/null
+++ b/tags/paradiseo-moeo-1.0-beta-26-06-07/Makefile.am
@@ -0,0 +1,17 @@
+SUBDIRS = doc src tutorial
+
+clean_all: clean_aux clean_doc
+ -@make clean
+ -@(rm -rf aclocal.m4 autom4te.cache configure config.* CO* dep* INST* install-sh miss* mkins* Makefile Makefile.in;\
+ cd doc; rm -rf Makefile Makefile.in *.doxytag; cd ../src ; rm -rf Makefile Makefile.in; cd core ; rm -rf Makefile Makefile.in;\
+ cd ../../tutorial; rm -rf Makefile Makefile.in; cd Lesson1; rm -rf .deps/ Makefile Makefile.in *.status;\
+ cd flowshop; rm -rf .deps/ Makefile Makefile.in; cd ../../Lesson2; rm -rf .deps/ Makefile Makefile.in)
+
+clean_aux:
+ -@find . \( -name "*~" -o -name "*.old" -o -name "#*" -o -name "*.bak" \) -print -exec rm -rf \{\} \;
+
+doc:
+ -@(cd doc; make doc)
+
+clean_doc:
+ -@(cd doc; make clean-local)
diff --git a/tags/paradiseo-moeo-1.0-beta-26-06-07/NEWS b/tags/paradiseo-moeo-1.0-beta-26-06-07/NEWS
new file mode 100644
index 000000000..52e218e1c
--- /dev/null
+++ b/tags/paradiseo-moeo-1.0-beta-26-06-07/NEWS
@@ -0,0 +1 @@
+* release 1.0
diff --git a/tags/paradiseo-moeo-1.0-beta-26-06-07/README b/tags/paradiseo-moeo-1.0-beta-26-06-07/README
new file mode 100644
index 000000000..c7633575f
--- /dev/null
+++ b/tags/paradiseo-moeo-1.0-beta-26-06-07/README
@@ -0,0 +1,65 @@
+ PARADISEO-MOEO README FILE
+=======================================================================
+ check latest news at http://paradiseo.gforge.inria.fr/
+=======================================================================
+
+Welcome to ParadisEO-MOEO, the Multi-Objective Evolving Objects library.
+The latest news about ParadisEO-MOEO can be found on the gforge repository at
+http://paradiseo.gforge.inria.fr/
+In case of any problem, please e-mail us at
+paradiseo-help@lists.gforge.inria.fr
+
+
+==================================================================
+ BUILDING PARADISEO-MOEO
+==================================================================
+The basic installation procedure goes the following:
+
+Go to your build-directory and run
+ > ./autogen.sh --with-EOdir=$(EO_SRC)
+ > make
+ > make doc
+
+where $(EO_SRC) is the top-level source directory of PARADISEO-EO.
+
+In case of problems, you can read the INSTALL file - but remember this
+is a standard installation file from GNU and that it contains nothing
+specific about PARADISEO-MOEO.
+
+To clean everything, the simply run
+ > make clean_all
+
+===================================================================
+ DIRECTORY STRUCTURE
+===================================================================
+After unpacking the archive file, you should end up with the following
+structure:
+
+.../ The main PARADISEO-MOEO directory, created when unpacking.
+ |
+ +-- src SOURCE directory Contains most PARADISEO-MOEO .h files.
+ |
+ +-- docs DOCUMENTATION directory (generated by Doxygen).
+ | |
+ | +- html HTML files - start at index.html.
+ | |
+ | +- latex latex files - use to generate Postcript doc.
+ | |
+ | +- man Unix man format documentation.
+ |
+ |
+ +-- tutorials APPLICATIONS - one directory per separate application.
+ |
+ +-- lesson1 A bi-objective flow-shop problem example with main algorithms.
+ | |
+ | +- flowshop Flow-shop source files
+ | |
+ | +- benchmarks Instance files for testing.
+ |
+ |-- lesson2 Implement NSGA-II for the SCH1 problem.
+
+===================================================================
+ NOTES
+===================================================================
+
+Mailing list : paradiseo-help@lists.gforge.inria.fr
diff --git a/tags/paradiseo-moeo-1.0-beta-26-06-07/autogen.sh b/tags/paradiseo-moeo-1.0-beta-26-06-07/autogen.sh
new file mode 100644
index 000000000..293b7972e
--- /dev/null
+++ b/tags/paradiseo-moeo-1.0-beta-26-06-07/autogen.sh
@@ -0,0 +1,148 @@
+#!/bin/sh
+# Run this to generate all the initial makefiles, etc.
+
+srcdir=`dirname $0`
+PKG_NAME="the package."
+
+DIE=0
+
+(autoconf --version) < /dev/null > /dev/null 2>&1 || {
+ echo
+ echo "**Error**: You must have \`autoconf' installed to."
+ echo "Download the appropriate package for your distribution,"
+ echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
+ DIE=1
+}
+
+(grep "^AM_PROG_LIBTOOL" $srcdir/configure.in >/dev/null) && {
+ (libtool --version) < /dev/null > /dev/null 2>&1 || {
+ echo
+ echo "**Error**: You must have \`libtool' installed."
+ echo "Get ftp://ftp.gnu.org/pub/gnu/libtool-1.2d.tar.gz"
+ echo "(or a newer version if it is available)"
+ DIE=1
+ }
+}
+
+grep "^AM_GNU_GETTEXT" $srcdir/configure.in >/dev/null && {
+ grep "sed.*POTFILES" $srcdir/configure.in >/dev/null || \
+ (gettext --version) < /dev/null > /dev/null 2>&1 || {
+ echo
+ echo "**Error**: You must have \`gettext' installed."
+ echo "Get ftp://alpha.gnu.org/gnu/gettext-0.10.35.tar.gz"
+ echo "(or a newer version if it is available)"
+ DIE=1
+ }
+}
+
+grep "^AM_GNOME_GETTEXT" $srcdir/configure.in >/dev/null && {
+ grep "sed.*POTFILES" $srcdir/configure.in >/dev/null || \
+ (gettext --version) < /dev/null > /dev/null 2>&1 || {
+ echo
+ echo "**Error**: You must have \`gettext' installed."
+ echo "Get ftp://alpha.gnu.org/gnu/gettext-0.10.35.tar.gz"
+ echo "(or a newer version if it is available)"
+ DIE=1
+ }
+}
+
+(automake --version) < /dev/null > /dev/null 2>&1 || {
+ echo
+ echo "**Error**: You must have \`automake' installed."
+ echo "Get ftp://ftp.gnu.org/pub/gnu/automake-1.3.tar.gz"
+ echo "(or a newer version if it is available)"
+ DIE=1
+ NO_AUTOMAKE=yes
+}
+
+
+# if no automake, don't bother testing for aclocal
+test -n "$NO_AUTOMAKE" || (aclocal --version) < /dev/null > /dev/null 2>&1 || {
+ echo
+ echo "**Error**: Missing \`aclocal'. The version of \`automake'"
+ echo "installed doesn't appear recent enough."
+ echo "Get ftp://ftp.gnu.org/pub/gnu/automake-1.3.tar.gz"
+ echo "(or a newer version if it is available)"
+ DIE=1
+}
+
+if test "$DIE" -eq 1; then
+ exit 1
+fi
+
+if test -z "$*"; then
+ echo "**Warning**: I am going to run \`configure' with no arguments."
+ echo "If you wish to pass any to it, please specify them on the"
+ echo \`$0\'" command line."
+ echo
+fi
+
+case $CC in
+xlc )
+ am_opt=--include-deps;;
+esac
+
+for coin in `find $srcdir -name configure.in -print`
+do
+ dr=`dirname $coin`
+ if test -f $dr/NO-AUTO-GEN; then
+ echo skipping $dr -- flagged as no auto-gen
+ else
+ echo processing $dr
+ macrodirs=`sed -n -e 's,AM_ACLOCAL_INCLUDE(\(.*\)),\1,gp' < $coin`
+ ( cd $dr
+ aclocalinclude="$ACLOCAL_FLAGS"
+ for k in $macrodirs; do
+ if test -d $k; then
+ aclocalinclude="$aclocalinclude -I $k"
+ ##else
+ ## echo "**Warning**: No such directory \`$k'. Ignored."
+ fi
+ done
+ if grep "^AM_GNU_GETTEXT" configure.in >/dev/null; then
+ if grep "sed.*POTFILES" configure.in >/dev/null; then
+ : do nothing -- we still have an old unmodified configure.in
+ else
+ echo "Creating $dr/aclocal.m4 ..."
+ test -r $dr/aclocal.m4 || touch $dr/aclocal.m4
+ echo "Running gettextize... Ignore non-fatal messages."
+ echo "no" | gettextize --force --copy
+ echo "Making $dr/aclocal.m4 writable ..."
+ test -r $dr/aclocal.m4 && chmod u+w $dr/aclocal.m4
+ fi
+ fi
+ if grep "^AM_GNOME_GETTEXT" configure.in >/dev/null; then
+ echo "Creating $dr/aclocal.m4 ..."
+ test -r $dr/aclocal.m4 || touch $dr/aclocal.m4
+ echo "Running gettextize... Ignore non-fatal messages."
+ echo "no" | gettextize --force --copy
+ echo "Making $dr/aclocal.m4 writable ..."
+ test -r $dr/aclocal.m4 && chmod u+w $dr/aclocal.m4
+ fi
+ if grep "^AM_PROG_LIBTOOL" configure.in >/dev/null; then
+ echo "Running libtoolize..."
+ libtoolize --force --copy
+ fi
+ echo "Running aclocal $aclocalinclude ..."
+ aclocal $aclocalinclude
+ if grep "^AM_CONFIG_HEADER" configure.in >/dev/null; then
+ echo "Running autoheader..."
+ autoheader
+ fi
+ echo "Running automake --gnu $am_opt ..."
+ automake --add-missing --gnu $am_opt
+ echo "Running autoconf ..."
+ autoconf
+ )
+ fi
+done
+
+#conf_flags="--enable-maintainer-mode --enable-compile-warnings" #--enable-iso-c
+
+if test x$NOCONFIGURE = x; then
+ echo Running $srcdir/configure $conf_flags "$@" ...
+ $srcdir/configure $conf_flags "$@" \
+ && echo Now type \`make\' to compile $PKG_NAME
+else
+ echo Skipping configure process.
+fi
diff --git a/tags/paradiseo-moeo-1.0-beta-26-06-07/configure.in b/tags/paradiseo-moeo-1.0-beta-26-06-07/configure.in
new file mode 100644
index 000000000..89efff8b7
--- /dev/null
+++ b/tags/paradiseo-moeo-1.0-beta-26-06-07/configure.in
@@ -0,0 +1,45 @@
+AC_INIT(configure.in)
+AM_INIT_AUTOMAKE(moeo, 0.1)
+
+AC_ISC_POSIX
+AC_PROG_CXX
+AM_PROG_CC_STDC
+AC_HEADER_STDC
+AC_PROG_RANLIB
+
+AC_PROG_INSTALL
+AC_PROG_LN_S
+AC_PROG_MAKE_SET
+
+AC_C_CONST
+AC_C_INLINE
+AC_TYPE_SIZE_T
+
+AC_SUBST(EO_DIR)
+
+dnl EO
+AC_ARG_WITH(EOdir,
+ --with-EOdir : Giving the path of the EO tree.,
+ EO_DIR="$withval"
+ if test ! -d $EO_DIR
+ then
+ echo ""
+ echo "# --with-EOdir Invalid directory $withval"
+ exit 1
+ fi,
+ echo ""
+ echo "# You forgot to give the path of the EO tree !"
+ echo "# Please write something like ... './configure --with-EOdir=\$HOME/eo'"
+ exit 1
+ )
+
+AC_OUTPUT([
+Makefile
+src/Makefile
+src/core/Makefile
+doc/Makefile
+tutorial/Makefile
+tutorial/Lesson1/Makefile
+tutorial/Lesson1/flowshop/Makefile
+tutorial/Lesson2/Makefile
+])
diff --git a/tags/paradiseo-moeo-1.0-beta-26-06-07/doc/Makefile.am b/tags/paradiseo-moeo-1.0-beta-26-06-07/doc/Makefile.am
new file mode 100644
index 000000000..254b2661c
--- /dev/null
+++ b/tags/paradiseo-moeo-1.0-beta-26-06-07/doc/Makefile.am
@@ -0,0 +1,5 @@
+doc:
+ -@doxygen moeo.doxyfile
+
+clean-local:
+ rm -rf html latex man
diff --git a/tags/paradiseo-moeo-1.0-beta-26-06-07/doc/index.h b/tags/paradiseo-moeo-1.0-beta-26-06-07/doc/index.h
new file mode 100644
index 000000000..72ba706bb
--- /dev/null
+++ b/tags/paradiseo-moeo-1.0-beta-26-06-07/doc/index.h
@@ -0,0 +1,44 @@
+/** @mainpage Welcome to ParadisEO-MOEO
+
+@section intro Introduction
+
+ParadisEO-MOEO is a white-box object-oriented generic framework dedicated to the flexible design of evolutionary multi-objective algorithms.
+This paradigm-free software embeds some features and techniques for Pareto-based resolution and
+aims to provide a set of classes allowing to ease and speed up the development of computationally efficient programs.
+It is based on a clear conceptual distinction between the solution methods and the multi-objective problems they are intended to solve.
+This separation confers a maximum design and code reuse.
+ParadisEO-MOEO provides a broad range of archive-related features (such as elitism or performance metrics)
+and the most common Pareto-based fitness assignment strategies (MOGA, NSGA, SPEA, IBEA and more).
+Furthermore, parallel and distributed models as well as hybridization mechanisms can be applied to an algorithm designed within ParadisEO-MOEO
+using the whole version of ParadisEO.
+
+
+
+@section tutorials Tutorials
+
+Tutorials for ParadisEO-MOEO are available here.
+
+
+
+@section install Installation
+
+The installation procedure of the package is detailed in the README file in the top-directory of the source-tree.
+
+
+
+@section design Overall Design
+
+For an introduction to the design of ParadisEO-MOEO,
+you can look at the ParadisEO website.
+*/
+
+
+
+/** @page webpages Related webpages
+
+- ParadisEO homepage
+- INRIA GForge project page
+- README
+- NEWS
+*/
diff --git a/tags/paradiseo-moeo-1.0-beta-26-06-07/doc/moeo.doxyfile b/tags/paradiseo-moeo-1.0-beta-26-06-07/doc/moeo.doxyfile
new file mode 100644
index 000000000..c5066b5c7
--- /dev/null
+++ b/tags/paradiseo-moeo-1.0-beta-26-06-07/doc/moeo.doxyfile
@@ -0,0 +1,237 @@
+# Doxyfile 1.5.1
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+PROJECT_NAME = ParadisEO-MOEO
+PROJECT_NUMBER = 1.0
+OUTPUT_DIRECTORY =
+CREATE_SUBDIRS = NO
+OUTPUT_LANGUAGE = English
+USE_WINDOWS_ENCODING = NO
+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 =
+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 = YES
+WARN_IF_UNDOCUMENTED = YES
+WARN_IF_DOC_ERROR = YES
+WARN_NO_PARAMDOC = NO
+WARN_FORMAT = "$file:$line: $text"
+WARN_LOGFILE =
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+INPUT = . ../src
+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
+#---------------------------------------------------------------------------
+TAGFILES = ../../paradiseo-eo/doc/eo.doxytag=../../../paradiseo-eo/doc/html
+GENERATE_TAGFILE = moeo.doxytag
+ALLEXTERNALS = NO
+EXTERNAL_GROUPS = YES
+PERL_PATH = /usr/bin/perl
+#---------------------------------------------------------------------------
+# 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_WIDTH = 1024
+MAX_DOT_GRAPH_HEIGHT = 1024
+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/tags/paradiseo-moeo-1.0-beta-26-06-07/src/Makefile.am b/tags/paradiseo-moeo-1.0-beta-26-06-07/src/Makefile.am
new file mode 100644
index 000000000..63f989053
--- /dev/null
+++ b/tags/paradiseo-moeo-1.0-beta-26-06-07/src/Makefile.am
@@ -0,0 +1 @@
+SUBDIRS = core
diff --git a/tags/paradiseo-moeo-1.0-beta-26-06-07/src/algo/moeoAlgo.h b/tags/paradiseo-moeo-1.0-beta-26-06-07/src/algo/moeoAlgo.h
new file mode 100644
index 000000000..0bc47ee8a
--- /dev/null
+++ b/tags/paradiseo-moeo-1.0-beta-26-06-07/src/algo/moeoAlgo.h
@@ -0,0 +1,21 @@
+// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
+
+//-----------------------------------------------------------------------------
+// moeoAlgo.h
+// (c) OPAC Team (LIFL), Dolphin Project (INRIA), 2007
+/*
+ This library...
+
+ Contact: paradiseo-help@lists.gforge.inria.fr, http://paradiseo.gforge.inria.fr
+ */
+//-----------------------------------------------------------------------------
+
+#ifndef MOEOALGO_H_
+#define MOEOALGO_H_
+
+/**
+ * Abstract class for multi-objective algorithms.
+ */
+class moeoAlgo {};
+
+#endif /*MOEOALGO_H_*/
diff --git a/tags/paradiseo-moeo-1.0-beta-26-06-07/src/algo/moeoCombinedLS.h b/tags/paradiseo-moeo-1.0-beta-26-06-07/src/algo/moeoCombinedLS.h
new file mode 100644
index 000000000..78b5b55a7
--- /dev/null
+++ b/tags/paradiseo-moeo-1.0-beta-26-06-07/src/algo/moeoCombinedLS.h
@@ -0,0 +1,67 @@
+// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
+
+//-----------------------------------------------------------------------------
+// moeoCombinedLS.h
+// (c) OPAC Team (LIFL), Dolphin Project (INRIA), 2007
+/*
+ This library...
+
+ Contact: paradiseo-help@lists.gforge.inria.fr, http://paradiseo.gforge.inria.fr
+ */
+//-----------------------------------------------------------------------------
+
+#ifndef MOEOCOMBINEDLS_H_
+#define MOEOCOMBINEDLS_H_
+
+#include
+#include
+#include
+
+/**
+ * This class allows to embed a set of local searches that are sequentially applied,
+ * and so working and updating the same archive of non-dominated solutions.
+ */
+template < class MOEOT, class Type >
+class moeoCombinedLS : public moeoLS < MOEOT, Type >
+{
+public:
+
+ /**
+ * Ctor
+ * @param _first_mols the first multi-objective local search to add
+ */
+ moeoCombinedLS(moeoLS < MOEOT, Type > & _first_mols)
+ {
+ combinedLS.push_back (& _first_mols);
+ }
+
+ /**
+ * Adds a new local search to combine
+ * @param _mols the multi-objective local search to add
+ */
+ void add(moeoLS < MOEOT, Type > & _mols)
+ {
+ combinedLS.push_back(& _mols);
+ }
+
+ /**
+ * Gives a new solution in order to explore the neigborhood.
+ * The new non-dominated solutions are added to the archive
+ * @param _type the object to apply the local search to
+ * @param _arch the archive of non-dominated solutions
+ */
+ void operator () (Type _type, moeoArchive < MOEOT > & _arch)
+ {
+ for (unsigned int i=0; i operator()(_type, _arch);
+ }
+
+
+private:
+
+ /** the vector that contains the combined LS */
+ std::vector< moeoLS < MOEOT, Type > * > combinedLS;
+
+};
+
+#endif /*MOEOCOMBINEDLS_H_*/
diff --git a/tags/paradiseo-moeo-1.0-beta-26-06-07/src/algo/moeoEA.h b/tags/paradiseo-moeo-1.0-beta-26-06-07/src/algo/moeoEA.h
new file mode 100644
index 000000000..d01264cec
--- /dev/null
+++ b/tags/paradiseo-moeo-1.0-beta-26-06-07/src/algo/moeoEA.h
@@ -0,0 +1,25 @@
+// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
+
+//-----------------------------------------------------------------------------
+// moeoEA.h
+// (c) OPAC Team (LIFL), Dolphin Project (INRIA), 2007
+/*
+ This library...
+
+ Contact: paradiseo-help@lists.gforge.inria.fr, http://paradiseo.gforge.inria.fr
+ */
+//-----------------------------------------------------------------------------
+
+#ifndef MOEOEA_H_
+#define MOEOEA_H_
+
+#include
+#include
+
+/**
+ * Abstract class for multi-objective evolutionary algorithms.
+ */
+template < class MOEOT >
+class moeoEA : public moeoAlgo, public eoAlgo < MOEOT > {};
+
+#endif /*MOEOEA_H_*/
diff --git a/tags/paradiseo-moeo-1.0-beta-26-06-07/src/algo/moeoEasyEA.h b/tags/paradiseo-moeo-1.0-beta-26-06-07/src/algo/moeoEasyEA.h
new file mode 100755
index 000000000..883a95e76
--- /dev/null
+++ b/tags/paradiseo-moeo-1.0-beta-26-06-07/src/algo/moeoEasyEA.h
@@ -0,0 +1,218 @@
+// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
+
+//-----------------------------------------------------------------------------
+// moeoEasyEA.h
+// (c) OPAC Team (LIFL), Dolphin Project (INRIA), 2007
+/*
+ This library...
+
+ Contact: paradiseo-help@lists.gforge.inria.fr, http://paradiseo.gforge.inria.fr
+ */
+//-----------------------------------------------------------------------------
+
+#ifndef _MOEOEASYEA_H
+#define _MOEOEASYEA_H
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+/**
+ * An easy class to design multi-objective evolutionary algorithms.
+ */
+template < class MOEOT >
+class moeoEasyEA: public moeoEA < MOEOT >
+{
+public:
+
+ /**
+ * Ctor taking a breed and merge.
+ * @param _continuator the stopping criteria
+ * @param _eval the evaluation functions
+ * @param _breed the breeder
+ * @param _replace the replacement strategy
+ * @param _fitnessEval the fitness evaluation scheme
+ * @param _diversityEval the diversity evaluation scheme
+ * @param _evalFitAndDivBeforeSelection put this parameter to 'true' if you want to re-evalue the fitness and the diversity of the population before the selection process
+ */
+ moeoEasyEA(eoContinue < MOEOT > & _continuator, eoEvalFunc < MOEOT > & _eval, eoBreed < MOEOT > & _breed, moeoReplacement < MOEOT > & _replace,
+ moeoFitnessAssignment < MOEOT > & _fitnessEval, moeoDiversityAssignment < MOEOT > & _diversityEval, bool _evalFitAndDivBeforeSelection = false)
+ :
+ continuator(_continuator), eval (_eval), loopEval(_eval), popEval(loopEval), selectTransform(dummySelect, dummyTransform), breed(_breed), mergeReduce(dummyMerge, dummyReduce), replace(_replace),
+ fitnessEval(_fitnessEval), diversityEval(_diversityEval), evalFitAndDivBeforeSelection(_evalFitAndDivBeforeSelection)
+ {}
+
+
+ /**
+ * Ctor taking a breed, a merge and a eoPopEval.
+ * @param _continuator the stopping criteria
+ * @param _popEval the evaluation functions for the whole population
+ * @param _breed the breeder
+ * @param _replace the replacement strategy
+ * @param _fitnessEval the fitness evaluation scheme
+ * @param _diversityEval the diversity evaluation scheme
+ * @param _evalFitAndDivBeforeSelection put this parameter to 'true' if you want to re-evalue the fitness and the diversity of the population before the selection process
+ */
+ moeoEasyEA(eoContinue < MOEOT > & _continuator, eoPopEvalFunc < MOEOT > & _popEval, eoBreed < MOEOT > & _breed, moeoReplacement < MOEOT > & _replace,
+ moeoFitnessAssignment < MOEOT > & _fitnessEval, moeoDiversityAssignment < MOEOT > & _diversityEval, bool _evalFitAndDivBeforeSelection = false)
+ :
+ continuator(_continuator), eval (dummyEval), loopEval(dummyEval), popEval(_popEval), selectTransform(dummySelect, dummyTransform), breed(_breed), mergeReduce(dummyMerge, dummyReduce), replace(_replace),
+ fitnessEval(_fitnessEval), diversityEval(_diversityEval), evalFitAndDivBeforeSelection(_evalFitAndDivBeforeSelection)
+ {}
+
+
+ /**
+ * Ctor taking a breed, a merge and a reduce.
+ * @param _continuator the stopping criteria
+ * @param _eval the evaluation functions
+ * @param _breed the breeder
+ * @param _merge the merge scheme
+ * @param _reduce the reduce scheme
+ * @param _fitnessEval the fitness evaluation scheme
+ * @param _diversityEval the diversity evaluation scheme
+ * @param _evalFitAndDivBeforeSelection put this parameter to 'true' if you want to re-evalue the fitness and the diversity of the population before the selection process
+ */
+ moeoEasyEA(eoContinue < MOEOT > & _continuator, eoEvalFunc < MOEOT > & _eval, eoBreed < MOEOT > & _breed, eoMerge < MOEOT > & _merge, eoReduce< MOEOT > & _reduce,
+ moeoFitnessAssignment < MOEOT > & _fitnessEval, moeoDiversityAssignment < MOEOT > & _diversityEval, bool _evalFitAndDivBeforeSelection = false)
+ :
+ continuator(_continuator), eval(_eval), loopEval(_eval), popEval(loopEval), selectTransform(dummySelect, dummyTransform), breed(_breed), mergeReduce(_merge,_reduce), replace(mergeReduce),
+ fitnessEval(_fitnessEval), diversityEval(_diversityEval), evalFitAndDivBeforeSelection(_evalFitAndDivBeforeSelection)
+ {}
+
+
+ /**
+ * Ctor taking a select, a transform and a replacement.
+ * @param _continuator the stopping criteria
+ * @param _eval the evaluation functions
+ * @param _select the selection scheme
+ * @param _transform the tranformation scheme
+ * @param _replace the replacement strategy
+ * @param _fitnessEval the fitness evaluation scheme
+ * @param _diversityEval the diversity evaluation scheme
+ * @param _evalFitAndDivBeforeSelection put this parameter to 'true' if you want to re-evalue the fitness and the diversity of the population before the selection process
+ */
+ moeoEasyEA(eoContinue < MOEOT > & _continuator, eoEvalFunc < MOEOT > & _eval, eoSelect < MOEOT > & _select, eoTransform < MOEOT > & _transform, moeoReplacement < MOEOT > & _replace,
+ moeoFitnessAssignment < MOEOT > & _fitnessEval, moeoDiversityAssignment < MOEOT > & _diversityEval, bool _evalFitAndDivBeforeSelection = false)
+ :
+ continuator(_continuator), eval(_eval), loopEval(_eval), popEval(loopEval), selectTransform(_select, _transform), breed(selectTransform), mergeReduce(dummyMerge, dummyReduce), replace(_replace),
+ fitnessEval(_fitnessEval), diversityEval(_diversityEval), evalFitAndDivBeforeSelection(_evalFitAndDivBeforeSelection)
+ {}
+
+
+ /**
+ * Ctor taking a select, a transform, a merge and a reduce.
+ * @param _continuator the stopping criteria
+ * @param _eval the evaluation functions
+ * @param _select the selection scheme
+ * @param _transform the tranformation scheme
+ * @param _merge the merge scheme
+ * @param _reduce the reduce scheme
+ * @param _fitnessEval the fitness evaluation scheme
+ * @param _diversityEval the diversity evaluation scheme
+ * @param _evalFitAndDivBeforeSelection put this parameter to 'true' if you want to re-evalue the fitness and the diversity of the population before the selection process
+ */
+ moeoEasyEA(eoContinue < MOEOT > & _continuator, eoEvalFunc < MOEOT > & _eval, eoSelect < MOEOT > & _select, eoTransform < MOEOT > & _transform, eoMerge < MOEOT > & _merge, eoReduce< MOEOT > & _reduce,
+ moeoFitnessAssignment < MOEOT > & _fitnessEval, moeoDiversityAssignment < MOEOT > & _diversityEval, bool _evalFitAndDivBeforeSelection = false)
+ :
+ continuator(_continuator), eval(_eval), loopEval(_eval), popEval(loopEval), selectTransform(_select, _transform), breed(selectTransform), mergeReduce(_merge,_reduce), replace(mergeReduce),
+ fitnessEval(_fitnessEval), diversityEval(_diversityEval), evalFitAndDivBeforeSelection(_evalFitAndDivBeforeSelection)
+ {}
+
+
+ /**
+ * Applies a few generation of evolution to the population _pop.
+ * @param _pop the population
+ */
+ virtual void operator()(eoPop < MOEOT > & _pop)
+ {
+ eoPop < MOEOT > offspring, empty_pop;
+ popEval(empty_pop, _pop); // A first eval of pop.
+ bool firstTime = true;
+ do
+ {
+ try
+ {
+ unsigned int pSize = _pop.size();
+ offspring.clear(); // new offspring
+ // fitness and diversity assignment (if you want to or if it is the first generation)
+ if (evalFitAndDivBeforeSelection || firstTime)
+ {
+ firstTime = false;
+ fitnessEval(_pop);
+ diversityEval(_pop);
+ }
+ breed(_pop, offspring);
+ popEval(_pop, offspring); // eval of parents + offspring if necessary
+ replace(_pop, offspring); // after replace, the new pop. is in _pop
+ if (pSize > _pop.size())
+ {
+ throw std::runtime_error("Population shrinking!");
+ }
+ else if (pSize < _pop.size())
+ {
+ throw std::runtime_error("Population growing!");
+ }
+ }
+ catch (std::exception& e)
+ {
+ std::string s = e.what();
+ s.append( " in moeoEasyEA");
+ throw std::runtime_error( s );
+ }
+ } while (continuator(_pop));
+ }
+
+
+protected:
+
+ /** the stopping criteria */
+ eoContinue < MOEOT > & continuator;
+ /** the evaluation functions */
+ eoEvalFunc < MOEOT > & eval;
+ /** to evaluate the whole population */
+ eoPopLoopEval < MOEOT > loopEval;
+ /** to evaluate the whole population */
+ eoPopEvalFunc < MOEOT > & popEval;
+ /** breed: a select followed by a transform */
+ eoSelectTransform < MOEOT > selectTransform;
+ /** the breeder */
+ eoBreed < MOEOT > & breed;
+ /** replacement: a merge followed by a reduce */
+ eoMergeReduce < MOEOT > mergeReduce;
+ /** the replacment strategy */
+ moeoReplacement < MOEOT > & replace;
+ /** the fitness assignment strategy */
+ moeoFitnessAssignment < MOEOT > & fitnessEval;
+ /** the diversity assignment strategy */
+ moeoDiversityAssignment < MOEOT > & diversityEval;
+ /** if this parameter is set to 'true', the fitness and the diversity of the whole population will be re-evaluated before the selection process */
+ bool evalFitAndDivBeforeSelection;
+ /** a dummy eval */
+ class eoDummyEval : public eoEvalFunc < MOEOT >
+ { public: /** the dummy functor */
+ void operator()(MOEOT &) {}} dummyEval;
+ /** a dummy select */
+ class eoDummySelect : public eoSelect < MOEOT >
+ { public: /** the dummy functor */
+ void operator()(const eoPop < MOEOT > &, eoPop < MOEOT > &) {} } dummySelect;
+ /** a dummy transform */
+ class eoDummyTransform : public eoTransform < MOEOT >
+ { public: /** the dummy functor */
+ void operator()(eoPop < MOEOT > &) {} } dummyTransform;
+ /** a dummy merge */
+ eoNoElitism < MOEOT > dummyMerge;
+ /** a dummy reduce */
+ eoTruncate < MOEOT > dummyReduce;
+
+};
+
+#endif /*MOEOEASYEA_H_*/
diff --git a/tags/paradiseo-moeo-1.0-beta-26-06-07/src/algo/moeoHybridLS.h b/tags/paradiseo-moeo-1.0-beta-26-06-07/src/algo/moeoHybridLS.h
new file mode 100644
index 000000000..3f2d6fd6f
--- /dev/null
+++ b/tags/paradiseo-moeo-1.0-beta-26-06-07/src/algo/moeoHybridLS.h
@@ -0,0 +1,76 @@
+// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
+
+//-----------------------------------------------------------------------------
+// moeoHybridLS.h
+// (c) OPAC Team (LIFL), Dolphin Project (INRIA), 2007
+/*
+ This library...
+
+ Contact: paradiseo-help@lists.gforge.inria.fr, http://paradiseo.gforge.inria.fr
+ */
+//-----------------------------------------------------------------------------
+
+#ifndef MOEOHYBRIDLS_H_
+#define MOEOHYBRIDLS_H_
+
+#include
+#include
+#include
+#include
+#include
+#include
+
+/**
+ * This class allows to apply a multi-objective local search to a number of selected individuals contained in the archive
+ * at every generation until a stopping criteria is verified.
+ */
+template < class MOEOT >
+class moeoHybridLS : public eoUpdater
+{
+public:
+
+ /**
+ * Ctor
+ * @param _term stopping criteria
+ * @param _select selector
+ * @param _mols a multi-objective local search
+ * @param _arch the archive
+ */
+ moeoHybridLS (eoContinue < MOEOT > & _term, eoSelect < MOEOT > & _select, moeoLS < MOEOT, MOEOT > & _mols, moeoArchive < MOEOT > & _arch) :
+ term(_term), select(_select), mols(_mols), arch(_arch)
+ {}
+
+
+ /**
+ * Applies the multi-objective local search to selected individuals contained in the archive if the stopping criteria is not verified
+ */
+ void operator () ()
+ {
+ if (! term (arch))
+ {
+ // selection of solutions
+ eoPop < MOEOT > selectedSolutions;
+ select(arch, selectedSolutions);
+ // apply the local search to every selected solution
+ for (unsigned int i=0; i & term;
+ /** selector */
+ eoSelect < MOEOT > & select;
+ /** multi-objective local search */
+ moeoLS < MOEOT, MOEOT > & mols;
+ /** archive */
+ moeoArchive < MOEOT > & arch;
+
+};
+
+#endif /*MOEOHYBRIDLS_H_*/
diff --git a/tags/paradiseo-moeo-1.0-beta-26-06-07/src/algo/moeoIBEA.h b/tags/paradiseo-moeo-1.0-beta-26-06-07/src/algo/moeoIBEA.h
new file mode 100644
index 000000000..9f9d2efef
--- /dev/null
+++ b/tags/paradiseo-moeo-1.0-beta-26-06-07/src/algo/moeoIBEA.h
@@ -0,0 +1,168 @@
+// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
+
+//-----------------------------------------------------------------------------
+// moeoIBEA.h
+// (c) OPAC Team (LIFL), Dolphin Project (INRIA), 2007
+/*
+ This library...
+
+ Contact: paradiseo-help@lists.gforge.inria.fr, http://paradiseo.gforge.inria.fr
+ */
+//-----------------------------------------------------------------------------
+
+#ifndef MOEOIBEA_H_
+#define MOEOIBEA_H_
+
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+/**
+ * IBEA (Indicator-Based Evolutionary Algorithm) as described in:
+ * E. Zitzler, S. Künzli, "Indicator-Based Selection in Multiobjective Search", Proc. 8th International Conference on Parallel Problem Solving from Nature (PPSN VIII), pp. 832-842, Birmingham, UK (2004).
+ * This class builds the IBEA algorithm only by using the fine-grained components of the ParadisEO-MOEO framework.
+ */
+template < class MOEOT >
+class moeoIBEA : public moeoEA < MOEOT >
+{
+public:
+
+ /** The type of objective vector */
+ typedef typename MOEOT::ObjectiveVector ObjectiveVector;
+
+
+ /**
+ * Simple ctor with a eoGenOp.
+ * @param _maxGen number of generations before stopping
+ * @param _eval evaluation function
+ * @param _op variation operator
+ * @param _metric metric
+ * @param _kappa scaling factor kappa
+ */
+ moeoIBEA (unsigned int _maxGen, eoEvalFunc < MOEOT > & _eval, eoGenOp < MOEOT > & _op, moeoNormalizedSolutionVsSolutionBinaryMetric < ObjectiveVector, double > & _metric, const double _kappa=0.05) :
+ defaultGenContinuator(_maxGen), continuator(defaultGenContinuator), popEval(_eval), select(2),
+ fitnessAssignment(_metric, _kappa), replace(fitnessAssignment, dummyDiversityAssignment), genBreed(select, _op), breed(genBreed)
+ {}
+
+
+ /**
+ * Simple ctor with a eoTransform.
+ * @param _maxGen number of generations before stopping
+ * @param _eval evaluation function
+ * @param _op variation operator
+ * @param _metric metric
+ * @param _kappa scaling factor kappa
+ */
+ moeoIBEA (unsigned int _maxGen, eoEvalFunc < MOEOT > & _eval, eoTransform < MOEOT > & _op, moeoNormalizedSolutionVsSolutionBinaryMetric < ObjectiveVector, double > & _metric, const double _kappa=0.05) :
+ defaultGenContinuator(_maxGen), continuator(defaultGenContinuator), popEval(_eval), select(2),
+ fitnessAssignment(_metric, _kappa), replace(fitnessAssignment, dummyDiversityAssignment), genBreed(select, _op), breed(genBreed)
+ {}
+
+
+ /**
+ * Ctor with a crossover, a mutation and their corresponding rates.
+ * @param _maxGen number of generations before stopping
+ * @param _eval evaluation function
+ * @param _crossover crossover
+ * @param _pCross crossover probability
+ * @param _mutation mutation
+ * @param _pMut mutation probability
+ * @param _metric metric
+ * @param _kappa scaling factor kappa
+ */
+ moeoIBEA (unsigned int _maxGen, eoEvalFunc < MOEOT > & _eval, eoQuadOp < MOEOT > & _crossover, double _pCross, eoMonOp < MOEOT > & _mutation, double _pMut, moeoNormalizedSolutionVsSolutionBinaryMetric < ObjectiveVector, double > & _metric, const double _kappa=0.05) :
+ defaultGenContinuator(_maxGen), continuator(defaultGenContinuator), popEval(_eval), select (2),
+ fitnessAssignment(_metric, _kappa), replace (fitnessAssignment, dummyDiversityAssignment), defaultSGAGenOp(_crossover, _pCross, _mutation, _pMut),
+ genBreed (select, defaultSGAGenOp), breed (genBreed)
+ {}
+
+
+ /**
+ * Ctor with a continuator (instead of _maxGen) and a eoGenOp.
+ * @param _continuator stopping criteria
+ * @param _eval evaluation function
+ * @param _op variation operator
+ * @param _metric metric
+ * @param _kappa scaling factor kappa
+ */
+ moeoIBEA (eoContinue < MOEOT > & _continuator, eoEvalFunc < MOEOT > & _eval, eoGenOp < MOEOT > & _op, moeoNormalizedSolutionVsSolutionBinaryMetric < ObjectiveVector, double > & _metric, const double _kappa=0.05) :
+ continuator(_continuator), popEval(_eval), select(2),
+ fitnessAssignment(_metric, _kappa), replace(fitnessAssignment, dummyDiversityAssignment), genBreed(select, _op), breed(genBreed)
+ {}
+
+
+ /**
+ * Ctor with a continuator (instead of _maxGen) and a eoTransform.
+ * @param _continuator stopping criteria
+ * @param _eval evaluation function
+ * @param _op variation operator
+ * @param _metric metric
+ * @param _kappa scaling factor kappa
+ */
+ moeoIBEA (eoContinue < MOEOT > & _continuator, eoEvalFunc < MOEOT > & _eval, eoTransform < MOEOT > & _op, moeoNormalizedSolutionVsSolutionBinaryMetric < ObjectiveVector, double > & _metric, const double _kappa=0.05) :
+ continuator(_continuator), popEval(_eval), select(2),
+ fitnessAssignment(_metric, _kappa), replace(fitnessAssignment, dummyDiversityAssignment), genBreed(select, _op), breed(genBreed)
+ {}
+
+
+ /**
+ * Apply a few generation of evolution to the population _pop until the stopping criteria is verified.
+ * @param _pop the population
+ */
+ virtual void operator () (eoPop < MOEOT > &_pop)
+ {
+ eoPop < MOEOT > offspring, empty_pop;
+ popEval (empty_pop, _pop); // a first eval of _pop
+ // evaluate fitness and diversity
+ fitnessAssignment(_pop);
+ dummyDiversityAssignment(_pop);
+ do
+ {
+ // generate offspring, worths are recalculated if necessary
+ breed (_pop, offspring);
+ // eval of offspring
+ popEval (_pop, offspring);
+ // after replace, the new pop is in _pop. Worths are recalculated if necessary
+ replace (_pop, offspring);
+ } while (continuator (_pop));
+ }
+
+
+protected:
+
+ /** a continuator based on the number of generations (used as default) */
+ eoGenContinue < MOEOT > defaultGenContinuator;
+ /** stopping criteria */
+ eoContinue < MOEOT > & continuator;
+ /** evaluation function used to evaluate the whole population */
+ eoPopLoopEval < MOEOT > popEval;
+ /** binary tournament selection */
+ moeoDetTournamentSelect < MOEOT > select;
+ /** fitness assignment used in IBEA */
+ moeoIndicatorBasedFitnessAssignment < MOEOT > fitnessAssignment;
+ /** dummy diversity assignment */
+ moeoDummyDiversityAssignment < MOEOT > dummyDiversityAssignment;
+ /** elitist replacement */
+ moeoEnvironmentalReplacement < MOEOT > replace;
+ /** an object for genetic operators (used as default) */
+ eoSGAGenOp < MOEOT > defaultSGAGenOp;
+ /** general breeder */
+ eoGeneralBreeder < MOEOT > genBreed;
+ /** breeder */
+ eoBreed < MOEOT > & breed;
+
+};
+
+#endif /*MOEOIBEA_H_*/
diff --git a/tags/paradiseo-moeo-1.0-beta-26-06-07/src/algo/moeoIBMOLS.h b/tags/paradiseo-moeo-1.0-beta-26-06-07/src/algo/moeoIBMOLS.h
new file mode 100755
index 000000000..e34a459fc
--- /dev/null
+++ b/tags/paradiseo-moeo-1.0-beta-26-06-07/src/algo/moeoIBMOLS.h
@@ -0,0 +1,280 @@
+// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
+
+//-----------------------------------------------------------------------------
+// moeoIBMOLS.h
+// (c) OPAC Team (LIFL), Dolphin Project (INRIA), 2007
+/*
+ This library...
+
+ Contact: paradiseo-help@lists.gforge.inria.fr, http://paradiseo.gforge.inria.fr
+ */
+//-----------------------------------------------------------------------------
+
+#ifndef MOEOIBMOLS_H_
+#define MOEOIBMOLS_H_
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+/**
+ * Indicator-Based Multi-Objective Local Search (IBMOLS) as described in
+ * Basseur M., Burke K. : "Indicator-Based Multi-Objective Local Search" (2007).
+ */
+template < class MOEOT, class Move >
+class moeoIBMOLS : public moeoLS < MOEOT, eoPop < MOEOT > & >
+{
+public:
+
+ /** The type of objective vector */
+ typedef typename MOEOT::ObjectiveVector ObjectiveVector;
+
+
+ /**
+ * Ctor.
+ * @param _moveInit the move initializer
+ * @param _nextMove the neighborhood explorer
+ * @param _eval the full evaluation
+ * @param _moveIncrEval the incremental evaluation
+ * @param _fitnessAssignment the fitness assignment strategy
+ * @param _continuator the stopping criteria
+ */
+ moeoIBMOLS(
+ moMoveInit < Move > & _moveInit,
+ moNextMove < Move > & _nextMove,
+ eoEvalFunc < MOEOT > & _eval,
+ moeoMoveIncrEval < Move > & _moveIncrEval,
+ moeoIndicatorBasedFitnessAssignment < MOEOT > & _fitnessAssignment,
+ eoContinue < MOEOT > & _continuator
+ ) :
+ moveInit(_moveInit),
+ nextMove(_nextMove),
+ eval(_eval),
+ moveIncrEval(_moveIncrEval),
+ fitnessAssignment (_fitnessAssignment),
+ continuator (_continuator)
+ {}
+
+
+ /**
+ * Apply the local search until a local archive does not change or
+ * another stopping criteria is met and update the archive _arch with new non-dominated solutions.
+ * @param _pop the initial population
+ * @param _arch the (updated) archive
+ */
+ void operator() (eoPop < MOEOT > & _pop, moeoArchive < MOEOT > & _arch)
+ {
+ // evaluation of the objective values
+ /*
+ for (unsigned int i=0; i<_pop.size(); i++)
+ {
+ eval(_pop[i]);
+ }
+ */
+ // fitness assignment for the whole population
+ fitnessAssignment(_pop);
+ // creation of a local archive
+ moeoArchive < MOEOT > archive;
+ // creation of another local archive (for the stopping criteria)
+ moeoArchive < MOEOT > previousArchive;
+ // update the archive with the initial population
+ archive.update(_pop);
+ do
+ {
+ previousArchive.update(archive);
+ oneStep(_pop);
+ archive.update(_pop);
+ } while ( (! archive.equals(previousArchive)) && (continuator(_arch)) );
+ _arch.update(archive);
+ }
+
+
+private:
+
+ /** the move initializer */
+ moMoveInit < Move > & moveInit;
+ /** the neighborhood explorer */
+ moNextMove < Move > & nextMove;
+ /** the full evaluation */
+ eoEvalFunc < MOEOT > & eval;
+ /** the incremental evaluation */
+ moeoMoveIncrEval < Move > & moveIncrEval;
+ /** the fitness assignment strategy */
+ moeoIndicatorBasedFitnessAssignment < MOEOT > & fitnessAssignment;
+ /** the stopping criteria */
+ eoContinue < MOEOT > & continuator;
+
+
+ /**
+ * Apply one step of the local search to the population _pop
+ * @param _pop the population
+ */
+ void oneStep (eoPop < MOEOT > & _pop)
+ {
+////////////////////////////////////////////
+ int ext_0_idx, ext_1_idx;
+ ObjectiveVector ext_0_objVec, ext_1_objVec;
+///////////////////////////////////////////
+ // the move
+ Move move;
+ // the objective vector and the fitness of the current solution
+ ObjectiveVector x_objVec;
+ double x_fitness;
+ // the index, the objective vector and the fitness of the worst solution in the population (-1 implies that the worst is the newly created one)
+ int worst_idx;
+ ObjectiveVector worst_objVec;
+ double worst_fitness;
+ // the index current of the current solution to be explored
+ unsigned int i=0;
+ // initilization of the move for the first individual
+ moveInit(move, _pop[i]);
+ while (i<_pop.size() && continuator(_pop))
+ {
+ // x = one neigbour of pop[i]
+ // evaluate x in the objective space
+ x_objVec = moveIncrEval(move, _pop[i]);
+ // update every fitness values to take x into account and compute the fitness of x
+ x_fitness = fitnessAssignment.updateByAdding(_pop, x_objVec);
+
+////////////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////////////
+// qui sont les extremes ? (=> min only !!!)
+ ext_0_idx = -1;
+ ext_0_objVec = x_objVec;
+ ext_1_idx = -1;
+ ext_1_objVec = x_objVec;
+ for (unsigned int k=0; k<_pop.size(); k++)
+ {
+ // ext_0
+ if (_pop[k].objectiveVector()[0] < ext_0_objVec[0])
+ {
+ ext_0_idx = k;
+ ext_0_objVec = _pop[k].objectiveVector();
+ }
+ else if ( (_pop[k].objectiveVector()[0] == ext_0_objVec[0]) && (_pop[k].objectiveVector()[1] < ext_0_objVec[1]) )
+ {
+ ext_0_idx = k;
+ ext_0_objVec = _pop[k].objectiveVector();
+ }
+ // ext_1
+ else if (_pop[k].objectiveVector()[1] < ext_1_objVec[1])
+ {
+ ext_1_idx = k;
+ ext_1_objVec = _pop[k].objectiveVector();
+ }
+ else if ( (_pop[k].objectiveVector()[1] == ext_1_objVec[1]) && (_pop[k].objectiveVector()[0] < ext_1_objVec[0]) )
+ {
+ ext_1_idx = k;
+ ext_1_objVec = _pop[k].objectiveVector();
+ }
+ }
+// worst init
+ if (ext_0_idx == -1)
+ {
+ unsigned int ind = 0;
+ while (ind == ext_1_idx)
+ {
+ ind++;
+ }
+ worst_idx = ind;
+ worst_objVec = _pop[ind].objectiveVector();
+ worst_fitness = _pop[ind].fitness();
+ }
+ else if (ext_1_idx == -1)
+ {
+ unsigned int ind = 0;
+ while (ind == ext_0_idx)
+ {
+ ind++;
+ }
+ worst_idx = ind;
+ worst_objVec = _pop[ind].objectiveVector();
+ worst_fitness = _pop[ind].fitness();
+ }
+ else
+ {
+ worst_idx = -1;
+ worst_objVec = x_objVec;
+ worst_fitness = x_fitness;
+ }
+////////////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+ // who is the worst ?
+ for (unsigned int j=0; j<_pop.size(); j++)
+ {
+ if ( (j!=ext_0_idx) && (j!=ext_1_idx) )
+ {
+ if (_pop[j].fitness() < worst_fitness)
+ {
+ worst_idx = j;
+ worst_objVec = _pop[j].objectiveVector();
+ worst_fitness = _pop[j].fitness();
+ }
+ }
+ }
+ // if the worst solution is the new one
+ if (worst_idx == -1)
+ {
+ // if all its neighbours have been explored,
+ // let's explore the neighborhoud of the next individual
+ if (! nextMove(move, _pop[i]))
+ {
+ i++;
+ if (i<_pop.size())
+ {
+ // initilization of the move for the next individual
+ moveInit(move, _pop[i]);
+ }
+ }
+ }
+ // if the worst solution is located before _pop[i]
+ else if (worst_idx <= i)
+ {
+ // the new solution takes place insteed of _pop[worst_idx]
+ _pop[worst_idx] = _pop[i];
+ move(_pop[worst_idx]);
+ _pop[worst_idx].objectiveVector(x_objVec);
+ _pop[worst_idx].fitness(x_fitness);
+ // let's explore the neighborhoud of the next individual
+ i++;
+ if (i<_pop.size())
+ {
+ // initilization of the move for the next individual
+ moveInit(move, _pop[i]);
+ }
+ }
+ // if the worst solution is located after _pop[i]
+ else if (worst_idx > i)
+ {
+ // the new solution takes place insteed of _pop[i+1] and _pop[worst_idx] is deleted
+ _pop[worst_idx] = _pop[i+1];
+ _pop[i+1] = _pop[i];
+ move(_pop[i+1]);
+ _pop[i+1].objectiveVector(x_objVec);
+ _pop[i+1].fitness(x_fitness);
+ // let's explore the neighborhoud of the individual _pop[i+2]
+ i += 2;
+ if (i<_pop.size())
+ {
+ // initilization of the move for the next individual
+ moveInit(move, _pop[i]);
+ }
+ }
+ // update fitness values
+ fitnessAssignment.updateByDeleting(_pop, worst_objVec);
+ }
+ }
+
+};
+
+#endif /*MOEOIBMOLS_H_*/
diff --git a/tags/paradiseo-moeo-1.0-beta-26-06-07/src/algo/moeoIteratedIBMOLS.h b/tags/paradiseo-moeo-1.0-beta-26-06-07/src/algo/moeoIteratedIBMOLS.h
new file mode 100755
index 000000000..c70fd27b2
--- /dev/null
+++ b/tags/paradiseo-moeo-1.0-beta-26-06-07/src/algo/moeoIteratedIBMOLS.h
@@ -0,0 +1,215 @@
+// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
+
+//-----------------------------------------------------------------------------
+// moeoIteratedIBMOLS.h
+// (c) OPAC Team (LIFL), Dolphin Project (INRIA), 2007
+/*
+ This library...
+
+ Contact: paradiseo-help@lists.gforge.inria.fr, http://paradiseo.gforge.inria.fr
+ */
+//-----------------------------------------------------------------------------
+
+#ifndef MOEOITERATEDIBMOLS_H_
+#define MOEOITERATEDIBMOLS_H_
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+
+
+//#include
+
+
+
+/**
+ * Iterated version of IBMOLS as described in
+ * Basseur M., Burke K. : "Indicator-Based Multi-Objective Local Search" (2007).
+ */
+template < class MOEOT, class Move >
+class moeoIteratedIBMOLS : public moeoLS < MOEOT, eoPop < MOEOT > & >
+{
+public:
+
+ /** The type of objective vector */
+ typedef typename MOEOT::ObjectiveVector ObjectiveVector;
+
+
+ /**
+ * Ctor.
+ * @param _moveInit the move initializer
+ * @param _nextMove the neighborhood explorer
+ * @param _eval the full evaluation
+ * @param _moveIncrEval the incremental evaluation
+ * @param _fitnessAssignment the fitness assignment strategy
+ * @param _continuator the stopping criteria
+ * @param _monOp the monary operator
+ * @param _randomMonOp the random monary operator (or random initializer)
+ * @param _nNoiseIterations the number of iterations to apply the random noise
+ */
+ moeoIteratedIBMOLS(
+ moMoveInit < Move > & _moveInit,
+ moNextMove < Move > & _nextMove,
+ eoEvalFunc < MOEOT > & _eval,
+ moeoMoveIncrEval < Move > & _moveIncrEval,
+ moeoIndicatorBasedFitnessAssignment < MOEOT > & _fitnessAssignment,
+ eoContinue < MOEOT > & _continuator,
+ eoMonOp < MOEOT > & _monOp,
+ eoMonOp < MOEOT > & _randomMonOp,
+ unsigned int _nNoiseIterations=1
+ ) :
+ ibmols(_moveInit, _nextMove, _eval, _moveIncrEval, _fitnessAssignment, _continuator),
+ eval(_eval),
+ continuator(_continuator),
+ monOp(_monOp),
+ randomMonOp(_randomMonOp),
+ nNoiseIterations(_nNoiseIterations)
+ {}
+
+
+ /**
+ * Apply the local search iteratively until the stopping criteria is met.
+ * @param _pop the initial population
+ * @param _arch the (updated) archive
+ */
+ void operator() (eoPop < MOEOT > & _pop, moeoArchive < MOEOT > & _arch)
+ {
+ _arch.update(_pop);
+ ibmols(_pop, _arch);
+ while (continuator(_arch))
+ {
+ // generate new solutions from the archive
+ generateNewSolutions(_pop, _arch);
+ // apply the local search (the global archive is updated in the sub-function)
+ ibmols(_pop, _arch);
+ }
+ }
+
+
+private:
+
+ /** the local search to iterate */
+ moeoIBMOLS < MOEOT, Move > ibmols;
+ /** the full evaluation */
+ eoEvalFunc < MOEOT > & eval;
+ /** the stopping criteria */
+ eoContinue < MOEOT > & continuator;
+ /** the monary operator */
+ eoMonOp < MOEOT > & monOp;
+ /** the random monary operator (or random initializer) */
+ eoMonOp < MOEOT > & randomMonOp;
+ /** the number of iterations to apply the random noise */
+ unsigned int nNoiseIterations;
+
+
+ /**
+ * Creates new population randomly initialized and/or initialized from the archive _arch.
+ * @param _pop the output population
+ * @param _arch the archive
+ */
+ void generateNewSolutions(eoPop < MOEOT > & _pop, const moeoArchive < MOEOT > & _arch)
+ {
+ // shuffle vector for the random selection of individuals
+ vector shuffle;
+ shuffle.resize(std::max(_pop.size(), _arch.size()));
+ // init shuffle
+ for (unsigned int i=0; i gen;
+ std::random_shuffle(shuffle.begin(), shuffle.end(), gen);
+ // start the creation of new solutions
+ for (unsigned int i=0; i<_pop.size(); i++)
+ {
+ if (shuffle[i] < _arch.size())
+ // the given archive contains the individual i
+ {
+ // add it to the resulting pop
+ _pop[i] = _arch[shuffle[i]];
+ // then, apply the operator nIterationsNoise times
+ for (unsigned int j=0; j & _pop, const moeoArchive < MOEOT > & _arch)
+ {
+ // here, we must have a QuadOp !
+ //eoQuadOp < MOEOT > quadOp;
+ rsCrossQuad quadOp;
+ // shuffle vector for the random selection of individuals
+ vector shuffle;
+ shuffle.resize(_arch.size());
+ // init shuffle
+ for (unsigned int i=0; i gen;
+ std::random_shuffle(shuffle.begin(), shuffle.end(), gen);
+ // start the creation of new solutions
+ unsigned int i=0;
+ while ((i<_pop.size()-1) && (i<_arch.size()-1))
+ {
+ _pop[i] = _arch[shuffle[i]];
+ _pop[i+1] = _arch[shuffle[i+1]];
+ // then, apply the operator nIterationsNoise times
+ for (unsigned int j=0; j
+#include
+#include
+
+/**
+ * Abstract class for local searches applied to multi-objective optimization.
+ * Starting from a Type (i.e.: an individual, a pop, an archive...), it produces a set of new non-dominated solutions.
+ */
+template < class MOEOT, class Type >
+class moeoLS: public moeoAlgo, public eoBF < Type, moeoArchive < MOEOT > &, void > {};
+
+#endif /*MOEOLS_H_*/
diff --git a/tags/paradiseo-moeo-1.0-beta-26-06-07/src/algo/moeoNSGA.h b/tags/paradiseo-moeo-1.0-beta-26-06-07/src/algo/moeoNSGA.h
new file mode 100644
index 000000000..b1bd71076
--- /dev/null
+++ b/tags/paradiseo-moeo-1.0-beta-26-06-07/src/algo/moeoNSGA.h
@@ -0,0 +1,158 @@
+// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
+
+//-----------------------------------------------------------------------------
+// moeoNSGA.h
+// (c) OPAC Team (LIFL), Dolphin Project (INRIA), 2007
+/*
+ This library...
+
+ Contact: paradiseo-help@lists.gforge.inria.fr, http://paradiseo.gforge.inria.fr
+ */
+//-----------------------------------------------------------------------------
+
+#ifndef MOEONSGA_H_
+#define MOEONSGA_H_
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+/**
+ * NSGA (Non-dominated Sorting Genetic Algorithm) as described in:
+ * N. Srinivas, K. Deb, "Multiobjective Optimization Using Nondominated Sorting in Genetic Algorithms".
+ * Evolutionary Computation, Vol. 2(3), No 2, pp. 221-248 (1994).
+ * This class builds the NSGA algorithm only by using the fine-grained components of the ParadisEO-MOEO framework.
+ */
+template < class MOEOT >
+class moeoNSGA: public moeoEA < MOEOT >
+{
+public:
+
+ /**
+ * Simple ctor with a eoGenOp.
+ * @param _maxGen number of generations before stopping
+ * @param _eval evaluation function
+ * @param _op variation operator
+ * @param _nicheSize niche size
+ */
+ moeoNSGA (unsigned int _maxGen, eoEvalFunc < MOEOT > & _eval, eoGenOp < MOEOT > & _op, double _nicheSize = 0.5) :
+ defaultGenContinuator(_maxGen), continuator(defaultGenContinuator), popEval(_eval), select(2),
+ diversityAssignment(_nicheSize), replace(fitnessAssignment, diversityAssignment), genBreed(select, _op), breed(genBreed)
+ {}
+
+
+ /**
+ * Simple ctor with a eoTransform.
+ * @param _maxGen number of generations before stopping
+ * @param _eval evaluation function
+ * @param _op variation operator
+ * @param _nicheSize niche size
+ */
+ moeoNSGA (unsigned int _maxGen, eoEvalFunc < MOEOT > & _eval, eoTransform < MOEOT > & _op, double _nicheSize = 0.5) :
+ defaultGenContinuator(_maxGen), continuator(defaultGenContinuator), popEval(_eval), select(2),
+ diversityAssignment(_nicheSize), replace(fitnessAssignment, diversityAssignment), genBreed(select, _op), breed(genBreed)
+ {}
+
+
+ /**
+ * Ctor with a crossover, a mutation and their corresponding rates.
+ * @param _maxGen number of generations before stopping
+ * @param _eval evaluation function
+ * @param _crossover crossover
+ * @param _pCross crossover probability
+ * @param _mutation mutation
+ * @param _pMut mutation probability
+ * @param _nicheSize niche size
+ */
+ moeoNSGA (unsigned int _maxGen, eoEvalFunc < MOEOT > & _eval, eoQuadOp < MOEOT > & _crossover, double _pCross, eoMonOp < MOEOT > & _mutation, double _pMut, double _nicheSize = 0.5) :
+ defaultGenContinuator(_maxGen), continuator(defaultGenContinuator), popEval(_eval), select (2),
+ diversityAssignment(_nicheSize), replace (fitnessAssignment, diversityAssignment),
+ defaultSGAGenOp(_crossover, _pCross, _mutation, _pMut), genBreed (select, defaultSGAGenOp), breed (genBreed)
+ {}
+
+
+ /**
+ * Ctor with a continuator (instead of _maxGen) and a eoGenOp.
+ * @param _continuator stopping criteria
+ * @param _eval evaluation function
+ * @param _op variation operator
+ * @param _nicheSize niche size
+ */
+ moeoNSGA (eoContinue < MOEOT > & _continuator, eoEvalFunc < MOEOT > & _eval, eoGenOp < MOEOT > & _op, double _nicheSize = 0.5) :
+ continuator(_continuator), popEval(_eval), select(2),
+ diversityAssignment(_nicheSize), replace(fitnessAssignment, diversityAssignment), genBreed(select, _op), breed(genBreed)
+ {}
+
+
+ /**
+ * Ctor with a continuator (instead of _maxGen) and a eoTransform.
+ * @param _continuator stopping criteria
+ * @param _eval evaluation function
+ * @param _op variation operator
+ * @param _nicheSize niche size
+ */
+ moeoNSGA (eoContinue < MOEOT > & _continuator, eoEvalFunc < MOEOT > & _eval, eoTransform < MOEOT > & _op, double _nicheSize = 0.5) :
+ continuator(_continuator), popEval(_eval), select(2),
+ diversityAssignment(_nicheSize), replace(fitnessAssignment, diversityAssignment), genBreed(select, _op), breed(genBreed)
+ {}
+
+
+ /**
+ * Apply a few generation of evolution to the population _pop until the stopping criteria is verified.
+ * @param _pop the population
+ */
+ virtual void operator () (eoPop < MOEOT > &_pop)
+ {
+ eoPop < MOEOT > offspring, empty_pop;
+ popEval (empty_pop, _pop); // a first eval of _pop
+ // evaluate fitness and diversity
+ fitnessAssignment(_pop);
+ diversityAssignment(_pop);
+ do
+ {
+ // generate offspring, worths are recalculated if necessary
+ breed (_pop, offspring);
+ // eval of offspring
+ popEval (_pop, offspring);
+ // after replace, the new pop is in _pop. Worths are recalculated if necessary
+ replace (_pop, offspring);
+ } while (continuator (_pop));
+ }
+
+
+protected:
+
+ /** a continuator based on the number of generations (used as default) */
+ eoGenContinue < MOEOT > defaultGenContinuator;
+ /** stopping criteria */
+ eoContinue < MOEOT > & continuator;
+ /** evaluation function used to evaluate the whole population */
+ eoPopLoopEval < MOEOT > popEval;
+ /** binary tournament selection */
+ moeoDetTournamentSelect < MOEOT > select;
+ /** fitness assignment used in NSGA-II */
+ moeoFastNonDominatedSortingFitnessAssignment < MOEOT > fitnessAssignment;
+ /** diversity assignment used in NSGA-II */
+ moeoFrontByFrontSharingDiversityAssignment < MOEOT > diversityAssignment;
+ /** elitist replacement */
+ moeoElitistReplacement < MOEOT > replace;
+ /** an object for genetic operators (used as default) */
+ eoSGAGenOp < MOEOT > defaultSGAGenOp;
+ /** general breeder */
+ eoGeneralBreeder < MOEOT > genBreed;
+ /** breeder */
+ eoBreed < MOEOT > & breed;
+
+};
+
+#endif /*MOEONSGAII_H_*/
diff --git a/tags/paradiseo-moeo-1.0-beta-26-06-07/src/algo/moeoNSGAII.h b/tags/paradiseo-moeo-1.0-beta-26-06-07/src/algo/moeoNSGAII.h
new file mode 100644
index 000000000..0c27bfd15
--- /dev/null
+++ b/tags/paradiseo-moeo-1.0-beta-26-06-07/src/algo/moeoNSGAII.h
@@ -0,0 +1,153 @@
+// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
+
+//-----------------------------------------------------------------------------
+// moeoNSGAII.h
+// (c) OPAC Team (LIFL), Dolphin Project (INRIA), 2007
+/*
+ This library...
+
+ Contact: paradiseo-help@lists.gforge.inria.fr, http://paradiseo.gforge.inria.fr
+ */
+//-----------------------------------------------------------------------------
+
+#ifndef MOEONSGAII_H_
+#define MOEONSGAII_H_
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+/**
+ * NSGA-II (Non-dominated Sorting Genetic Algorithm II) as described in:
+ * Deb, K., S. Agrawal, A. Pratap, and T. Meyarivan : "A fast elitist non-dominated sorting genetic algorithm for multi-objective optimization: NSGA-II".
+ * In IEEE Transactions on Evolutionary Computation, Vol. 6, No 2, pp 182-197 (April 2002).
+ * This class builds the NSGA-II algorithm only by using the fine-grained components of the ParadisEO-MOEO framework.
+ */
+template < class MOEOT >
+class moeoNSGAII: public moeoEA < MOEOT >
+{
+public:
+
+ /**
+ * Simple ctor with a eoGenOp.
+ * @param _maxGen number of generations before stopping
+ * @param _eval evaluation function
+ * @param _op variation operator
+ */
+ moeoNSGAII (unsigned int _maxGen, eoEvalFunc < MOEOT > & _eval, eoGenOp < MOEOT > & _op) :
+ defaultGenContinuator(_maxGen), continuator(defaultGenContinuator), popEval(_eval), select(2),
+ replace(fitnessAssignment, diversityAssignment), genBreed(select, _op), breed(genBreed)
+ {}
+
+
+ /**
+ * Simple ctor with a eoTransform.
+ * @param _maxGen number of generations before stopping
+ * @param _eval evaluation function
+ * @param _op variation operator
+ */
+ moeoNSGAII (unsigned int _maxGen, eoEvalFunc < MOEOT > & _eval, eoTransform < MOEOT > & _op) :
+ defaultGenContinuator(_maxGen), continuator(defaultGenContinuator), popEval(_eval), select(2),
+ replace(fitnessAssignment, diversityAssignment), genBreed(select, _op), breed(genBreed)
+ {}
+
+
+ /**
+ * Ctor with a crossover, a mutation and their corresponding rates.
+ * @param _maxGen number of generations before stopping
+ * @param _eval evaluation function
+ * @param _crossover crossover
+ * @param _pCross crossover probability
+ * @param _mutation mutation
+ * @param _pMut mutation probability
+ */
+ moeoNSGAII (unsigned int _maxGen, eoEvalFunc < MOEOT > & _eval, eoQuadOp < MOEOT > & _crossover, double _pCross, eoMonOp < MOEOT > & _mutation, double _pMut) :
+ defaultGenContinuator(_maxGen), continuator(defaultGenContinuator), popEval(_eval), select (2),
+ replace (fitnessAssignment, diversityAssignment), defaultSGAGenOp(_crossover, _pCross, _mutation, _pMut),
+ genBreed (select, defaultSGAGenOp), breed (genBreed)
+ {}
+
+
+ /**
+ * Ctor with a continuator (instead of _maxGen) and a eoGenOp.
+ * @param _continuator stopping criteria
+ * @param _eval evaluation function
+ * @param _op variation operator
+ */
+ moeoNSGAII (eoContinue < MOEOT > & _continuator, eoEvalFunc < MOEOT > & _eval, eoGenOp < MOEOT > & _op) :
+ continuator(_continuator), popEval(_eval), select(2),
+ replace(fitnessAssignment, diversityAssignment), genBreed(select, _op), breed(genBreed)
+ {}
+
+
+ /**
+ * Ctor with a continuator (instead of _maxGen) and a eoTransform.
+ * @param _continuator stopping criteria
+ * @param _eval evaluation function
+ * @param _op variation operator
+ */
+ moeoNSGAII (eoContinue < MOEOT > & _continuator, eoEvalFunc < MOEOT > & _eval, eoTransform < MOEOT > & _op) :
+ continuator(_continuator), popEval(_eval), select(2),
+ replace(fitnessAssignment, diversityAssignment), genBreed(select, _op), breed(genBreed)
+ {}
+
+
+ /**
+ * Apply a few generation of evolution to the population _pop until the stopping criteria is verified.
+ * @param _pop the population
+ */
+ virtual void operator () (eoPop < MOEOT > &_pop)
+ {
+ eoPop < MOEOT > offspring, empty_pop;
+ popEval (empty_pop, _pop); // a first eval of _pop
+ // evaluate fitness and diversity
+ fitnessAssignment(_pop);
+ diversityAssignment(_pop);
+ do
+ {
+ // generate offspring, worths are recalculated if necessary
+ breed (_pop, offspring);
+ // eval of offspring
+ popEval (_pop, offspring);
+ // after replace, the new pop is in _pop. Worths are recalculated if necessary
+ replace (_pop, offspring);
+ } while (continuator (_pop));
+ }
+
+
+protected:
+
+ /** a continuator based on the number of generations (used as default) */
+ eoGenContinue < MOEOT > defaultGenContinuator;
+ /** stopping criteria */
+ eoContinue < MOEOT > & continuator;
+ /** evaluation function used to evaluate the whole population */
+ eoPopLoopEval < MOEOT > popEval;
+ /** binary tournament selection */
+ moeoDetTournamentSelect < MOEOT > select;
+ /** fitness assignment used in NSGA-II */
+ moeoFastNonDominatedSortingFitnessAssignment < MOEOT > fitnessAssignment;
+ /** diversity assignment used in NSGA-II */
+ moeoFrontByFrontCrowdingDistanceDiversityAssignment < MOEOT > diversityAssignment;
+ /** elitist replacement */
+ moeoElitistReplacement < MOEOT > replace;
+ /** an object for genetic operators (used as default) */
+ eoSGAGenOp < MOEOT > defaultSGAGenOp;
+ /** general breeder */
+ eoGeneralBreeder < MOEOT > genBreed;
+ /** breeder */
+ eoBreed < MOEOT > & breed;
+
+};
+
+#endif /*MOEONSGAII_H_*/
diff --git a/tags/paradiseo-moeo-1.0-beta-26-06-07/src/archive/moeoArchive.h b/tags/paradiseo-moeo-1.0-beta-26-06-07/src/archive/moeoArchive.h
new file mode 100644
index 000000000..9338799d8
--- /dev/null
+++ b/tags/paradiseo-moeo-1.0-beta-26-06-07/src/archive/moeoArchive.h
@@ -0,0 +1,180 @@
+// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
+
+//-----------------------------------------------------------------------------
+// moeoArchive.h
+// (c) OPAC Team (LIFL), Dolphin Project (INRIA), 2007
+/*
+ This library...
+
+ Contact: paradiseo-help@lists.gforge.inria.fr, http://paradiseo.gforge.inria.fr
+ */
+//-----------------------------------------------------------------------------
+
+#ifndef MOEOARCHIVE_H_
+#define MOEOARCHIVE_H_
+
+#include
+#include
+#include
+
+/**
+ * An archive is a secondary population that stores non-dominated solutions.
+ */
+template < class MOEOT >
+class moeoArchive : public eoPop < MOEOT >
+{
+public:
+
+ using eoPop < MOEOT > :: size;
+ using eoPop < MOEOT > :: operator[];
+ using eoPop < MOEOT > :: back;
+ using eoPop < MOEOT > :: pop_back;
+
+
+ /**
+ * The type of an objective vector for a solution
+ */
+ typedef typename MOEOT::ObjectiveVector ObjectiveVector;
+
+
+ /**
+ * Default ctor.
+ * The moeoObjectiveVectorComparator used to compare solutions is based on Pareto dominance
+ */
+ moeoArchive() : eoPop < MOEOT >(), comparator(paretoComparator)
+ {}
+
+
+ /**
+ * Ctor
+ * @param _comparator the moeoObjectiveVectorComparator used to compare solutions
+ */
+ moeoArchive(moeoObjectiveVectorComparator < ObjectiveVector > & _comparator) : eoPop < MOEOT >(), comparator(_comparator)
+ {}
+
+
+ /**
+ * Returns true if the current archive dominates _objectiveVector according to the moeoObjectiveVectorComparator given in the constructor
+ * @param _objectiveVector the objective vector to compare with the current archive
+ */
+ bool dominates (const ObjectiveVector & _objectiveVector) const
+ {
+ for (unsigned int i = 0; i & _pop)
+ {
+ for (unsigned int i=0; i<_pop.size(); i++)
+ {
+ update(_pop[i]);
+ }
+ }
+
+
+ /**
+ * Returns true if the current archive contains the same objective vectors than the given archive _arch
+ * @param _arch the given archive
+ */
+ bool equals (const moeoArchive < MOEOT > & _arch)
+ {
+ for (unsigned int i=0; i & comparator;
+ /** A moeoObjectiveVectorComparator based on Pareto dominance (used as default) */
+ moeoParetoObjectiveVectorComparator < ObjectiveVector > paretoComparator;
+
+};
+
+#endif /*MOEOARCHIVE_H_ */
diff --git a/tags/paradiseo-moeo-1.0-beta-26-06-07/src/comparator/moeoAggregativeComparator.h b/tags/paradiseo-moeo-1.0-beta-26-06-07/src/comparator/moeoAggregativeComparator.h
new file mode 100644
index 000000000..a217bd52d
--- /dev/null
+++ b/tags/paradiseo-moeo-1.0-beta-26-06-07/src/comparator/moeoAggregativeComparator.h
@@ -0,0 +1,55 @@
+// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
+
+//-----------------------------------------------------------------------------
+// moeoAggregativeComparator.h
+// (c) OPAC Team (LIFL), Dolphin Project (INRIA), 2007
+/*
+ This library...
+
+ Contact: paradiseo-help@lists.gforge.inria.fr, http://paradiseo.gforge.inria.fr
+ */
+//-----------------------------------------------------------------------------
+
+#ifndef MOEOAGGREGATIVECOMPARATOR_H_
+#define MOEOAGGREGATIVECOMPARATOR_H_
+
+#include
+
+/**
+ * Functor allowing to compare two solutions according to their fitness and diversity values, each according to its aggregative value.
+ */
+template < class MOEOT >
+class moeoAggregativeComparator : public moeoComparator < MOEOT >
+{
+public:
+
+ /**
+ * Ctor.
+ * @param _weightFitness the weight for fitness
+ * @param _weightDiversity the weight for diversity
+ */
+ moeoAggregativeComparator(double _weightFitness = 1.0, double _weightDiversity = 1.0) : weightFitness(_weightFitness), weightDiversity(_weightDiversity)
+ {}
+
+
+ /**
+ * Returns true if _moeo1 < _moeo2 according to the aggregation of their fitness and diversity values
+ * @param _moeo1 the first solution
+ * @param _moeo2 the second solution
+ */
+ const bool operator()(const MOEOT & _moeo1, const MOEOT & _moeo2)
+ {
+ return ( weightFitness * _moeo1.fitness() + weightDiversity * _moeo1.diversity() ) < ( weightFitness * _moeo2.fitness() + weightDiversity * _moeo2.diversity() );
+ }
+
+
+private:
+
+ /** the weight for fitness */
+ double weightFitness;
+ /** the weight for diversity */
+ double weightDiversity;
+
+};
+
+#endif /*MOEOAGGREGATIVECOMPARATOR_H_*/
diff --git a/tags/paradiseo-moeo-1.0-beta-26-06-07/src/comparator/moeoComparator.h b/tags/paradiseo-moeo-1.0-beta-26-06-07/src/comparator/moeoComparator.h
new file mode 100644
index 000000000..9243a57bc
--- /dev/null
+++ b/tags/paradiseo-moeo-1.0-beta-26-06-07/src/comparator/moeoComparator.h
@@ -0,0 +1,24 @@
+// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
+
+//-----------------------------------------------------------------------------
+// moeoComparator.h
+// (c) OPAC Team (LIFL), Dolphin Project (INRIA), 2007
+/*
+ This library...
+
+ Contact: paradiseo-help@lists.gforge.inria.fr, http://paradiseo.gforge.inria.fr
+ */
+//-----------------------------------------------------------------------------
+
+#ifndef MOEOCOMPARATOR_H_
+#define MOEOCOMPARATOR_H_
+
+#include
+
+/**
+ * Functor allowing to compare two solutions.
+ */
+template < class MOEOT >
+class moeoComparator : public eoBF < const MOEOT &, const MOEOT &, const bool > {};
+
+#endif /*MOEOCOMPARATOR_H_*/
diff --git a/tags/paradiseo-moeo-1.0-beta-26-06-07/src/comparator/moeoDiversityThenFitnessComparator.h b/tags/paradiseo-moeo-1.0-beta-26-06-07/src/comparator/moeoDiversityThenFitnessComparator.h
new file mode 100644
index 000000000..54df59b82
--- /dev/null
+++ b/tags/paradiseo-moeo-1.0-beta-26-06-07/src/comparator/moeoDiversityThenFitnessComparator.h
@@ -0,0 +1,45 @@
+// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
+
+//-----------------------------------------------------------------------------
+// moeoDiversityThenFitnessComparator.h
+// (c) OPAC Team (LIFL), Dolphin Project (INRIA), 2007
+/*
+ This library...
+
+ Contact: paradiseo-help@lists.gforge.inria.fr, http://paradiseo.gforge.inria.fr
+ */
+//-----------------------------------------------------------------------------
+
+#ifndef MOEODIVERSITYTHENFITNESSCOMPARATOR_H_
+#define MOEODIVERSITYTHENFITNESSCOMPARATOR_H_
+
+#include
+
+/**
+ * Functor allowing to compare two solutions according to their diversity values, then according to their fitness values.
+ */
+template < class MOEOT >
+class moeoDiversityThenFitnessComparator : public moeoComparator < MOEOT >
+{
+public:
+
+ /**
+ * Returns true if _moeo1 < _moeo2 according to their diversity values, then according to their fitness values
+ * @param _moeo1 the first solution
+ * @param _moeo2 the second solution
+ */
+ const bool operator()(const MOEOT & _moeo1, const MOEOT & _moeo2)
+ {
+ if (_moeo1.diversity() == _moeo2.diversity())
+ {
+ return _moeo1.fitness() < _moeo2.fitness();
+ }
+ else
+ {
+ return _moeo1.diversity() < _moeo2.diversity();
+ }
+ }
+
+};
+
+#endif /*MOEODIVERSITYTHENFITNESSCOMPARATOR_H_*/
diff --git a/tags/paradiseo-moeo-1.0-beta-26-06-07/src/comparator/moeoFitnessThenDiversityComparator.h b/tags/paradiseo-moeo-1.0-beta-26-06-07/src/comparator/moeoFitnessThenDiversityComparator.h
new file mode 100644
index 000000000..5baf10097
--- /dev/null
+++ b/tags/paradiseo-moeo-1.0-beta-26-06-07/src/comparator/moeoFitnessThenDiversityComparator.h
@@ -0,0 +1,45 @@
+// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
+
+//-----------------------------------------------------------------------------
+// moeoFitnessThenDiversityComparator.h
+// (c) OPAC Team (LIFL), Dolphin Project (INRIA), 2007
+/*
+ This library...
+
+ Contact: paradiseo-help@lists.gforge.inria.fr, http://paradiseo.gforge.inria.fr
+ */
+//-----------------------------------------------------------------------------
+
+#ifndef MOEOFITNESSTHENDIVERSITYCOMPARATOR_H_
+#define MOEOFITNESSTHENDIVERSITYCOMPARATOR_H_
+
+#include
+
+/**
+ * Functor allowing to compare two solutions according to their fitness values, then according to their diversity values.
+ */
+template < class MOEOT >
+class moeoFitnessThenDiversityComparator : public moeoComparator < MOEOT >
+{
+public:
+
+ /**
+ * Returns true if _moeo1 < _moeo2 according to their fitness values, then according to their diversity values
+ * @param _moeo1 the first solution
+ * @param _moeo2 the second solution
+ */
+ const bool operator()(const MOEOT & _moeo1, const MOEOT & _moeo2)
+ {
+ if (_moeo1.fitness() == _moeo2.fitness())
+ {
+ return _moeo1.diversity() < _moeo2.diversity();
+ }
+ else
+ {
+ return _moeo1.fitness() < _moeo2.fitness();
+ }
+ }
+
+};
+
+#endif /*MOEOFITNESSTHENDIVERSITYCOMPARATOR_H_*/
diff --git a/tags/paradiseo-moeo-1.0-beta-26-06-07/src/comparator/moeoGDominanceObjectiveVectorComparator.h b/tags/paradiseo-moeo-1.0-beta-26-06-07/src/comparator/moeoGDominanceObjectiveVectorComparator.h
new file mode 100644
index 000000000..006d1c4f2
--- /dev/null
+++ b/tags/paradiseo-moeo-1.0-beta-26-06-07/src/comparator/moeoGDominanceObjectiveVectorComparator.h
@@ -0,0 +1,102 @@
+// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
+
+//-----------------------------------------------------------------------------
+// moeoGDominanceObjectiveVectorComparator.h
+// (c) OPAC Team (LIFL), Dolphin Project (INRIA), 2007
+/*
+ This library...
+
+ Contact: paradiseo-help@lists.gforge.inria.fr, http://paradiseo.gforge.inria.fr
+ */
+//-----------------------------------------------------------------------------
+
+#ifndef MOEOGDOMINANCEOBJECTIVEVECTORCOMPARATOR_H_
+#define MOEOGDOMINANCEOBJECTIVEVECTORCOMPARATOR_H_
+
+#include
+
+/**
+ * This functor class allows to compare 2 objective vectors according to g-dominance.
+ * The concept of g-dominance as been introduced in:
+ * J. Molina, L. V. Santana, A. G. Hernandez-Diaz, C. A. Coello Coello, R. Caballero,
+ * "g-dominance: Reference point based dominance" (2007)
+ */
+template < class ObjectiveVector >
+class moeoGDominanceObjectiveVectorComparator : public moeoObjectiveVectorComparator < ObjectiveVector >
+{
+public:
+
+ /**
+ * Ctor.
+ * @param _ref the reference point
+ */
+ moeoGDominanceObjectiveVectorComparator(ObjectiveVector & _ref) : ref(_ref)
+ {}
+
+
+ /**
+ * Returns true if _objectiveVector1 is g-dominated by _objectiveVector2.
+ * @param _objectiveVector1 the first objective vector
+ * @param _objectiveVector2 the second objective vector
+ */
+ const bool operator()(const ObjectiveVector & _objectiveVector1, const ObjectiveVector & _objectiveVector2)
+ {
+ unsigned int flag1 = flag(_objectiveVector1);
+ unsigned int flag2 = flag(_objectiveVector2);
+ if (flag2==0)
+ {
+ // cannot dominate
+ return false;
+ }
+ else if ( (flag2==1) && (flag1==0) )
+ {
+ // is dominated
+ return true;
+ }
+ else // (flag1==1) && (flag2==1)
+ {
+ // both are on the good region, so let's use the classical Pareto dominance
+ return paretoComparator(_objectiveVector1, _objectiveVector2);
+ }
+ }
+
+
+private:
+
+ /** the reference point */
+ ObjectiveVector & ref;
+ /** Pareto comparator */
+ moeoParetoObjectiveVectorComparator < ObjectiveVector > paretoComparator;
+
+
+ /**
+ * Returns the flag of _objectiveVector according to the reference point
+ * @param _objectiveVector the first objective vector
+ */
+ unsigned int flag(const ObjectiveVector & _objectiveVector)
+ {
+ unsigned int result=1;
+ for (unsigned int i=0; i ref[i])
+ {
+ result=0;
+ }
+ }
+ if (result==0)
+ {
+ result=1;
+ for (unsigned int i=0; i
+
+/**
+ * Functor allowing to compare two objective vectors according to their first objective value, then their second, and so on.
+ */
+template < class ObjectiveVector >
+class moeoObjectiveObjectiveVectorComparator : public moeoObjectiveVectorComparator < ObjectiveVector >
+{
+public:
+
+ /**
+ * Returns true if _objectiveVector1 < _objectiveVector2 on the first objective, then on the second, and so on
+ * @param _objectiveVector1 the first objective vector
+ * @param _objectiveVector2 the second objective vector
+ */
+ const bool operator()(const ObjectiveVector & _objectiveVector1, const ObjectiveVector & _objectiveVector2)
+ {
+ for (unsigned int i=0; i ObjectiveVector::Traits::tolerance() )
+ {
+ if (_objectiveVector1[i] < _objectiveVector2[i])
+ {
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+ }
+ return false;
+ }
+
+};
+
+#endif /*MOEOOBJECTIVEOBJECTIVEVECTORCOMPARATOR_H_*/
diff --git a/tags/paradiseo-moeo-1.0-beta-26-06-07/src/comparator/moeoObjectiveVectorComparator.h b/tags/paradiseo-moeo-1.0-beta-26-06-07/src/comparator/moeoObjectiveVectorComparator.h
new file mode 100644
index 000000000..75608ad12
--- /dev/null
+++ b/tags/paradiseo-moeo-1.0-beta-26-06-07/src/comparator/moeoObjectiveVectorComparator.h
@@ -0,0 +1,26 @@
+// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
+
+//-----------------------------------------------------------------------------
+// moeoObjectiveVectorComparator.h
+// (c) OPAC Team (LIFL), Dolphin Project (INRIA), 2007
+/*
+ This library...
+
+ Contact: paradiseo-help@lists.gforge.inria.fr, http://paradiseo.gforge.inria.fr
+ */
+//-----------------------------------------------------------------------------
+
+#ifndef MOEOOBJECTIVEVECTORCOMPARATOR_H_
+#define MOEOOBJECTIVEVECTORCOMPARATOR_H_
+
+#include
+#include
+
+/**
+ * Abstract class allowing to compare 2 objective vectors.
+ * The template argument ObjectiveVector have to be a moeoObjectiveVector.
+ */
+template < class ObjectiveVector >
+class moeoObjectiveVectorComparator : public eoBF < const ObjectiveVector &, const ObjectiveVector &, const bool > {};
+
+#endif /*MOEOOBJECTIVEVECTORCOMPARATOR_H_*/
diff --git a/tags/paradiseo-moeo-1.0-beta-26-06-07/src/comparator/moeoOneObjectiveComparator.h b/tags/paradiseo-moeo-1.0-beta-26-06-07/src/comparator/moeoOneObjectiveComparator.h
new file mode 100644
index 000000000..74be47bb3
--- /dev/null
+++ b/tags/paradiseo-moeo-1.0-beta-26-06-07/src/comparator/moeoOneObjectiveComparator.h
@@ -0,0 +1,57 @@
+// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
+
+//-----------------------------------------------------------------------------
+// moeoOneObjectiveComparator.h
+// (c) OPAC Team (LIFL), Dolphin Project (INRIA), 2007
+/*
+ This library...
+
+ Contact: paradiseo-help@lists.gforge.inria.fr, http://paradiseo.gforge.inria.fr
+ */
+//-----------------------------------------------------------------------------
+
+#ifndef MOEOONEOBJECTIVECOMPARATOR_H_
+#define MOEOONEOBJECTIVECOMPARATOR_H_
+
+#include
+
+/**
+ * Functor allowing to compare two solutions according to one objective.
+ */
+template < class MOEOT >
+class moeoOneObjectiveComparator : public moeoComparator < MOEOT >
+{
+public:
+
+ /**
+ * Ctor.
+ * @param _obj the index of objective
+ */
+ moeoOneObjectiveComparator(unsigned int _obj) : obj(_obj)
+ {
+ if (obj > MOEOT::ObjectiveVector::nObjectives())
+ {
+ throw std::runtime_error("Problem with the index of objective in moeoOneObjectiveComparator");
+ }
+ }
+
+
+ /**
+ * Returns true if _moeo1 < _moeo2 on the obj objective
+ * @param _moeo1 the first solution
+ * @param _moeo2 the second solution
+ */
+ const bool operator()(const MOEOT & _moeo1, const MOEOT & _moeo2)
+ {
+ return _moeo1.objectiveVector()[obj] < _moeo2.objectiveVector()[obj];
+ }
+
+
+private:
+
+ /** the index of objective */
+ unsigned int obj;
+
+};
+
+#endif /*MOEOONEOBJECTIVECOMPARATOR_H_*/
diff --git a/tags/paradiseo-moeo-1.0-beta-26-06-07/src/comparator/moeoParetoObjectiveVectorComparator.h b/tags/paradiseo-moeo-1.0-beta-26-06-07/src/comparator/moeoParetoObjectiveVectorComparator.h
new file mode 100644
index 000000000..c9f8e8260
--- /dev/null
+++ b/tags/paradiseo-moeo-1.0-beta-26-06-07/src/comparator/moeoParetoObjectiveVectorComparator.h
@@ -0,0 +1,70 @@
+// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
+
+//-----------------------------------------------------------------------------
+// moeoParetoObjectiveVectorComparator.h
+// (c) OPAC Team (LIFL), Dolphin Project (INRIA), 2007
+/*
+ This library...
+
+ Contact: paradiseo-help@lists.gforge.inria.fr, http://paradiseo.gforge.inria.fr
+ */
+//-----------------------------------------------------------------------------
+
+#ifndef MOEOPARETOOBJECTIVEVECTORCOMPARATOR_H_
+#define MOEOPARETOOBJECTIVEVECTORCOMPARATOR_H_
+
+#include
+
+/**
+ * This functor class allows to compare 2 objective vectors according to Pareto dominance.
+ */
+template < class ObjectiveVector >
+class moeoParetoObjectiveVectorComparator : public moeoObjectiveVectorComparator < ObjectiveVector >
+{
+public:
+
+ /**
+ * Returns true if _objectiveVector1 is dominated by _objectiveVector2
+ * @param _objectiveVector1 the first objective vector
+ * @param _objectiveVector2 the second objective vector
+ */
+ const bool operator()(const ObjectiveVector & _objectiveVector1, const ObjectiveVector & _objectiveVector2)
+ {
+ bool dom = false;
+ for (unsigned int i=0; i ObjectiveVector::Traits::tolerance() )
+ {
+ // if the ith objective have to be minimized...
+ if (ObjectiveVector::minimizing(i))
+ {
+ if (_objectiveVector1[i] > _objectiveVector2[i])
+ {
+ dom = true; //_objectiveVector1[i] is not better than _objectiveVector2[i]
+ }
+ else
+ {
+ return false; //_objectiveVector2 cannot dominate _objectiveVector1
+ }
+ }
+ // if the ith objective have to be maximized...
+ else if (ObjectiveVector::maximizing(i))
+ {
+ if (_objectiveVector1[i] > _objectiveVector2[i])
+ {
+ dom = true; //_objectiveVector1[i] is not better than _objectiveVector2[i]
+ }
+ else
+ {
+ return false; //_objectiveVector2 cannot dominate _objectiveVector1
+ }
+ }
+ }
+ }
+ return dom;
+ }
+
+};
+
+#endif /*MOEOPARETOOBJECTIVEVECTORCOMPARATOR_H_*/
diff --git a/tags/paradiseo-moeo-1.0-beta-26-06-07/src/core/MOEO.h b/tags/paradiseo-moeo-1.0-beta-26-06-07/src/core/MOEO.h
new file mode 100644
index 000000000..ed288facc
--- /dev/null
+++ b/tags/paradiseo-moeo-1.0-beta-26-06-07/src/core/MOEO.h
@@ -0,0 +1,291 @@
+// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
+
+//-----------------------------------------------------------------------------
+// MOEO.h
+// (c) OPAC Team (LIFL), Dolphin Project (INRIA), 2007
+/*
+ This library...
+
+ Contact: paradiseo-help@lists.gforge.inria.fr, http://paradiseo.gforge.inria.fr
+ */
+//-----------------------------------------------------------------------------
+
+#ifndef MOEO_H_
+#define MOEO_H_
+
+#include
+#include
+#include
+#include
+
+/**
+ * Base class allowing to represent a solution (an individual) for multi-objective optimization.
+ * The template argument MOEOObjectiveVector allows to represent the solution in the objective space (it can be a moeoObjectiveVector object).
+ * The template argument MOEOFitness is an object reflecting the quality of the solution in term of convergence (the fitness of a solution is always to be maximized).
+ * The template argument MOEODiversity is an object reflecting the quality of the solution in term of diversity (the diversity of a solution is always to be maximized).
+ * All template arguments must have a void and a copy constructor.
+ * Using some specific representations, you will have to define a copy constructor if the default one is not what you want.
+ * In the same cases, you will also have to define the affectation operator (operator=).
+ * Then, you will explicitly have to call the parent copy constructor and the parent affectation operator at the beginning of the corresponding implementation.
+ * Besides, note that, contrary to the mono-objective case (and to EO) where the fitness value of a solution is confused with its objective value,
+ * the fitness value differs of the objectives values in the multi-objective case.
+ */
+template < class MOEOObjectiveVector, class MOEOFitness, class MOEODiversity >
+class MOEO : public EO < MOEOObjectiveVector >
+{
+public:
+
+ /** the objective vector type of a solution */
+ typedef MOEOObjectiveVector ObjectiveVector;
+
+ /** the fitness type of a solution */
+ typedef MOEOFitness Fitness;
+
+ /** the diversity type of a solution */
+ typedef MOEODiversity Diversity;
+
+
+ /**
+ * Ctor
+ */
+ MOEO()
+ {
+ // default values for every parameters
+ objectiveVectorValue = ObjectiveVector();
+ fitnessValue = Fitness();
+ diversityValue = Diversity();
+ // invalidate all
+ invalidate();
+ }
+
+
+ /**
+ * Virtual dtor
+ */
+ virtual ~MOEO() {};
+
+
+ /**
+ * Returns the objective vector of the current solution
+ */
+ ObjectiveVector objectiveVector() const
+ {
+ if ( invalidObjectiveVector() )
+ {
+ throw std::runtime_error("invalid objective vector in MOEO");
+ }
+ return objectiveVectorValue;
+ }
+
+
+ /**
+ * Sets the objective vector of the current solution
+ * @param _objectiveVectorValue the new objective vector
+ */
+ void objectiveVector(const ObjectiveVector & _objectiveVectorValue)
+ {
+ objectiveVectorValue = _objectiveVectorValue;
+ invalidObjectiveVectorValue = false;
+ }
+
+
+ /**
+ * Sets the objective vector as invalid
+ */
+ void invalidateObjectiveVector()
+ {
+ invalidObjectiveVectorValue = true;
+ }
+
+
+ /**
+ * Returns true if the objective vector is invalid, false otherwise
+ */
+ bool invalidObjectiveVector() const
+ {
+ return invalidObjectiveVectorValue;
+ }
+
+
+ /**
+ * Returns the fitness value of the current solution
+ */
+ Fitness fitness() const
+ {
+ if ( invalidFitness() )
+ {
+ throw std::runtime_error("invalid fitness in MOEO");
+ }
+ return fitnessValue;
+ }
+
+
+ /**
+ * Sets the fitness value of the current solution
+ * @param _fitnessValue the new fitness value
+ */
+ void fitness(const Fitness & _fitnessValue)
+ {
+ fitnessValue = _fitnessValue;
+ invalidFitnessValue = false;
+ }
+
+
+ /**
+ * Sets the fitness value as invalid
+ */
+ void invalidateFitness()
+ {
+ invalidFitnessValue = true;
+ }
+
+
+ /**
+ * Returns true if the fitness value is invalid, false otherwise
+ */
+ bool invalidFitness() const
+ {
+ return invalidFitnessValue;
+ }
+
+
+ /**
+ * Returns the diversity value of the current solution
+ */
+ Diversity diversity() const
+ {
+ if ( invalidDiversity() )
+ {
+ throw std::runtime_error("invalid diversity in MOEO");
+ }
+ return diversityValue;
+ }
+
+
+ /**
+ * Sets the diversity value of the current solution
+ * @param _diversityValue the new diversity value
+ */
+ void diversity(const Diversity & _diversityValue)
+ {
+ diversityValue = _diversityValue;
+ invalidDiversityValue = false;
+ }
+
+
+ /**
+ * Sets the diversity value as invalid
+ */
+ void invalidateDiversity()
+ {
+ invalidDiversityValue = true;
+ }
+
+
+ /**
+ * Returns true if the diversity value is invalid, false otherwise
+ */
+ bool invalidDiversity() const
+ {
+ return invalidDiversityValue;
+ }
+
+
+ /**
+ * Sets the objective vector, the fitness value and the diversity value as invalid
+ */
+ void invalidate()
+ {
+ invalidateObjectiveVector();
+ invalidateFitness();
+ invalidateDiversity();
+ }
+
+
+ /**
+ * Returns true if the fitness value is invalid, false otherwise
+ */
+ bool invalid() const
+ {
+ return invalidObjectiveVector();
+ }
+
+
+ /**
+ * Returns true if the objective vector of the current solution is smaller than the objective vector of _other on the first objective,
+ * then on the second, and so on (can be usefull for sorting/printing).
+ * You should implement another function in the sub-class of MOEO to have another sorting mecanism.
+ * @param _other the other MOEO object to compare with
+ */
+ bool operator<(const MOEO & _other) const
+ {
+ return objectiveVector() < _other.objectiveVector();
+ }
+
+
+ /**
+ * Return the class id (the class name as a std::string)
+ */
+ virtual std::string className() const
+ {
+ return "MOEO";
+ }
+
+
+ /**
+ * Writing object
+ * @param _os output stream
+ */
+ virtual void printOn(std::ostream & _os) const
+ {
+ if ( invalidObjectiveVector() )
+ {
+ _os << "INVALID\t";
+ }
+ else
+ {
+ _os << objectiveVectorValue << '\t';
+ }
+ }
+
+
+ /**
+ * Reading object
+ * @param _is input stream
+ */
+ virtual void readFrom(std::istream & _is)
+ {
+ std::string objectiveVector_str;
+ int pos = _is.tellg();
+ _is >> objectiveVector_str;
+ if (objectiveVector_str == "INVALID")
+ {
+ invalidateObjectiveVector();
+ }
+ else
+ {
+ invalidObjectiveVectorValue = false;
+ _is.seekg(pos); // rewind
+ _is >> objectiveVectorValue;
+ }
+ }
+
+
+private:
+
+ /** the objective vector of this solution */
+ ObjectiveVector objectiveVectorValue;
+ /** true if the objective vector is invalid */
+ bool invalidObjectiveVectorValue;
+ /** the fitness value of this solution */
+ Fitness fitnessValue;
+ /** true if the fitness value is invalid */
+ bool invalidFitnessValue;
+ /** the diversity value of this solution */
+ Diversity diversityValue;
+ /** true if the diversity value is invalid */
+ bool invalidDiversityValue;
+
+};
+
+#endif /*MOEO_H_*/
diff --git a/tags/paradiseo-moeo-1.0-beta-26-06-07/src/core/Makefile.am b/tags/paradiseo-moeo-1.0-beta-26-06-07/src/core/Makefile.am
new file mode 100644
index 000000000..8e2a6f0cd
--- /dev/null
+++ b/tags/paradiseo-moeo-1.0-beta-26-06-07/src/core/Makefile.am
@@ -0,0 +1,9 @@
+lib_LIBRARIES = libmoeo.a
+
+libmoeo_a_SOURCES = moeoObjectiveVectorTraits.cpp
+
+pkginclude_HEADERS = moeoObjectiveVectorTraits.h
+
+INCLUDES = -I$(EO_DIR)/src/ -I$(top_srcdir)/src/
+
+AM_CXXFLAGS = -Wall -ansi -pedantic
diff --git a/tags/paradiseo-moeo-1.0-beta-26-06-07/src/core/moeoBitVector.h b/tags/paradiseo-moeo-1.0-beta-26-06-07/src/core/moeoBitVector.h
new file mode 100644
index 000000000..61ed4b7ed
--- /dev/null
+++ b/tags/paradiseo-moeo-1.0-beta-26-06-07/src/core/moeoBitVector.h
@@ -0,0 +1,74 @@
+// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
+
+//-----------------------------------------------------------------------------
+// moeoBitVector.h
+// (c) OPAC Team (LIFL), Dolphin Project (INRIA), 2007
+/*
+ This library...
+
+ Contact: paradiseo-help@lists.gforge.inria.fr, http://paradiseo.gforge.inria.fr
+ */
+//-----------------------------------------------------------------------------
+
+#ifndef MOEOBITVECTOR_H_
+#define MOEOBITVECTOR_H_
+
+#include
+
+/**
+ * This class is an implementationeo of a simple bit-valued moeoVector.
+ */
+template < class MOEOObjectiveVector, class MOEOFitness, class MOEODiversity >
+class moeoBitVector : public moeoVector < MOEOObjectiveVector, MOEOFitness, MOEODiversity, bool >
+{
+public:
+
+ using moeoVector < MOEOObjectiveVector, MOEOFitness, MOEODiversity, bool > :: begin;
+ using moeoVector < MOEOObjectiveVector, MOEOFitness, MOEODiversity, bool > :: end;
+ using moeoVector < MOEOObjectiveVector, MOEOFitness, MOEODiversity, bool > :: resize;
+ using moeoVector < MOEOObjectiveVector, MOEOFitness, MOEODiversity, bool > :: size;
+
+
+ /**
+ * Ctor
+ * @param _size Length of vector (default is 0)
+ * @param _value Initial value of all elements (default is default value of type GeneType)
+ */
+ moeoBitVector(unsigned int _size = 0, bool _value = false) : moeoVector< MOEOObjectiveVector, MOEOFitness, MOEODiversity, bool >(_size, _value)
+ {}
+
+
+ /**
+ * Writing object
+ * @param _os output stream
+ */
+ virtual void printOn(std::ostream & _os) const
+ {
+ MOEO < MOEOObjectiveVector, MOEOFitness, MOEODiversity >::printOn(_os);
+ _os << ' ';
+ _os << size() << ' ';
+ std::copy(begin(), end(), std::ostream_iterator(_os));
+ }
+
+
+ /**
+ * Reading object
+ * @param _is input stream
+ */
+ virtual void readFrom(std::istream & _is)
+ {
+ MOEO < MOEOObjectiveVector, MOEOFitness, MOEODiversity >::readFrom(_is);
+ unsigned int s;
+ _is >> s;
+ std::string bits;
+ _is >> bits;
+ if (_is)
+ {
+ resize(bits.size());
+ std::transform(bits.begin(), bits.end(), begin(), std::bind2nd(std::equal_to(), '1'));
+ }
+ }
+
+};
+
+#endif /*MOEOBITVECTOR_H_*/
diff --git a/tags/paradiseo-moeo-1.0-beta-26-06-07/src/core/moeoEvalFunc.h b/tags/paradiseo-moeo-1.0-beta-26-06-07/src/core/moeoEvalFunc.h
new file mode 100644
index 000000000..1f6b7544d
--- /dev/null
+++ b/tags/paradiseo-moeo-1.0-beta-26-06-07/src/core/moeoEvalFunc.h
@@ -0,0 +1,24 @@
+// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
+
+//-----------------------------------------------------------------------------
+// moeoEvalFunc.h
+// (c) OPAC Team (LIFL), Dolphin Project (INRIA), 2007
+/*
+ This library...
+
+ Contact: paradiseo-help@lists.gforge.inria.fr, http://paradiseo.gforge.inria.fr
+ */
+//-----------------------------------------------------------------------------
+
+#ifndef MOEOEVALFUNC_H_
+#define MOEOEVALFUNC_H_
+
+#include
+
+/*
+ * Functor that evaluates one MOEO by setting all its objective values.
+ */
+template < class MOEOT >
+class moeoEvalFunc : public eoEvalFunc< MOEOT > {};
+
+#endif /*MOEOEVALFUNC_H_*/
diff --git a/tags/paradiseo-moeo-1.0-beta-26-06-07/src/core/moeoObjectiveVector.h b/tags/paradiseo-moeo-1.0-beta-26-06-07/src/core/moeoObjectiveVector.h
new file mode 100644
index 000000000..867f6a3d3
--- /dev/null
+++ b/tags/paradiseo-moeo-1.0-beta-26-06-07/src/core/moeoObjectiveVector.h
@@ -0,0 +1,91 @@
+// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
+
+//-----------------------------------------------------------------------------
+// moeoObjectiveVector.h
+// (c) OPAC Team (LIFL), Dolphin Project (INRIA), 2007
+/*
+ This library...
+
+ Contact: paradiseo-help@lists.gforge.inria.fr, http://paradiseo.gforge.inria.fr
+ */
+//-----------------------------------------------------------------------------
+
+#ifndef MOEOOBJECTIVEVECTOR_H_
+#define MOEOOBJECTIVEVECTOR_H_
+
+#include
+
+/**
+ * Abstract class allowing to represent a solution in the objective space (phenotypic representation).
+ * The template argument ObjectiveVectorTraits defaults to moeoObjectiveVectorTraits,
+ * but it can be replaced at will by any other class that implements the static functions defined therein.
+ * Some static funtions to access to the traits characteristics are re-defined in order not to write a lot of typedef's.
+ */
+template < class ObjectiveVectorTraits, class ObjectiveVectorType >
+class moeoObjectiveVector : public std::vector < ObjectiveVectorType >
+{
+public:
+
+ /** The traits of objective vectors */
+ typedef ObjectiveVectorTraits Traits;
+ /** The type of an objective value */
+ typedef ObjectiveVectorType Type;
+
+
+ /**
+ * Ctor
+ */
+ moeoObjectiveVector(Type _value = Type()) : std::vector < Type > (ObjectiveVectorTraits::nObjectives(), _value)
+ {}
+
+
+ /**
+ * Ctor from a vector of Type
+ * @param _v the std::vector < Type >
+ */
+ moeoObjectiveVector(std::vector < Type > & _v) : std::vector < Type > (_v)
+ {}
+
+
+ /**
+ * Parameters setting (for the objective vector of any solution)
+ * @param _nObjectives the number of objectives
+ * @param _bObjectives the min/max vector (true = min / false = max)
+ */
+ static void setup(unsigned int _nObjectives, std::vector < bool > & _bObjectives)
+ {
+ ObjectiveVectorTraits::setup(_nObjectives, _bObjectives);
+ }
+
+
+ /**
+ * Returns the number of objectives
+ */
+ static unsigned int nObjectives()
+ {
+ return ObjectiveVectorTraits::nObjectives();
+ }
+
+
+ /**
+ * Returns true if the _ith objective have to be minimized
+ * @param _i the index
+ */
+ static bool minimizing(unsigned int _i)
+ {
+ return ObjectiveVectorTraits::minimizing(_i);
+ }
+
+
+ /**
+ * Returns true if the _ith objective have to be maximized
+ * @param _i the index
+ */
+ static bool maximizing(unsigned int _i)
+ {
+ return ObjectiveVectorTraits::maximizing(_i);
+ }
+
+};
+
+#endif /*MOEOOBJECTIVEVECTOR_H_*/
diff --git a/tags/paradiseo-moeo-1.0-beta-26-06-07/src/core/moeoObjectiveVectorDouble.h b/tags/paradiseo-moeo-1.0-beta-26-06-07/src/core/moeoObjectiveVectorDouble.h
new file mode 100644
index 000000000..6b296a69c
--- /dev/null
+++ b/tags/paradiseo-moeo-1.0-beta-26-06-07/src/core/moeoObjectiveVectorDouble.h
@@ -0,0 +1,166 @@
+// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
+
+//-----------------------------------------------------------------------------
+// moeoObjectiveVectorDouble.h
+// (c) OPAC Team (LIFL), Dolphin Project (INRIA), 2007
+/*
+ This library...
+
+ Contact: paradiseo-help@lists.gforge.inria.fr, http://paradiseo.gforge.inria.fr
+ */
+//-----------------------------------------------------------------------------
+
+#ifndef MOEOOBJECTIVEVECTORDOUBLE_H_
+#define MOEOOBJECTIVEVECTORDOUBLE_H_
+
+#include
+#include
+#include
+#include
+#include
+
+/**
+ * This class allows to represent a solution in the objective space (phenotypic representation) by a std::vector of doubles,
+ * i.e. that an objective value is represented using a double, and this for any objective.
+ */
+template < class ObjectiveVectorTraits >
+class moeoObjectiveVectorDouble : public moeoObjectiveVector < ObjectiveVectorTraits, double >
+{
+public:
+
+ using moeoObjectiveVector < ObjectiveVectorTraits, double >::size;
+ using moeoObjectiveVector < ObjectiveVectorTraits, double >::operator[];
+
+ /**
+ * Ctor
+ */
+ moeoObjectiveVectorDouble(double _value = 0.0) : moeoObjectiveVector < ObjectiveVectorTraits, double > (_value)
+ {}
+
+
+ /**
+ * Ctor from a vector of doubles
+ * @param _v the std::vector < double >
+ */
+ moeoObjectiveVectorDouble(std::vector < double > & _v) : moeoObjectiveVector < ObjectiveVectorTraits, double > (_v)
+ {}
+
+
+ /**
+ * Returns true if the current objective vector dominates _other according to the Pareto dominance relation
+ * (but it's better to use a moeoObjectiveVectorComparator object to compare solutions)
+ * @param _other the other moeoObjectiveVectorDouble object to compare with
+ */
+ bool dominates(const moeoObjectiveVectorDouble < ObjectiveVectorTraits > & _other) const
+ {
+ moeoParetoObjectiveVectorComparator < moeoObjectiveVectorDouble > comparator;
+ return comparator(_other, *this);
+ }
+
+
+ /**
+ * Returns true if the current objective vector is equal to _other (according to a tolerance value)
+ * @param _other the other moeoObjectiveVectorDouble object to compare with
+ */
+ bool operator==(const moeoObjectiveVectorDouble < ObjectiveVectorTraits > & _other) const
+ {
+ for (unsigned int i=0; i < size(); i++)
+ {
+ if ( fabs(operator[](i) - _other[i]) > ObjectiveVectorTraits::tolerance() )
+ {
+ return false;
+ }
+ }
+ return true;
+ }
+
+
+ /**
+ * Returns true if the current objective vector is different than _other (according to a tolerance value)
+ * @param _other the other moeoObjectiveVectorDouble object to compare with
+ */
+ bool operator!=(const moeoObjectiveVectorDouble < ObjectiveVectorTraits > & _other) const
+ {
+ return ! operator==(_other);
+ }
+
+
+ /**
+ * Returns true if the current objective vector is smaller than _other on the first objective, then on the second, and so on
+ * (can be usefull for sorting/printing)
+ * @param _other the other moeoObjectiveVectorDouble object to compare with
+ */
+ bool operator<(const moeoObjectiveVectorDouble < ObjectiveVectorTraits > & _other) const
+ {
+ moeoObjectiveObjectiveVectorComparator < moeoObjectiveVectorDouble < ObjectiveVectorTraits > > cmp;
+ return cmp(*this, _other);
+ }
+
+
+ /**
+ * Returns true if the current objective vector is greater than _other on the first objective, then on the second, and so on
+ * (can be usefull for sorting/printing)
+ * @param _other the other moeoObjectiveVectorDouble object to compare with
+ */
+ bool operator>(const moeoObjectiveVectorDouble < ObjectiveVectorTraits > & _other) const
+ {
+ return _other < *this;
+ }
+
+
+ /**
+ * Returns true if the current objective vector is smaller than or equal to _other on the first objective, then on the second, and so on
+ * (can be usefull for sorting/printing)
+ * @param _other the other moeoObjectiveVectorDouble object to compare with
+ */
+ bool operator<=(const moeoObjectiveVectorDouble < ObjectiveVectorTraits > & _other) const
+ {
+ return operator==(_other) || operator<(_other);
+ }
+
+
+ /**
+ * Returns true if the current objective vector is greater than or equal to _other on the first objective, then on the second, and so on
+ * (can be usefull for sorting/printing)
+ * @param _other the other moeoObjectiveVectorDouble object to compare with
+ */
+ bool operator>=(const moeoObjectiveVectorDouble < ObjectiveVectorTraits > & _other) const
+ {
+ return operator==(_other) || operator>(_other);
+ }
+
+};
+
+
+/**
+ * Output for a moeoObjectiveVectorDouble object
+ * @param _os output stream
+ * @param _objectiveVector the objective vector to write
+ */
+template < class ObjectiveVectorTraits >
+std::ostream & operator<<(std::ostream & _os, const moeoObjectiveVectorDouble < ObjectiveVectorTraits > & _objectiveVector)
+{
+ for (unsigned int i=0; i<_objectiveVector.size(); i++)
+ {
+ _os << _objectiveVector[i] << '\t';
+ }
+ return _os;
+}
+
+/**
+ * Input for a moeoObjectiveVectorDouble object
+ * @param _is input stream
+ * @param _objectiveVector the objective vector to read
+ */
+template < class ObjectiveVectorTraits >
+std::istream & operator>>(std::istream & _is, moeoObjectiveVectorDouble < ObjectiveVectorTraits > & _objectiveVector)
+{
+ _objectiveVector = moeoObjectiveVectorDouble < ObjectiveVectorTraits > ();
+ for (unsigned int i=0; i<_objectiveVector.size(); i++)
+ {
+ _is >> _objectiveVector[i];
+ }
+ return _is;
+}
+
+#endif /*MOEOOBJECTIVEVECTORDOUBLE_H_*/
diff --git a/tags/paradiseo-moeo-1.0-beta-26-06-07/src/core/moeoObjectiveVectorTraits.cpp b/tags/paradiseo-moeo-1.0-beta-26-06-07/src/core/moeoObjectiveVectorTraits.cpp
new file mode 100644
index 000000000..84d507fca
--- /dev/null
+++ b/tags/paradiseo-moeo-1.0-beta-26-06-07/src/core/moeoObjectiveVectorTraits.cpp
@@ -0,0 +1,17 @@
+// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
+
+//-----------------------------------------------------------------------------
+// moeoObjectiveVectorTraits.cpp
+// (c) OPAC Team (LIFL), Dolphin Project (INRIA), 2007
+/*
+ This library...
+
+ Contact: paradiseo-help@lists.gforge.inria.fr, http://paradiseo.gforge.inria.fr
+ */
+//-----------------------------------------------------------------------------
+
+#include
+
+// The static variables of the moeoObjectiveVectorTraits class need to be allocated
+unsigned int moeoObjectiveVectorTraits::nObj;
+std::vector < bool > moeoObjectiveVectorTraits::bObj;
diff --git a/tags/paradiseo-moeo-1.0-beta-26-06-07/src/core/moeoObjectiveVectorTraits.h b/tags/paradiseo-moeo-1.0-beta-26-06-07/src/core/moeoObjectiveVectorTraits.h
new file mode 100644
index 000000000..9c51c7463
--- /dev/null
+++ b/tags/paradiseo-moeo-1.0-beta-26-06-07/src/core/moeoObjectiveVectorTraits.h
@@ -0,0 +1,103 @@
+// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
+
+//-----------------------------------------------------------------------------
+// moeoObjectiveVectorTraits.h
+// (c) OPAC Team (LIFL), Dolphin Project (INRIA), 2007
+/*
+ This library...
+
+ Contact: paradiseo-help@lists.gforge.inria.fr, http://paradiseo.gforge.inria.fr
+ */
+//-----------------------------------------------------------------------------
+
+#ifndef MOEOOBJECTIVEVECTORTRAITS_H_
+#define MOEOOBJECTIVEVECTORTRAITS_H_
+
+#include
+#include
+#include
+
+/**
+ * A traits class for moeoObjectiveVector to specify the number of objectives and which ones have to be minimized or maximized.
+ */
+class moeoObjectiveVectorTraits
+{
+public:
+
+ /**
+ * Parameters setting
+ * @param _nObjectives the number of objectives
+ * @param _bObjectives the min/max vector (true = min / false = max)
+ */
+ static void setup(unsigned int _nObjectives, std::vector < bool > & _bObjectives)
+ {
+ // in case the number of objectives was already set to a different value
+ if ( nObj && (nObj != _nObjectives) ) {
+ std::cout << "WARNING\n";
+ std::cout << "WARNING : the number of objectives are changing\n";
+ std::cout << "WARNING : Make sure all existing objects are destroyed\n";
+ std::cout << "WARNING\n";
+ }
+ // number of objectives
+ nObj = _nObjectives;
+ // min/max vector
+ bObj = _bObjectives;
+ // in case the number of objectives and the min/max vector size don't match
+ if (nObj != bObj.size())
+ throw std::runtime_error("Number of objectives and min/max size don't match in moeoObjectiveVectorTraits::setup");
+ }
+
+
+ /**
+ * Returns the number of objectives
+ */
+ static unsigned int nObjectives()
+ {
+ // in case the number of objectives would not be assigned yet
+ if (! nObj)
+ throw std::runtime_error("Number of objectives not assigned in moeoObjectiveVectorTraits");
+ return nObj;
+ }
+
+
+ /**
+ * Returns true if the _ith objective have to be minimized
+ * @param _i the index
+ */
+ static bool minimizing(unsigned int _i)
+ {
+ // in case there would be a wrong index
+ if (_i >= bObj.size())
+ throw std::runtime_error("Wrong index in moeoObjectiveVectorTraits");
+ return bObj[_i];
+ }
+
+
+ /**
+ * Returns true if the _ith objective have to be maximized
+ * @param _i the index
+ */
+ static bool maximizing(unsigned int _i) {
+ return (! minimizing(_i));
+ }
+
+
+ /**
+ * Returns the tolerance value (to compare solutions)
+ */
+ static double tolerance()
+ {
+ return 1e-6;
+ }
+
+
+private:
+
+ /** The number of objectives */
+ static unsigned int nObj;
+ /** The min/max vector */
+ static std::vector < bool > bObj;
+
+};
+
+#endif /*MOEOOBJECTIVEVECTORTRAITS_H_*/
diff --git a/tags/paradiseo-moeo-1.0-beta-26-06-07/src/core/moeoRealVector.h b/tags/paradiseo-moeo-1.0-beta-26-06-07/src/core/moeoRealVector.h
new file mode 100644
index 000000000..9c2816e18
--- /dev/null
+++ b/tags/paradiseo-moeo-1.0-beta-26-06-07/src/core/moeoRealVector.h
@@ -0,0 +1,36 @@
+// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
+
+//-----------------------------------------------------------------------------
+// moeoRealVector.h
+// (c) OPAC Team (LIFL), Dolphin Project (INRIA), 2007
+/*
+ This library...
+
+ Contact: paradiseo-help@lists.gforge.inria.fr, http://paradiseo.gforge.inria.fr
+ */
+//-----------------------------------------------------------------------------
+
+#ifndef MOEOREALVECTOR_H_
+#define MOEOREALVECTOR_H_
+
+#include
+
+/**
+ * This class is an implementation of a simple double-valued moeoVector.
+ */
+template < class MOEOObjectiveVector, class MOEOFitness, class MOEODiversity >
+class moeoRealVector : public moeoVector < MOEOObjectiveVector, MOEOFitness, MOEODiversity, double >
+{
+public:
+
+ /**
+ * Ctor
+ * @param _size Length of vector (default is 0)
+ * @param _value Initial value of all elements (default is default value of type GeneType)
+ */
+ moeoRealVector(unsigned int _size = 0, double _value = 0.0) : moeoVector< MOEOObjectiveVector, MOEOFitness, MOEODiversity, double >(_size, _value)
+ {}
+
+};
+
+#endif /*MOEOREALVECTOR_H_*/
diff --git a/tags/paradiseo-moeo-1.0-beta-26-06-07/src/core/moeoVector.h b/tags/paradiseo-moeo-1.0-beta-26-06-07/src/core/moeoVector.h
new file mode 100644
index 000000000..680306ff6
--- /dev/null
+++ b/tags/paradiseo-moeo-1.0-beta-26-06-07/src/core/moeoVector.h
@@ -0,0 +1,143 @@
+// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
+
+//-----------------------------------------------------------------------------
+// moeoVector.h
+// (c) OPAC Team (LIFL), Dolphin Project (INRIA), 2007
+/*
+ This library...
+
+ Contact: paradiseo-help@lists.gforge.inria.fr, http://paradiseo.gforge.inria.fr
+ */
+//-----------------------------------------------------------------------------
+
+#ifndef MOEOVECTOR_H_
+#define MOEOVECTOR_H_
+
+#include
+#include
+#include
+
+/**
+ * Base class for fixed length chromosomes, just derives from MOEO and std::vector and redirects the smaller than operator to MOEO (objective vector based comparison).
+ * GeneType must have the following methods: void ctor (needed for the std::vector<>), copy ctor.
+ */
+template < class MOEOObjectiveVector, class MOEOFitness, class MOEODiversity, class GeneType >
+class moeoVector : public MOEO < MOEOObjectiveVector, MOEOFitness, MOEODiversity >, public std::vector < GeneType >
+{
+public:
+
+ using MOEO < MOEOObjectiveVector, MOEOFitness, MOEODiversity > :: invalidate;
+ using std::vector < GeneType > :: operator[];
+ using std::vector < GeneType > :: begin;
+ using std::vector < GeneType > :: end;
+ using std::vector < GeneType > :: resize;
+ using std::vector < GeneType > :: size;
+
+ /** the atomic type */
+ typedef GeneType AtomType;
+ /** the container type */
+ typedef std::vector < GeneType > ContainerType;
+
+
+ /**
+ * Default ctor.
+ * @param _size Length of vector (default is 0)
+ * @param _value Initial value of all elements (default is default value of type GeneType)
+ */
+ moeoVector(unsigned int _size = 0, GeneType _value = GeneType()) :
+ MOEO < MOEOObjectiveVector, MOEOFitness, MOEODiversity >(), std::vector(_size, _value)
+ {}
+
+
+ /**
+ * We can't have a Ctor from a std::vector as it would create ambiguity with the copy Ctor.
+ * @param _v a vector of GeneType
+ */
+ void value(const std::vector < GeneType > & _v)
+ {
+ if (_v.size() != size()) // safety check
+ {
+ if (size()) // NOT an initial empty std::vector
+ {
+ std::cout << "Warning: Changing size in moeoVector assignation"<::operator<
+ * @param _moeo the object to compare with
+ */
+ bool operator<(const moeoVector< MOEOObjectiveVector, MOEOFitness, MOEODiversity, GeneType> & _moeo) const
+ {
+ return MOEO < MOEOObjectiveVector, MOEOFitness, MOEODiversity >::operator<(_moeo);
+ }
+
+
+ /**
+ * Writing object
+ * @param _os output stream
+ */
+ virtual void printOn(std::ostream & _os) const
+ {
+ MOEO < MOEOObjectiveVector, MOEOFitness, MOEODiversity >::printOn(_os);
+ _os << ' ';
+ _os << size() << ' ';
+ std::copy(begin(), end(), std::ostream_iterator(_os, " "));
+ }
+
+
+ /**
+ * Reading object
+ * @param _is input stream
+ */
+ virtual void readFrom(std::istream & _is)
+ {
+ MOEO < MOEOObjectiveVector, MOEOFitness, MOEODiversity >::readFrom(_is);
+ unsigned int sz;
+ _is >> sz;
+ resize(sz);
+ unsigned int i;
+ for (i = 0; i < sz; ++i)
+ {
+ AtomType atom;
+ _is >> atom;
+ operator[](i) = atom;
+ }
+ }
+
+};
+
+
+/**
+ * To avoid conflicts between MOEO::operator< and std::vector::operator<
+ * @param _moeo1 the first object to compare
+ * @param _moeo2 the second object to compare
+ */
+template < class MOEOObjectiveVector, class MOEOFitness, class MOEODiversity, class GeneType >
+bool operator<(const moeoVector< MOEOObjectiveVector, MOEOFitness, MOEODiversity, GeneType> & _moeo1, const moeoVector< MOEOObjectiveVector, MOEOFitness, MOEODiversity, GeneType> & _moeo2)
+{
+ return _moeo1.operator<(_moeo2);
+}
+
+
+/**
+ * To avoid conflicts between MOEO::operator> and std::vector::operator>
+ * @param _moeo1 the first object to compare
+ * @param _moeo2 the second object to compare
+ */
+template < class MOEOObjectiveVector, class MOEOFitness, class MOEODiversity, class GeneType >
+bool operator>(const moeoVector< MOEOObjectiveVector, MOEOFitness, MOEODiversity, GeneType> & _moeo1, const moeoVector< MOEOObjectiveVector, MOEOFitness, MOEODiversity, GeneType> & _moeo2)
+{
+ return _moeo1.operator>(_moeo2);
+}
+
+#endif /*MOEOVECTOR_H_*/
diff --git a/tags/paradiseo-moeo-1.0-beta-26-06-07/src/distance/moeoDistance.h b/tags/paradiseo-moeo-1.0-beta-26-06-07/src/distance/moeoDistance.h
new file mode 100644
index 000000000..61b8fb670
--- /dev/null
+++ b/tags/paradiseo-moeo-1.0-beta-26-06-07/src/distance/moeoDistance.h
@@ -0,0 +1,54 @@
+// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
+
+//-----------------------------------------------------------------------------
+// moeoDistance.h
+// (c) OPAC Team (LIFL), Dolphin Project (INRIA), 2007
+/*
+ This library...
+
+ Contact: paradiseo-help@lists.gforge.inria.fr, http://paradiseo.gforge.inria.fr
+ */
+//-----------------------------------------------------------------------------
+
+#ifndef MOEODISTANCE_H_
+#define MOEODISTANCE_H_
+
+#include
+
+/**
+ * The base class for distance computation.
+ */
+template < class MOEOT , class Type >
+class moeoDistance : public eoBF < const MOEOT &, const MOEOT &, const Type >
+{
+public:
+
+ /**
+ * Nothing to do
+ * @param _pop the population
+ */
+ virtual void setup(const eoPop < MOEOT > & _pop)
+ {}
+
+
+ /**
+ * Nothing to do
+ * @param _min lower bound
+ * @param _max upper bound
+ * @param _obj the objective index
+ */
+ virtual void setup(double _min, double _max, unsigned int _obj)
+ {}
+
+
+ /**
+ * Nothing to do
+ * @param _realInterval the eoRealInterval object
+ * @param _obj the objective index
+ */
+ virtual void setup(eoRealInterval _realInterval, unsigned int _obj)
+ {}
+
+};
+
+#endif /*MOEODISTANCE_H_*/
diff --git a/tags/paradiseo-moeo-1.0-beta-26-06-07/src/distance/moeoDistanceMatrix.h b/tags/paradiseo-moeo-1.0-beta-26-06-07/src/distance/moeoDistanceMatrix.h
new file mode 100644
index 000000000..b9a9e924e
--- /dev/null
+++ b/tags/paradiseo-moeo-1.0-beta-26-06-07/src/distance/moeoDistanceMatrix.h
@@ -0,0 +1,76 @@
+// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
+
+//-----------------------------------------------------------------------------
+// moeoDistanceMatrix.h
+// (c) OPAC Team (LIFL), Dolphin Project (INRIA), 2007
+/*
+ This library...
+
+ Contact: paradiseo-help@lists.gforge.inria.fr, http://paradiseo.gforge.inria.fr
+ */
+//-----------------------------------------------------------------------------
+
+#ifndef MOEODISTANCEMATRIX_H_
+#define MOEODISTANCEMATRIX_H_
+
+#include
+#include
+#include
+
+/**
+ * A matrix to compute distances between every pair of individuals contained in a population.
+ */
+template < class MOEOT , class Type >
+class moeoDistanceMatrix : public eoUF < const eoPop < MOEOT > &, void > , public std::vector< std::vector < Type > >
+{
+public:
+
+ using std::vector< std::vector < Type > > :: size;
+ using std::vector< std::vector < Type > > :: operator[];
+
+
+ /**
+ * Ctor
+ * @param _size size for every dimension of the matrix
+ * @param _distance the distance to use
+ */
+ moeoDistanceMatrix (unsigned int _size, moeoDistance < MOEOT , Type > & _distance) : distance(_distance)
+ {
+ this->resize(_size);
+ for (unsigned int i=0; i<_size; i++)
+ {
+ this->operator[](i).resize(_size);
+ }
+ }
+
+
+ /**
+ * Sets the distance between every pair of individuals contained in the population _pop
+ * @param _pop the population
+ */
+ void operator()(const eoPop < MOEOT > & _pop)
+ {
+ // 1 - setup the bounds (if necessary)
+ distance.setup(_pop);
+ // 2 - compute distances
+ this->operator[](0).operator[](0) = Type();
+ for (unsigned int i=0; ioperator[](i).operator[](i) = Type();
+ for (unsigned int j=0; joperator[](i).operator[](j) = distance(_pop[i], _pop[j]);
+ this->operator[](j).operator[](i) = this->operator[](i).operator[](j);
+ }
+ }
+ }
+
+
+private:
+
+ /** the distance to use */
+ moeoDistance < MOEOT , Type > & distance;
+
+};
+
+#endif /*MOEODISTANCEMATRIX_H_*/
diff --git a/tags/paradiseo-moeo-1.0-beta-26-06-07/src/distance/moeoEuclideanDistance.h b/tags/paradiseo-moeo-1.0-beta-26-06-07/src/distance/moeoEuclideanDistance.h
new file mode 100644
index 000000000..2d8d8ec49
--- /dev/null
+++ b/tags/paradiseo-moeo-1.0-beta-26-06-07/src/distance/moeoEuclideanDistance.h
@@ -0,0 +1,58 @@
+// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
+
+//-----------------------------------------------------------------------------
+// moeoEuclideanDistance.h
+// (c) OPAC Team (LIFL), Dolphin Project (INRIA), 2007
+/*
+ This library...
+
+ Contact: paradiseo-help@lists.gforge.inria.fr, http://paradiseo.gforge.inria.fr
+ */
+//-----------------------------------------------------------------------------
+
+#ifndef MOEOEUCLIDEANDISTANCE_H_
+#define MOEOEUCLIDEANDISTANCE_H_
+
+#include
+#include
+
+/**
+ * A class allowing to compute an euclidian distance between two solutions in the objective space with normalized objective values (i.e. between 0 and 1).
+ * A distance value then lies between 0 and sqrt(nObjectives).
+ */
+template < class MOEOT >
+class moeoEuclideanDistance : public moeoNormalizedDistance < MOEOT >
+{
+public:
+
+ /** the objective vector type of the solutions */
+ typedef typename MOEOT::ObjectiveVector ObjectiveVector;
+
+
+ /**
+ * Returns the euclidian distance between _moeo1 and _moeo2 in the objective space
+ * @param _moeo1 the first solution
+ * @param _moeo2 the second solution
+ */
+ const double operator()(const MOEOT & _moeo1, const MOEOT & _moeo2)
+ {
+ double result = 0.0;
+ double tmp1, tmp2;
+ for (unsigned int i=0; i :: bounds;
+
+};
+
+#endif /*MOEOEUCLIDEANDISTANCE_H_*/
diff --git a/tags/paradiseo-moeo-1.0-beta-26-06-07/src/distance/moeoManhattanDistance.h b/tags/paradiseo-moeo-1.0-beta-26-06-07/src/distance/moeoManhattanDistance.h
new file mode 100644
index 000000000..f4c145fe7
--- /dev/null
+++ b/tags/paradiseo-moeo-1.0-beta-26-06-07/src/distance/moeoManhattanDistance.h
@@ -0,0 +1,58 @@
+// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
+
+//-----------------------------------------------------------------------------
+// moeoManhattanDistance.h
+// (c) OPAC Team (LIFL), Dolphin Project (INRIA), 2007
+/*
+ This library...
+
+ Contact: paradiseo-help@lists.gforge.inria.fr, http://paradiseo.gforge.inria.fr
+ */
+//-----------------------------------------------------------------------------
+
+#ifndef MOEOMANHATTANDISTANCE_H_
+#define MOEOMANHATTANDISTANCE_H_
+
+#include
+#include
+
+/**
+ * A class allowing to compute the Manhattan distance between two solutions in the objective space normalized objective values (i.e. between 0 and 1).
+ * A distance value then lies between 0 and nObjectives.
+ */
+template < class MOEOT >
+class moeoManhattanDistance : public moeoNormalizedDistance < MOEOT >
+{
+public:
+
+ /** the objective vector type of the solutions */
+ typedef typename MOEOT::ObjectiveVector ObjectiveVector;
+
+
+ /**
+ * Returns the Manhattan distance between _moeo1 and _moeo2 in the objective space
+ * @param _moeo1 the first solution
+ * @param _moeo2 the second solution
+ */
+ const double operator()(const MOEOT & _moeo1, const MOEOT & _moeo2)
+ {
+ double result = 0.0;
+ double tmp1, tmp2;
+ for (unsigned int i=0; i :: bounds;
+
+};
+
+#endif /*MOEOMANHATTANDISTANCE_H_*/
diff --git a/tags/paradiseo-moeo-1.0-beta-26-06-07/src/distance/moeoNormalizedDistance.h b/tags/paradiseo-moeo-1.0-beta-26-06-07/src/distance/moeoNormalizedDistance.h
new file mode 100644
index 000000000..ee1a2caa8
--- /dev/null
+++ b/tags/paradiseo-moeo-1.0-beta-26-06-07/src/distance/moeoNormalizedDistance.h
@@ -0,0 +1,112 @@
+// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
+
+//-----------------------------------------------------------------------------
+// moeoNormalizedDistance.h
+// (c) OPAC Team (LIFL), Dolphin Project (INRIA), 2007
+/*
+ This library...
+
+ Contact: paradiseo-help@lists.gforge.inria.fr, http://paradiseo.gforge.inria.fr
+ */
+//-----------------------------------------------------------------------------
+
+#ifndef MOEONORMALIZEDDISTANCE_H_
+#define MOEONORMALIZEDDISTANCE_H_
+
+#include
+#include
+#include
+
+/**
+ * The base class for double distance computation with normalized objective values (i.e. between 0 and 1).
+ */
+template < class MOEOT , class Type = double >
+class moeoNormalizedDistance : public moeoDistance < MOEOT , Type >
+{
+public:
+
+ /** the objective vector type of the solutions */
+ typedef typename MOEOT::ObjectiveVector ObjectiveVector;
+
+
+ /**
+ * Default ctr
+ */
+ moeoNormalizedDistance()
+ {
+ bounds.resize(ObjectiveVector::Traits::nObjectives());
+ // initialize bounds in case someone does not want to use them
+ for (unsigned int i=0; i & _pop)
+ {
+ double min, max;
+ for (unsigned int i=0; i bounds;
+
+};
+
+#endif /*MOEONORMALIZEDDISTANCE_H_*/
diff --git a/tags/paradiseo-moeo-1.0-beta-26-06-07/src/diversity/moeoCrowdingDistanceDiversityAssignment.h b/tags/paradiseo-moeo-1.0-beta-26-06-07/src/diversity/moeoCrowdingDistanceDiversityAssignment.h
new file mode 100755
index 000000000..bece3da4f
--- /dev/null
+++ b/tags/paradiseo-moeo-1.0-beta-26-06-07/src/diversity/moeoCrowdingDistanceDiversityAssignment.h
@@ -0,0 +1,122 @@
+// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
+
+//-----------------------------------------------------------------------------
+// moeoCrowdingDistanceDiversityAssignment.h
+// (c) OPAC Team (LIFL), Dolphin Project (INRIA), 2007
+/*
+ This library...
+
+ Contact: paradiseo-help@lists.gforge.inria.fr, http://paradiseo.gforge.inria.fr
+ */
+//-----------------------------------------------------------------------------
+
+#ifndef MOEOCROWDINGDISTANCEDIVERSITYASSIGNMENT_H_
+#define MOEOCROWDINGDISTANCEDIVERSITYASSIGNMENT_H_
+
+#include
+#include
+#include
+
+/**
+ * Diversity assignment sheme based on crowding distance proposed in:
+ * K. Deb, A. Pratap, S. Agarwal, T. Meyarivan, "A Fast and Elitist Multi-Objective Genetic Algorithm: NSGA-II", IEEE Transactions on Evolutionary Computation, vol. 6, no. 2 (2002).
+ */
+template < class MOEOT >
+class moeoCrowdingDistanceDiversityAssignment : public moeoDiversityAssignment < MOEOT >
+{
+public:
+
+ /** the objective vector type of the solutions */
+ typedef typename MOEOT::ObjectiveVector ObjectiveVector;
+
+
+ /**
+ * Returns a big value (regarded as infinite)
+ */
+ double inf() const
+ {
+ return std::numeric_limits::max();
+ }
+
+
+ /**
+ * Returns a very small value that can be used to avoid extreme cases (where the min bound == the max bound)
+ */
+ double tiny() const
+ {
+ return 1e-6;
+ }
+
+
+ /**
+ * Computes diversity values for every solution contained in the population _pop
+ * @param _pop the population
+ */
+ void operator()(eoPop < MOEOT > & _pop)
+ {
+ if (_pop.size() <= 2)
+ {
+ for (unsigned int i=0; i<_pop.size(); i++)
+ {
+ _pop[i].diversity(inf());
+ }
+ }
+ else
+ {
+ setDistances(_pop);
+ }
+ }
+
+
+ /**
+ * @warning NOT IMPLEMENTED, DO NOTHING !
+ * Updates the diversity values of the whole population _pop by taking the deletion of the objective vector _objVec into account.
+ * @param _pop the population
+ * @param _objVec the objective vector
+ * @warning NOT IMPLEMENTED, DO NOTHING !
+ */
+ void updateByDeleting(eoPop < MOEOT > & _pop, ObjectiveVector & _objVec)
+ {
+ std::cout << "WARNING : updateByDeleting not implemented in moeoCrowdingDiversityAssignment" << std::endl;
+ }
+
+
+protected:
+
+ /**
+ * Sets the distance values
+ * @param _pop the population
+ */
+ virtual void setDistances (eoPop < MOEOT > & _pop)
+ {
+ double min, max, distance;
+ unsigned int nObjectives = MOEOT::ObjectiveVector::nObjectives();
+ // set diversity to 0
+ for (unsigned int i=0; i<_pop.size(); i++)
+ {
+ _pop[i].diversity(0);
+ }
+ // for each objective
+ for (unsigned int obj=0; obj objComp(obj);
+ // sort
+ std::sort(_pop.begin(), _pop.end(), objComp);
+ // min & max
+ min = _pop[0].objectiveVector()[obj];
+ max = _pop[_pop.size()-1].objectiveVector()[obj];
+ // set the diversity value to infiny for min and max
+ _pop[0].diversity(inf());
+ _pop[_pop.size()-1].diversity(inf());
+ for (unsigned int i=1; i<_pop.size()-1; i++)
+ {
+ distance = (_pop[i+1].objectiveVector()[obj] - _pop[i-1].objectiveVector()[obj]) / (max-min);
+ _pop[i].diversity(_pop[i].diversity() + distance);
+ }
+ }
+ }
+
+};
+
+#endif /*MOEOCROWDINGDISTANCEDIVERSITYASSIGNMENT_H_*/
diff --git a/tags/paradiseo-moeo-1.0-beta-26-06-07/src/diversity/moeoDiversityAssignment.h b/tags/paradiseo-moeo-1.0-beta-26-06-07/src/diversity/moeoDiversityAssignment.h
new file mode 100644
index 000000000..05151be7a
--- /dev/null
+++ b/tags/paradiseo-moeo-1.0-beta-26-06-07/src/diversity/moeoDiversityAssignment.h
@@ -0,0 +1,51 @@
+// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
+
+//-----------------------------------------------------------------------------
+// moeoDiversityAssignment.h
+// (c) OPAC Team (LIFL), Dolphin Project (INRIA), 2007
+/*
+ This library...
+
+ Contact: paradiseo-help@lists.gforge.inria.fr, http://paradiseo.gforge.inria.fr
+ */
+//-----------------------------------------------------------------------------
+
+#ifndef MOEODIVERSITYASSIGNMENT_H_
+#define MOEODIVERSITYASSIGNMENT_H_
+
+#include
+#include
+
+/**
+ * Functor that sets the diversity values of a whole population.
+ */
+template < class MOEOT >
+class moeoDiversityAssignment : public eoUF < eoPop < MOEOT > &, void >
+{
+public:
+
+ /** The type for objective vector */
+ typedef typename MOEOT::ObjectiveVector ObjectiveVector;
+
+
+ /**
+ * Updates the diversity values of the whole population _pop by taking the deletion of the objective vector _objVec into account.
+ * @param _pop the population
+ * @param _objVec the objective vector
+ */
+ virtual void updateByDeleting(eoPop < MOEOT > & _pop, ObjectiveVector & _objVec) = 0;
+
+
+ /**
+ * Updates the diversity values of the whole population _pop by taking the deletion of the individual _moeo into account.
+ * @param _pop the population
+ * @param _moeo the individual
+ */
+ void updateByDeleting(eoPop < MOEOT > & _pop, MOEOT & _moeo)
+ {
+ updateByDeleting(_pop, _moeo.objectiveVector());
+ }
+
+};
+
+#endif /*MOEODIVERSITYASSIGNMENT_H_*/
diff --git a/tags/paradiseo-moeo-1.0-beta-26-06-07/src/diversity/moeoDummyDiversityAssignment.h b/tags/paradiseo-moeo-1.0-beta-26-06-07/src/diversity/moeoDummyDiversityAssignment.h
new file mode 100644
index 000000000..b7305801c
--- /dev/null
+++ b/tags/paradiseo-moeo-1.0-beta-26-06-07/src/diversity/moeoDummyDiversityAssignment.h
@@ -0,0 +1,59 @@
+// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
+
+//-----------------------------------------------------------------------------
+// moeoDummyDiversityAssignment.h
+// (c) OPAC Team (LIFL), Dolphin Project (INRIA), 2007
+/*
+ This library...
+
+ Contact: paradiseo-help@lists.gforge.inria.fr, http://paradiseo.gforge.inria.fr
+ */
+//-----------------------------------------------------------------------------
+
+#ifndef MOEODUMMYDIVERSITYASSIGNMENT_H_
+#define MOEODUMMYDIVERSITYASSIGNMENT_H_
+
+#include
+
+/**
+ * moeoDummyDiversityAssignment is a moeoDiversityAssignment that gives the value '0' as the individual's diversity for a whole population if it is invalid.
+ */
+template < class MOEOT >
+class moeoDummyDiversityAssignment : public moeoDiversityAssignment < MOEOT >
+{
+public:
+
+ /** The type for objective vector */
+ typedef typename MOEOT::ObjectiveVector ObjectiveVector;
+
+
+ /**
+ * Sets the diversity to '0' for every individuals of the population _pop if it is invalid
+ * @param _pop the population
+ */
+ void operator () (eoPop < MOEOT > & _pop)
+ {
+ for (unsigned int idx = 0; idx<_pop.size (); idx++)
+ {
+ if (_pop[idx].invalidDiversity())
+ {
+ // set the diversity to 0
+ _pop[idx].diversity(0.0);
+ }
+ }
+ }
+
+
+ /**
+ * Updates the diversity values of the whole population _pop by taking the deletion of the objective vector _objVec into account.
+ * @param _pop the population
+ * @param _objVec the objective vector
+ */
+ void updateByDeleting(eoPop < MOEOT > & _pop, ObjectiveVector & _objVec)
+ {
+ // nothing to do... ;-)
+ }
+
+};
+
+#endif /*MOEODUMMYDIVERSITYASSIGNMENT_H_*/
diff --git a/tags/paradiseo-moeo-1.0-beta-26-06-07/src/diversity/moeoFrontByFrontCrowdingDistanceDiversityAssignment.h b/tags/paradiseo-moeo-1.0-beta-26-06-07/src/diversity/moeoFrontByFrontCrowdingDistanceDiversityAssignment.h
new file mode 100644
index 000000000..b4d35ac6e
--- /dev/null
+++ b/tags/paradiseo-moeo-1.0-beta-26-06-07/src/diversity/moeoFrontByFrontCrowdingDistanceDiversityAssignment.h
@@ -0,0 +1,133 @@
+// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
+
+//-----------------------------------------------------------------------------
+// moeoFrontByFrontCrowdingDistanceDiversityAssignment.h
+// (c) OPAC Team (LIFL), Dolphin Project (INRIA), 2007
+/*
+ This library...
+
+ Contact: paradiseo-help@lists.gforge.inria.fr, http://paradiseo.gforge.inria.fr
+ */
+//-----------------------------------------------------------------------------
+
+#ifndef MOEOFRONTBYFRONTCROWDINGDISTANCEDIVERSITYASSIGNMENT_H_
+#define MOEOFRONTBYFRONTCROWDINGDISTANCEDIVERSITYASSIGNMENT_H_
+
+#include
+#include
+
+/**
+ * Diversity assignment sheme based on crowding distance proposed in:
+ * K. Deb, A. Pratap, S. Agarwal, T. Meyarivan, "A Fast and Elitist Multi-Objective Genetic Algorithm: NSGA-II", IEEE Transactions on Evolutionary Computation, vol. 6, no. 2 (2002).
+ * Tis strategy assigns diversity values FRONT BY FRONT. It is, for instance, used in NSGA-II.
+ */
+template < class MOEOT >
+class moeoFrontByFrontCrowdingDistanceDiversityAssignment : public moeoCrowdingDistanceDiversityAssignment < MOEOT >
+{
+public:
+
+ /** the objective vector type of the solutions */
+ typedef typename MOEOT::ObjectiveVector ObjectiveVector;
+
+
+ /**
+ * @warning NOT IMPLEMENTED, DO NOTHING !
+ * Updates the diversity values of the whole population _pop by taking the deletion of the objective vector _objVec into account.
+ * @param _pop the population
+ * @param _objVec the objective vector
+ * @warning NOT IMPLEMENTED, DO NOTHING !
+ */
+ void updateByDeleting(eoPop < MOEOT > & _pop, ObjectiveVector & _objVec)
+ {
+ std::cout << "WARNING : updateByDeleting not implemented in moeoFrontByFrontCrowdingDistanceDiversityAssignment" << std::endl;
+ }
+
+
+private:
+
+ using moeoCrowdingDistanceDiversityAssignment < MOEOT >::inf;
+ using moeoCrowdingDistanceDiversityAssignment < MOEOT >::tiny;
+
+ /**
+ * Sets the distance values
+ * @param _pop the population
+ */
+ void setDistances (eoPop < MOEOT > & _pop)
+ {
+ unsigned int a,b;
+ double min, max, distance;
+ unsigned int nObjectives = MOEOT::ObjectiveVector::nObjectives();
+ // set diversity to 0 for every individual
+ for (unsigned int i=0; i<_pop.size(); i++)
+ {
+ _pop[i].diversity(0.0);
+ }
+ // sort the whole pop according to fitness values
+ moeoFitnessThenDiversityComparator < MOEOT > fitnessComparator;
+ std::sort(_pop.begin(), _pop.end(), fitnessComparator);
+ // compute the crowding distance values for every individual "front" by "front" (front : from a to b)
+ a = 0; // the front starts at a
+ while (a < _pop.size())
+ {
+ b = lastIndex(_pop,a); // the front ends at b
+ // if there is less than 2 individuals in the front...
+ if ((b-a) < 2)
+ {
+ for (unsigned int i=a; i<=b; i++)
+ {
+ _pop[i].diversity(inf());
+ }
+ }
+ // else...
+ else
+ {
+ // for each objective
+ for (unsigned int obj=0; obj objComp(obj);
+ std::sort(_pop.begin()+a, _pop.begin()+b+1, objComp);
+ // min & max
+ min = _pop[b].objectiveVector()[obj];
+ max = _pop[a].objectiveVector()[obj];
+ // avoid extreme case
+ if (min == max)
+ {
+ min -= tiny();
+ max += tiny();
+ }
+ // set the diversity value to infiny for min and max
+ _pop[a].diversity(inf());
+ _pop[b].diversity(inf());
+ // set the diversity values for the other individuals
+ for (unsigned int i=a+1; i & _pop, unsigned int _start)
+ {
+ unsigned int i=_start;
+ while ( (i<_pop.size()-1) && (_pop[i].fitness()==_pop[i+1].fitness()) )
+ {
+ i++;
+ }
+ return i;
+ }
+
+};
+
+#endif /*MOEOFRONTBYFRONTCROWDINGDISTANCEDIVERSITYASSIGNMENT_H_*/
diff --git a/tags/paradiseo-moeo-1.0-beta-26-06-07/src/diversity/moeoFrontByFrontSharingDiversityAssignment.h b/tags/paradiseo-moeo-1.0-beta-26-06-07/src/diversity/moeoFrontByFrontSharingDiversityAssignment.h
new file mode 100644
index 000000000..dea3b342d
--- /dev/null
+++ b/tags/paradiseo-moeo-1.0-beta-26-06-07/src/diversity/moeoFrontByFrontSharingDiversityAssignment.h
@@ -0,0 +1,106 @@
+// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
+
+//-----------------------------------------------------------------------------
+// moeoFrontByFrontSharingDiversityAssignment.h
+// (c) OPAC Team (LIFL), Dolphin Project (INRIA), 2007
+/*
+ This library...
+
+ Contact: paradiseo-help@lists.gforge.inria.fr, http://paradiseo.gforge.inria.fr
+ */
+//-----------------------------------------------------------------------------
+
+#ifndef MOEOFRONTBYFRONTSHARINGDIVERSITYASSIGNMENT_H_
+#define MOEOFRONTBYFRONTSHARINGDIVERSITYASSIGNMENT_H_
+
+#include
+
+/**
+ * Sharing assignment scheme on the way it is used in NSGA.
+ */
+template < class MOEOT >
+class moeoFrontByFrontSharingDiversityAssignment : public moeoSharingDiversityAssignment < MOEOT >
+{
+public:
+
+ /** the objective vector type of the solutions */
+ typedef typename MOEOT::ObjectiveVector ObjectiveVector;
+
+
+ /**
+ * Ctor
+ * @param _distance the distance used to compute the neighborhood of solutions (can be related to the decision space or the objective space)
+ * @param _nicheSize neighborhood size in terms of radius distance (closely related to the way the distances are computed)
+ * @param _alpha parameter used to regulate the shape of the sharing function
+ */
+ moeoFrontByFrontSharingDiversityAssignment(moeoDistance & _distance, double _nicheSize = 0.5, double _alpha = 2.0) : moeoSharingDiversityAssignment < MOEOT >(_distance, _nicheSize, _alpha)
+ {}
+
+
+ /**
+ * Ctor with an euclidean distance (with normalized objective values) in the objective space is used as default
+ * @param _nicheSize neighborhood size in terms of radius distance (closely related to the way the distances are computed)
+ * @param _alpha parameter used to regulate the shape of the sharing function
+ */
+ moeoFrontByFrontSharingDiversityAssignment(double _nicheSize = 0.5, double _alpha = 2.0) : moeoSharingDiversityAssignment < MOEOT >(_nicheSize, _alpha)
+ {}
+
+
+ /**
+ * @warning NOT IMPLEMENTED, DO NOTHING !
+ * Updates the diversity values of the whole population _pop by taking the deletion of the objective vector _objVec into account.
+ * @param _pop the population
+ * @param _objVec the objective vector
+ * @warning NOT IMPLEMENTED, DO NOTHING !
+ */
+ void updateByDeleting(eoPop < MOEOT > & _pop, ObjectiveVector & _objVec)
+ {
+ std::cout << "WARNING : updateByDeleting not implemented in moeoSharingDiversityAssignment" << std::endl;
+ }
+
+
+private:
+
+ using moeoSharingDiversityAssignment < MOEOT >::distance;
+ using moeoSharingDiversityAssignment < MOEOT >::nicheSize;
+ using moeoSharingDiversityAssignment < MOEOT >::sh;
+ using moeoSharingDiversityAssignment < MOEOT >::operator();
+
+
+ /**
+ * Sets similarities FRONT BY FRONT for every solution contained in the population _pop
+ * @param _pop the population
+ */
+ void setSimilarities(eoPop < MOEOT > & _pop)
+ {
+ // compute distances between every individuals
+ moeoDistanceMatrix < MOEOT , double > dMatrix (_pop.size(), distance);
+ dMatrix(_pop);
+ // sets the distance to bigger than the niche size for every couple of solutions that do not belong to the same front
+ for (unsigned int i=0; i<_pop.size(); i++)
+ {
+ for (unsigned int j=0; j
+#include
+#include
+#include
+#include
+#include
+
+/**
+ * Sharing assignment scheme originally porposed by:
+ * D. E. Goldberg, "Genetic Algorithms in Search, Optimization and Machine Learning", Addision-Wesley, MA, USA (1989).
+ */
+template < class MOEOT >
+class moeoSharingDiversityAssignment : public moeoDiversityAssignment < MOEOT >
+{
+public:
+
+ /** the objective vector type of the solutions */
+ typedef typename MOEOT::ObjectiveVector ObjectiveVector;
+
+
+ /**
+ * Ctor
+ * @param _distance the distance used to compute the neighborhood of solutions (can be related to the decision space or the objective space)
+ * @param _nicheSize neighborhood size in terms of radius distance (closely related to the way the distances are computed)
+ * @param _alpha parameter used to regulate the shape of the sharing function
+ */
+ moeoSharingDiversityAssignment(moeoDistance & _distance, double _nicheSize = 0.5, double _alpha = 1.0) : distance(_distance), nicheSize(_nicheSize), alpha(_alpha)
+ {}
+
+
+ /**
+ * Ctor with an euclidean distance (with normalized objective values) in the objective space is used as default
+ * @param _nicheSize neighborhood size in terms of radius distance (closely related to the way the distances are computed)
+ * @param _alpha parameter used to regulate the shape of the sharing function
+ */
+ moeoSharingDiversityAssignment(double _nicheSize = 0.5, double _alpha = 1.0) : distance(defaultDistance), nicheSize(_nicheSize), alpha(_alpha)
+ {}
+
+
+ /**
+ * Sets diversity values for every solution contained in the population _pop
+ * @param _pop the population
+ */
+ void operator()(eoPop < MOEOT > & _pop)
+ {
+ // 1 - set simuilarities
+ setSimilarities(_pop);
+ // 2 - a higher diversity is better, so the values need to be inverted
+ moeoDiversityThenFitnessComparator < MOEOT > divComparator;
+ double max = std::max_element(_pop.begin(), _pop.end(), divComparator)->diversity();
+ for (unsigned int i=0 ; i<_pop.size() ; i++)
+ {
+ _pop[i].diversity(max - _pop[i].diversity());
+ }
+ }
+
+
+ /**
+ * @warning NOT IMPLEMENTED, DO NOTHING !
+ * Updates the diversity values of the whole population _pop by taking the deletion of the objective vector _objVec into account.
+ * @param _pop the population
+ * @param _objVec the objective vector
+ * @warning NOT IMPLEMENTED, DO NOTHING !
+ */
+ void updateByDeleting(eoPop < MOEOT > & _pop, ObjectiveVector & _objVec)
+ {
+ std::cout << "WARNING : updateByDeleting not implemented in moeoSharingDiversityAssignment" << std::endl;
+ }
+
+
+protected:
+
+ /** the distance used to compute the neighborhood of solutions */
+ moeoDistance < MOEOT , double > & distance;
+ /** euclidean distancein the objective space (can be used as default) */
+ moeoEuclideanDistance < MOEOT > defaultDistance;
+ /** neighborhood size in terms of radius distance */
+ double nicheSize;
+ /** parameter used to regulate the shape of the sharing function */
+ double alpha;
+
+
+ /**
+ * Sets similarities for every solution contained in the population _pop
+ * @param _pop the population
+ */
+ virtual void setSimilarities(eoPop < MOEOT > & _pop)
+ {
+ // compute distances between every individuals
+ moeoDistanceMatrix < MOEOT , double > dMatrix (_pop.size(), distance);
+ dMatrix(_pop);
+ // compute similarities
+ double sum;
+ for (unsigned int i=0; i<_pop.size(); i++)
+ {
+ sum = 0.0;
+ for (unsigned int j=0; j<_pop.size(); j++)
+ {
+ sum += sh(dMatrix[i][j]);
+ }
+ _pop[i].diversity(sum);
+ }
+ }
+
+
+ /**
+ * Sharing function
+ * @param _dist the distance value
+ */
+ double sh(double _dist)
+ {
+ double result;
+ if (_dist < nicheSize)
+ {
+ result = 1.0 - pow(_dist / nicheSize, alpha);
+ }
+ else
+ {
+ result = 0.0;
+ }
+ return result;
+ }
+
+};
+
+
+#endif /*MOEOSHARINGDIVERSITYASSIGNMENT_H_*/
diff --git a/tags/paradiseo-moeo-1.0-beta-26-06-07/src/do/make_checkpoint_moeo.h b/tags/paradiseo-moeo-1.0-beta-26-06-07/src/do/make_checkpoint_moeo.h
new file mode 100755
index 000000000..14ea4a336
--- /dev/null
+++ b/tags/paradiseo-moeo-1.0-beta-26-06-07/src/do/make_checkpoint_moeo.h
@@ -0,0 +1,176 @@
+// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
+
+//-----------------------------------------------------------------------------
+// make_checkpoint_moeo.h
+// (c) OPAC Team (LIFL), Dolphin Project (INRIA), 2007
+/*
+ This library...
+
+ Contact: paradiseo-help@lists.gforge.inria.fr, http://paradiseo.gforge.inria.fr
+ */
+//-----------------------------------------------------------------------------
+
+#ifndef MAKE_CHECKPOINT_MOEO_H_
+#define MAKE_CHECKPOINT_MOEO_H_
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+bool testDirRes(std::string _dirName, bool _erase);
+
+/**
+ * This functions allows to build an eoCheckPoint for multi-objective optimization from the parser (partly taken from make_checkpoint_pareto.h)
+ * @param _parser the parser
+ * @param _state to store allocated objects
+ * @param _eval the funtions evaluator
+ * @param _continue the stopping crietria
+ * @param _pop the population
+ * @param _archive the archive of non-dominated solutions
+ */
+template < class MOEOT >
+eoCheckPoint < MOEOT > & do_make_checkpoint_moeo (eoParser & _parser, eoState & _state, eoEvalFuncCounter < MOEOT > & _eval, eoContinue < MOEOT > & _continue, eoPop < MOEOT > & _pop, moeoArchive < MOEOT > & _archive)
+{
+ eoCheckPoint < MOEOT > & checkpoint = _state.storeFunctor(new eoCheckPoint < MOEOT > (_continue));
+ /* the objective vector type */
+ typedef typename MOEOT::ObjectiveVector ObjectiveVector;
+
+ ///////////////////
+ // Counters
+ //////////////////
+ // is nb Eval to be used as counter?
+ //bool useEval = _parser.getORcreateParam(true, "useEval", "Use nb of eval. as counter (vs nb of gen.)", '\0', "Output").value();
+ // Create anyway a generation-counter parameter
+ eoValueParam *generationCounter = new eoValueParam(0, "Gen.");
+ // Create an incrementor (sub-class of eoUpdater).
+ eoIncrementor & increment = _state.storeFunctor( new eoIncrementor(generationCounter->value()) );
+ // Add it to the checkpoint
+ checkpoint.add(increment);
+ // dir for DISK output
+ std::string & dirName = _parser.getORcreateParam(std::string("Res"), "resDir", "Directory to store DISK outputs", '\0', "Output").value();
+ // shoudl we empty it if exists
+ eoValueParam& eraseParam = _parser.getORcreateParam(true, "eraseDir", "erase files in dirName if any", '\0', "Output");
+ bool dirOK = false; // not tested yet
+
+ // Dump of the whole population
+ //-----------------------------
+ bool printPop = _parser.getORcreateParam(false, "printPop", "Print sorted pop. every gen.", '\0', "Output").value();
+ eoSortedPopStat * popStat;
+ if ( printPop ) // we do want pop dump
+ {
+ popStat = & _state.storeFunctor(new eoSortedPopStat);
+ checkpoint.add(*popStat);
+ }
+
+ //////////////////////////////////
+ // State savers
+ //////////////////////////////
+ // feed the state to state savers
+ // save state every N generation
+ eoValueParam& saveFrequencyParam = _parser.createParam((unsigned int)(0), "saveFrequency", "Save every F generation (0 = only final state, absent = never)", '\0', "Persistence" );
+ if (_parser.isItThere(saveFrequencyParam))
+ {
+ // first make sure dirName is OK
+ if (! dirOK )
+ dirOK = testDirRes(dirName, eraseParam.value()); // TRUE
+ unsigned int freq = (saveFrequencyParam.value()>0 ? saveFrequencyParam.value() : UINT_MAX );
+#ifdef _MSVC
+ std::string stmp = dirName + "\generations";
+#else
+ std::string stmp = dirName + "/generations";
+#endif
+ eoCountedStateSaver *stateSaver1 = new eoCountedStateSaver(freq, _state, stmp);
+ _state.storeFunctor(stateSaver1);
+ checkpoint.add(*stateSaver1);
+ }
+ // save state every T seconds
+ eoValueParam& saveTimeIntervalParam = _parser.getORcreateParam((unsigned int)(0), "saveTimeInterval", "Save every T seconds (0 or absent = never)", '\0',"Persistence" );
+ if (_parser.isItThere(saveTimeIntervalParam) && saveTimeIntervalParam.value()>0)
+ {
+ // first make sure dirName is OK
+ if (! dirOK )
+ dirOK = testDirRes(dirName, eraseParam.value()); // TRUE
+#ifdef _MSVC
+ std::string stmp = dirName + "\time";
+#else
+ std::string stmp = dirName + "/time";
+#endif
+ eoTimedStateSaver *stateSaver2 = new eoTimedStateSaver(saveTimeIntervalParam.value(), _state, stmp);
+ _state.storeFunctor(stateSaver2);
+ checkpoint.add(*stateSaver2);
+ }
+
+ ///////////////////
+ // Archive
+ //////////////////
+ // update the archive every generation
+ bool updateArch = _parser.getORcreateParam(true, "updateArch", "Update the archive at each gen.", '\0', "Evolution Engine").value();
+ if (updateArch)
+ {
+ moeoArchiveUpdater < MOEOT > * updater = new moeoArchiveUpdater < MOEOT > (_archive, _pop);
+ _state.storeFunctor(updater);
+ checkpoint.add(*updater);
+ }
+ // store the objective vectors contained in the archive every generation
+ bool storeArch = _parser.getORcreateParam(false, "storeArch", "Store the archive's objective vectors at each gen.", '\0', "Output").value();
+ if (storeArch)
+ {
+ if (! dirOK )
+ dirOK = testDirRes(dirName, eraseParam.value()); // TRUE
+#ifdef _MSVC
+ std::string stmp = dirName + "\arch";
+#else
+ std::string stmp = dirName + "/arch";
+#endif
+ moeoArchiveObjectiveVectorSavingUpdater < MOEOT > * save_updater = new moeoArchiveObjectiveVectorSavingUpdater < MOEOT > (_archive, stmp);
+ _state.storeFunctor(save_updater);
+ checkpoint.add(*save_updater);
+ }
+ // store the contribution of the non-dominated solutions
+ bool cont = _parser.getORcreateParam(false, "contribution", "Store the contribution of the archive at each gen.", '\0', "Output").value();
+ if (cont)
+ {
+ if (! dirOK )
+ dirOK = testDirRes(dirName, eraseParam.value()); // TRUE
+#ifdef _MSVC
+ std::string stmp = dirName + "\contribution";
+#else
+ std::string stmp = dirName + "/contribution";
+#endif
+ moeoContributionMetric < ObjectiveVector > * contribution = new moeoContributionMetric < ObjectiveVector >;
+ moeoBinaryMetricSavingUpdater < MOEOT > * contribution_updater = new moeoBinaryMetricSavingUpdater < MOEOT > (*contribution, _archive, stmp);
+ _state.storeFunctor(contribution_updater);
+ checkpoint.add(*contribution_updater);
+ }
+ // store the entropy of the non-dominated solutions
+ bool ent = _parser.getORcreateParam(false, "entropy", "Store the entropy of the archive at each gen.", '\0', "Output").value();
+ if (ent)
+ {
+ if (! dirOK )
+ dirOK = testDirRes(dirName, eraseParam.value()); // TRUE
+#ifdef _MSVC
+ std::string stmp = dirName + "\entropy";
+#else
+ std::string stmp = dirName + "/entropy";
+#endif
+ moeoEntropyMetric < ObjectiveVector > * entropy = new moeoEntropyMetric < ObjectiveVector >;
+ moeoBinaryMetricSavingUpdater < MOEOT > * entropy_updater = new moeoBinaryMetricSavingUpdater < MOEOT > (*entropy, _archive, stmp);
+ _state.storeFunctor(entropy_updater);
+ checkpoint.add(*entropy_updater);
+ }
+
+ // and that's it for the (control and) output
+ return checkpoint;
+}
+
+#endif /*MAKE_CHECKPOINT_MOEO_H_*/
diff --git a/tags/paradiseo-moeo-1.0-beta-26-06-07/src/do/make_continue_moeo.h b/tags/paradiseo-moeo-1.0-beta-26-06-07/src/do/make_continue_moeo.h
new file mode 100755
index 000000000..66ebf0501
--- /dev/null
+++ b/tags/paradiseo-moeo-1.0-beta-26-06-07/src/do/make_continue_moeo.h
@@ -0,0 +1,106 @@
+// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
+
+//-----------------------------------------------------------------------------
+// make_continue_moeo.h
+// (c) OPAC Team (LIFL), Dolphin Project (INRIA), 2007
+/*
+ This library...
+
+ Contact: paradiseo-help@lists.gforge.inria.fr, http://paradiseo.gforge.inria.fr
+ */
+//-----------------------------------------------------------------------------
+
+#ifndef MAKE_CONTINUE_MOEO_H_
+#define MAKE_CONTINUE_MOEO_H_
+
+#include
+#include
+#include
+#include
+#include
+#ifndef _MSC_VER
+#include
+#endif
+#include
+#include
+
+
+/**
+ * Helper function
+ * @param _combined the eoCombinedContinue object
+ * @param _cont the eoContinue to add
+ */
+template
+eoCombinedContinue * make_combinedContinue(eoCombinedContinue *_combined, eoContinue *_cont)
+{
+ if (_combined) // already exists
+ _combined->add(*_cont);
+ else
+ _combined = new eoCombinedContinue(*_cont);
+ return _combined;
+}
+
+
+/**
+ * This functions allows to build a eoContinue for multi-objective optimization from the parser (partly taken from make_continue_pareto.h)
+ * @param _parser the parser
+ * @param _state to store allocated objects
+ * @param _eval the funtions evaluator
+ */
+template
+eoContinue & do_make_continue_moeo(eoParser& _parser, eoState& _state, eoEvalFuncCounter & _eval)
+{
+ // the combined continue - to be filled
+ eoCombinedContinue *continuator = NULL;
+ // First the eoGenContinue - need a default value so you can run blind
+ // but we also need to be able to avoid it <--> 0
+ eoValueParam& maxGenParam = _parser.createParam((unsigned int)(100), "maxGen", "Maximum number of generations (0 = none)",'G',"Stopping criterion");
+ if (maxGenParam.value()) // positive: -> define and store
+ {
+ eoGenContinue *genCont = new eoGenContinue(maxGenParam.value());
+ _state.storeFunctor(genCont);
+ // and "add" to combined
+ continuator = make_combinedContinue(continuator, genCont);
+ }
+ // maxEval
+ eoValueParam& maxEvalParam = _parser.getORcreateParam((unsigned long)(0), "maxEval", "Maximum number of evaluations (0 = none)", 'E', "Stopping criterion");
+ if (maxEvalParam.value())
+ {
+ eoEvalContinue *evalCont = new eoEvalContinue(_eval, maxEvalParam.value());
+ _state.storeFunctor(evalCont);
+ // and "add" to combined
+ continuator = make_combinedContinue(continuator, evalCont);
+ }
+ // maxTime
+ eoValueParam& maxTimeParam = _parser.getORcreateParam((unsigned long)(0), "maxTime", "Maximum running time in seconds (0 = none)", 'T', "Stopping criterion");
+ if (maxTimeParam.value()) // positive: -> define and store
+ {
+ eoTimeContinue *timeCont = new eoTimeContinue(maxTimeParam.value());
+ _state.storeFunctor(timeCont);
+ // and "add" to combined
+ continuator = make_combinedContinue(continuator, timeCont);
+ }
+ // CtrlC
+#ifndef _MSC_VER
+ // the CtrlC interception (Linux only I'm afraid)
+ eoCtrlCContinue *ctrlCCont;
+ eoValueParam& ctrlCParam = _parser.createParam(true, "CtrlC", "Terminate current generation upon Ctrl C",'C', "Stopping criterion");
+ if (_parser.isItThere(ctrlCParam))
+ {
+ ctrlCCont = new eoCtrlCContinue;
+ // store
+ _state.storeFunctor(ctrlCCont);
+ // add to combinedContinue
+ continuator = make_combinedContinue(continuator, ctrlCCont);
+ }
+#endif
+ // now check that there is at least one!
+ if (!continuator)
+ throw std::runtime_error("You MUST provide a stopping criterion");
+ // OK, it's there: store in the eoState
+ _state.storeFunctor(continuator);
+ // and return
+ return *continuator;
+}
+
+#endif /*MAKE_CONTINUE_MOEO_H_*/
diff --git a/tags/paradiseo-moeo-1.0-beta-26-06-07/src/do/make_ea_moeo.h b/tags/paradiseo-moeo-1.0-beta-26-06-07/src/do/make_ea_moeo.h
new file mode 100755
index 000000000..bd624cc17
--- /dev/null
+++ b/tags/paradiseo-moeo-1.0-beta-26-06-07/src/do/make_ea_moeo.h
@@ -0,0 +1,272 @@
+// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
+
+//-----------------------------------------------------------------------------
+// make_ea_moeo.h
+// (c) OPAC Team (LIFL), Dolphin Project (INRIA), 2007
+/*
+ This library...
+
+ Contact: paradiseo-help@lists.gforge.inria.fr, http://paradiseo.gforge.inria.fr
+ */
+//-----------------------------------------------------------------------------
+
+#ifndef MAKE_EA_MOEO_H_
+#define MAKE_EA_MOEO_H_
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include