diff --git a/branches/paradiseo-peo-meta-model/AUTHORS b/branches/paradiseo-peo-meta-model/AUTHORS new file mode 100644 index 000000000..42976e9ee --- /dev/null +++ b/branches/paradiseo-peo-meta-model/AUTHORS @@ -0,0 +1,2 @@ +Sébastien Cahon +Alexandru-Adrian Tantar diff --git a/branches/paradiseo-peo-meta-model/CMakeLists.txt b/branches/paradiseo-peo-meta-model/CMakeLists.txt new file mode 100644 index 000000000..86eee5ea0 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/CMakeLists.txt @@ -0,0 +1,150 @@ + +###################################################################################### +### 0) Preliminary checking: no WIN and libxml2 +###################################################################################### + +IF(WIN32) + MESSAGE (FATAL_ERROR "ParadisEO-PEO can not be generated on Windows systems") +ENDIF(WIN32) + +# check libxml2 +FIND_PROGRAM(XML2_CONFIG_PROGRAM NAMES xml2-config PATHS /usr/local/bin /usr/bin DOC "The libxml2 (www.xmlsoft.org) configuration tool") + +IF(NOT XML2_CONFIG_PROGRAM) + MESSAGE(FATAL_ERROR "Libxml2 cannot be found on your system. Libxml2 is required for ParadisEO-PEO install") +ENDIF(NOT XML2_CONFIG_PROGRAM) + +# set libxml2 cflags in XML2_CFLAGS +EXECUTE_PROCESS(COMMAND ${XML2_CONFIG_PROGRAM} --cflags OUTPUT_VARIABLE XML2_CFLAGS OUTPUT_STRIP_TRAILING_WHITESPACE) +SET(XML2_CFLAGS_WITH_WHITESPACE " ${XML2_CFLAGS}") + +# set libxml2 libs in XML2_LIBS +EXECUTE_PROCESS(COMMAND ${XML2_CONFIG_PROGRAM} --libs OUTPUT_VARIABLE XML2_LIBS OUTPUT_STRIP_TRAILING_WHITESPACE) +###################################################################################### + + +###################################################################################### +### 1) If you want to set your variables in moeo-conf.cmake and avoid the cmd line +###################################################################################### + +INCLUDE(peo-conf.cmake OPTIONAL) + +###################################################################################### + + +###################################################################################### +### 2) Main project config +###################################################################################### + +# set the project name +PROJECT(ParadisEO-PEO) + +# check cmake version compatibility +CMAKE_MINIMUM_REQUIRED(VERSION 2.4 FATAL_ERROR) + +# regular expression checking +INCLUDE_REGULAR_EXPRESSION("^.*$" "^$") + +# set a language for the entire project. +ENABLE_LANGUAGE(CXX) +ENABLE_LANGUAGE(C) + +##################################################################################### + + +##################################################################################### +### 3) Include required modules +##################################################################################### +INCLUDE(CMakeBackwardCompatibilityCXX) + +INCLUDE(FindDoxygen) + +INCLUDE(FindGnuplot) + +# check for some functions +INCLUDE(CheckLibraryExists) + +###################################################################################### + + +###################################################################################### +### 4) SET main paths (can be defined in peo-conf.cmake) +###################################################################################### + +IF(NOT DEFINED PEO_DIR) + SET(PEO_DIR ${ParadisEO-PEO_SOURCE_DIR} CACHE PATH "ParadisEO-PEO main directory") +ENDIF(NOT DEFINED PEO_DIR) + +# Need main EO directory path +IF(NOT DEFINED EO_DIR OR NOT EO_DIR) + SET(EO_DIR ${EOdir} CACHE PATH "ParadisEO-EO main directory" FORCE) # given on the command line +ELSE(NOT DEFINED EO_DIR OR NOT EO_DIR) + MESSAGE(STATUS "EOdir already defined as ${EO_DIR}") +ENDIF(NOT DEFINED EO_DIR OR NOT EO_DIR) + +# Set the main paths for EO +IF(NOT DEFINED EO_SRC_DIR) + SET(EO_SRC_DIR "${EO_DIR}/src") +ENDIF(NOT DEFINED EO_SRC_DIR) + +# Need main MO directory path +IF(NOT DEFINED MO_DIR OR NOT MO_DIR) + SET(MO_DIR ${MOdir} CACHE PATH "ParadisMO-MO main directory" FORCE) # given on the command line +ELSE(NOT DEFINED MO_DIR OR NOT MO_DIR) + MESSAGE(STATUS "MOdir already defined as ${MO_DIR}") +ENDIF(NOT DEFINED MO_DIR OR NOT MO_DIR) + +# Set the main paths for MO +IF(NOT DEFINED MO_SRC_DIR) + SET(MO_SRC_DIR "${MO_DIR}/src") +ENDIF(NOT DEFINED MO_SRC_DIR) + +IF(NOT DEFINED PEO_SRC_DIR) + SET(PEO_SRC_DIR ${PEO_DIR}/src) +ENDIF(NOT DEFINED PEO_SRC_DIR) + +IF(NOT DEFINED PEO_DOC_DIR) + SET(PEO_DOC_DIR ${PEO_DIR}/doc) +ENDIF(NOT DEFINED PEO_DOC_DIR) +###################################################################################### + + +###################################################################################### +### 5) Paths checking +###################################################################################### +IF(EXISTS ${EO_DIR}) + MESSAGE (STATUS "Using ParadisEO-EO path: ${EO_DIR}") +ELSE(EXISTS ${EO_DIR}) + MESSAGE (FATAL_ERROR "Could not find the ParadisEO-EO path: ${EO_DIR}. You should use : cmake . -DEOdir= -DMOdir=") +ENDIF(EXISTS ${EO_DIR}) + +# Is it an absolute path ? +SET (ABSOLUTE_PATH_REGEX "^/") +IF(NOT ${EO_DIR} MATCHES "${ABSOLUTE_PATH_REGEX}") + MESSAGE (FATAL_ERROR "${EO_DIR} MUST BE an absolute path") +ENDIF(NOT ${EO_DIR} MATCHES "${ABSOLUTE_PATH_REGEX}") + +SET(EO_LIB_DIR "${EO_DIR}/src") + + +IF(EXISTS ${MO_DIR}) + MESSAGE (STATUS "Using ParadisMO-MO path: ${MO_DIR}") +ELSE(EXISTS ${MO_DIR}) + MESSAGE (FATAL_ERROR "Could not find the ParadisMO-MO path: ${MO_DIR}. You should use : cmake . -DEOdir= -DMOdir=") +ENDIF(EXISTS ${MO_DIR}) + +# Is it an absolute path ? +SET (ABSOLUTE_PATH_REGEX "^/") +IF(NOT ${MO_DIR} MATCHES "${ABSOLUTE_PATH_REGEX}") + MESSAGE (FATAL_ERROR "${MO_DIR} MUST BE an absolute path") +ENDIF(NOT ${MO_DIR} MATCHES "${ABSOLUTE_PATH_REGEX}") +###################################################################################### + + +###################################################################################### +### 6) Where must cmake go now ? +###################################################################################### + +SUBDIRS(doc src tutorial) + +###################################################################################### diff --git a/branches/paradiseo-peo-meta-model/README b/branches/paradiseo-peo-meta-model/README new file mode 100755 index 000000000..5ff232eba --- /dev/null +++ b/branches/paradiseo-peo-meta-model/README @@ -0,0 +1,81 @@ + PARADISEO-PEO README FILE +======================================================================= + check latest news at http://paradiseo.gforge.inria.fr/ +======================================================================= + +Welcome to ParadisEO-PEO, the Parallel Evolving Objects library. +The latest news about ParadisEO-PEO 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-PEO +======================================================================= +The basic installation procedure goes the following. + +To compile paradiseo-peo in the default directory, +go to paradiseo-peo/build/ and run: + > cmake ../ -DEOdir=$(EO_SRC) -DMOdir=$(MO_SRC) + > make + // for an easy-use of the provided lessons + > make install + // optional (if the documentation is not already available) + > make doc + +To compile paradiseo-peo anywhere else, simply run: + > cmake $(PEO) -DEOdir=$(EO_SRC) -DMOdir=$(MO_SRC) + > make + // for an easy-use of the provided lessons + > make install + // optional (if the documentation is not already available) + > make doc + +where $(EO_SRC) is the top-level source directory of PARADISEO-EO, +and $(MO) is the top-level directory of PARADISEO-MO. + +To clean everything, simply run + > make clean + + +=================================================================== + DIRECTORY STRUCTURE +=================================================================== +After unpacking the archive file, you should end up with the following +structure: + +.../ The main PARADISEO-PEO directory, created when unpacking. + | + +-- build BUILD directory that contains libraries and executable files. + | + +-- src SOURCE directory Contains most PARADISEO-PEO .h files. + | + +-- doc 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. + | + | + +-- tutorial APPLICATIONS - one directory per separate application. + | + +-- examples Examples repository including source code shared by all or most of the included lessons. + | | + | +- tsp A Traveling Salesman Problem (TSP) example with benchmarks, the main operators, definitions, etc. + | + +-- Lesson1 A simple ParadisEO-PEO evolutionary algorithm example using the peoEA class. + | + +-- Lesson2 Example of an EA featuring a parallel evaluation of the population/parallel fitness function evaluation. + | + +-- Lesson3 Example of an asynchronous insular model including two evolutionary algorithms. + | + +-- Walkthrough Walkthrough ParadisEO-PEO features - EA+LS hybridization, parallelization, insular model. + +=================================================================== + NOTES +=================================================================== + +Mailing list : paradiseo-help@lists.gforge.inria.fr diff --git a/branches/paradiseo-peo-meta-model/doc/CMakeLists.txt b/branches/paradiseo-peo-meta-model/doc/CMakeLists.txt new file mode 100644 index 000000000..6a72254d3 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/CMakeLists.txt @@ -0,0 +1,38 @@ + +### ParadisEO-PEO Doc generation using Doxygen ### + +# Find the Doxygen package - will set all the variables required to use Doxygen +FIND_PACKAGE(Doxygen) + +IF (DOXYGEN_FOUND) + +SET(PEO_DOC_COMMENT "ParadisEO-PEO framework documentation") +SET(DOXYGEN_INPUT "paradiseo-peo.doxyfile") +SET(DOXYGEN_OUTPUT "ParadisEO-PEO documentation") + +ADD_CUSTOM_COMMAND( + OUTPUT ${DOXYGEN_OUTPUT} + COMMAND ${CMAKE_COMMAND} -E echo_append "Building documentation from ${PEO_DOC_DIR} ..." + COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_INPUT} + COMMAND ${CMAKE_COMMAND} -E echo "Done." + WORKING_DIRECTORY ${PEO_DOC_DIR} + COMMENT ${PEO_DOC_COMMENT} + DEPENDS ${DOXYGEN_INPUT} + ) + +# The main target launched with "make doc" +ADD_CUSTOM_TARGET(doc DEPENDS ${DOXYGEN_OUTPUT}) + +# A forced additionnal target that generate the documentation in the current directory +ADD_CUSTOM_TARGET(doc_forced + COMMAND ${CMAKE_COMMAND} -E echo_append "Building documentation from current directory ..." + COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_INPUT} + COMMAND ${CMAKE_COMMAND} -E echo " Done." + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) + +ELSE (DOXYGEN_FOUND) + MESSAGE(STATUS "Unable to generate the document, Doxygen package not found") +ENDIF (DOXYGEN_FOUND) + + + diff --git a/branches/paradiseo-peo-meta-model/doc/html/annotated.html b/branches/paradiseo-peo-meta-model/doc/html/annotated.html new file mode 100644 index 000000000..e51f0fa90 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/annotated.html @@ -0,0 +1,61 @@ + + +ParadisEO-PEO: Class List + + + + +
+
+ +

ParadisEO-PEO Class List

Here are the classes, structs, unions and interfaces with brief descriptions: + + + + + + + + + + + + + + + + + + + + + + + +
Communicable
Communicator
Cooperative
peoAggEvalFunc< EOT >The peoAggEvalFunc class offers only the interface for creating aggregate evaluation functions - there are no direct internal functions provided
peoAsyncIslandMig< EOT >The peoAsyncIslandMig class offers the elementary basis for implementating an asynchronous island migration model - requires the specification of several basic parameters, i.e
peoEA< EOT >The peoEA class offers an elementary evolutionary algorithm implementation
peoNoAggEvalFunc< EOT >The peoNoAggEvalFunc class does nothing more than an association between a fitness value and a specified individual
peoParaPopEval< EOT >The peoParaPopEval represents a wrapper for creating a functor capable of applying in parallel an EO-derived evaluation functor
peoParaSGATransform< EOT >
peoPopEval< EOT >The peoPopEval class provides the interface for constructing ParadisEO specific evaluation functors
peoSeqPopEval< EOT >The peoSeqPopEval class acts only as a ParadisEO specific sequential evaluation functor - a wrapper for incorporating an eoEvalFunc< EOT >-derived class as evaluation functor
peoSeqTransform< EOT >The peoSeqTransform represent a wrapper for offering the possibility of using EO derived transform operators along with the ParadisEO evolutionary algorithms
peoSyncIslandMig< EOT >The peoSyncIslandMig class offers the elementary basis for implementating a synchronous island migration model - requires the specification of several basic parameters, i.e
peoSyncMultiStart< EOT >The peoSyncMultiStart class provides the basis for implementing the synchronous multi-start model, for launching several solution-based algorithms in parallel on a specified initial population
peoTransform< EOT >The peoTransform class acts only as an interface for creating transform operators - for an example please refer to the peoSeqTransform and the peoParaSGATransform classes
ReactiveThread
RingTopology
Runner
SEND_REQUEST
Service
Thread
Topology
Worker
+
Generated on Thu Jul 5 13:43:30 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/classCommunicable-members.html b/branches/paradiseo-peo-meta-model/doc/html/classCommunicable-members.html new file mode 100644 index 000000000..d9acf5532 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/classCommunicable-members.html @@ -0,0 +1,48 @@ + + +ParadisEO-PEO: Member List + + + + +
+
+ +

Communicable Member List

This is the complete list of members for Communicable, including all inherited members.

+ + + + + + + + + + + +
Communicable()Communicable
getKey()Communicable
keyCommunicable [protected]
lock()Communicable
num_commCommunicable [protected, static]
resume()Communicable
sem_lockCommunicable [protected]
sem_stopCommunicable [protected]
stop()Communicable
unlock()Communicable
~Communicable()Communicable [virtual]


Generated on Thu Jul 5 13:43:30 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/classCommunicable.html b/branches/paradiseo-peo-meta-model/doc/html/classCommunicable.html new file mode 100644 index 000000000..541d9bc60 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/classCommunicable.html @@ -0,0 +1,100 @@ + + +ParadisEO-PEO: Communicable Class Reference + + + + +
+
+ +

Communicable Class Reference

Inheritance diagram for Communicable: +

+ +Cooperative +Runner +Service +Worker +peoAsyncIslandMig< EOT > +peoSyncIslandMig< EOT > +peoEA< EOT > +peoPopEval< EOT > +peoSyncMultiStart< EOT > +peoTransform< EOT > +peoParaPopEval< EOT > +peoSeqPopEval< EOT > +peoParaSGATransform< EOT > +peoSeqTransform< EOT > + +List of all members. + + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Member Functions

Communicable ()
+virtual ~Communicable ()
+COMM_ID getKey ()
+void lock ()
+void unlock ()
+void stop ()
+void resume ()

Protected Attributes

+COMM_ID key
+sem_t sem_lock
+sem_t sem_stop

Static Protected Attributes

+static unsigned num_comm = 0
+

Detailed Description

+ +

+ +

+Definition at line 16 of file communicable.h.


The documentation for this class was generated from the following files: +
Generated on Thu Jul 5 13:43:30 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/classCommunicable.png b/branches/paradiseo-peo-meta-model/doc/html/classCommunicable.png new file mode 100644 index 000000000..a229e7068 Binary files /dev/null and b/branches/paradiseo-peo-meta-model/doc/html/classCommunicable.png differ diff --git a/branches/paradiseo-peo-meta-model/doc/html/classCommunicator-members.html b/branches/paradiseo-peo-meta-model/doc/html/classCommunicator-members.html new file mode 100644 index 000000000..997ea5e08 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/classCommunicator-members.html @@ -0,0 +1,46 @@ + + +ParadisEO-PEO: Member List + + + + +
+
+ +

Communicator Member List

This is the complete list of members for Communicator, including all inherited members.

+ + + + + + + + + +
Communicator(int *__argc, char ***__argv)Communicator
ReactiveThread()ReactiveThread
setActive()Thread
setPassive()Thread
sleep()ReactiveThread
start()Communicator [virtual]
Thread()Thread
wakeUp()ReactiveThread
~Thread()Thread [virtual]


Generated on Thu Jul 5 13:43:30 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/classCommunicator.html b/branches/paradiseo-peo-meta-model/doc/html/classCommunicator.html new file mode 100644 index 000000000..2a223b44c --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/classCommunicator.html @@ -0,0 +1,59 @@ + + +ParadisEO-PEO: Communicator Class Reference + + + + +
+
+ +

Communicator Class Reference

Inheritance diagram for Communicator: +

+ +ReactiveThread +Thread + +List of all members. + + + + + + +

Public Member Functions

Communicator (int *__argc, char ***__argv)
+void start ()
+

Detailed Description

+ +

+ +

+Definition at line 15 of file comm.h.


The documentation for this class was generated from the following files: +
Generated on Thu Jul 5 13:43:30 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/classCommunicator.png b/branches/paradiseo-peo-meta-model/doc/html/classCommunicator.png new file mode 100644 index 000000000..0f0ce225b Binary files /dev/null and b/branches/paradiseo-peo-meta-model/doc/html/classCommunicator.png differ diff --git a/branches/paradiseo-peo-meta-model/doc/html/classCooperative-members.html b/branches/paradiseo-peo-meta-model/doc/html/classCooperative-members.html new file mode 100644 index 000000000..37d0a7b7b --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/classCooperative-members.html @@ -0,0 +1,53 @@ + + +ParadisEO-PEO: Member List + + + + +
+
+ +

Cooperative Member List

This is the complete list of members for Cooperative, including all inherited members.

+ + + + + + + + + + + + + + + + +
Communicable()Communicable
getKey()Communicable
getOwner()Cooperative
keyCommunicable [protected]
lock()Communicable
notifySending()Cooperative [virtual]
num_commCommunicable [protected, static]
ownerCooperative [private]
resume()Communicable
sem_lockCommunicable [protected]
sem_stopCommunicable [protected]
send(Cooperative *__coop)Cooperative
setOwner(Runner &__runner)Cooperative
stop()Communicable
unlock()Communicable
~Communicable()Communicable [virtual]


Generated on Thu Jul 5 13:43:30 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/classCooperative.html b/branches/paradiseo-peo-meta-model/doc/html/classCooperative.html new file mode 100644 index 000000000..a52bd0cd9 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/classCooperative.html @@ -0,0 +1,70 @@ + + +ParadisEO-PEO: Cooperative Class Reference + + + + +
+
+ +

Cooperative Class Reference

Inheritance diagram for Cooperative: +

+ +Communicable +peoAsyncIslandMig< EOT > +peoSyncIslandMig< EOT > + +List of all members. + + + + + + + + + + + + + +

Public Member Functions

+RunnergetOwner ()
+void setOwner (Runner &__runner)
+void send (Cooperative *__coop)
+virtual void notifySending ()

Private Attributes

+Runnerowner
+

Detailed Description

+ +

+ +

+Definition at line 17 of file cooperative.h.


The documentation for this class was generated from the following files: +
Generated on Thu Jul 5 13:43:30 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/classCooperative.png b/branches/paradiseo-peo-meta-model/doc/html/classCooperative.png new file mode 100644 index 000000000..826cbc31b Binary files /dev/null and b/branches/paradiseo-peo-meta-model/doc/html/classCooperative.png differ diff --git a/branches/paradiseo-peo-meta-model/doc/html/classReactiveThread-members.html b/branches/paradiseo-peo-meta-model/doc/html/classReactiveThread-members.html new file mode 100644 index 000000000..579cb4bdf --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/classReactiveThread-members.html @@ -0,0 +1,45 @@ + + +ParadisEO-PEO: Member List + + + + +
+
+ +

ReactiveThread Member List

This is the complete list of members for ReactiveThread, including all inherited members.

+ + + + + + + + +
ReactiveThread()ReactiveThread
semReactiveThread [private]
setActive()Thread
setPassive()Thread
sleep()ReactiveThread
Thread()Thread
wakeUp()ReactiveThread
~Thread()Thread [virtual]


Generated on Thu Jul 5 13:43:31 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/classReactiveThread.html b/branches/paradiseo-peo-meta-model/doc/html/classReactiveThread.html new file mode 100644 index 000000000..ce0530bc2 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/classReactiveThread.html @@ -0,0 +1,67 @@ + + +ParadisEO-PEO: ReactiveThread Class Reference + + + + +
+
+ +

ReactiveThread Class Reference

Inheritance diagram for ReactiveThread: +

+ +Thread +Communicator +Worker + +List of all members. + + + + + + + + + + + +

Public Member Functions

ReactiveThread ()
+void sleep ()
+void wakeUp ()

Private Attributes

+sem_t sem
+

Detailed Description

+ +

+ +

+Definition at line 16 of file reac_thread.h.


The documentation for this class was generated from the following files: +
Generated on Thu Jul 5 13:43:31 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/classReactiveThread.png b/branches/paradiseo-peo-meta-model/doc/html/classReactiveThread.png new file mode 100644 index 000000000..46b2d6d40 Binary files /dev/null and b/branches/paradiseo-peo-meta-model/doc/html/classReactiveThread.png differ diff --git a/branches/paradiseo-peo-meta-model/doc/html/classRingTopology-members.html b/branches/paradiseo-peo-meta-model/doc/html/classRingTopology-members.html new file mode 100644 index 000000000..68b897f4d --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/classRingTopology-members.html @@ -0,0 +1,41 @@ + + +ParadisEO-PEO: Member List + + + + +
+
+ +

RingTopology Member List

This is the complete list of members for RingTopology, including all inherited members.

+ + + + +
add(Cooperative &__mig)Topology
migTopology [protected]
setNeighbors(Cooperative *__mig, std::vector< Cooperative * > &__from, std::vector< Cooperative * > &__to)RingTopology [virtual]
~Topology()Topology [virtual]


Generated on Thu Jul 5 13:43:31 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/classRingTopology.html b/branches/paradiseo-peo-meta-model/doc/html/classRingTopology.html new file mode 100644 index 000000000..e64fb0cbf --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/classRingTopology.html @@ -0,0 +1,55 @@ + + +ParadisEO-PEO: RingTopology Class Reference + + + + +
+
+ +

RingTopology Class Reference

Inheritance diagram for RingTopology: +

+ +Topology + +List of all members. + + + + +

Public Member Functions

+void setNeighbors (Cooperative *__mig, std::vector< Cooperative * > &__from, std::vector< Cooperative * > &__to)
+

Detailed Description

+ +

+ +

+Definition at line 14 of file ring_topo.h.


The documentation for this class was generated from the following files: +
Generated on Thu Jul 5 13:43:31 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/classRingTopology.png b/branches/paradiseo-peo-meta-model/doc/html/classRingTopology.png new file mode 100644 index 000000000..79e86b847 Binary files /dev/null and b/branches/paradiseo-peo-meta-model/doc/html/classRingTopology.png differ diff --git a/branches/paradiseo-peo-meta-model/doc/html/classRunner-members.html b/branches/paradiseo-peo-meta-model/doc/html/classRunner-members.html new file mode 100644 index 000000000..71f0e4ccc --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/classRunner-members.html @@ -0,0 +1,62 @@ + + +ParadisEO-PEO: Member List + + + + +
+
+ +

Runner Member List

This is the complete list of members for Runner, including all inherited members.

+ + + + + + + + + + + + + + + + + + + + + + + + + +
Communicable()Communicable
getID()Runner
getKey()Communicable
idRunner [private]
isLocal()Runner
keyCommunicable [protected]
lock()Communicable
notifySendingTermination()Runner
num_commCommunicable [protected, static]
packTermination()Runner
resume()Communicable
Runner()Runner
sem_lockCommunicable [protected]
sem_startRunner [private]
sem_stopCommunicable [protected]
setActive()Thread
setPassive()Thread
start()Runner [virtual]
stop()Communicable
terminate()Runner
Thread()Thread
unlock()Communicable
waitStarting()Runner
~Communicable()Communicable [virtual]
~Thread()Thread [virtual]


Generated on Thu Jul 5 13:43:31 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/classRunner.html b/branches/paradiseo-peo-meta-model/doc/html/classRunner.html new file mode 100644 index 000000000..46cb557a9 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/classRunner.html @@ -0,0 +1,85 @@ + + +ParadisEO-PEO: Runner Class Reference + + + + +
+
+ +

Runner Class Reference

Inheritance diagram for Runner: +

+ +Communicable +Thread +peoEA< EOT > + +List of all members. + + + + + + + + + + + + + + + + + + + + + + + +

Public Member Functions

Runner ()
+void start ()
+void waitStarting ()
+bool isLocal ()
+void terminate ()
+RUNNER_ID getID ()
+void packTermination ()
+void notifySendingTermination ()

Private Attributes

+sem_t sem_start
+unsigned id
+

Detailed Description

+ +

+ +

+Definition at line 19 of file runner.h.


The documentation for this class was generated from the following files: +
Generated on Thu Jul 5 13:43:31 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/classRunner.png b/branches/paradiseo-peo-meta-model/doc/html/classRunner.png new file mode 100644 index 000000000..bd6d66557 Binary files /dev/null and b/branches/paradiseo-peo-meta-model/doc/html/classRunner.png differ diff --git a/branches/paradiseo-peo-meta-model/doc/html/classService-members.html b/branches/paradiseo-peo-meta-model/doc/html/classService-members.html new file mode 100644 index 000000000..ae20922e5 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/classService-members.html @@ -0,0 +1,62 @@ + + +ParadisEO-PEO: Member List + + + + +
+
+ +

Service Member List

This is the complete list of members for Service, including all inherited members.

+ + + + + + + + + + + + + + + + + + + + + + + + + +
Communicable()Communicable
execute()Service [virtual]
getKey()Communicable
getOwner()Service
keyCommunicable [protected]
lock()Communicable
notifySendingAllResourceRequests()Service [virtual]
notifySendingData()Service [virtual]
notifySendingResourceRequest()Service [virtual]
num_commCommunicable [protected, static]
num_sent_rrService [private]
ownerService [private]
packData()Service [virtual]
packResourceRequest()Service
packResult()Service [virtual]
requestResourceRequest(unsigned __how_many=1)Service
resume()Communicable
sem_lockCommunicable [protected]
sem_stopCommunicable [protected]
setOwner(Thread &__owner)Service
stop()Communicable
unlock()Communicable
unpackData()Service [virtual]
unpackResult()Service [virtual]
~Communicable()Communicable [virtual]


Generated on Thu Jul 5 13:43:31 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/classService.html b/branches/paradiseo-peo-meta-model/doc/html/classService.html new file mode 100644 index 000000000..74c382af0 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/classService.html @@ -0,0 +1,102 @@ + + +ParadisEO-PEO: Service Class Reference + + + + +
+
+ +

Service Class Reference

Inheritance diagram for Service: +

+ +Communicable +peoPopEval< EOT > +peoSyncMultiStart< EOT > +peoTransform< EOT > +peoParaPopEval< EOT > +peoSeqPopEval< EOT > +peoParaSGATransform< EOT > +peoSeqTransform< EOT > + +List of all members. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Member Functions

+void setOwner (Thread &__owner)
+ThreadgetOwner ()
+void requestResourceRequest (unsigned __how_many=1)
+void packResourceRequest ()
+virtual void packData ()
+virtual void unpackData ()
+virtual void execute ()
+virtual void packResult ()
+virtual void unpackResult ()
+virtual void notifySendingData ()
+virtual void notifySendingResourceRequest ()
+virtual void notifySendingAllResourceRequests ()

Private Attributes

+Threadowner
+unsigned num_sent_rr
+

Detailed Description

+ +

+ +

+Definition at line 17 of file service.h.


The documentation for this class was generated from the following files: +
Generated on Thu Jul 5 13:43:31 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/classService.png b/branches/paradiseo-peo-meta-model/doc/html/classService.png new file mode 100644 index 000000000..cf6f68a54 Binary files /dev/null and b/branches/paradiseo-peo-meta-model/doc/html/classService.png differ diff --git a/branches/paradiseo-peo-meta-model/doc/html/classThread-members.html b/branches/paradiseo-peo-meta-model/doc/html/classThread-members.html new file mode 100644 index 000000000..100b8b4eb --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/classThread-members.html @@ -0,0 +1,42 @@ + + +ParadisEO-PEO: Member List + + + + +
+
+ +

Thread Member List

This is the complete list of members for Thread, including all inherited members.

+ + + + + +
actThread [private]
setActive()Thread
setPassive()Thread
Thread()Thread
~Thread()Thread [virtual]


Generated on Thu Jul 5 13:43:31 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/classThread.html b/branches/paradiseo-peo-meta-model/doc/html/classThread.html new file mode 100644 index 000000000..36c1b3551 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/classThread.html @@ -0,0 +1,72 @@ + + +ParadisEO-PEO: Thread Class Reference + + + + +
+
+ +

Thread Class Reference

Inheritance diagram for Thread: +

+ +ReactiveThread +Runner +Communicator +Worker +peoEA< EOT > + +List of all members. + + + + + + + + + + + + + +

Public Member Functions

Thread ()
+virtual ~Thread ()
+void setActive ()
+void setPassive ()

Private Attributes

+bool act
+

Detailed Description

+ +

+ +

+Definition at line 16 of file thread.h.


The documentation for this class was generated from the following files: +
Generated on Thu Jul 5 13:43:31 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/classThread.png b/branches/paradiseo-peo-meta-model/doc/html/classThread.png new file mode 100644 index 000000000..bac19c424 Binary files /dev/null and b/branches/paradiseo-peo-meta-model/doc/html/classThread.png differ diff --git a/branches/paradiseo-peo-meta-model/doc/html/classTopology-members.html b/branches/paradiseo-peo-meta-model/doc/html/classTopology-members.html new file mode 100644 index 000000000..9385356fd --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/classTopology-members.html @@ -0,0 +1,40 @@ + + +ParadisEO-PEO: Member List + + + + +
+
+ +

Topology Member List

This is the complete list of members for Topology, including all inherited members.

+ + + +
add(Cooperative &__mig)Topology
migTopology [protected]
~Topology()Topology [virtual]


Generated on Thu Jul 5 13:43:31 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/classTopology.html b/branches/paradiseo-peo-meta-model/doc/html/classTopology.html new file mode 100644 index 000000000..6f65f2c0a --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/classTopology.html @@ -0,0 +1,62 @@ + + +ParadisEO-PEO: Topology Class Reference + + + + +
+
+ +

Topology Class Reference

Inheritance diagram for Topology: +

+ +RingTopology + +List of all members. + + + + + + + + + +

Public Member Functions

+virtual ~Topology ()
+void add (Cooperative &__mig)

Protected Attributes

+std::vector< Cooperative * > mig
+

Detailed Description

+ +

+ +

+Definition at line 16 of file topology.h.


The documentation for this class was generated from the following files: +
Generated on Thu Jul 5 13:43:31 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/classTopology.png b/branches/paradiseo-peo-meta-model/doc/html/classTopology.png new file mode 100644 index 000000000..bc09751e5 Binary files /dev/null and b/branches/paradiseo-peo-meta-model/doc/html/classTopology.png differ diff --git a/branches/paradiseo-peo-meta-model/doc/html/classWorker-members.html b/branches/paradiseo-peo-meta-model/doc/html/classWorker-members.html new file mode 100644 index 000000000..8595ad3b3 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/classWorker-members.html @@ -0,0 +1,68 @@ + + +ParadisEO-PEO: Member List + + + + +
+
+ +

Worker Member List

This is the complete list of members for Worker, including all inherited members.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Communicable()Communicable
getKey()Communicable
idWorker [private]
keyCommunicable [protected]
lock()Communicable
notifySendingResult()Worker
notifySendingTaskDone()Worker
num_commCommunicable [protected, static]
packResult()Worker
packTaskDone()Worker
ReactiveThread()ReactiveThread
resume()Communicable
sem_lockCommunicable [protected]
sem_stopCommunicable [protected]
servWorker [private]
serv_idWorker [private]
setActive()Thread
setPassive()Thread
setSource(int __rank)Worker
sleep()ReactiveThread
srcWorker [private]
start()Worker [virtual]
stop()Communicable
Thread()Thread
totoWorker [private]
unlock()Communicable
unpackData()Worker
wakeUp()ReactiveThread
Worker()Worker
~Communicable()Communicable [virtual]
~Thread()Thread [virtual]


Generated on Thu Jul 5 13:43:31 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/classWorker.html b/branches/paradiseo-peo-meta-model/doc/html/classWorker.html new file mode 100644 index 000000000..36d82e7b4 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/classWorker.html @@ -0,0 +1,94 @@ + + +ParadisEO-PEO: Worker Class Reference + + + + +
+
+ +

Worker Class Reference

Inheritance diagram for Worker: +

+ +Communicable +ReactiveThread +Thread + +List of all members. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Member Functions

Worker ()
+void start ()
+void packResult ()
+void unpackData ()
+void packTaskDone ()
+void notifySendingResult ()
+void notifySendingTaskDone ()
+void setSource (int __rank)

Private Attributes

+WORKER_ID id
+SERVICE_ID serv_id
+Serviceserv
+int src
+bool toto
+

Detailed Description

+ +

+ +

+Definition at line 18 of file worker.h.


The documentation for this class was generated from the following files: +
Generated on Thu Jul 5 13:43:31 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/classWorker.png b/branches/paradiseo-peo-meta-model/doc/html/classWorker.png new file mode 100644 index 000000000..0ea239005 Binary files /dev/null and b/branches/paradiseo-peo-meta-model/doc/html/classWorker.png differ diff --git a/branches/paradiseo-peo-meta-model/doc/html/classes.html b/branches/paradiseo-peo-meta-model/doc/html/classes.html new file mode 100644 index 000000000..8a7a8dec4 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/classes.html @@ -0,0 +1,48 @@ + + +ParadisEO-PEO: Alphabetical List + + + + +
+
+ +

ParadisEO-PEO Class Index

A | C | E | N | P | R | S | T | W

+ +
  A  
+
  P  
+
peoSeqTransform   
peoAggEvalFunc   peoParaPopEval   Service   
peoAsyncIslandMig   peoParaSGATransform   peoSyncIslandMig   
  C  
+
peoPopEval   peoSyncMultiStart   
Communicable   
  R  
+
  T  
+
Communicator   ReactiveThread   Thread   
Cooperative   RingTopology   Topology   
  E  
+
Runner   peoTransform   
peoEA   
  S  
+
  W  
+
  N  
+
SEND_REQUEST   Worker   
peoNoAggEvalFunc   peoSeqPopEval   

A | C | E | N | P | R | S | T | W

+


Generated on Thu Jul 5 13:43:30 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/classpeoAggEvalFunc-members.html b/branches/paradiseo-peo-meta-model/doc/html/classpeoAggEvalFunc-members.html new file mode 100644 index 000000000..f9b5240e0 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/classpeoAggEvalFunc-members.html @@ -0,0 +1,41 @@ + + +ParadisEO-PEO: Member List + + + + +
+
+ +

peoAggEvalFunc< EOT > Member List

This is the complete list of members for peoAggEvalFunc< EOT >, including all inherited members.

+ + + + +
functor_category()eoBF< A1, A2, R > [static]
operator()(A1, A2)=0eoBF< A1, A2, R > [pure virtual]
~eoBF()eoBF< A1, A2, R > [virtual]
~eoFunctorBase()eoFunctorBase [virtual]


Generated on Thu Jul 5 13:43:30 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/classpeoAggEvalFunc.html b/branches/paradiseo-peo-meta-model/doc/html/classpeoAggEvalFunc.html new file mode 100644 index 000000000..950a9ba26 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/classpeoAggEvalFunc.html @@ -0,0 +1,69 @@ + + +ParadisEO-PEO: peoAggEvalFunc< EOT > Class Template Reference + + + + +
+
+ +

peoAggEvalFunc< EOT > Class Template Reference

The peoAggEvalFunc class offers only the interface for creating aggregate evaluation functions - there are no direct internal functions provided. +More... +

+#include <peoAggEvalFunc.h> +

+

Inheritance diagram for peoAggEvalFunc< EOT >: +

+ +eoBF< A1, A2, R > +eoFunctorBase +peoNoAggEvalFunc< EOT > + +List of all members. + +
+

Detailed Description

+

template<class EOT>
+ class peoAggEvalFunc< EOT >

+ +The peoAggEvalFunc class offers only the interface for creating aggregate evaluation functions - there are no direct internal functions provided. +

+The class inherits public eoBF< EOT&, const typename EOT :: Fitness&, void > thus requiring, for the derived classes, the creation of a function having the following signature:

+ + + +
void operator()( EOT& __eot, const typename EOT :: Fitness& __partial_fittness );    
+

+The aggregation object is called in an iterative manner for each of the results obtained by applying partial evaluation functions. +

+ +

+Definition at line 25 of file peoAggEvalFunc.h.


The documentation for this class was generated from the following file: +
Generated on Thu Jul 5 13:43:30 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/classpeoAggEvalFunc.png b/branches/paradiseo-peo-meta-model/doc/html/classpeoAggEvalFunc.png new file mode 100644 index 000000000..02c34fb8a Binary files /dev/null and b/branches/paradiseo-peo-meta-model/doc/html/classpeoAggEvalFunc.png differ diff --git a/branches/paradiseo-peo-meta-model/doc/html/classpeoAsyncIslandMig-members.html b/branches/paradiseo-peo-meta-model/doc/html/classpeoAsyncIslandMig-members.html new file mode 100644 index 000000000..34ae9a952 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/classpeoAsyncIslandMig-members.html @@ -0,0 +1,73 @@ + + +ParadisEO-PEO: Member List + + + + +
+
+ +

peoAsyncIslandMig< EOT > Member List

This is the complete list of members for peoAsyncIslandMig< EOT >, including all inherited members.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
className(void) const eoUpdater [virtual]
Communicable()Communicable
contpeoAsyncIslandMig< EOT > [private]
coop_empeoAsyncIslandMig< EOT > [private]
destinationpeoAsyncIslandMig< EOT > [private]
empeoAsyncIslandMig< EOT > [private]
emigrate()peoAsyncIslandMig< EOT > [private]
functor_category()eoF< void > [static]
getKey()Communicable
getOwner()Cooperative
immpeoAsyncIslandMig< EOT > [private]
immigrate()peoAsyncIslandMig< EOT > [private]
keyCommunicable [protected]
lastCall()eoUpdater [virtual]
lock()Communicable
notifySending()Cooperative [virtual]
num_commCommunicable [protected, static]
operator()()peoAsyncIslandMig< EOT > [virtual]
pack()peoAsyncIslandMig< EOT > [virtual]
peoAsyncIslandMig(eoContinue< EOT > &__cont, eoSelect< EOT > &__select, eoReplacement< EOT > &__replace, Topology &__topology, eoPop< EOT > &__source, eoPop< EOT > &__destination)peoAsyncIslandMig< EOT >
replacepeoAsyncIslandMig< EOT > [private]
result_type typedefeoF< void >
resume()Communicable
selectpeoAsyncIslandMig< EOT > [private]
sem_lockCommunicable [protected]
sem_stopCommunicable [protected]
send(Cooperative *__coop)Cooperative
setOwner(Runner &__runner)Cooperative
sourcepeoAsyncIslandMig< EOT > [private]
stop()Communicable
topologypeoAsyncIslandMig< EOT > [private]
unlock()Communicable
unpack()peoAsyncIslandMig< EOT > [virtual]
~Communicable()Communicable [virtual]
~eoF()eoF< void > [virtual]
~eoFunctorBase()eoFunctorBase [virtual]


Generated on Thu Jul 5 13:43:30 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/classpeoAsyncIslandMig.html b/branches/paradiseo-peo-meta-model/doc/html/classpeoAsyncIslandMig.html new file mode 100644 index 000000000..ff017e9d1 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/classpeoAsyncIslandMig.html @@ -0,0 +1,305 @@ + + +ParadisEO-PEO: peoAsyncIslandMig< EOT > Class Template Reference + + + + +
+
+ +

peoAsyncIslandMig< EOT > Class Template Reference

The peoAsyncIslandMig class offers the elementary basis for implementating an asynchronous island migration model - requires the specification of several basic parameters, i.e. +More... +

+#include <peoAsyncIslandMig.h> +

+

Inheritance diagram for peoAsyncIslandMig< EOT >: +

+ +Cooperative +eoUpdater +Communicable +eoF< void > +eoFunctorBase + +List of all members. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Member Functions

 peoAsyncIslandMig (eoContinue< EOT > &__cont, eoSelect< EOT > &__select, eoReplacement< EOT > &__replace, Topology &__topology, eoPop< EOT > &__source, eoPop< EOT > &__destination)
 Constructor for the peoAsyncIslandMig class; the characteristics of the migration model are defined through the specified parameters - out of the box objects provided in EO, etc., or custom, derived objects may be passed as parameters.
void operator() ()
 Function operator to be called as checkpoint for performing the migration step.
+void pack ()
 Auxiliary function dealing with sending the emigrant individuals. There is no need to explicitly call the function.
+void unpack ()
 Auxiliary function dealing with receiving immigrant individuals. There is no need to explicitly call the function.

Private Member Functions

+void emigrate ()
+void immigrate ()

Private Attributes

+eoContinue< EOT > & cont
+eoSelect< EOT > & select
+eoReplacement< EOT > & replace
+Topologytopology
+eoPop< EOT > & source
+eoPop< EOT > & destination
+std::queue< eoPop< EOT > > imm
+std::queue< eoPop< EOT > > em
+std::queue< Cooperative * > coop_em
+

Detailed Description

+

template<class EOT>
+ class peoAsyncIslandMig< EOT >

+ +The peoAsyncIslandMig class offers the elementary basis for implementating an asynchronous island migration model - requires the specification of several basic parameters, i.e. +

+continuation criterion, selection and replacement strategies, a topological model and the source and destination population for the migrating individuals. As opposed to the synchronous migration model, in the asynchronous migration approach, there is no synchronization step between islands after performing the emigration phase.

+The migration operator is called at the end of each generation of an evolutionary algorithms as a checkpoint object - the following code exposes the structure of a classic evolutionary algorithm:

+ + + + + + + + + + + + + +
do {    
         select( population, offsprings );   // select the offsprings from the current population
         transform( offsprings );   // crossover and mutation operators are applied on the selected offsprings
         evaluate( offsprings );   // evaluation step of the resulting offsprings
         replace( population, offsprings );   // replace the individuals in the current population whith individuals from the offspring population, according to a specified replacement strategy
} while ( eaCheckpointContinue( population ) );   // checkpoint operators are applied on the current population, including the migration operator, if any specified
+

+Constructing an asynchronous island migration model requires having defined (1) a topological migration model, (2) the control parameters of the migration process, (3) a checkpoint object associated with an evolutionary algorithm, and (4) an owner object must be set. The owner object must be derived from the Runner class (for example a peoEA object represents a possible owner). A simple example is offered bellow:

+

    +
  1. +topological model to be followed when performing migrations:
    +
    + + + +
    RingTopology migTopology;   // a simple ring topological model - each island communicates with two other islands
    +

    +

  2. +
  3. +the continuation criterion, selection and replacement strategy etc. are defined:
    +
    + + + + + + + + + + + + + + + + + +
    eoPop< EOT > population( POP_SIZE, popInitializer );   // population of individuals to be used for the evolutionary algorithm
       
    eoPeriodicContinue< EOT > migCont( MIG_FREQ );   // migrations occur periodically at MIG_FREQ iterations
    eoRandomSelect< EOT > migSelectStrategy;   // selection strategy - in this case a random selection is applied
    eoSelectNumber< EOT > migSelect( migSelectStrategy, MIG_SIZE );   // number of individuals to be selected using the specified strategy
    eoPlusReplacement< EOT > migReplace;   // immigration strategy - the worse individuals in the destination population are replaced by the immigrant individuals
       
    peoAsyncIslandMig< EOT > asyncMigration(
    +          migCont, migSelect, migReplace, migTopology,
    +          population, population
    + );  
    // asynchronous migration object - the emigrant individuals are selected from the same from population in which the immigrant individuals are being integrated
    +

    +

  4. +
  5. +creation of a checkpoint object as part of the definition of an evolutionary algoritm (details of th EA not given as being out of scope):
    +
    + + + + + + + + + + + + + +
    ...    
    eoGenContinue< EOT > eaCont( NUM_GEN );   // the evolutionary algorithm will stop after NUM_GEN generations
    eoCheckPoint< EOT > eaCheckpointContinue( eaCont );   // number of individuals to be selected using the specified strategy
    ...    
    eaCheckpointContinue.add( asyncMigration );   // adding the migration operator as checkpoint element
    ...    
    +

    +

  6. +
  7. +definition of an owner evolutionary algorithm (an object inheriting the Runner class):
    +
    + + + + + + + +
    peoEA< EOT > eaAlg( eaCheckpointContinue, eaPopEval, eaSelect, eaTransform, eaReplace);   // evolutionary algorithm having as checkpoint the eaCheckpointContinue object defined above
    asyncMigration.setOwner( eaAlg );   // setting the evolutionary algorithm as owner of the migration object
    eaAlg( population );   // applying the evolutionary algorithm on a given population
    +
  8. +
+

+The source and the destination population for the migration object were specified as being the same, in step no. 2, as we are usually interested in selecting the emigrants and integrating the immigrant individuals from and in, respectively, one unique population, iteratively evolved by an evolutionary algorithm. There is no restriction in having two distinct populations as source and destination for the emigrant and immigrant individuals respectively.

+The above steps only create an asynchronous migration object associated to an evolutionary algorithm. The creation of several islands requires the reiteration of the steps 2 through 4 for creating distinct algorithms, with distinct populations and the associated distinctly parametrized migration objects. The interconnecting element is the underlying topology, defined at step 1 (the same C++ migTopology object has to be passed as parameter for all the migration objects, in order to interconnect them). +

+ +

+Definition at line 112 of file peoAsyncIslandMig.h.


Constructor & Destructor Documentation

+ +
+
+
+template<class EOT>
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
peoAsyncIslandMig< EOT >::peoAsyncIslandMig (eoContinue< EOT > &  __cont,
eoSelect< EOT > &  __select,
eoReplacement< EOT > &  __replace,
Topology __topology,
eoPop< EOT > &  __source,
eoPop< EOT > &  __destination 
)
+
+
+ +

+Constructor for the peoAsyncIslandMig class; the characteristics of the migration model are defined through the specified parameters - out of the box objects provided in EO, etc., or custom, derived objects may be passed as parameters. +

+

Parameters:
+ + + + + + + +
eoContinue< EOT >& __cont - continuation criterion specifying whether the migration is performed or not;
eoSelect< EOT >& __select - selection strategy to be applied for constructing a list of emigrant individuals out of the source population;
eoReplacement< EOT >& __replace - replacement strategy used for integrating the immigrant individuals in the destination population;
Topology& __topology - topological model to be followed when performing migrations;
eoPop< EOT >& __source - source population from which the emigrant individuals are selected;
eoPop< EOT >& __destination - destination population in which the immigrant population are integrated.
+
+ +

+Definition at line 171 of file peoAsyncIslandMig.h. +

+References Topology::add(). +

+

+


Member Function Documentation

+ +
+
+
+template<class EOT>
+ + + + + + + + +
void peoAsyncIslandMig< EOT >::operator() (  )  [virtual]
+
+
+ +

+Function operator to be called as checkpoint for performing the migration step. +

+The emigrant individuals are selected from the source population and sent to the next island (defined by the topology object) while the immigrant individuals are integrated in the destination population. There is no need to explicitly call the function - the wrapper checkpoint object (please refer to the above example) will perform the call when required. +

+Implements eoF< void >. +

+Definition at line 248 of file peoAsyncIslandMig.h. +

+References peoAsyncIslandMig< EOT >::cont, peoAsyncIslandMig< EOT >::emigrate(), peoAsyncIslandMig< EOT >::immigrate(), and peoAsyncIslandMig< EOT >::source. +

+

+


The documentation for this class was generated from the following file: +
Generated on Thu Jul 5 13:43:30 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/classpeoAsyncIslandMig.png b/branches/paradiseo-peo-meta-model/doc/html/classpeoAsyncIslandMig.png new file mode 100644 index 000000000..3a59d02e1 Binary files /dev/null and b/branches/paradiseo-peo-meta-model/doc/html/classpeoAsyncIslandMig.png differ diff --git a/branches/paradiseo-peo-meta-model/doc/html/classpeoEA-members.html b/branches/paradiseo-peo-meta-model/doc/html/classpeoEA-members.html new file mode 100644 index 000000000..52c476878 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/classpeoEA-members.html @@ -0,0 +1,69 @@ + + +ParadisEO-PEO: Member List + + + + +
+
+ +

peoEA< EOT > Member List

This is the complete list of members for peoEA< EOT >, including all inherited members.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Communicable()Communicable
contpeoEA< EOT > [private]
getID()Runner
getKey()Communicable
isLocal()Runner
keyCommunicable [protected]
lock()Communicable
notifySendingTermination()Runner
num_commCommunicable [protected, static]
operator()(eoPop< EOT > &__pop)peoEA< EOT >
packTermination()Runner
peoEA(eoContinue< EOT > &__cont, peoPopEval< EOT > &__pop_eval, eoSelect< EOT > &__select, peoTransform< EOT > &__trans, eoReplacement< EOT > &__replace)peoEA< EOT >
poppeoEA< EOT > [private]
pop_evalpeoEA< EOT > [private]
replacepeoEA< EOT > [private]
resume()Communicable
run()peoEA< EOT > [virtual]
Runner()Runner
selectpeoEA< EOT > [private]
sem_lockCommunicable [protected]
sem_stopCommunicable [protected]
setActive()Thread
setPassive()Thread
start()Runner [virtual]
stop()Communicable
terminate()Runner
Thread()Thread
transpeoEA< EOT > [private]
unlock()Communicable
waitStarting()Runner
~Communicable()Communicable [virtual]
~Thread()Thread [virtual]


Generated on Thu Jul 5 13:43:30 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/classpeoEA.html b/branches/paradiseo-peo-meta-model/doc/html/classpeoEA.html new file mode 100644 index 000000000..416cb49db --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/classpeoEA.html @@ -0,0 +1,236 @@ + + +ParadisEO-PEO: peoEA< EOT > Class Template Reference + + + + +
+
+ +

peoEA< EOT > Class Template Reference

The peoEA class offers an elementary evolutionary algorithm implementation. +More... +

+#include <peoEA.h> +

+

Inheritance diagram for peoEA< EOT >: +

+ +Runner +Communicable +Thread + +List of all members. + + + + + + + + + + + + + + + + + + + + + + + + +

Public Member Functions

 peoEA (eoContinue< EOT > &__cont, peoPopEval< EOT > &__pop_eval, eoSelect< EOT > &__select, peoTransform< EOT > &__trans, eoReplacement< EOT > &__replace)
 Constructor for the evolutionary algorithm object - several basic parameters have to be specified, allowing for different levels of parallelism.
+void run ()
 Evolutionary algorithm function - a side effect of the fact that the class is derived from the Runner class, thus requiring the existence of a run function, the algorithm being executed on a distinct thread.
void operator() (eoPop< EOT > &__pop)
 Function operator for specifying the population to be associated with the algorithm.

Private Attributes

+eoContinue< EOT > & cont
+peoPopEval< EOT > & pop_eval
+eoSelect< EOT > & select
+peoTransform< EOT > & trans
+eoReplacement< EOT > & replace
+eoPop< EOT > * pop
+

Detailed Description

+

template<class EOT>
+ class peoEA< EOT >

+ +The peoEA class offers an elementary evolutionary algorithm implementation. +

+In addition, as compared with the algorithms provided by the EO framework, the peoEA class has the underlying necessary structure for including, for example, parallel evaluation and parallel transformation operators, migration operators etc. Although there is no restriction on using the algorithms provided by the EO framework, the drawback resides in the fact that the EO implementation is exclusively sequential and, in consequence, no parallelism is provided. A simple example for constructing a peoEA object:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
...    
eoPop< EOT > population( POP_SIZE, popInitializer );   // creation of a population with POP_SIZE individuals - the popInitializer is a functor to be called for each individual
   
eoGenContinue< EOT > eaCont( NUM_GEN );   // number of generations for the evolutionary algorithm
eoCheckPoint< EOT > eaCheckpointContinue( eaCont );   // checkpoint incorporating the continuation criterion - startpoint for adding other checkpoint objects
   
peoSeqPopEval< EOT > eaPopEval( evalFunction );   // sequential evaluation functor wrapper - evalFunction represents the actual evaluation functor
   
eoRankingSelect< EOT > selectionStrategy;   // selection strategy for creating the offspring population - a simple ranking selection in this case
eoSelectNumber< EOT > eaSelect( selectionStrategy, POP_SIZE );   // the number of individuals to be selected for creating the offspring population
eoRankingSelect< EOT > selectionStrategy;   // selection strategy for creating the offspring population - a simple ranking selection in this case
   
eoSGATransform< EOT > transform( crossover, CROSS_RATE, mutation, MUT_RATE );   // transformation operator - crossover and mutation operators with their associated probabilities
peoSeqTransform< EOT > eaTransform( transform );   // ParadisEO specific sequential operator - a parallel version may be specified in the same manner
   
eoPlusReplacement< EOT > eaReplace;   // replacement strategy - for integrating the offspring resulting individuals in the initial population
   
peoEA< EOT > eaAlg( eaCheckpointContinue, eaPopEval, eaSelect, eaTransform, eaReplace );   // ParadisEO evolutionary algorithm integrating the above defined objects
eaAlg( population );   // specifying the initial population for the algorithm
...    
+ +

+ +

+Definition at line 54 of file peoEA.h.


Constructor & Destructor Documentation

+ +
+
+
+template<class EOT>
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
peoEA< EOT >::peoEA (eoContinue< EOT > &  __cont,
peoPopEval< EOT > &  __pop_eval,
eoSelect< EOT > &  __select,
peoTransform< EOT > &  __trans,
eoReplacement< EOT > &  __replace 
)
+
+
+ +

+Constructor for the evolutionary algorithm object - several basic parameters have to be specified, allowing for different levels of parallelism. +

+Depending on the requirements, a sequential or a parallel evaluation operator may be specified or, in the same manner, a sequential or a parallel transformation operator may be given as parameter. Out of the box objects may be provided, from the EO package, for example, or custom defined ones may be specified, provided that they are derived from the correct base classes.

+

Parameters:
+ + + + + + +
eoContinue< EOT >& __cont - continuation criterion specifying whether the algorithm should continue or not;
peoPopEval< EOT >& __pop_eval - evaluation operator; it allows the specification of parallel evaluation operators, aggregate evaluation functions, etc.;
eoSelect< EOT >& __select - selection strategy to be applied for constructing a list of offspring individuals;
peoTransform< EOT >& __trans - transformation operator, i.e. crossover and mutation; allows for sequential or parallel transform;
eoReplacement< EOT >& __replace - replacement strategy for integrating the offspring individuals in the initial population;
+
+ +

+Definition at line 98 of file peoEA.h. +

+References peoEA< EOT >::pop_eval, and peoEA< EOT >::trans. +

+

+


Member Function Documentation

+ +
+
+
+template<class EOT>
+ + + + + + + + + +
void peoEA< EOT >::operator() (eoPop< EOT > &  __pop  ) 
+
+
+ +

+Function operator for specifying the population to be associated with the algorithm. +

+

Parameters:
+ + +
eoPop< EOT >& __pop - initial population of the algorithm, to be iteratively evolved;
+
+ +

+Definition at line 114 of file peoEA.h. +

+References peoEA< EOT >::pop. +

+

+


The documentation for this class was generated from the following file: +
Generated on Thu Jul 5 13:43:30 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/classpeoEA.png b/branches/paradiseo-peo-meta-model/doc/html/classpeoEA.png new file mode 100644 index 000000000..e3384cb44 Binary files /dev/null and b/branches/paradiseo-peo-meta-model/doc/html/classpeoEA.png differ diff --git a/branches/paradiseo-peo-meta-model/doc/html/classpeoNoAggEvalFunc-members.html b/branches/paradiseo-peo-meta-model/doc/html/classpeoNoAggEvalFunc-members.html new file mode 100644 index 000000000..4551ff4c1 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/classpeoNoAggEvalFunc-members.html @@ -0,0 +1,42 @@ + + +ParadisEO-PEO: Member List + + + + +
+
+ +

peoNoAggEvalFunc< EOT > Member List

This is the complete list of members for peoNoAggEvalFunc< EOT >, including all inherited members.

+ + + + + +
functor_category()eoBF< A1, A2, R > [static]
operator()(EOT &__sol, const typename EOT::Fitness &__fit)peoNoAggEvalFunc< EOT >
peoAggEvalFunc::operator()(A1, A2)=0eoBF< A1, A2, R > [pure virtual]
~eoBF()eoBF< A1, A2, R > [virtual]
~eoFunctorBase()eoFunctorBase [virtual]


Generated on Thu Jul 5 13:43:30 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/classpeoNoAggEvalFunc.html b/branches/paradiseo-peo-meta-model/doc/html/classpeoNoAggEvalFunc.html new file mode 100644 index 000000000..8aebd17ac --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/classpeoNoAggEvalFunc.html @@ -0,0 +1,68 @@ + + +ParadisEO-PEO: peoNoAggEvalFunc< EOT > Class Template Reference + + + + +
+
+ +

peoNoAggEvalFunc< EOT > Class Template Reference

The peoNoAggEvalFunc class does nothing more than an association between a fitness value and a specified individual. +More... +

+#include <peoNoAggEvalFunc.h> +

+

Inheritance diagram for peoNoAggEvalFunc< EOT >: +

+ +peoAggEvalFunc< EOT > +eoBF< A1, A2, R > +eoFunctorBase + +List of all members. + + + + + +

Public Member Functions

+void operator() (EOT &__sol, const typename EOT::Fitness &__fit)
 Operator which sets as fitness the __fit value for the __sol individual.
+

Detailed Description

+

template<class EOT>
+ class peoNoAggEvalFunc< EOT >

+ +The peoNoAggEvalFunc class does nothing more than an association between a fitness value and a specified individual. +

+The class is provided as a mean of declaring that no aggregation is required for the evaluation function - the fitness value is explicitly specified. +

+ +

+Definition at line 19 of file peoNoAggEvalFunc.h.


The documentation for this class was generated from the following file: +
Generated on Thu Jul 5 13:43:30 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/classpeoNoAggEvalFunc.png b/branches/paradiseo-peo-meta-model/doc/html/classpeoNoAggEvalFunc.png new file mode 100644 index 000000000..2feda5514 Binary files /dev/null and b/branches/paradiseo-peo-meta-model/doc/html/classpeoNoAggEvalFunc.png differ diff --git a/branches/paradiseo-peo-meta-model/doc/html/classpeoParaPopEval-members.html b/branches/paradiseo-peo-meta-model/doc/html/classpeoParaPopEval-members.html new file mode 100644 index 000000000..6d756ebc8 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/classpeoParaPopEval-members.html @@ -0,0 +1,73 @@ + + +ParadisEO-PEO: Member List + + + + +
+
+ +

peoParaPopEval< EOT > Member List

This is the complete list of members for peoParaPopEval< EOT >, including all inherited members.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ad_solpeoParaPopEval< EOT > [private]
Communicable()Communicable
execute()peoParaPopEval< EOT > [virtual]
funcspeoParaPopEval< EOT > [private]
getKey()Communicable
getOwner()Service
keyCommunicable [protected]
lock()Communicable
merge_evalpeoParaPopEval< EOT > [private]
no_merge_evalpeoParaPopEval< EOT > [private]
notifySendingAllResourceRequests()peoParaPopEval< EOT > [virtual]
notifySendingData()peoParaPopEval< EOT > [virtual]
notifySendingResourceRequest()Service [virtual]
num_commCommunicable [protected, static]
num_funcpeoParaPopEval< EOT > [private]
one_funcpeoParaPopEval< EOT > [private]
operator()(eoPop< EOT > &__pop)peoParaPopEval< EOT > [virtual]
packData()peoParaPopEval< EOT > [virtual]
packResourceRequest()Service
packResult()peoParaPopEval< EOT > [virtual]
peoParaPopEval(eoEvalFunc< EOT > &__eval_func)peoParaPopEval< EOT >
peoParaPopEval(const std::vector< eoEvalFunc< EOT > * > &__funcs, peoAggEvalFunc< EOT > &__merge_eval)peoParaPopEval< EOT >
progressionpeoParaPopEval< EOT > [private]
requestResourceRequest(unsigned __how_many=1)Service
resume()Communicable
sem_lockCommunicable [protected]
sem_stopCommunicable [protected]
setOwner(Thread &__owner)Service
solpeoParaPopEval< EOT > [private]
stop()Communicable
taskspeoParaPopEval< EOT > [private]
totalpeoParaPopEval< EOT > [private]
unlock()Communicable
unpackData()peoParaPopEval< EOT > [virtual]
unpackResult()peoParaPopEval< EOT > [virtual]
~Communicable()Communicable [virtual]


Generated on Thu Jul 5 13:43:30 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/classpeoParaPopEval.html b/branches/paradiseo-peo-meta-model/doc/html/classpeoParaPopEval.html new file mode 100644 index 000000000..6955adb88 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/classpeoParaPopEval.html @@ -0,0 +1,411 @@ + + +ParadisEO-PEO: peoParaPopEval< EOT > Class Template Reference + + + + +
+
+ +

peoParaPopEval< EOT > Class Template Reference

The peoParaPopEval represents a wrapper for creating a functor capable of applying in parallel an EO-derived evaluation functor. +More... +

+#include <peoParaPopEval.h> +

+

Inheritance diagram for peoParaPopEval< EOT >: +

+ +peoPopEval< EOT > +Service +Communicable + +List of all members. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Member Functions

 peoParaPopEval (eoEvalFunc< EOT > &__eval_func)
 Constructor function - an EO-derived evaluation functor has to be specified; an internal reference is set towards the specified evaluation functor.
 peoParaPopEval (const std::vector< eoEvalFunc< EOT > * > &__funcs, peoAggEvalFunc< EOT > &__merge_eval)
 Constructor function - a vector of EO-derived evaluation functors has to be specified as well as an aggregation function.
void operator() (eoPop< EOT > &__pop)
 Operator for applying the evaluation functor (direct or aggregate) for each individual of the specified population.
void packData ()
 Auxiliary function for transferring data between the process requesting an evaluation operation and the process that performs the actual evaluation phase.
void unpackData ()
 Auxiliary function for transferring data between the process requesting an evaluation operation and the process that performs the actual evaluation phase.
+void execute ()
 Auxiliary function - it calls the specified evaluation functor(s). There is no need to explicitly call the function.
void packResult ()
 Auxiliary function for transferring data between the process requesting an evaluation operation and the process that performs the actual evaluation phase.
void unpackResult ()
 Auxiliary function for transferring data between the process requesting an evaluation operation and the process that performs the actual evaluation phase.
void notifySendingData ()
 Auxiliary function for notifications between the process requesting an evaluation operation and the processes that performs the actual evaluation phase.
void notifySendingAllResourceRequests ()
 Auxiliary function for notifications between the process requesting an evaluation operation and the processes that performs the actual evaluation phase.

Private Attributes

+const std::vector< eoEvalFunc<
+ EOT > * > & 
funcs
+std::vector< eoEvalFunc< EOT > * > one_func
+peoAggEvalFunc< EOT > & merge_eval
+peoNoAggEvalFunc< EOT > no_merge_eval
+std::queue< EOT * > tasks
+std::map< EOT *, std::pair<
+ unsigned, unsigned > > 
progression
+unsigned num_func
+EOT sol
+EOT * ad_sol
+unsigned total
+

Detailed Description

+

template<class EOT>
+ class peoParaPopEval< EOT >

+ +The peoParaPopEval represents a wrapper for creating a functor capable of applying in parallel an EO-derived evaluation functor. +

+The class offers the possibility of chosing between a single-function evaluation and an aggregate evaluation function, including several sub-evalution functions. +

+ +

+Definition at line 26 of file peoParaPopEval.h.


Constructor & Destructor Documentation

+ +
+
+
+template<class EOT>
+ + + + + + + + + +
peoParaPopEval< EOT >::peoParaPopEval (eoEvalFunc< EOT > &  __eval_func  ) 
+
+
+ +

+Constructor function - an EO-derived evaluation functor has to be specified; an internal reference is set towards the specified evaluation functor. +

+

Parameters:
+ + +
eoEvalFunc< EOT >& __eval_func - EO-derived evaluation functor to be applied in parallel on each individual of a specified population
+
+ +

+Definition at line 102 of file peoParaPopEval.h. +

+References peoParaPopEval< EOT >::one_func. +

+

+ +

+
+
+template<class EOT>
+ + + + + + + + + + + + + + + + + + +
peoParaPopEval< EOT >::peoParaPopEval (const std::vector< eoEvalFunc< EOT > * > &  __funcs,
peoAggEvalFunc< EOT > &  __merge_eval 
)
+
+
+ +

+Constructor function - a vector of EO-derived evaluation functors has to be specified as well as an aggregation function. +

+

Parameters:
+ + + +
const std :: vector< eoEvalFunc < EOT >* >& __funcs - vector of EO-derived partial evaluation functors;
peoAggEvalFunc< EOT >& __merge_eval - aggregation functor for creating a fitness value out of the partial fitness values.
+
+ +

+Definition at line 111 of file peoParaPopEval.h. +

+

+


Member Function Documentation

+ +
+
+
+template<class EOT>
+ + + + + + + + + +
void peoParaPopEval< EOT >::operator() (eoPop< EOT > &  __pop  )  [virtual]
+
+
+ +

+Operator for applying the evaluation functor (direct or aggregate) for each individual of the specified population. +

+

Parameters:
+ + +
eoPop< EOT >& __pop - population to be evaluated by applying the evaluation functor specified in the constructor.
+
+ +

+Implements peoPopEval< EOT >. +

+Definition at line 122 of file peoParaPopEval.h. +

+References peoParaPopEval< EOT >::funcs, peoParaPopEval< EOT >::progression, Service::requestResourceRequest(), Communicable::stop(), peoParaPopEval< EOT >::tasks, and peoParaPopEval< EOT >::total. +

+

+ +

+
+
+template<class EOT>
+ + + + + + + + +
void peoParaPopEval< EOT >::packData (  )  [virtual]
+
+
+ +

+Auxiliary function for transferring data between the process requesting an evaluation operation and the process that performs the actual evaluation phase. +

+There is no need to explicitly call the function. +

+Reimplemented from Service. +

+Definition at line 143 of file peoParaPopEval.h. +

+References peoParaPopEval< EOT >::progression, and peoParaPopEval< EOT >::tasks. +

+

+ +

+
+
+template<class EOT>
+ + + + + + + + +
void peoParaPopEval< EOT >::unpackData (  )  [virtual]
+
+
+ +

+Auxiliary function for transferring data between the process requesting an evaluation operation and the process that performs the actual evaluation phase. +

+There is no need to explicitly call the function. +

+Reimplemented from Service. +

+Definition at line 157 of file peoParaPopEval.h. +

+References peoParaPopEval< EOT >::ad_sol, peoParaPopEval< EOT >::num_func, and peoParaPopEval< EOT >::sol. +

+

+ +

+
+
+template<class EOT>
+ + + + + + + + +
void peoParaPopEval< EOT >::packResult (  )  [virtual]
+
+
+ +

+Auxiliary function for transferring data between the process requesting an evaluation operation and the process that performs the actual evaluation phase. +

+There is no need to explicitly call the function. +

+Reimplemented from Service. +

+Definition at line 174 of file peoParaPopEval.h. +

+References peoParaPopEval< EOT >::ad_sol, and peoParaPopEval< EOT >::sol. +

+

+ +

+
+
+template<class EOT>
+ + + + + + + + +
void peoParaPopEval< EOT >::unpackResult (  )  [virtual]
+
+
+ +

+Auxiliary function for transferring data between the process requesting an evaluation operation and the process that performs the actual evaluation phase. +

+There is no need to explicitly call the function. +

+Reimplemented from Service. +

+Definition at line 183 of file peoParaPopEval.h. +

+References peoParaPopEval< EOT >::ad_sol, Service::getOwner(), peoParaPopEval< EOT >::merge_eval, peoParaPopEval< EOT >::progression, Communicable::resume(), Thread::setActive(), and peoParaPopEval< EOT >::total. +

+

+ +

+
+
+template<class EOT>
+ + + + + + + + +
void peoParaPopEval< EOT >::notifySendingData (  )  [virtual]
+
+
+ +

+Auxiliary function for notifications between the process requesting an evaluation operation and the processes that performs the actual evaluation phase. +

+There is no need to explicitly call the function. +

+Reimplemented from Service. +

+Definition at line 214 of file peoParaPopEval.h. +

+

+ +

+
+
+template<class EOT>
+ + + + + + + + +
void peoParaPopEval< EOT >::notifySendingAllResourceRequests (  )  [virtual]
+
+
+ +

+Auxiliary function for notifications between the process requesting an evaluation operation and the processes that performs the actual evaluation phase. +

+There is no need to explicitly call the function. +

+Reimplemented from Service. +

+Definition at line 219 of file peoParaPopEval.h. +

+References Service::getOwner(), and Thread::setPassive(). +

+

+


The documentation for this class was generated from the following file: +
Generated on Thu Jul 5 13:43:30 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/classpeoParaPopEval.png b/branches/paradiseo-peo-meta-model/doc/html/classpeoParaPopEval.png new file mode 100644 index 000000000..3ddb39223 Binary files /dev/null and b/branches/paradiseo-peo-meta-model/doc/html/classpeoParaPopEval.png differ diff --git a/branches/paradiseo-peo-meta-model/doc/html/classpeoParaSGATransform-members.html b/branches/paradiseo-peo-meta-model/doc/html/classpeoParaSGATransform-members.html new file mode 100644 index 000000000..a1dff0885 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/classpeoParaSGATransform-members.html @@ -0,0 +1,75 @@ + + +ParadisEO-PEO: Member List + + + + +
+
+ +

peoParaSGATransform< EOT > Member List

This is the complete list of members for peoParaSGATransform< EOT >, including all inherited members.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Communicable()Communicable
crosspeoParaSGATransform< EOT > [private]
cross_ratepeoParaSGATransform< EOT > [private]
execute()peoParaSGATransform< EOT > [virtual]
fatherpeoParaSGATransform< EOT > [private]
functor_category()eoUF< A1, R > [static]
getKey()Communicable
getOwner()Service
idxpeoParaSGATransform< EOT > [private]
keyCommunicable [protected]
lock()Communicable
motherpeoParaSGATransform< EOT > [private]
mutpeoParaSGATransform< EOT > [private]
mut_ratepeoParaSGATransform< EOT > [private]
notifySendingAllResourceRequests()peoParaSGATransform< EOT > [virtual]
notifySendingData()peoParaSGATransform< EOT > [virtual]
notifySendingResourceRequest()Service [virtual]
num_commCommunicable [protected, static]
num_termpeoParaSGATransform< EOT > [private]
operator()(eoPop< EOT > &__pop)peoParaSGATransform< EOT >
peoTransform::operator()(A1)=0eoUF< A1, R > [pure virtual]
packData()peoParaSGATransform< EOT > [virtual]
packResourceRequest()Service
packResult()peoParaSGATransform< EOT > [virtual]
peoParaSGATransform(eoQuadOp< EOT > &__cross, double __cross_rate, eoMonOp< EOT > &__mut, double __mut_rate)peoParaSGATransform< EOT >
poppeoParaSGATransform< EOT > [private]
requestResourceRequest(unsigned __how_many=1)Service
resume()Communicable
sem_lockCommunicable [protected]
sem_stopCommunicable [protected]
setOwner(Thread &__owner)Service
stop()Communicable
unlock()Communicable
unpackData()peoParaSGATransform< EOT > [virtual]
unpackResult()peoParaSGATransform< EOT > [virtual]
~Communicable()Communicable [virtual]
~eoFunctorBase()eoFunctorBase [virtual]
~eoUF()eoUF< A1, R > [virtual]


Generated on Thu Jul 5 13:43:30 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/classpeoParaSGATransform.html b/branches/paradiseo-peo-meta-model/doc/html/classpeoParaSGATransform.html new file mode 100644 index 000000000..690784db0 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/classpeoParaSGATransform.html @@ -0,0 +1,115 @@ + + +ParadisEO-PEO: peoParaSGATransform< EOT > Class Template Reference + + + + +
+
+ +

peoParaSGATransform< EOT > Class Template Reference

Inheritance diagram for peoParaSGATransform< EOT >: +

+ +peoTransform< EOT > +Service +eoTransform< EOT > +Communicable +eoUF< A1, R > +eoFunctorBase + +List of all members. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Member Functions

peoParaSGATransform (eoQuadOp< EOT > &__cross, double __cross_rate, eoMonOp< EOT > &__mut, double __mut_rate)
+void operator() (eoPop< EOT > &__pop)
+void packData ()
+void unpackData ()
+void execute ()
+void packResult ()
+void unpackResult ()
+void notifySendingData ()
+void notifySendingAllResourceRequests ()

Private Attributes

+eoQuadOp< EOT > & cross
+double cross_rate
+eoMonOp< EOT > & mut
+double mut_rate
+unsigned idx
+eoPop< EOT > * pop
+EOT father
+EOT mother
+unsigned num_term
+

Detailed Description

+

template<class EOT>
+ class peoParaSGATransform< EOT >

+ + +

+ +

+Definition at line 21 of file peoParaSGATransform.h.


The documentation for this class was generated from the following file: +
Generated on Thu Jul 5 13:43:30 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/classpeoParaSGATransform.png b/branches/paradiseo-peo-meta-model/doc/html/classpeoParaSGATransform.png new file mode 100644 index 000000000..ed966aad7 Binary files /dev/null and b/branches/paradiseo-peo-meta-model/doc/html/classpeoParaSGATransform.png differ diff --git a/branches/paradiseo-peo-meta-model/doc/html/classpeoPopEval-members.html b/branches/paradiseo-peo-meta-model/doc/html/classpeoPopEval-members.html new file mode 100644 index 000000000..34e68d3c5 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/classpeoPopEval-members.html @@ -0,0 +1,61 @@ + + +ParadisEO-PEO: Member List + + + + +
+
+ +

peoPopEval< EOT > Member List

This is the complete list of members for peoPopEval< EOT >, including all inherited members.

+ + + + + + + + + + + + + + + + + + + + + + + + +
Communicable()Communicable
execute()Service [virtual]
getKey()Communicable
getOwner()Service
keyCommunicable [protected]
lock()Communicable
notifySendingAllResourceRequests()Service [virtual]
notifySendingData()Service [virtual]
notifySendingResourceRequest()Service [virtual]
num_commCommunicable [protected, static]
operator()(eoPop< EOT > &__pop)=0peoPopEval< EOT > [pure virtual]
packData()Service [virtual]
packResourceRequest()Service
packResult()Service [virtual]
requestResourceRequest(unsigned __how_many=1)Service
resume()Communicable
sem_lockCommunicable [protected]
sem_stopCommunicable [protected]
setOwner(Thread &__owner)Service
stop()Communicable
unlock()Communicable
unpackData()Service [virtual]
unpackResult()Service [virtual]
~Communicable()Communicable [virtual]


Generated on Thu Jul 5 13:43:30 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/classpeoPopEval.html b/branches/paradiseo-peo-meta-model/doc/html/classpeoPopEval.html new file mode 100644 index 000000000..d702ee706 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/classpeoPopEval.html @@ -0,0 +1,69 @@ + + +ParadisEO-PEO: peoPopEval< EOT > Class Template Reference + + + + +
+
+ +

peoPopEval< EOT > Class Template Reference

The peoPopEval class provides the interface for constructing ParadisEO specific evaluation functors. +More... +

+#include <peoPopEval.h> +

+

Inheritance diagram for peoPopEval< EOT >: +

+ +Service +Communicable +peoParaPopEval< EOT > +peoSeqPopEval< EOT > + +List of all members. + + + + + +

Public Member Functions

+virtual void operator() (eoPop< EOT > &__pop)=0
 Interface function providing the signature for constructing an evaluation functor.
+

Detailed Description

+

template<class EOT>
+ class peoPopEval< EOT >

+ +The peoPopEval class provides the interface for constructing ParadisEO specific evaluation functors. +

+The derived classes may be used as wrappers for EO-derived evaluation functors. In order to have an example, please refer to the implementation of the peoSeqPopEval and peoParaPopEval classes. +

+ +

+Definition at line 19 of file peoPopEval.h.


The documentation for this class was generated from the following file: +
Generated on Thu Jul 5 13:43:30 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/classpeoPopEval.png b/branches/paradiseo-peo-meta-model/doc/html/classpeoPopEval.png new file mode 100644 index 000000000..100bbb770 Binary files /dev/null and b/branches/paradiseo-peo-meta-model/doc/html/classpeoPopEval.png differ diff --git a/branches/paradiseo-peo-meta-model/doc/html/classpeoSeqPopEval-members.html b/branches/paradiseo-peo-meta-model/doc/html/classpeoSeqPopEval-members.html new file mode 100644 index 000000000..91af4cd6b --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/classpeoSeqPopEval-members.html @@ -0,0 +1,63 @@ + + +ParadisEO-PEO: Member List + + + + +
+
+ +

peoSeqPopEval< EOT > Member List

This is the complete list of members for peoSeqPopEval< EOT >, including all inherited members.

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Communicable()Communicable
evalpeoSeqPopEval< EOT > [private]
execute()Service [virtual]
getKey()Communicable
getOwner()Service
keyCommunicable [protected]
lock()Communicable
notifySendingAllResourceRequests()Service [virtual]
notifySendingData()Service [virtual]
notifySendingResourceRequest()Service [virtual]
num_commCommunicable [protected, static]
operator()(eoPop< EOT > &__pop)peoSeqPopEval< EOT > [virtual]
packData()Service [virtual]
packResourceRequest()Service
packResult()Service [virtual]
peoSeqPopEval(eoEvalFunc< EOT > &__eval)peoSeqPopEval< EOT >
requestResourceRequest(unsigned __how_many=1)Service
resume()Communicable
sem_lockCommunicable [protected]
sem_stopCommunicable [protected]
setOwner(Thread &__owner)Service
stop()Communicable
unlock()Communicable
unpackData()Service [virtual]
unpackResult()Service [virtual]
~Communicable()Communicable [virtual]


Generated on Thu Jul 5 13:43:30 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/classpeoSeqPopEval.html b/branches/paradiseo-peo-meta-model/doc/html/classpeoSeqPopEval.html new file mode 100644 index 000000000..d202b349e --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/classpeoSeqPopEval.html @@ -0,0 +1,142 @@ + + +ParadisEO-PEO: peoSeqPopEval< EOT > Class Template Reference + + + + +
+
+ +

peoSeqPopEval< EOT > Class Template Reference

The peoSeqPopEval class acts only as a ParadisEO specific sequential evaluation functor - a wrapper for incorporating an eoEvalFunc< EOT >-derived class as evaluation functor. +More... +

+#include <peoSeqPopEval.h> +

+

Inheritance diagram for peoSeqPopEval< EOT >: +

+ +peoPopEval< EOT > +Service +Communicable + +List of all members. + + + + + + + + + + + +

Public Member Functions

 peoSeqPopEval (eoEvalFunc< EOT > &__eval)
 Constructor function - it only sets an internal reference to point to the specified evaluation object.
void operator() (eoPop< EOT > &__pop)
 Operator for evaluating all the individuals of a given population - in a sequential iterative manner.

Private Attributes

+eoEvalFunc< EOT > & eval
+

Detailed Description

+

template<class EOT>
+ class peoSeqPopEval< EOT >

+ +The peoSeqPopEval class acts only as a ParadisEO specific sequential evaluation functor - a wrapper for incorporating an eoEvalFunc< EOT >-derived class as evaluation functor. +

+The specified EO evaluation object is applyied in an iterative manner to each individual of a specified population. +

+ +

+Definition at line 21 of file peoSeqPopEval.h.


Constructor & Destructor Documentation

+ +
+
+
+template<class EOT>
+ + + + + + + + + +
peoSeqPopEval< EOT >::peoSeqPopEval (eoEvalFunc< EOT > &  __eval  ) 
+
+
+ +

+Constructor function - it only sets an internal reference to point to the specified evaluation object. +

+

Parameters:
+ + +
eoEvalFunc< EOT >& __eval - evaluation object to be applied for each individual of a specified population
+
+ +

+Definition at line 41 of file peoSeqPopEval.h. +

+

+


Member Function Documentation

+ +
+
+
+template<class EOT>
+ + + + + + + + + +
void peoSeqPopEval< EOT >::operator() (eoPop< EOT > &  __pop  )  [virtual]
+
+
+ +

+Operator for evaluating all the individuals of a given population - in a sequential iterative manner. +

+

Parameters:
+ + +
eoPop< EOT >& __pop - population to be evaluated.
+
+ +

+Implements peoPopEval< EOT >. +

+Definition at line 46 of file peoSeqPopEval.h. +

+References peoSeqPopEval< EOT >::eval. +

+

+


The documentation for this class was generated from the following file: +
Generated on Thu Jul 5 13:43:30 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/classpeoSeqPopEval.png b/branches/paradiseo-peo-meta-model/doc/html/classpeoSeqPopEval.png new file mode 100644 index 000000000..df2001515 Binary files /dev/null and b/branches/paradiseo-peo-meta-model/doc/html/classpeoSeqPopEval.png differ diff --git a/branches/paradiseo-peo-meta-model/doc/html/classpeoSeqTransform-members.html b/branches/paradiseo-peo-meta-model/doc/html/classpeoSeqTransform-members.html new file mode 100644 index 000000000..4b9ecd570 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/classpeoSeqTransform-members.html @@ -0,0 +1,67 @@ + + +ParadisEO-PEO: Member List + + + + +
+
+ +

peoSeqTransform< EOT > Member List

This is the complete list of members for peoSeqTransform< EOT >, including all inherited members.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Communicable()Communicable
execute()peoSeqTransform< EOT > [inline, virtual]
functor_category()eoUF< A1, R > [static]
getKey()Communicable
getOwner()Service
keyCommunicable [protected]
lock()Communicable
notifySendingAllResourceRequests()Service [virtual]
notifySendingData()Service [virtual]
notifySendingResourceRequest()Service [virtual]
num_commCommunicable [protected, static]
operator()(eoPop< EOT > &__pop)peoSeqTransform< EOT >
peoTransform::operator()(A1)=0eoUF< A1, R > [pure virtual]
packData()peoSeqTransform< EOT > [inline, virtual]
packResourceRequest()Service
packResult()peoSeqTransform< EOT > [inline, virtual]
peoSeqTransform(eoTransform< EOT > &__trans)peoSeqTransform< EOT >
requestResourceRequest(unsigned __how_many=1)Service
resume()Communicable
sem_lockCommunicable [protected]
sem_stopCommunicable [protected]
setOwner(Thread &__owner)Service
stop()Communicable
transpeoSeqTransform< EOT > [private]
unlock()Communicable
unpackData()peoSeqTransform< EOT > [inline, virtual]
unpackResult()peoSeqTransform< EOT > [inline, virtual]
~Communicable()Communicable [virtual]
~eoFunctorBase()eoFunctorBase [virtual]
~eoUF()eoUF< A1, R > [virtual]


Generated on Thu Jul 5 13:43:30 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/classpeoSeqTransform.html b/branches/paradiseo-peo-meta-model/doc/html/classpeoSeqTransform.html new file mode 100644 index 000000000..0eaed61a7 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/classpeoSeqTransform.html @@ -0,0 +1,163 @@ + + +ParadisEO-PEO: peoSeqTransform< EOT > Class Template Reference + + + + +
+
+ +

peoSeqTransform< EOT > Class Template Reference

The peoSeqTransform represent a wrapper for offering the possibility of using EO derived transform operators along with the ParadisEO evolutionary algorithms. +More... +

+#include <peoSeqTransform.h> +

+

Inheritance diagram for peoSeqTransform< EOT >: +

+ +peoTransform< EOT > +Service +eoTransform< EOT > +Communicable +eoUF< A1, R > +eoFunctorBase + +List of all members. + + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Member Functions

 peoSeqTransform (eoTransform< EOT > &__trans)
 Constructor function - sets an internal reference towards the specified EO-derived transform object.
void operator() (eoPop< EOT > &__pop)
 Operator for applying the specified transform operators on each individual of the given population.
+virtual void packData ()
 Interface function for providing a link with the parallel architecture of the ParadisEO framework.
+virtual void unpackData ()
 Interface function for providing a link with the parallel architecture of the ParadisEO framework.
+virtual void execute ()
 Interface function for providing a link with the parallel architecture of the ParadisEO framework.
+virtual void packResult ()
 Interface function for providing a link with the parallel architecture of the ParadisEO framework.
+virtual void unpackResult ()
 Interface function for providing a link with the parallel architecture of the ParadisEO framework.

Private Attributes

+eoTransform< EOT > & trans
+

Detailed Description

+

template<class EOT>
+ class peoSeqTransform< EOT >

+ +The peoSeqTransform represent a wrapper for offering the possibility of using EO derived transform operators along with the ParadisEO evolutionary algorithms. +

+A minimal set of interface functions is also provided for creating the link with the parallel architecture of the ParadisEO framework. +

+ +

+Definition at line 20 of file peoSeqTransform.h.


Constructor & Destructor Documentation

+ +
+
+
+template<class EOT>
+ + + + + + + + + +
peoSeqTransform< EOT >::peoSeqTransform (eoTransform< EOT > &  __trans  ) 
+
+
+ +

+Constructor function - sets an internal reference towards the specified EO-derived transform object. +

+

Parameters:
+ + +
eoTransform< EOT >& __trans - EO-derived transform object including crossover and mutation operators.
+
+ +

+Definition at line 55 of file peoSeqTransform.h. +

+

+


Member Function Documentation

+ +
+
+
+template<class EOT>
+ + + + + + + + + +
void peoSeqTransform< EOT >::operator() (eoPop< EOT > &  __pop  ) 
+
+
+ +

+Operator for applying the specified transform operators on each individual of the given population. +

+

Parameters:
+ + +
eoPop< EOT >& __pop - population to be transformed by applying the crossover and mutation operators.
+
+ +

+Definition at line 60 of file peoSeqTransform.h. +

+References peoSeqTransform< EOT >::trans. +

+

+


The documentation for this class was generated from the following file: +
Generated on Thu Jul 5 13:43:30 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/classpeoSeqTransform.png b/branches/paradiseo-peo-meta-model/doc/html/classpeoSeqTransform.png new file mode 100644 index 000000000..48c554a94 Binary files /dev/null and b/branches/paradiseo-peo-meta-model/doc/html/classpeoSeqTransform.png differ diff --git a/branches/paradiseo-peo-meta-model/doc/html/classpeoSyncIslandMig-members.html b/branches/paradiseo-peo-meta-model/doc/html/classpeoSyncIslandMig-members.html new file mode 100644 index 000000000..e372442a3 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/classpeoSyncIslandMig-members.html @@ -0,0 +1,74 @@ + + +ParadisEO-PEO: Member List + + + + +
+
+ +

peoSyncIslandMig< EOT > Member List

This is the complete list of members for peoSyncIslandMig< EOT >, including all inherited members.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
className(void) const eoUpdater [virtual]
Communicable()Communicable
contpeoSyncIslandMig< EOT > [private]
coop_empeoSyncIslandMig< EOT > [private]
destinationpeoSyncIslandMig< EOT > [private]
empeoSyncIslandMig< EOT > [private]
emigrate()peoSyncIslandMig< EOT > [private]
functor_category()eoF< void > [static]
getKey()Communicable
getOwner()Cooperative
immpeoSyncIslandMig< EOT > [private]
immigrate()peoSyncIslandMig< EOT > [private]
keyCommunicable [protected]
lastCall()eoUpdater [virtual]
lock()Communicable
notifySending()peoSyncIslandMig< EOT > [virtual]
num_commCommunicable [protected, static]
operator()()peoSyncIslandMig< EOT > [virtual]
pack()peoSyncIslandMig< EOT > [virtual]
peoSyncIslandMig(unsigned __frequency, eoSelect< EOT > &__select, eoReplacement< EOT > &__replace, Topology &__topology, eoPop< EOT > &__source, eoPop< EOT > &__destination)peoSyncIslandMig< EOT >
replacepeoSyncIslandMig< EOT > [private]
result_type typedefeoF< void >
resume()Communicable
selectpeoSyncIslandMig< EOT > [private]
sem_lockCommunicable [protected]
sem_stopCommunicable [protected]
send(Cooperative *__coop)Cooperative
setOwner(Runner &__runner)Cooperative
sourcepeoSyncIslandMig< EOT > [private]
stop()Communicable
syncpeoSyncIslandMig< EOT > [private]
topologypeoSyncIslandMig< EOT > [private]
unlock()Communicable
unpack()peoSyncIslandMig< EOT > [virtual]
~Communicable()Communicable [virtual]
~eoF()eoF< void > [virtual]
~eoFunctorBase()eoFunctorBase [virtual]


Generated on Thu Jul 5 13:43:31 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/classpeoSyncIslandMig.html b/branches/paradiseo-peo-meta-model/doc/html/classpeoSyncIslandMig.html new file mode 100644 index 000000000..6e8c45e2e --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/classpeoSyncIslandMig.html @@ -0,0 +1,310 @@ + + +ParadisEO-PEO: peoSyncIslandMig< EOT > Class Template Reference + + + + +
+
+ +

peoSyncIslandMig< EOT > Class Template Reference

The peoSyncIslandMig class offers the elementary basis for implementating a synchronous island migration model - requires the specification of several basic parameters, i.e. +More... +

+#include <peoSyncIslandMig.h> +

+

Inheritance diagram for peoSyncIslandMig< EOT >: +

+ +Cooperative +eoUpdater +Communicable +eoF< void > +eoFunctorBase + +List of all members. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Member Functions

 peoSyncIslandMig (unsigned __frequency, eoSelect< EOT > &__select, eoReplacement< EOT > &__replace, Topology &__topology, eoPop< EOT > &__source, eoPop< EOT > &__destination)
 Constructor for the peoSyncIslandMig class; the characteristics of the migration model are defined through the specified parameters - out of the box objects provided in EO, etc., or custom, derived objects may be passed as parameters.
void operator() ()
 Function operator to be called as checkpoint for performing the migration step.
+void pack ()
 Auxiliary function dealing with sending the emigrant individuals. There is no need to explicitly call the function.
+void unpack ()
 Auxiliary function dealing with receiving immigrant individuals. There is no need to explicitly call the function.
+void notifySending ()
 Auxiliary function dealing with migration notifications. There is no need to explicitly call the function.

Private Member Functions

+void emigrate ()
+void immigrate ()

Private Attributes

+eoPeriodicContinue< EOT > cont
+eoSelect< EOT > & select
+eoReplacement< EOT > & replace
+Topologytopology
+eoPop< EOT > & source
+eoPop< EOT > & destination
+std::queue< eoPop< EOT > > imm
+std::queue< eoPop< EOT > > em
+std::queue< Cooperative * > coop_em
+sem_t sync
+

Detailed Description

+

template<class EOT>
+ class peoSyncIslandMig< EOT >

+ +The peoSyncIslandMig class offers the elementary basis for implementating a synchronous island migration model - requires the specification of several basic parameters, i.e. +

+frequency of the migrations, selection and replacement strategies, a topological model and the source and destination population for the migrating individuals. The main difference as opposed to the asynchronous migration model is the synchronization step performed after selecting and sending the emigrant individuals.

+The migration operator is called at the end of each generation of an evolutionary algorithms as a checkpoint object - the following code exposes the structure of a classic evolutionary algorithm:

+ + + + + + + + + + + + + +
do {    
         select( population, offsprings );   // select the offsprings from the current population
         transform( offsprings );   // crossover and mutation operators are applied on the selected offsprings
         evaluate( offsprings );   // evaluation step of the resulting offspring
         replace( population, offsprings );   // replace the individuals in the current population whith individuals from the offspring population, according to a specified replacement strategy
} while ( eaCheckpointContinue( population ) );   // checkpoint operators are applied on the current population, including the migration operator, if any specified
+

+Constructing a synchronous island migration model requires having defined (1) a topological migration model, (2) the control parameters of the migration process, (3) a checkpoint object associated with an evolutionary algorithm, and (4) an owner object must be set. The owner object must be derived from the Runner class (for example a peoEA object represents a possible owner). A simple example is offered bellow:

+

    +
  1. +topological model to be followed when performing migrations:
    +
    + + + +
    RingTopology migTopology;   // a simple ring topological model - each island communicates with two other islands
    +

    +

  2. +
  3. +the continuation criterion, selection and replacement strategy etc. are defined:
    +
    + + + + + + + + + + + + + + + +
    eoPop< EOT > population( POP_SIZE, popInitializer );   // population of individuals to be used for the evolutionary algorithm
       
    eoRandomSelect< EOT > migSelectStrategy;   // selection strategy - in this case a random selection is applied
    eoSelectNumber< EOT > migSelect( migSelectStrategy, MIG_SIZE );   // number of individuals to be selected using the specified strategy
    eoPlusReplacement< EOT > migReplace;   // immigration strategy - the worse individuals in the destination population are replaced by the immigrant individuals
       
    peoSyncIslandMig< EOT > syncMigration(
    +          MIG_FREQ, migSelect, migReplace, migTopology,
    +          population, population
    + );  
    // synchronous migration object - the emigrant individuals are selected from the same from population in which the immigrant individuals are being integrated
    +

    +

  4. +
  5. +creation of a checkpoint object as part of the definition of an evolutionary algoritm (details of th EA not given as being out of scope):
    +
    + + + + + + + + + + + + + +
    ...    
    eoGenContinue< EOT > eaCont( NUM_GEN );   // the evolutionary algorithm will stop after NUM_GEN generations
    eoCheckPoint< EOT > eaCheckpointContinue( eaCont );   // number of individuals to be selected using the specified strategy
    ...    
    eaCheckpointContinue.add( syncMigration );   // adding the migration operator as checkpoint element
    ...    
    +

    +

  6. +
  7. +definition of an owner evolutionary algorithm (an object inheriting the Runner class):
    +
    + + + + + + + +
    peoEA< EOT > eaAlg( eaCheckpointContinue, eaPopEval, eaSelect, eaTransform, eaReplace);   // evolutionary algorithm having as checkpoint the eaCheckpointContinue object defined above
    syncMigration.setOwner( eaAlg );   // setting the evolutionary algorithm as owner of the migration object
    eaAlg( population );   // applying the evolutionary algorithm on a given population
    +
  8. +
+

+The source and the destination population for the migration object were specified as being the same, in step no. 2, as we are usually interested in selecting the emigrants and integrating the immigrant individuals from and in, respectively, one unique population, iteratively evolved by an evolutionary algorithm. There is no restriction in having two distinct populations as source and destination for the emigrant and immigrant individuals respectively.

+The above steps only create a synchronous migration object associated to an evolutionary algorithm. The creation of several islands requires the reiteration of the steps 2 through 4 for creating distinct algorithms, with distinct populations and the associated distinctly parametrized migration objects. The interconnecting element is the underlying topology, defined at step 1 (the same C++ migTopology object has to be passed as parameter for all the migration objects, in order to interconnect them). +

+ +

+Definition at line 114 of file peoSyncIslandMig.h.


Constructor & Destructor Documentation

+ +
+
+
+template<class EOT>
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
peoSyncIslandMig< EOT >::peoSyncIslandMig (unsigned  __frequency,
eoSelect< EOT > &  __select,
eoReplacement< EOT > &  __replace,
Topology __topology,
eoPop< EOT > &  __source,
eoPop< EOT > &  __destination 
)
+
+
+ +

+Constructor for the peoSyncIslandMig class; the characteristics of the migration model are defined through the specified parameters - out of the box objects provided in EO, etc., or custom, derived objects may be passed as parameters. +

+

Parameters:
+ + + + + + + +
unsigned __frequency - frequency of the migrations - the migrations occur periodically;
eoSelect< EOT >& __select - selection strategy to be applied for constructing a list of emigrant individuals out of the source population;
eoReplacement< EOT >& __replace - replacement strategy used for integrating the immigrant individuals in the destination population;
Topology& __topology - topological model to be followed when performing migrations;
eoPop< EOT >& __source - source population from which the emigrant individuals are selected;
eoPop< EOT >& __destination - destination population in which the immigrant population are integrated.
+
+ +

+Definition at line 178 of file peoSyncIslandMig.h. +

+References Topology::add(), and peoSyncIslandMig< EOT >::sync. +

+

+


Member Function Documentation

+ +
+
+
+template<class EOT>
+ + + + + + + + +
void peoSyncIslandMig< EOT >::operator() (  )  [virtual]
+
+
+ +

+Function operator to be called as checkpoint for performing the migration step. +

+The emigrant individuals are selected from the source population and sent to the next island (defined by the topology object) while the immigrant individuals are integrated in the destination population. There is no need to explicitly call the function - the wrapper checkpoint object (please refer to the above example) will perform the call when required. +

+Implements eoF< void >. +

+Definition at line 252 of file peoSyncIslandMig.h. +

+References peoSyncIslandMig< EOT >::cont, peoSyncIslandMig< EOT >::emigrate(), Cooperative::getOwner(), peoSyncIslandMig< EOT >::immigrate(), Thread::setActive(), peoSyncIslandMig< EOT >::source, Communicable::stop(), and peoSyncIslandMig< EOT >::sync. +

+

+


The documentation for this class was generated from the following file: +
Generated on Thu Jul 5 13:43:31 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/classpeoSyncIslandMig.png b/branches/paradiseo-peo-meta-model/doc/html/classpeoSyncIslandMig.png new file mode 100644 index 000000000..6a1b7c227 Binary files /dev/null and b/branches/paradiseo-peo-meta-model/doc/html/classpeoSyncIslandMig.png differ diff --git a/branches/paradiseo-peo-meta-model/doc/html/classpeoSyncMultiStart-members.html b/branches/paradiseo-peo-meta-model/doc/html/classpeoSyncMultiStart-members.html new file mode 100644 index 000000000..151209557 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/classpeoSyncMultiStart-members.html @@ -0,0 +1,78 @@ + + +ParadisEO-PEO: Member List + + + + +
+
+ +

peoSyncMultiStart< EOT > Member List

This is the complete list of members for peoSyncMultiStart< EOT >, including all inherited members.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
className(void) const eoUpdater [virtual]
Communicable()Communicable
contpeoSyncMultiStart< EOT > [private]
execute()peoSyncMultiStart< EOT > [virtual]
functor_category()eoF< void > [static]
getKey()Communicable
getOwner()Service
idxpeoSyncMultiStart< EOT > [private]
impr_selpeoSyncMultiStart< EOT > [private]
keyCommunicable [protected]
lastCall()eoUpdater [virtual]
lock()Communicable
lspeoSyncMultiStart< EOT > [private]
notifySendingAllResourceRequests()peoSyncMultiStart< EOT > [virtual]
notifySendingData()peoSyncMultiStart< EOT > [virtual]
notifySendingResourceRequest()Service [virtual]
num_commCommunicable [protected, static]
num_termpeoSyncMultiStart< EOT > [private]
operator()()peoSyncMultiStart< EOT > [virtual]
packData()peoSyncMultiStart< EOT > [virtual]
packResourceRequest()Service
packResult()peoSyncMultiStart< EOT > [virtual]
peoSyncMultiStart(eoContinue< EOT > &__cont, eoSelect< EOT > &__select, eoReplacement< EOT > &__replace, moAlgo< EOT > &__ls, eoPop< EOT > &__pop)peoSyncMultiStart< EOT >
poppeoSyncMultiStart< EOT > [private]
replacepeoSyncMultiStart< EOT > [private]
requestResourceRequest(unsigned __how_many=1)Service
result_type typedefeoF< void >
resume()Communicable
selpeoSyncMultiStart< EOT > [private]
selectpeoSyncMultiStart< EOT > [private]
sem_lockCommunicable [protected]
sem_stopCommunicable [protected]
setOwner(Thread &__owner)Service
solpeoSyncMultiStart< EOT > [private]
stop()Communicable
unlock()Communicable
unpackData()peoSyncMultiStart< EOT > [virtual]
unpackResult()peoSyncMultiStart< EOT > [virtual]
~Communicable()Communicable [virtual]
~eoF()eoF< void > [virtual]
~eoFunctorBase()eoFunctorBase [virtual]


Generated on Thu Jul 5 13:43:31 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/classpeoSyncMultiStart.html b/branches/paradiseo-peo-meta-model/doc/html/classpeoSyncMultiStart.html new file mode 100644 index 000000000..3a3e37955 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/classpeoSyncMultiStart.html @@ -0,0 +1,418 @@ + + +ParadisEO-PEO: peoSyncMultiStart< EOT > Class Template Reference + + + + +
+
+ +

peoSyncMultiStart< EOT > Class Template Reference

The peoSyncMultiStart class provides the basis for implementing the synchronous multi-start model, for launching several solution-based algorithms in parallel on a specified initial population. +More... +

+#include <peoSyncMultiStart.h> +

+

Inheritance diagram for peoSyncMultiStart< EOT >: +

+ +Service +eoUpdater +Communicable +eoF< void > +eoFunctorBase + +List of all members. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Member Functions

 peoSyncMultiStart (eoContinue< EOT > &__cont, eoSelect< EOT > &__select, eoReplacement< EOT > &__replace, moAlgo< EOT > &__ls, eoPop< EOT > &__pop)
 Constructor function - several simple parameters are required for defining the characteristics of the multi-start model.
void operator() ()
 Operator which synchronously executes the specified algorithm on the individuals selected from the initial population.
void packData ()
 Auxiliary function for transferring data between the process requesting the synchronous execution of the specified algorithm and the process which actually executes the algorithm.
void unpackData ()
 Auxiliary function for transferring data between the process requesting the synchronous execution of the specified algorithm and the process which actually executes the algorithm.
void execute ()
 Auxiliary function for actually executing the specified algorithm on one assigned individual.
void packResult ()
 Auxiliary function for transferring data between the process requesting the synchronous execution of the specified algorithm and the process which actually executes the algorithm.
void unpackResult ()
 Auxiliary function for transferring data between the process requesting the synchronous execution of the specified algorithm and the process which actually executes the algorithm.
void notifySendingData ()
 Auxiliary function for notifications between the process requesting the synchronous multi-start execution and the processes that performs the actual execution phase.
void notifySendingAllResourceRequests ()
 Auxiliary function for notifications between the process requesting the synchronous multi-start execution and the processes that performs the actual execution phase.

Private Attributes

+eoContinue< EOT > & cont
+eoSelect< EOT > & select
+eoReplacement< EOT > & replace
+moAlgo< EOT > & ls
+eoPop< EOT > & pop
+eoPop< EOT > sel
+eoPop< EOT > impr_sel
+EOT sol
+unsigned idx
+unsigned num_term
+

Detailed Description

+

template<class EOT>
+ class peoSyncMultiStart< EOT >

+ +The peoSyncMultiStart class provides the basis for implementing the synchronous multi-start model, for launching several solution-based algorithms in parallel on a specified initial population. +

+As a simple example, several hill climbing algorithms may be synchronously launched on the specified population, each algorithm acting upon one individual only, the final result being integrated back in the population. A peoSyncMultiStart object can be specified as checkpoint object for a classic ParadisEO evolutionary algorithm thus allowing for simple hybridization schemes which combine the evolutionary approach with a local search approach, for example, executed at the end of each generation. +

+ +

+Definition at line 36 of file peoSyncMultiStart.h.


Constructor & Destructor Documentation

+ +
+
+
+template<class EOT>
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
peoSyncMultiStart< EOT >::peoSyncMultiStart (eoContinue< EOT > &  __cont,
eoSelect< EOT > &  __select,
eoReplacement< EOT > &  __replace,
moAlgo< EOT > &  __ls,
eoPop< EOT > &  __pop 
)
+
+
+ +

+Constructor function - several simple parameters are required for defining the characteristics of the multi-start model. +

+

Parameters:
+ + + + + + +
eoContinue< EOT >& __cont - defined for including further functionality - no semantics associated at this time;
eoSelect< EOT >& __select - selection strategy for obtaining a subset of the initial population on which to apply the specified algorithm;
eoReplacement< EOT >& __replace - replacement strategy for integrating the resulting individuals in the initial population;
moAlgo< EOT >& __ls - algorithm to be applied on each of the selected individuals - a moAlgo< EOT >-derived object must be specified;
eoPop< EOT >& __pop - the initial population from which the individuals are selected for applying the specified algorithm.
+
+ +

+Definition at line 106 of file peoSyncMultiStart.h. +

+

+


Member Function Documentation

+ +
+
+
+template<class EOT>
+ + + + + + + + +
void peoSyncMultiStart< EOT >::operator() (  )  [virtual]
+
+
+ +

+Operator which synchronously executes the specified algorithm on the individuals selected from the initial population. +

+There is no need to explicitly call the operator - automatically called as checkpoint operator. +

+Implements eoF< void >. +

+Definition at line 161 of file peoSyncMultiStart.h. +

+References peoSyncMultiStart< EOT >::idx, peoSyncMultiStart< EOT >::impr_sel, peoSyncMultiStart< EOT >::num_term, peoSyncMultiStart< EOT >::pop, Service::requestResourceRequest(), peoSyncMultiStart< EOT >::sel, peoSyncMultiStart< EOT >::select, and Communicable::stop(). +

+

+ +

+
+
+template<class EOT>
+ + + + + + + + +
void peoSyncMultiStart< EOT >::packData (  )  [virtual]
+
+
+ +

+Auxiliary function for transferring data between the process requesting the synchronous execution of the specified algorithm and the process which actually executes the algorithm. +

+There is no need to explicitly call the function. +

+Reimplemented from Service. +

+Definition at line 120 of file peoSyncMultiStart.h. +

+References peoSyncMultiStart< EOT >::idx, and peoSyncMultiStart< EOT >::sel. +

+

+ +

+
+
+template<class EOT>
+ + + + + + + + +
void peoSyncMultiStart< EOT >::unpackData (  )  [virtual]
+
+
+ +

+Auxiliary function for transferring data between the process requesting the synchronous execution of the specified algorithm and the process which actually executes the algorithm. +

+There is no need to explicitly call the function. +

+Reimplemented from Service. +

+Definition at line 126 of file peoSyncMultiStart.h. +

+References peoSyncMultiStart< EOT >::sol. +

+

+ +

+
+
+template<class EOT>
+ + + + + + + + +
void peoSyncMultiStart< EOT >::execute (  )  [virtual]
+
+
+ +

+Auxiliary function for actually executing the specified algorithm on one assigned individual. +

+There is no need to explicitly call the function. +

+Reimplemented from Service. +

+Definition at line 132 of file peoSyncMultiStart.h. +

+References peoSyncMultiStart< EOT >::ls, and peoSyncMultiStart< EOT >::sol. +

+

+ +

+
+
+template<class EOT>
+ + + + + + + + +
void peoSyncMultiStart< EOT >::packResult (  )  [virtual]
+
+
+ +

+Auxiliary function for transferring data between the process requesting the synchronous execution of the specified algorithm and the process which actually executes the algorithm. +

+There is no need to explicitly call the function. +

+Reimplemented from Service. +

+Definition at line 138 of file peoSyncMultiStart.h. +

+References peoSyncMultiStart< EOT >::sol. +

+

+ +

+
+
+template<class EOT>
+ + + + + + + + +
void peoSyncMultiStart< EOT >::unpackResult (  )  [virtual]
+
+
+ +

+Auxiliary function for transferring data between the process requesting the synchronous execution of the specified algorithm and the process which actually executes the algorithm. +

+There is no need to explicitly call the function. +

+Reimplemented from Service. +

+Definition at line 144 of file peoSyncMultiStart.h. +

+References Service::getOwner(), peoSyncMultiStart< EOT >::impr_sel, peoSyncMultiStart< EOT >::num_term, peoSyncMultiStart< EOT >::pop, peoSyncMultiStart< EOT >::replace, Communicable::resume(), peoSyncMultiStart< EOT >::sel, Thread::setActive(), and peoSyncMultiStart< EOT >::sol. +

+

+ +

+
+
+template<class EOT>
+ + + + + + + + +
void peoSyncMultiStart< EOT >::notifySendingData (  )  [virtual]
+
+
+ +

+Auxiliary function for notifications between the process requesting the synchronous multi-start execution and the processes that performs the actual execution phase. +

+There is no need to explicitly call the function. +

+Reimplemented from Service. +

+Definition at line 172 of file peoSyncMultiStart.h. +

+

+ +

+
+
+template<class EOT>
+ + + + + + + + +
void peoSyncMultiStart< EOT >::notifySendingAllResourceRequests (  )  [virtual]
+
+
+ +

+Auxiliary function for notifications between the process requesting the synchronous multi-start execution and the processes that performs the actual execution phase. +

+There is no need to explicitly call the function. +

+Reimplemented from Service. +

+Definition at line 177 of file peoSyncMultiStart.h. +

+References Service::getOwner(), and Thread::setPassive(). +

+

+


The documentation for this class was generated from the following file: +
Generated on Thu Jul 5 13:43:31 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/classpeoSyncMultiStart.png b/branches/paradiseo-peo-meta-model/doc/html/classpeoSyncMultiStart.png new file mode 100644 index 000000000..2ab8fb990 Binary files /dev/null and b/branches/paradiseo-peo-meta-model/doc/html/classpeoSyncMultiStart.png differ diff --git a/branches/paradiseo-peo-meta-model/doc/html/classpeoTransform-members.html b/branches/paradiseo-peo-meta-model/doc/html/classpeoTransform-members.html new file mode 100644 index 000000000..19a5c57b4 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/classpeoTransform-members.html @@ -0,0 +1,64 @@ + + +ParadisEO-PEO: Member List + + + + +
+
+ +

peoTransform< EOT > Member List

This is the complete list of members for peoTransform< EOT >, including all inherited members.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
Communicable()Communicable
execute()Service [virtual]
functor_category()eoUF< A1, R > [static]
getKey()Communicable
getOwner()Service
keyCommunicable [protected]
lock()Communicable
notifySendingAllResourceRequests()Service [virtual]
notifySendingData()Service [virtual]
notifySendingResourceRequest()Service [virtual]
num_commCommunicable [protected, static]
operator()(A1)=0eoUF< A1, R > [pure virtual]
packData()Service [virtual]
packResourceRequest()Service
packResult()Service [virtual]
requestResourceRequest(unsigned __how_many=1)Service
resume()Communicable
sem_lockCommunicable [protected]
sem_stopCommunicable [protected]
setOwner(Thread &__owner)Service
stop()Communicable
unlock()Communicable
unpackData()Service [virtual]
unpackResult()Service [virtual]
~Communicable()Communicable [virtual]
~eoFunctorBase()eoFunctorBase [virtual]
~eoUF()eoUF< A1, R > [virtual]


Generated on Thu Jul 5 13:43:31 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/classpeoTransform.html b/branches/paradiseo-peo-meta-model/doc/html/classpeoTransform.html new file mode 100644 index 000000000..7d416dc79 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/classpeoTransform.html @@ -0,0 +1,65 @@ + + +ParadisEO-PEO: peoTransform< EOT > Class Template Reference + + + + +
+
+ +

peoTransform< EOT > Class Template Reference

The peoTransform class acts only as an interface for creating transform operators - for an example please refer to the peoSeqTransform and the peoParaSGATransform classes. +More... +

+#include <peoTransform.h> +

+

Inheritance diagram for peoTransform< EOT >: +

+ +Service +eoTransform< EOT > +Communicable +eoUF< A1, R > +eoFunctorBase +peoParaSGATransform< EOT > +peoSeqTransform< EOT > + +List of all members. + +
+

Detailed Description

+

template<class EOT>
+ class peoTransform< EOT >

+ +The peoTransform class acts only as an interface for creating transform operators - for an example please refer to the peoSeqTransform and the peoParaSGATransform classes. +

+ +

+Definition at line 20 of file peoTransform.h.


The documentation for this class was generated from the following file: +
Generated on Thu Jul 5 13:43:31 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/classpeoTransform.png b/branches/paradiseo-peo-meta-model/doc/html/classpeoTransform.png new file mode 100644 index 000000000..d762a43a5 Binary files /dev/null and b/branches/paradiseo-peo-meta-model/doc/html/classpeoTransform.png differ diff --git a/branches/paradiseo-peo-meta-model/doc/html/comm_8cpp-source.html b/branches/paradiseo-peo-meta-model/doc/html/comm_8cpp-source.html new file mode 100644 index 000000000..ad844aea2 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/comm_8cpp-source.html @@ -0,0 +1,96 @@ + + +ParadisEO-PEO: comm.cpp Source File + + + + +
+
+

comm.cpp

00001 // "comm.cpp"
+00002 
+00003 // (c) OPAC Team, LIFL, August 2005
+00004 
+00005 /* 
+00006    Contact: paradiseo-help@lists.gforge.inria.fr
+00007 */
+00008 
+00009 
+00010 #include <mpi.h>
+00011 
+00012 #include "comm.h"
+00013 #include "mess.h"
+00014 #include "node.h"
+00015 #include "param.h"
+00016 #include "../../core/peo_debug.h"
+00017 #include "../../core/runner.h"
+00018 #include "send.h"
+00019 #include "recv.h"
+00020 #include "scheduler.h"
+00021 
+00022 static sem_t sem_comm_init;
+00023 
+00024 static Communicator * the_thread;
+00025 
+00026 Communicator :: Communicator (int * __argc, char * * * __argv) {
+00027 
+00028   the_thread = this;  
+00029   initNode  (__argc, __argv);
+00030   loadRMCParameters (* __argc, * __argv);  
+00031   sem_post (& sem_comm_init);
+00032 }
+00033 
+00034 void Communicator :: start () {
+00035 
+00036   while (true) {
+00037     
+00038     /* Zzz Zzz Zzz :-))) */
+00039     sleep ();
+00040     sendMessages ();
+00041 
+00042     if (! atLeastOneActiveRunner ())     
+00043       break;
+00044     receiveMessages ();    
+00045   }
+00046   waitBuffers ();  
+00047   printDebugMessage ("finalizing");
+00048   MPI_Finalize ();  
+00049 }
+00050 
+00051 void initCommunication () {
+00052 
+00053   sem_init (& sem_comm_init, 0, 0);
+00054 }
+00055 
+00056 void waitNodeInitialization () {
+00057 
+00058   sem_wait (& sem_comm_init);
+00059 }
+00060 
+00061 void wakeUpCommunicator () {
+00062 
+00063   the_thread -> wakeUp ();
+00064 }
+00065 
+00066 
+00067 
+

Generated on Thu Jul 5 13:43:30 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/comm_8h-source.html b/branches/paradiseo-peo-meta-model/doc/html/comm_8h-source.html new file mode 100644 index 000000000..0596c24f1 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/comm_8h-source.html @@ -0,0 +1,60 @@ + + +ParadisEO-PEO: comm.h Source File + + + + +
+
+

comm.h

00001 // "comm.h"
+00002 
+00003 // (c) OPAC Team, LIFL, August 2005
+00004 
+00005 /* 
+00006    Contact: paradiseo-help@lists.gforge.inria.fr
+00007 */
+00008 
+00009 #ifndef __comm_mpi_h
+00010 #define __comm_mpi_h
+00011 
+00012 #include "../../core/communicable.h"
+00013 #include "../../core/reac_thread.h"
+00014 
+00015 class Communicator : public ReactiveThread {
+00016 
+00017 public :
+00018   
+00019   /* Ctor */
+00020   Communicator (int * __argc, char * * * __argv);
+00021 
+00022   void start ();
+00023 };
+00024 
+00025 extern void initCommunication ();
+00026 
+00027 extern void waitNodeInitialization ();
+00028 
+00029 extern void wakeUpCommunicator ();
+00030 
+00031 #endif
+

Generated on Thu Jul 5 13:43:30 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/communicable_8cpp-source.html b/branches/paradiseo-peo-meta-model/doc/html/communicable_8cpp-source.html new file mode 100644 index 000000000..133b8367d --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/communicable_8cpp-source.html @@ -0,0 +1,99 @@ + + +ParadisEO-PEO: communicable.cpp Source File + + + + +
+
+

communicable.cpp

00001 // "comm.cpp"
+00002 
+00003 // (c) OPAC Team, LIFL, August 2005
+00004 
+00005 /* 
+00006    Contact: paradiseo-help@lists.gforge.inria.fr
+00007 */
+00008 
+00009 #include <vector>
+00010 #include <map>
+00011 #include <cassert>
+00012 
+00013 #include "communicable.h"
+00014 
+00015 static std :: vector <Communicable *> key_to_comm (1); /* Vector of registered cooperators */
+00016 
+00017 static std :: map <const Communicable *, unsigned> comm_to_key; /* Map of registered cooperators */
+00018 
+00019 unsigned Communicable :: num_comm = 0;
+00020 
+00021 Communicable :: Communicable () {
+00022 
+00023   comm_to_key [this] = key = ++ num_comm;
+00024   key_to_comm.push_back (this);
+00025   sem_init (& sem_lock, 0, 1);
+00026   sem_init (& sem_stop, 0, 0);
+00027 }
+00028 
+00029 Communicable :: ~ Communicable () {
+00030 
+00031 }
+00032 
+00033 COMM_ID Communicable :: getKey () {
+00034 
+00035   return key;
+00036 }
+00037 
+00038 Communicable * getCommunicable (COMM_ID __key) {
+00039 
+00040   assert (__key < key_to_comm.size ());
+00041   return key_to_comm [__key];  
+00042 }
+00043 
+00044 COMM_ID getKey (const Communicable * __comm) {
+00045   
+00046   return comm_to_key [__comm];
+00047 }
+00048 
+00049 void Communicable :: lock () {
+00050 
+00051   sem_wait (& sem_lock);
+00052 }
+00053 
+00054 void Communicable :: unlock () {
+00055 
+00056   sem_post (& sem_lock);
+00057 }
+00058 
+00059 void Communicable :: stop () {
+00060 
+00061   sem_wait (& sem_stop);
+00062 }
+00063 
+00064 void Communicable :: resume () {
+00065 
+00066   sem_post (& sem_stop);
+00067 }
+00068 
+00069 
+00070 
+

Generated on Thu Jul 5 13:43:30 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/communicable_8h-source.html b/branches/paradiseo-peo-meta-model/doc/html/communicable_8h-source.html new file mode 100644 index 000000000..5fb98576c --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/communicable_8h-source.html @@ -0,0 +1,76 @@ + + +ParadisEO-PEO: communicable.h Source File + + + + +
+
+

communicable.h

00001 // "communicable.h"
+00002 
+00003 // (c) OPAC Team, LIFL, August 2005
+00004 
+00005 /* 
+00006    Contact: paradiseo-help@lists.gforge.inria.fr
+00007 */
+00008 
+00009 #ifndef __communicable_h
+00010 #define __communicable_h
+00011 
+00012 #include <semaphore.h>
+00013 
+00014 typedef unsigned COMM_ID;
+00015 
+00016 class Communicable {
+00017 
+00018 public :
+00019 
+00020   Communicable ();
+00021   
+00022   virtual ~ Communicable ();
+00023 
+00024   COMM_ID getKey ();  
+00025 
+00026   void lock (); /* It suspends the current process if the semaphore is locked */
+00027   void unlock (); /* It unlocks the shared semaphore */
+00028 
+00029   void stop (); /* It suspends the current process */
+00030   void resume (); /* It resumes ___________ */
+00031   
+00032 protected :
+00033 
+00034   COMM_ID key;
+00035 
+00036   sem_t sem_lock;
+00037   
+00038   sem_t sem_stop;
+00039 
+00040   static unsigned num_comm;
+00041 };
+00042 
+00043 extern Communicable * getCommunicable (COMM_ID __key); 
+00044 
+00045 //extern COMM_ID getKey (const Communicable * __comm);
+00046 
+00047 #endif
+

Generated on Thu Jul 5 13:43:30 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/coop_8cpp-source.html b/branches/paradiseo-peo-meta-model/doc/html/coop_8cpp-source.html new file mode 100644 index 000000000..4e9b4a9af --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/coop_8cpp-source.html @@ -0,0 +1,71 @@ + + +ParadisEO-PEO: coop.cpp Source File + + + + +
+
+

coop.cpp

00001 // "coop.cpp"
+00002 
+00003 // (c) OPAC Team, LIFL, August 2005
+00004 
+00005 /* 
+00006    Contact: paradiseo-help@lists.gforge.inria.fr
+00007 */
+00008 
+00009 #include "../../core/cooperative.h"
+00010 #include "send.h"
+00011 #include "tags.h"
+00012 #include "schema.h"
+00013 #include "mess.h"
+00014 #include "../../core/peo_debug.h"
+00015 
+00016 Runner * Cooperative :: getOwner () {
+00017 
+00018   return owner;
+00019 }
+00020 
+00021 void Cooperative :: setOwner (Runner & __runner) {
+00022 
+00023   owner = & __runner;
+00024 }
+00025 
+00026 void Cooperative :: send (Cooperative * __coop) {
+00027 
+00028   :: send (this, getRankOfRunner (__coop -> getOwner () -> getID ()), COOP_TAG);   
+00029   //  stop ();
+00030 }
+00031 
+00032 Cooperative * getCooperative (COOP_ID __key) {
+00033 
+00034   return dynamic_cast <Cooperative *> (getCommunicable (__key));
+00035 }
+00036 
+00037 void Cooperative :: notifySending () {
+00038 
+00039   //getOwner -> setPassive ();
+00040   //  resume ();
+00041   //  printDebugMessage (b);
+00042 }
+

Generated on Thu Jul 5 13:43:30 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/cooperative_8h-source.html b/branches/paradiseo-peo-meta-model/doc/html/cooperative_8h-source.html new file mode 100644 index 000000000..0b89e4f74 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/cooperative_8h-source.html @@ -0,0 +1,70 @@ + + +ParadisEO-PEO: cooperative.h Source File + + + + +
+
+

cooperative.h

00001 // "cooperative.h"
+00002 
+00003 // (c) OPAC Team, LIFL, August 2005
+00004 
+00005 /* 
+00006    Contact: paradiseo-help@lists.gforge.inria.fr
+00007 */
+00008 
+00009 #ifndef __cooperative_h
+00010 #define __cooperative_h
+00011 
+00012 #include "communicable.h"
+00013 #include "runner.h"
+00014 
+00015 typedef unsigned COOP_ID;
+00016 
+00017 class Cooperative : public Communicable {
+00018 
+00019 public :
+00020 
+00021   Runner * getOwner ();
+00022 
+00023   void setOwner (Runner & __runner);
+00024 
+00025   virtual void pack () = 0;
+00026   
+00027   virtual void unpack () = 0;
+00028 
+00029   void send (Cooperative * __coop); 
+00030 
+00031   virtual void notifySending ();
+00032 
+00033 private :
+00034 
+00035   Runner * owner;
+00036 
+00037 };
+00038 
+00039 extern Cooperative * getCooperative (COOP_ID __key); 
+00040 
+00041 #endif
+

Generated on Thu Jul 5 13:43:30 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/core_2runner_8cpp-source.html b/branches/paradiseo-peo-meta-model/doc/html/core_2runner_8cpp-source.html new file mode 100644 index 000000000..4a87691af --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/core_2runner_8cpp-source.html @@ -0,0 +1,133 @@ + + +ParadisEO-PEO: runner.cpp Source File + + + + +
+
+

runner.cpp

00001 // "runner.cpp"
+00002 
+00003 // (c) OPAC Team, LIFL, August 2005
+00004 
+00005 /* 
+00006    Contact: paradiseo-help@lists.gforge.inria.fr
+00007 */
+00008 
+00009 #include <vector>
+00010 
+00011 #include "runner.h"
+00012 #include "reac_thread.h"
+00013 #include "peo_debug.h"
+00014 #include "messaging.h"
+00015 
+00016 static unsigned num_act = 0; /* Number of active runners */
+00017 
+00018 static std :: vector <pthread_t *> ll_threads; /* Low-level runner threads */ 
+00019 
+00020 static std :: vector <Runner *> the_runners;
+00021 
+00022 static unsigned num_runners = 0;
+00023 
+00024 Runner :: Runner () {
+00025 
+00026   id = ++ num_runners;
+00027   the_runners.push_back (this);
+00028   sem_init (& sem_start, 0, 0);
+00029   num_act ++;  
+00030 }
+00031 
+00032 extern int getNodeRank ();
+00033 
+00034 extern int getNumberOfNodes ();
+00035 
+00036 void unpackTerminationOfRunner () {
+00037   
+00038   RUNNER_ID id;
+00039   unpack (id);    
+00040   num_act --;
+00041   printDebugMessage ("I'm noticed of the termination of a runner");
+00042   if (! num_act) {
+00043     printDebugMessage ("all the runners have terminated. Now stopping the reactive threads.");
+00044     stopReactiveThreads ();
+00045   }
+00046 }
+00047 
+00048 bool atLeastOneActiveRunner () {
+00049 
+00050   return num_act;
+00051 }
+00052 
+00053 RUNNER_ID Runner :: getID () {
+00054 
+00055   return id;
+00056 }
+00057 
+00058 void Runner :: start () {
+00059 
+00060   setActive ();
+00061   sem_post (& sem_start);
+00062   run ();
+00063   terminate ();
+00064 }
+00065 
+00066 void Runner :: notifySendingTermination () {
+00067 
+00068   /*
+00069   char b [1000];
+00070   sprintf (b, "Il reste encore %d !!!!!!!!!!!!", n);
+00071   printDebugMessage (b);
+00072   */
+00073   printDebugMessage ("je suis informe que tout le monde a recu ma terminaison");
+00074   setPassive ();
+00075   
+00076 }
+00077 
+00078 void Runner :: waitStarting () {
+00079 
+00080   sem_wait (& sem_start);
+00081 }
+00082 
+00083 Runner * getRunner (RUNNER_ID __key) {
+00084 
+00085   return dynamic_cast <Runner *> (getCommunicable (__key));
+00086 }
+00087 
+00088 void startRunners () {
+00089   
+00090   /* Runners */
+00091   for (unsigned i = 0; i < the_runners.size (); i ++)
+00092     if (the_runners [i] -> isLocal ()) {
+00093       addThread (the_runners [i], ll_threads);
+00094       the_runners [i] -> waitStarting ();
+00095     }
+00096   printDebugMessage ("launched the parallel runners");
+00097 }
+00098 
+00099 
+00100 void joinRunners () {
+00101 
+00102 
+00103   joinThreads (ll_threads);
+00104 }
+

Generated on Thu Jul 5 13:43:30 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/core_2service_8cpp-source.html b/branches/paradiseo-peo-meta-model/doc/html/core_2service_8cpp-source.html new file mode 100644 index 000000000..5a0cff6c4 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/core_2service_8cpp-source.html @@ -0,0 +1,87 @@ + + +ParadisEO-PEO: service.cpp Source File + + + + +
+
+

service.cpp

00001 // "service.cpp"
+00002 
+00003 // (c) OPAC Team, LIFL, August 2005
+00004 
+00005 /* 
+00006    Contact: paradiseo-help@lists.gforge.inria.fr
+00007 */
+00008 
+00009 #include "service.h"
+00010 
+00011 void Service :: setOwner (Thread & __owner) {
+00012 
+00013   owner = & __owner;
+00014 }
+00015   
+00016 Thread * Service :: getOwner () {
+00017 
+00018   return owner;
+00019 }
+00020 
+00021 Service * getService (SERVICE_ID __key) {
+00022 
+00023   return dynamic_cast <Service *> (getCommunicable (__key));
+00024 }
+00025 
+00026 void Service :: notifySendingData () {
+00027 
+00028 }
+00029 void Service :: notifySendingResourceRequest () {
+00030 
+00031   num_sent_rr --;
+00032   if (! num_sent_rr)
+00033     notifySendingAllResourceRequests ();
+00034 }
+00035 
+00036 void Service :: notifySendingAllResourceRequests () {
+00037 
+00038 }
+00039 
+00040 void Service :: packData () {
+00041 
+00042 }
+00043 
+00044 void Service :: unpackData () {
+00045 
+00046 }
+00047 
+00048 void Service :: execute () {
+00049 
+00050 }
+00051   
+00052 void Service :: packResult () {
+00053 
+00054 }
+00055 
+00056 void Service :: unpackResult () {
+00057 
+00058 }
+

Generated on Thu Jul 5 13:43:30 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/doxygen.css b/branches/paradiseo-peo-meta-model/doc/html/doxygen.css new file mode 100644 index 000000000..5d583694e --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/doxygen.css @@ -0,0 +1,358 @@ +BODY,H1,H2,H3,H4,H5,H6,P,CENTER,TD,TH,UL,DL,DIV { + font-family: Geneva, Arial, Helvetica, sans-serif; +} +BODY,TD { + font-size: 90%; +} +H1 { + text-align: center; + font-size: 160%; +} +H2 { + font-size: 120%; +} +H3 { + font-size: 100%; +} +CAPTION { font-weight: bold } +DIV.qindex { + width: 100%; + background-color: #e8eef2; + border: 1px solid #84b0c7; + text-align: center; + margin: 2px; + padding: 2px; + line-height: 140%; +} +DIV.nav { + width: 100%; + background-color: #e8eef2; + border: 1px solid #84b0c7; + text-align: center; + margin: 2px; + padding: 2px; + line-height: 140%; +} +DIV.navtab { + background-color: #e8eef2; + border: 1px solid #84b0c7; + text-align: center; + margin: 2px; + margin-right: 15px; + padding: 2px; +} +TD.navtab { + font-size: 70%; +} +A.qindex { + text-decoration: none; + font-weight: bold; + color: #1A419D; +} +A.qindex:visited { + text-decoration: none; + font-weight: bold; + color: #1A419D +} +A.qindex:hover { + text-decoration: none; + background-color: #ddddff; +} +A.qindexHL { + text-decoration: none; + font-weight: bold; + background-color: #6666cc; + color: #ffffff; + border: 1px double #9295C2; +} +A.qindexHL:hover { + text-decoration: none; + background-color: #6666cc; + color: #ffffff; +} +A.qindexHL:visited { text-decoration: none; background-color: #6666cc; color: #ffffff } +A.el { text-decoration: none; font-weight: bold } +A.elRef { font-weight: bold } +A.code:link { text-decoration: none; font-weight: normal; color: #0000FF} +A.code:visited { text-decoration: none; font-weight: normal; color: #0000FF} +A.codeRef:link { font-weight: normal; color: #0000FF} +A.codeRef:visited { font-weight: normal; color: #0000FF} +A:hover { text-decoration: none; background-color: #f2f2ff } +DL.el { margin-left: -1cm } +.fragment { + font-family: monospace, fixed; + font-size: 95%; +} +PRE.fragment { + border: 1px solid #CCCCCC; + background-color: #f5f5f5; + margin-top: 4px; + margin-bottom: 4px; + margin-left: 2px; + margin-right: 8px; + padding-left: 6px; + padding-right: 6px; + padding-top: 4px; + padding-bottom: 4px; +} +DIV.ah { background-color: black; font-weight: bold; color: #ffffff; margin-bottom: 3px; margin-top: 3px } + +DIV.groupHeader { + margin-left: 16px; + margin-top: 12px; + margin-bottom: 6px; + font-weight: bold; +} +DIV.groupText { margin-left: 16px; font-style: italic; font-size: 90% } +BODY { + background: white; + color: black; + margin-right: 20px; + margin-left: 20px; +} +TD.indexkey { + background-color: #e8eef2; + font-weight: bold; + padding-right : 10px; + padding-top : 2px; + padding-left : 10px; + padding-bottom : 2px; + margin-left : 0px; + margin-right : 0px; + margin-top : 2px; + margin-bottom : 2px; + border: 1px solid #CCCCCC; +} +TD.indexvalue { + background-color: #e8eef2; + font-style: italic; + padding-right : 10px; + padding-top : 2px; + padding-left : 10px; + padding-bottom : 2px; + margin-left : 0px; + margin-right : 0px; + margin-top : 2px; + margin-bottom : 2px; + border: 1px solid #CCCCCC; +} +TR.memlist { + background-color: #f0f0f0; +} +P.formulaDsp { text-align: center; } +IMG.formulaDsp { } +IMG.formulaInl { vertical-align: middle; } +SPAN.keyword { color: #008000 } +SPAN.keywordtype { color: #604020 } +SPAN.keywordflow { color: #e08000 } +SPAN.comment { color: #800000 } +SPAN.preprocessor { color: #806020 } +SPAN.stringliteral { color: #002080 } +SPAN.charliteral { color: #008080 } +.mdescLeft { + padding: 0px 8px 4px 8px; + font-size: 80%; + font-style: italic; + background-color: #FAFAFA; + border-top: 1px none #E0E0E0; + border-right: 1px none #E0E0E0; + border-bottom: 1px none #E0E0E0; + border-left: 1px none #E0E0E0; + margin: 0px; +} +.mdescRight { + padding: 0px 8px 4px 8px; + font-size: 80%; + font-style: italic; + background-color: #FAFAFA; + border-top: 1px none #E0E0E0; + border-right: 1px none #E0E0E0; + border-bottom: 1px none #E0E0E0; + border-left: 1px none #E0E0E0; + margin: 0px; +} +.memItemLeft { + padding: 1px 0px 0px 8px; + margin: 4px; + border-top-width: 1px; + border-right-width: 1px; + border-bottom-width: 1px; + border-left-width: 1px; + border-top-color: #E0E0E0; + border-right-color: #E0E0E0; + border-bottom-color: #E0E0E0; + border-left-color: #E0E0E0; + border-top-style: solid; + border-right-style: none; + border-bottom-style: none; + border-left-style: none; + background-color: #FAFAFA; + font-size: 80%; +} +.memItemRight { + padding: 1px 8px 0px 8px; + margin: 4px; + border-top-width: 1px; + border-right-width: 1px; + border-bottom-width: 1px; + border-left-width: 1px; + border-top-color: #E0E0E0; + border-right-color: #E0E0E0; + border-bottom-color: #E0E0E0; + border-left-color: #E0E0E0; + border-top-style: solid; + border-right-style: none; + border-bottom-style: none; + border-left-style: none; + background-color: #FAFAFA; + font-size: 80%; +} +.memTemplItemLeft { + padding: 1px 0px 0px 8px; + margin: 4px; + border-top-width: 1px; + border-right-width: 1px; + border-bottom-width: 1px; + border-left-width: 1px; + border-top-color: #E0E0E0; + border-right-color: #E0E0E0; + border-bottom-color: #E0E0E0; + border-left-color: #E0E0E0; + border-top-style: none; + border-right-style: none; + border-bottom-style: none; + border-left-style: none; + background-color: #FAFAFA; + font-size: 80%; +} +.memTemplItemRight { + padding: 1px 8px 0px 8px; + margin: 4px; + border-top-width: 1px; + border-right-width: 1px; + border-bottom-width: 1px; + border-left-width: 1px; + border-top-color: #E0E0E0; + border-right-color: #E0E0E0; + border-bottom-color: #E0E0E0; + border-left-color: #E0E0E0; + border-top-style: none; + border-right-style: none; + border-bottom-style: none; + border-left-style: none; + background-color: #FAFAFA; + font-size: 80%; +} +.memTemplParams { + padding: 1px 0px 0px 8px; + margin: 4px; + border-top-width: 1px; + border-right-width: 1px; + border-bottom-width: 1px; + border-left-width: 1px; + border-top-color: #E0E0E0; + border-right-color: #E0E0E0; + border-bottom-color: #E0E0E0; + border-left-color: #E0E0E0; + border-top-style: solid; + border-right-style: none; + border-bottom-style: none; + border-left-style: none; + color: #606060; + background-color: #FAFAFA; + font-size: 80%; +} +.search { color: #003399; + font-weight: bold; +} +FORM.search { + margin-bottom: 0px; + margin-top: 0px; +} +INPUT.search { font-size: 75%; + color: #000080; + font-weight: normal; + background-color: #e8eef2; +} +TD.tiny { font-size: 75%; +} +a { + color: #1A41A8; +} +a:visited { + color: #2A3798; +} +.dirtab { padding: 4px; + border-collapse: collapse; + border: 1px solid #84b0c7; +} +TH.dirtab { background: #e8eef2; + font-weight: bold; +} +HR { height: 1px; + border: none; + border-top: 1px solid black; +} + +/* Style for detailed member documentation */ +.memtemplate { + font-size: 80%; + color: #606060; + font-weight: normal; +} +.memnav { + background-color: #e8eef2; + border: 1px solid #84b0c7; + text-align: center; + margin: 2px; + margin-right: 15px; + padding: 2px; +} +.memitem { + padding: 4px; + background-color: #eef3f5; + border-width: 1px; + border-style: solid; + border-color: #dedeee; + -moz-border-radius: 8px 8px 8px 8px; +} +.memname { + white-space: nowrap; + font-weight: bold; +} +.memdoc{ + padding-left: 10px; +} +.memproto { + background-color: #d5e1e8; + width: 100%; + border-width: 1px; + border-style: solid; + border-color: #84b0c7; + font-weight: bold; + -moz-border-radius: 8px 8px 8px 8px; +} +.paramkey { + text-align: right; +} +.paramtype { + white-space: nowrap; +} +.paramname { + color: #602020; + font-style: italic; +} +/* End Styling for detailed member documentation */ + +/* for the tree view */ +.ftvtree { + font-family: sans-serif; + margin:0.5em; +} +.directory { font-size: 9pt; font-weight: bold; } +.directory h3 { margin: 0px; margin-top: 1em; font-size: 11pt; } +.directory > h3 { margin-top: 0; } +.directory p { margin: 0px; white-space: nowrap; } +.directory div { display: none; margin: 0px; } +.directory img { vertical-align: -30%; } + diff --git a/branches/paradiseo-peo-meta-model/doc/html/doxygen.png b/branches/paradiseo-peo-meta-model/doc/html/doxygen.png new file mode 100644 index 000000000..f0a274bba Binary files /dev/null and b/branches/paradiseo-peo-meta-model/doc/html/doxygen.png differ diff --git a/branches/paradiseo-peo-meta-model/doc/html/eoPop__comm_8h-source.html b/branches/paradiseo-peo-meta-model/doc/html/eoPop__comm_8h-source.html new file mode 100644 index 000000000..196d1cd23 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/eoPop__comm_8h-source.html @@ -0,0 +1,61 @@ + + +ParadisEO-PEO: eoPop_comm.h Source File + + + + +
+
+

eoPop_comm.h

00001 // "eoPop_comm.h"
+00002 
+00003 // (c) OPAC Team, LIFL, August 2005
+00004 
+00005 /* 
+00006    Contact: paradiseo-help@lists.gforge.inria.fr
+00007 */
+00008 
+00009 #ifndef __eoPop_comm_h
+00010 #define __eoPop_comm_h
+00011 
+00012 #include <eoPop.h>
+00013 
+00014 #include "messaging.h"
+00015 
+00016 template <class EOT> void pack (const eoPop <EOT> & __pop) {
+00017 
+00018   pack ((unsigned) __pop.size ());
+00019   for (unsigned i = 0; i < __pop.size (); i ++)
+00020     pack (__pop [i]);
+00021 }
+00022 
+00023 template <class EOT> void unpack (eoPop <EOT> & __pop) {
+00024 
+00025   unsigned n;
+00026   
+00027   unpack (n);
+00028   __pop.resize (n);
+00029   for (unsigned i = 0; i < n; i ++)
+00030     unpack (__pop [i]);
+00031 }
+00032 #endif
+

Generated on Thu Jul 5 13:43:30 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/eoVector__comm_8h-source.html b/branches/paradiseo-peo-meta-model/doc/html/eoVector__comm_8h-source.html new file mode 100644 index 000000000..00aedb035 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/eoVector__comm_8h-source.html @@ -0,0 +1,67 @@ + + +ParadisEO-PEO: eoVector_comm.h Source File + + + + +
+
+

eoVector_comm.h

00001 // "eoVector_comm.h"
+00002 
+00003 // (c) OPAC Team, LIFL, August 2005
+00004 
+00005 /* 
+00006    Contact: paradiseo-help@lists.gforge.inria.fr
+00007 */
+00008 
+00009 #ifndef __eoVector_comm_h
+00010 #define __eoVector_comm_h
+00011 
+00012 #include <eoVector.h>
+00013 
+00014 #include "messaging.h"
+00015 
+00016 template <class F, class T> void pack (const eoVector <F, T> & __v) {
+00017 
+00018   pack (__v.fitness ()) ;
+00019   unsigned len = __v.size ();
+00020   pack (len);
+00021   for (unsigned i = 0 ; i < len; i ++)
+00022     pack (__v [i]);  
+00023 }
+00024 
+00025 template <class F, class T> void unpack (eoVector <F, T> & __v) {
+00026 
+00027   F fit; 
+00028   unpack (fit);
+00029   __v.fitness (fit);
+00030 
+00031   unsigned len;
+00032   unpack (len);
+00033   __v.resize (len);
+00034   for (unsigned i = 0 ; i < len; i ++)
+00035     unpack (__v [i]);
+00036 }
+00037 
+00038 #endif
+

Generated on Thu Jul 5 13:43:30 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/files.html b/branches/paradiseo-peo-meta-model/doc/html/files.html new file mode 100644 index 000000000..043f498b3 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/files.html @@ -0,0 +1,98 @@ + + +ParadisEO-PEO: File Index + + + + +
+
+

ParadisEO-PEO File List

Here is a list of all documented files with brief descriptions: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
comm.cpp [code]
comm.h [code]
communicable.cpp [code]
communicable.h [code]
coop.cpp [code]
cooperative.h [code]
eoPop_comm.h [code]
eoVector_comm.h [code]
mess.cpp [code]
mess.h [code]
messaging.h [code]
node.cpp [code]
node.h [code]
paradiseo.h [code]
param.cpp [code]
param.h [code]
peo_debug.cpp [code]
peo_debug.h [code]
peo_fin.cpp [code]
peo_fin.h [code]
peo_init.cpp [code]
peo_init.h [code]
peo_param.cpp [code]
peo_param.h [code]
peo_run.cpp [code]
peo_run.h [code]
peoAggEvalFunc.h [code]
peoAsyncIslandMig.h [code]
peoEA.h [code]
peoNoAggEvalFunc.h [code]
peoParaPopEval.h [code]
peoParaSGATransform.h [code]
peoPopEval.h [code]
peoSeqPopEval.h [code]
peoSeqTransform.h [code]
peoSyncIslandMig.h [code]
peoSyncMultiStart.h [code]
peoTransform.h [code]
reac_thread.cpp [code]
reac_thread.h [code]
recv.cpp [code]
recv.h [code]
ring_topo.cpp [code]
ring_topo.h [code]
rmc.cpp [code]
rmc.h [code]
core/runner.cpp [code]
rmc/mpi/runner.cpp [code]
runner.h [code]
scheduler.cpp [code]
scheduler.h [code]
schema.cpp [code]
schema.h [code]
send.cpp [code]
send.h [code]
core/service.cpp [code]
rmc/mpi/service.cpp [code]
service.h [code]
tags.h [code]
thread.cpp [code]
thread.h [code]
topology.cpp [code]
topology.h [code]
worker.cpp [code]
worker.h [code]
xml_parser.cpp [code]
xml_parser.h [code]
+
Generated on Thu Jul 5 13:43:31 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/ftv2blank.png b/branches/paradiseo-peo-meta-model/doc/html/ftv2blank.png new file mode 100644 index 000000000..493c3c0b6 Binary files /dev/null and b/branches/paradiseo-peo-meta-model/doc/html/ftv2blank.png differ diff --git a/branches/paradiseo-peo-meta-model/doc/html/ftv2doc.png b/branches/paradiseo-peo-meta-model/doc/html/ftv2doc.png new file mode 100644 index 000000000..f72999f92 Binary files /dev/null and b/branches/paradiseo-peo-meta-model/doc/html/ftv2doc.png differ diff --git a/branches/paradiseo-peo-meta-model/doc/html/ftv2folderclosed.png b/branches/paradiseo-peo-meta-model/doc/html/ftv2folderclosed.png new file mode 100644 index 000000000..d6d063440 Binary files /dev/null and b/branches/paradiseo-peo-meta-model/doc/html/ftv2folderclosed.png differ diff --git a/branches/paradiseo-peo-meta-model/doc/html/ftv2folderopen.png b/branches/paradiseo-peo-meta-model/doc/html/ftv2folderopen.png new file mode 100644 index 000000000..bbe2c913c Binary files /dev/null and b/branches/paradiseo-peo-meta-model/doc/html/ftv2folderopen.png differ diff --git a/branches/paradiseo-peo-meta-model/doc/html/ftv2lastnode.png b/branches/paradiseo-peo-meta-model/doc/html/ftv2lastnode.png new file mode 100644 index 000000000..e7b9ba90c Binary files /dev/null and b/branches/paradiseo-peo-meta-model/doc/html/ftv2lastnode.png differ diff --git a/branches/paradiseo-peo-meta-model/doc/html/ftv2link.png b/branches/paradiseo-peo-meta-model/doc/html/ftv2link.png new file mode 100644 index 000000000..14f3fed00 Binary files /dev/null and b/branches/paradiseo-peo-meta-model/doc/html/ftv2link.png differ diff --git a/branches/paradiseo-peo-meta-model/doc/html/ftv2mlastnode.png b/branches/paradiseo-peo-meta-model/doc/html/ftv2mlastnode.png new file mode 100644 index 000000000..09ceb6adb Binary files /dev/null and b/branches/paradiseo-peo-meta-model/doc/html/ftv2mlastnode.png differ diff --git a/branches/paradiseo-peo-meta-model/doc/html/ftv2mnode.png b/branches/paradiseo-peo-meta-model/doc/html/ftv2mnode.png new file mode 100644 index 000000000..3254c0511 Binary files /dev/null and b/branches/paradiseo-peo-meta-model/doc/html/ftv2mnode.png differ diff --git a/branches/paradiseo-peo-meta-model/doc/html/ftv2node.png b/branches/paradiseo-peo-meta-model/doc/html/ftv2node.png new file mode 100644 index 000000000..c9f06a57f Binary files /dev/null and b/branches/paradiseo-peo-meta-model/doc/html/ftv2node.png differ diff --git a/branches/paradiseo-peo-meta-model/doc/html/ftv2plastnode.png b/branches/paradiseo-peo-meta-model/doc/html/ftv2plastnode.png new file mode 100644 index 000000000..0b07e0091 Binary files /dev/null and b/branches/paradiseo-peo-meta-model/doc/html/ftv2plastnode.png differ diff --git a/branches/paradiseo-peo-meta-model/doc/html/ftv2pnode.png b/branches/paradiseo-peo-meta-model/doc/html/ftv2pnode.png new file mode 100644 index 000000000..2001b797b Binary files /dev/null and b/branches/paradiseo-peo-meta-model/doc/html/ftv2pnode.png differ diff --git a/branches/paradiseo-peo-meta-model/doc/html/ftv2vertline.png b/branches/paradiseo-peo-meta-model/doc/html/ftv2vertline.png new file mode 100644 index 000000000..b330f3a33 Binary files /dev/null and b/branches/paradiseo-peo-meta-model/doc/html/ftv2vertline.png differ diff --git a/branches/paradiseo-peo-meta-model/doc/html/functions.html b/branches/paradiseo-peo-meta-model/doc/html/functions.html new file mode 100644 index 000000000..24a2160f9 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/functions.html @@ -0,0 +1,220 @@ + + +ParadisEO-PEO: Class Members + + + + +
+
+ +
+ +
+
+ +
+ +

+Here is a list of all documented class members with links to the class documentation for each member: +

+

- a -

+

- c -

+

- d -

+

- e -

+

- f -

+

- g -

+

- i -

+

- k -

+

- l -

+

- m -

+

- n -

+

- o -

+

- p -

+

- r -

+

- s -

+

- t -

+

- u -

+

- w -

+

- ~ -

+
Generated on Thu Jul 5 13:43:30 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/functions_func.html b/branches/paradiseo-peo-meta-model/doc/html/functions_func.html new file mode 100644 index 000000000..8a8d8f228 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/functions_func.html @@ -0,0 +1,155 @@ + + +ParadisEO-PEO: Class Members - Functions + + + + +
+
+ +
+ +
+
+ +
+ +

+  +

+

- a -

+

- c -

+

- e -

+

- g -

+

- i -

+

- l -

+

- n -

+

- o -

+

- p -

+

- r -

+

- s -

+

- t -

+

- u -

+

- w -

+

- ~ -

+
Generated on Thu Jul 5 13:43:30 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/functions_vars.html b/branches/paradiseo-peo-meta-model/doc/html/functions_vars.html new file mode 100644 index 000000000..bb6e20426 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/functions_vars.html @@ -0,0 +1,149 @@ + + +ParadisEO-PEO: Class Members - Variables + + + + +
+
+ +
+ +
+
+ +
+ +

+  +

+

- a -

+

- c -

+

- d -

+

- e -

+

- f -

+

- i -

+

- k -

+

- l -

+

- m -

+

- n -

+

- o -

+

- p -

+

- r -

+

- s -

+

- t -

+
Generated on Thu Jul 5 13:43:30 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/hierarchy.html b/branches/paradiseo-peo-meta-model/doc/html/hierarchy.html new file mode 100644 index 000000000..a6a9172ad --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/hierarchy.html @@ -0,0 +1,105 @@ + + +ParadisEO-PEO: Hierarchical Index + + + + +
+
+ +

ParadisEO-PEO Class Hierarchy

This inheritance list is sorted roughly, but not completely, alphabetically: +
Generated on Thu Jul 5 13:43:30 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/index.html b/branches/paradiseo-peo-meta-model/doc/html/index.html new file mode 100644 index 000000000..1d73e16b0 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/index.html @@ -0,0 +1,8 @@ + + +ParadisEO-PEO + + + + + diff --git a/branches/paradiseo-peo-meta-model/doc/html/installdox b/branches/paradiseo-peo-meta-model/doc/html/installdox new file mode 100755 index 000000000..294677f26 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/installdox @@ -0,0 +1,117 @@ +#!/usr/bin/perl + +%subst = ( "eo.doxytag", "", "mo.doxytag", ""); +$quiet = 0; + +if (open(F,"search.cfg")) +{ + $_= ; s/[ \t\n]*$//g ; $subst{"_doc"} = $_; + $_= ; s/[ \t\n]*$//g ; $subst{"_cgi"} = $_; +} + +while ( @ARGV ) { + $_ = shift @ARGV; + if ( s/^-// ) { + if ( /^l(.*)/ ) { + $v = ($1 eq "") ? shift @ARGV : $1; + ($v =~ /\/$/) || ($v .= "/"); + $_ = $v; + if ( /(.+)\@(.+)/ ) { + if ( exists $subst{$1} ) { + $subst{$1} = $2; + } else { + print STDERR "Unknown tag file $1 given with option -l\n"; + &usage(); + } + } else { + print STDERR "Argument $_ is invalid for option -l\n"; + &usage(); + } + } + elsif ( /^q/ ) { + $quiet = 1; + } + elsif ( /^\?|^h/ ) { + &usage(); + } + else { + print STDERR "Illegal option -$_\n"; + &usage(); + } + } + else { + push (@files, $_ ); + } +} + +foreach $sub (keys %subst) +{ + if ( $subst{$sub} eq "" ) + { + print STDERR "No substitute given for tag file `$sub'\n"; + &usage(); + } + elsif ( ! $quiet && $sub ne "_doc" && $sub ne "_cgi" ) + { + print "Substituting $subst{$sub} for each occurence of tag file $sub\n"; + } +} + +if ( ! @files ) { + if (opendir(D,".")) { + foreach $file ( readdir(D) ) { + $match = ".html"; + next if ( $file =~ /^\.\.?$/ ); + ($file =~ /$match/) && (push @files, $file); + ($file =~ "tree.js") && (push @files, $file); + } + closedir(D); + } +} + +if ( ! @files ) { + print STDERR "Warning: No input files given and none found!\n"; +} + +foreach $f (@files) +{ + if ( ! $quiet ) { + print "Editing: $f...\n"; + } + $oldf = $f; + $f .= ".bak"; + unless (rename $oldf,$f) { + print STDERR "Error: cannot rename file $oldf\n"; + exit 1; + } + if (open(F,"<$f")) { + unless (open(G,">$oldf")) { + print STDERR "Error: opening file $oldf for writing\n"; + exit 1; + } + if ($oldf ne "tree.js") { + while () { + s/doxygen\=\"([^ \"\:\t\>\<]*)\:([^ \"\t\>\<]*)\" (href|src)=\"\2/doxygen\=\"$1:$subst{$1}\" \3=\"$subst{$1}/g; + print G "$_"; + } + } + else { + while () { + s/\"([^ \"\:\t\>\<]*)\:([^ \"\t\>\<]*)\", \"\2/\"$1:$subst{$1}\" ,\"$subst{$1}/g; + print G "$_"; + } + } + } + else { + print STDERR "Warning file $f does not exist\n"; + } + unlink $f; +} + +sub usage { + print STDERR "Usage: installdox [options] [html-file [html-file ...]]\n"; + print STDERR "Options:\n"; + print STDERR " -l tagfile\@linkName tag file + URL or directory \n"; + print STDERR " -q Quiet mode\n\n"; + exit 1; +} diff --git a/branches/paradiseo-peo-meta-model/doc/html/main.html b/branches/paradiseo-peo-meta-model/doc/html/main.html new file mode 100644 index 000000000..d1252fcef --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/main.html @@ -0,0 +1,106 @@ + + +ParadisEO-PEO: The ParadisEO-PEO Framework + + + + +
+
+

The ParadisEO-PEO Framework

+

+

0.1

+Introduction

+ParadisEO is a white-box object-oriented framework dedicated to the reusable design of parallel and distributed metaheuristics (PDM). ParadisEO provides a broad range of features including evolutionary algorithms (EA), local searches (LS), the most common parallel and distributed models and hybridization mechanisms, etc. This high content and utility encourages its use at European level. ParadisEO is based on a clear conceptual separation of the solution methods from the problems they are intended to solve. This separation confers to the user a maximum code and design reuse. Furthermore, the fine-grained nature of the classes provided by the framework allow a higher flexibility compared to other frameworks. ParadisEO is one of the rare frameworks that provide the most common parallel and distributed models. Their implementation is portable on distributed-memory machines as well as on shared-memory multiprocessors, as it uses standard libraries such as MPI, PVM and PThreads. The models can be exploited in a transparent way, one has just to instantiate their associated provided classes. Their experimentation on the radio network design real-world application demonstrate their efficiency.

+In practice, combinatorial optimization problems are often NP-hard, CPU time-consuming, and evolve over time. Unlike exact methods, metaheuristics allow to tackle large-size problems instances by delivering satisfactory solutions in a reasonable time. Metaheuristics are general-purpose heuristics that split in two categories: evolutionary algorithms (EA) and local search methods (LS). These two families have complementary characteristics: EA allow a better exploration of the search space, while LS have the power to intensify the search in promising regions. Their hybridization allows to deliver robust and better solutions

+Although serial metaheuristics have a polynomial temporal complexity, they remain unsatisfactory for industrial problems. Parallel and distributed computing is a powerful way to deal with the performance issue of these problems. Numerous parallel and distributed metaheuristics (PDM) and their implementations have been proposed, and are available on theWeb. They can be reused and adapted to his/her own problems. However, the user has to deeply examine the code and rewrite its problem-specific sections. The task is tedious, errorprone, takes along time and makes harder the produced code maintenance. A better way to reuse the code of existing PDM is the reuse through libraries. These are often more reliable as they are more tested and documented. They allow a better maintainability and efficiency. However, libraries do not allow the reuse of design.

+Parallel and distributed metaheuristics

+

+Parallel distributed evolutionary algorithms

+Evolutionary Algorithms (EA) are based on the iterative improvement of a population of solutions. At each step, individuals are selected, paired and recombined in order to generate new solutions that replace other ones, and so on. As the algorithm converges, the population is mainly composed of individuals well adapted to the "environment", for instance the problem. The main features that characterize EA are the way the population is initialized, the selection strategy (deterministic/stochastic) by fostering "good" solutions, the replacement strategy that discards individuals, and the continuation/stopping criterion to decide whether the evolution should go on or not.

+Basically, three major parallel and distributed models for EA can been distinguished: the island (a)synchronous cooperative model, the parallel evaluation of the population, and the distributed evaluation of a single solution.

    +
  • +Island (a)synchronous cooperative model. Different EA are simultaneously deployed to cooperate for computing better and robust solutions. They exchange in an asynchronous way genetic stuff to diversify the search. The objective is to allow to delay the global convergence, especially when theEAare heterogeneous regarding the variation operators. The migration of individuals follows a policy defined by few parameters: the migration decision criterion, the exchange topology, the number of emigrants, the emigrants selection policy, and the replacement/integration policy.

    +

  • +
  • +Parallel evaluation of the population. It is required as it is in general the most timeconsuming. The parallel evaluation follows the centralized model. The farmer applies the following operations: selection, transformation and replacement as they require a global management of the population. At each generation, it distributes the set of new solutions between differentworkers. These evaluate and return back the solutions and their quality values. An efficient execution is often obtained particularly when the evaluation of each solution is costly. The two main advantages of an asynchronous model over the synchronous model are: (1) the fault tolerance of the asynchronous model; (2) the robustness in case the fitness computation can take very different computation times (e.g. for nonlinear numerical optimization). Whereas some time-out detection can be used to address the former issue, the latter one can be partially overcome if the grain is set to very small values, as individuals will be sent out for evaluations upon request of the workers.

    +

  • +
  • +Distributed evaluation of a single solution. The quality of each solution is evaluated in a parallel centralized way. That model is particularly interesting when the evaluation function can be itself parallelized as it is CPU time-consuming and/or IO intensive. In that case, the function can be viewed as an aggregation of a certain number of partial functions. The partial functions could also be identical if for example the problem to deal with is a data mining one. The evaluation is thus data parallel and the accesses to data base are performed in parallel. Furthermore, a reduction operation is performed on the results returned by the partial functions. As a summary, for this model the user has to indicate a set of partial functions and an aggregation operator of these.
  • +
+

+Parallel distributed local searches

+

+Local searches

+All metaheuristics dedicated to the improvement of a single solution are based on the concept of neighborhood. They start from a solution randomly generated or obtained from another optimization algorithm, and update it, step by step, by replacing the current solution by one of its neighboring candidates. Some criterion have been identified to differentiate such searches: the heuristic internal memory, the choice of the initial solution, the candidate solutions generator, and the selection strategy of candidate moves. Three main algorithms of local search stand out: Hill Climbing (HC), Simulated Annealing (SA) and Tabu Search (TS).

+Parallel local searches

+Two parallel distributed models are commonly used in the literature: the parallel distributed exploration of neighboring candidate solutions model, and the multi-start model.
    +
  • +Parallel exploration of neighboring candidates. It is a low-level Farmer-Worker model that does not alter the behavior of the heuristic. A sequential search computes the same results slower.At the beginning of each iteration, the farmer duplicates the current solution between distributed nodes. Each one manages some candidates and the results are returned to the farmer. The model is efficient if the evaluation of a each solution is time-consuming and/or there are a great deal of candidate neighbors to evaluate. This is obviously not applicable to SA since only one candidate is evaluated at each iteration. Likewise, the efficiency of the model for HC is not always guaranteed as the number of neighboring solutions to process before finding one that improves the current objective function may be highly variable.

    +

  • +
  • +Multi-start model. It consists in simultaneously launching several local searches. They may be heterogeneous, but no information is exchanged between them. The resultswould be identical as if the algorithms were sequentially run.Very often deterministic algorithms differ by the supplied initial solution and/or some other parameters. This trivial model is convenient for low-speed networks of workstations.
  • +
+

+Hybridization

+Recently, hybrid metaheuristics have gained a considerable interest. For many practical or academic optimization problems, the best found solutions are obtained by hybrid algorithms. Combinations of different metaheuristics have provided very powerful search methods. Two levels and two modes of hybridization have been distinguished: Low and High levels, and Relay and Cooperative modes. The low-level hybridization addresses the functional composition of a single optimization method. A function of a given metaheuristic is replaced by another metaheuristic. On the contrary, for high-level hybrid algorithms the different metaheuristics are self-containing, meaning no direct relationship to their internal working is considered. On the other hand, relay hybridization means a set of metaheuristics is applied in a pipeline way. The output of a metaheuristic (except the last) is the input of the following one (except the first). Conversely, co-evolutionist hybridization is a cooperative optimization model. Each metaheuristic performs a search in a solution space, and exchange solutions with others.

+Paradiseo goals and architecture

+The "EO" part of ParadisEO means Evolving Objects. EO is a C++ LGPL open source framework and includes a paradigm-free Evolutionary Computation library (EOlib) dedicated to the flexible design of EA through evolving objects superseding the most common dialects (Genetic Algorithms, Evolution Strategies, Evolutionary Programming and Genetic Programming). Furthermore, EO integrates several services including visualization facilities, on-line definition of parameters, application check-pointing, etc. ParadisEO is an extended version of the EO framework. The extensions include local search methods, hybridization mechanisms, parallelism and distribution mechanisms, and other features that are not addressed in this paper such as multi-objective optimization and grid computing. In the next sections, we present the motivations and goals of ParadisEO, its architecture and some of its main implementation details and issues.

+Motivations and goals

+A framework is normally intended to be exploited by as many users as possible. Therefore, its exploitation could be successful only if some important user criteria are satisfied. The following criteria are the major of them and constitute the main objectives of the ParadisEO framework:

+

    +
  • +Maximum design and code reuse. The framework must provide for the user a whole architecture design of his/her solution method. Moreover, the programmer may redo as little code as possible. This objective requires a clear and maximal conceptual separation between the solution methods and the problems to be solved, and thus a deep domain analysis. The user might therefore develop only the minimal problem-specific code.

    +

  • +
  • +Flexibility and adaptability. It must be possible for the user to easily add new features/ metaheuristics or change existing ones without implicating other components. Furthermore, as in practice existing problems evolve and new others arise these have to be tackled by specializing/adapting the framework components.

    +

  • +
  • +Utility. The framework must allow the user to cover a broad range of metaheuristics, problems, parallel distributed models, hybridization mechanisms, etc.

    +

  • +
  • +Transparent and easy access to performance and robustness. As the optimization applications are often time-consuming the performance issue is crucial. Parallelism and distribution are two important ways to achieve high performance execution. In order to facilitate its use it is implemented so that the user can deploy his/her parallel algorithms in a transparent manner. Moreover, the execution of the algorithms must be robust to guarantee the reliability and the quality of the results. The hybridization mechanism allows to obtain robust and better solutions.

    +

  • +
  • +Portability. In order to satisfy a large number of users the framework must support different material architectures and their associated operating systems.
  • +
+

+ParadisEO architecture

+The architecture of ParadisEO is multi-layer and modular allowing to achieve the objectives quoted above. This allows particularly a high flexibility and adaptability, an easier hybridization, and more code and design reuse. The architecture has three layers identifying three major categories of classes: Solvers, Runners and Helpers.
    +
  • +Helpers. Helpers are low-level classes that perform specific actions related to the evolution or search process. They are split in two categories: Evolutionary helpers (EH) and Local search helpers (LSH). EH include mainly the transformation, selection and replacement operations, the evaluation function and the stopping criterion. LSH can be generic such as the neighborhood explorer class, or specific to the local search metaheuristic like the tabu list manager class in the Tabu Search solution method. On the other hand, there are some special helpers dedicated to the management of parallel and distributed models 2 and 3, such as the communicators that embody the communication services.

    +Helpers cooperate between them and interact with the components of the upper layer i.e. the runners. The runners invoke the helpers through function parameters. Indeed, helpers have not their own data, but they work on the internal data of the runners.

    +

  • +
  • +Runners. The Runners layer contains a set of classes that implement the metaheuristics themselves. They perform the run of the metaheuristics from the initial state or population to the final one. One can distinguish the Evolutionary runners (ER) such as genetic algorithms, evolution strategies, etc., and Local search runners (LSR) like tabu search, simulated annealing and hill climbing. Runners invoke the helpers to perform specific actions on their data. For instance, an ER may ask the fitness function evaluation helper to evaluate its population. An LSR asks the movement helper to perform a given movement on the current state. Furthermore, runners can be serial or parallel distributed.

    +

  • +
  • +Solvers. Solvers are devoted to control the evolution process and/or the search. They generate the initial state (solution or population) and define the strategy for combining and sequencing different metaheuristics. Two types of solvers can be distinguished. Single metaheuristic solvers (SMS) and Multiple metaheuristics solvers (MMS). SMSs are dedicated to the execution of only one metaheuristic.MMS are more complex as they control and sequence several metaheuristics that can be heterogeneous. Solvers interact with the user by getting the input data and delivering the output (best solution, statistics, etc).
  • +
+

+According to the generality of their embedded features, the classes of the architecture split in two major categories: Provided classes and Required classes. Provided classes embody the factored out part of the metaheuristics. They are generic, implemented in the framework, and ensure the control at run time. Required classes are those that must be supplied by the user. They encapsulate the problem-specific aspects of the application. These classes are fixed but not implemented in ParadisEO. The programmer has the burden to develop them using the OO specialization mechanism.

+ParadisEO-PEO Tutorials

+The basisc of the ParadisEO framework philosophy are exposed in a few simple tutorials: +All the presented examples have as case study the traveling salesman problem (TSP). Different operators and auxiliary objects were designed, standing as a common shared source code base. While not being part of the ParadisEO-PEO framework, it may represent a startpoint for a better understanding of the presented tutorials.
Generated on Thu Jul 5 13:43:30 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/mess_8cpp-source.html b/branches/paradiseo-peo-meta-model/doc/html/mess_8cpp-source.html new file mode 100644 index 000000000..d7fa3e9ea --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/mess_8cpp-source.html @@ -0,0 +1,266 @@ + + +ParadisEO-PEO: mess.cpp Source File + + + + +
+
+

mess.cpp

00001 // "mess.cpp"
+00002 
+00003 // (c) OPAC Team, LIFL, August 2005
+00004 
+00005 /* 
+00006    Contact: paradiseo-help@lists.gforge.inria.fr
+00007 */
+00008 
+00009 #include <mpi.h>
+00010 #include <vector>
+00011 
+00012 #include "mess.h"
+00013 #include "../../core/peo_debug.h"
+00014 #include "node.h"
+00015 
+00016 #define MPI_BUF_SIZE 1024*64
+00017         
+00018 static char mpi_buf [MPI_BUF_SIZE];
+00019         
+00020 static int pos_buf ;
+00021 
+00022 static std :: vector <char *> act_buf; /* Active buffers */
+00023 
+00024 static std :: vector <MPI_Request *> act_req; /* Active requests */
+00025 
+00026 void cleanBuffers () {
+00027 
+00028   for (unsigned i = 0; i < act_req.size ();) {
+00029        
+00030     MPI_Status stat ;
+00031     int flag ;
+00032     MPI_Test (act_req [i], & flag, & stat) ;
+00033     if (flag) {
+00034       
+00035       delete act_buf [i] ;
+00036       delete act_req [i] ;
+00037         
+00038       act_buf [i] = act_buf.back () ;
+00039       act_buf.pop_back () ;
+00040       
+00041       act_req [i] = act_req.back () ;
+00042       act_req.pop_back () ;
+00043     }
+00044     else
+00045       i ++;
+00046   } 
+00047 }
+00048 
+00049 void waitBuffers () {
+00050 
+00051   printDebugMessage ("waiting the termination of the asynchronous operations to complete");
+00052 
+00053   for (unsigned i = 0; i < act_req.size (); i ++) {
+00054        
+00055     MPI_Status stat ;
+00056 
+00057     MPI_Wait (act_req [i], & stat) ;
+00058       
+00059     delete act_buf [i] ;
+00060     delete act_req [i] ;
+00061   } 
+00062 }
+00063 
+00064 bool probeMessage (int & __src, int & __tag) {
+00065 
+00066   int flag;
+00067 
+00068   MPI_Status stat;
+00069 
+00070   MPI_Iprobe (MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD, & flag, & stat);
+00071 
+00072   __src = stat.MPI_SOURCE;
+00073   __tag = stat.MPI_TAG;
+00074 
+00075   return flag;
+00076 }
+00077 
+00078 void waitMessage () {
+00079 
+00080   MPI_Status stat;  
+00081 
+00082   MPI_Probe (MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD, & stat);
+00083 }
+00084 
+00085 void initMessage () {
+00086   
+00087   pos_buf = 0;
+00088 }
+00089 
+00090 void sendMessage (int __to, int __tag) {
+00091 
+00092   cleanBuffers ();  
+00093   act_buf.push_back (new char [pos_buf]);
+00094   act_req.push_back (new MPI_Request);  
+00095   memcpy (act_buf.back (), mpi_buf, pos_buf);  
+00096   MPI_Isend (act_buf.back (), pos_buf, MPI_PACKED, __to, __tag, MPI_COMM_WORLD, act_req.back ()); 
+00097 }
+00098 
+00099 void sendMessageToAll (int __tag) {
+00100 
+00101   for (int i = 0; i < getNumberOfNodes (); i ++)
+00102     sendMessage (i, __tag);
+00103 }
+00104 
+00105 void receiveMessage (int __from, int __tag) {
+00106   
+00107   MPI_Status stat;  
+00108   MPI_Request req;
+00109 
+00110   MPI_Irecv (mpi_buf, MPI_BUF_SIZE, MPI_PACKED, __from, __tag, MPI_COMM_WORLD, & req) ;
+00111   MPI_Wait (& req, & stat) ;
+00112 }
+00113 
+00114 /* Char */
+00115 void pack (const char & __c) {
+00116 
+00117   MPI_Pack ((void *) & __c, 1, MPI_CHAR, mpi_buf, MPI_BUF_SIZE, & pos_buf, MPI_COMM_WORLD);
+00118 }
+00119 
+00120 /* Float */
+00121 void pack (const float & __f, int __nitem) {
+00122 
+00123   MPI_Pack ((void *) & __f, __nitem, MPI_FLOAT, mpi_buf, MPI_BUF_SIZE, & pos_buf, MPI_COMM_WORLD);
+00124 }
+00125 
+00126 /* Double */
+00127 void pack (const double & __d, int __nitem) {
+00128 
+00129   MPI_Pack ((void *) & __d, __nitem, MPI_DOUBLE, mpi_buf, MPI_BUF_SIZE, & pos_buf, MPI_COMM_WORLD);
+00130 }
+00131 
+00132 /* Integer */
+00133 void pack (const int & __i, int __nitem) {
+00134 
+00135   MPI_Pack ((void *) & __i, __nitem, MPI_INT, mpi_buf, MPI_BUF_SIZE, & pos_buf, MPI_COMM_WORLD);
+00136 }
+00137 
+00138 /* Unsigned int. */
+00139 void pack (const unsigned int & __ui, int __nitem) {
+00140 
+00141   MPI_Pack ((void *) & __ui, __nitem, MPI_UNSIGNED, mpi_buf, MPI_BUF_SIZE, & pos_buf, MPI_COMM_WORLD);
+00142 }
+00143 
+00144 /* Short int. */
+00145 void pack (const short & __sh, int __nitem) {
+00146 
+00147   MPI_Pack ((void *) & __sh, __nitem, MPI_SHORT, mpi_buf, MPI_BUF_SIZE, & pos_buf, MPI_COMM_WORLD);
+00148 }
+00149 
+00150 /* Unsigned short */
+00151 void pack (const unsigned short & __ush, int __nitem) {
+00152 
+00153   MPI_Pack ((void *) & __ush, __nitem, MPI_UNSIGNED_SHORT, mpi_buf, MPI_BUF_SIZE, & pos_buf, MPI_COMM_WORLD);
+00154 }
+00155 
+00156 /* Long */
+00157 void pack (const long & __l, int __nitem) {
+00158 
+00159   MPI_Pack ((void *) & __l, __nitem, MPI_LONG, mpi_buf, MPI_BUF_SIZE, & pos_buf, MPI_COMM_WORLD);
+00160 }
+00161 
+00162 /* Unsigned long */
+00163 void pack (const unsigned long & __ul, int __nitem) {
+00164 
+00165   MPI_Pack ((void *) & __ul, __nitem, MPI_UNSIGNED_LONG, mpi_buf, MPI_BUF_SIZE, & pos_buf, MPI_COMM_WORLD);
+00166 }
+00167 
+00168 /* String */
+00169 void pack (const char * __str) {
+00170   
+00171   int len = strlen (__str) + 1;
+00172   MPI_Pack (& len, 1, MPI_INT, mpi_buf, MPI_BUF_SIZE, & pos_buf, MPI_COMM_WORLD);
+00173   MPI_Pack ((void *) __str, len, MPI_CHAR, mpi_buf, MPI_BUF_SIZE, & pos_buf, MPI_COMM_WORLD);
+00174 }
+00175 
+00176 /* Char */
+00177 void unpack (char & __c) {
+00178 
+00179   MPI_Unpack (mpi_buf, MPI_BUF_SIZE, & pos_buf, & __c, 1, MPI_CHAR, MPI_COMM_WORLD);
+00180 }
+00181 
+00182 /* Float */
+00183 void unpack (float & __f, int __nitem) {
+00184 
+00185   MPI_Unpack (mpi_buf, MPI_BUF_SIZE, & pos_buf, & __f, __nitem, MPI_FLOAT, MPI_COMM_WORLD);
+00186 }
+00187 
+00188 /* Double */
+00189 void unpack (double & __d, int __nitem) {
+00190 
+00191   MPI_Unpack (mpi_buf, MPI_BUF_SIZE, & pos_buf, & __d, __nitem, MPI_DOUBLE, MPI_COMM_WORLD);
+00192 }
+00193 
+00194 /* Integer */
+00195 void unpack (int & __i, int __nitem) {
+00196 
+00197   MPI_Unpack (mpi_buf, MPI_BUF_SIZE, & pos_buf, & __i, __nitem, MPI_INT, MPI_COMM_WORLD);
+00198 }
+00199 
+00200 /* Unsigned int. */
+00201 void unpack (unsigned int & __ui, int __nitem) {
+00202 
+00203   MPI_Unpack (mpi_buf, MPI_BUF_SIZE, & pos_buf, & __ui, __nitem, MPI_UNSIGNED, MPI_COMM_WORLD);
+00204 }
+00205 
+00206 /* Short int. */
+00207 void unpack (short & __sh, int __nitem) {
+00208 
+00209   MPI_Unpack (mpi_buf, MPI_BUF_SIZE, & pos_buf, & __sh, __nitem, MPI_SHORT, MPI_COMM_WORLD);
+00210 }
+00211 
+00212 /* Unsigned short */
+00213 void unpack (unsigned short & __ush, int __nitem) {
+00214 
+00215   MPI_Unpack (mpi_buf, MPI_BUF_SIZE, & pos_buf, & __ush, __nitem, MPI_UNSIGNED_SHORT, MPI_COMM_WORLD);
+00216 }
+00217 
+00218 /* Long */
+00219 void unpack (long & __l, int __nitem) {
+00220 
+00221   MPI_Unpack (mpi_buf, MPI_BUF_SIZE, & pos_buf, & __l, __nitem, MPI_LONG, MPI_COMM_WORLD);
+00222 }
+00223 
+00224 /* Unsigned long */
+00225 void unpack (unsigned long & __ul, int __nitem) {
+00226 
+00227   MPI_Unpack (mpi_buf, MPI_BUF_SIZE, & pos_buf, & __ul, __nitem, MPI_UNSIGNED_LONG, MPI_COMM_WORLD);
+00228 }
+00229 
+00230 /* String */
+00231 void unpack (char * __str) {
+00232 
+00233   int len;
+00234   MPI_Unpack (mpi_buf, MPI_BUF_SIZE, & pos_buf, & len, 1, MPI_INT, MPI_COMM_WORLD);
+00235   MPI_Unpack (mpi_buf, MPI_BUF_SIZE, & pos_buf, __str, len, MPI_CHAR, MPI_COMM_WORLD);    
+00236 }
+00237 
+

Generated on Thu Jul 5 13:43:30 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/mess_8h-source.html b/branches/paradiseo-peo-meta-model/doc/html/mess_8h-source.html new file mode 100644 index 000000000..5ea857a68 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/mess_8h-source.html @@ -0,0 +1,60 @@ + + +ParadisEO-PEO: mess.h Source File + + + + +
+
+

mess.h

00001 // "mess.h"
+00002 
+00003 // (c) OPAC Team, LIFL, August 2005
+00004 
+00005 /* 
+00006    Contact: paradiseo-help@lists.gforge.inria.fr
+00007 */
+00008 
+00009 #ifndef __mess_rmc_h
+00010 #define __mess_rmc_h
+00011 
+00012 #include "../../core/messaging.h"
+00013 
+00014 extern void initMessage ();
+00015 
+00016 extern void sendMessage (int __to, int __tag);
+00017 
+00018 extern void sendMessageToAll (int __tag);
+00019 
+00020 extern void receiveMessage (int __from, int __tag);
+00021 
+00022 extern void cleanBuffers ();
+00023 
+00024 extern void waitBuffers ();
+00025 
+00026 extern bool probeMessage (int & __src, int & __tag);
+00027 
+00028 extern void waitMessage ();
+00029 
+00030 #endif
+00031 
+

Generated on Thu Jul 5 13:43:30 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/messaging_8h-source.html b/branches/paradiseo-peo-meta-model/doc/html/messaging_8h-source.html new file mode 100644 index 000000000..7ddd053fc --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/messaging_8h-source.html @@ -0,0 +1,133 @@ + + +ParadisEO-PEO: messaging.h Source File + + + + +
+
+

messaging.h

00001 // "messaging.h"
+00002 
+00003 // (c) OPAC Team, LIFL, August 2005
+00004 
+00005 /* 
+00006    Contact: paradiseo-help@lists.gforge.inria.fr
+00007 */
+00008 
+00009 #ifndef __mess_h
+00010 #define __mess_h
+00011 
+00012 #include <utility>
+00013 
+00014 /* Char */
+00015 extern void pack (const char & __c); 
+00016 
+00017 /* Float */
+00018 extern void pack (const float & __f, int __nitem = 1); 
+00019 
+00020 /* Double */
+00021 extern void pack (const double & __d, int __nitem = 1); 
+00022 
+00023 /* Integer */
+00024 extern void pack (const int & __i, int __nitem = 1); 
+00025 
+00026 /* Unsigned int. */
+00027 extern void pack (const unsigned int & __ui, int __nitem = 1); 
+00028 
+00029 /* Short int. */
+00030 extern void pack (const short & __sh, int __nitem = 1); 
+00031 
+00032 /* Unsigned short */
+00033 extern void pack (const unsigned short & __ush, int __nitem = 1);
+00034 
+00035 /* Long */
+00036 extern void pack (const long & __l, int __nitem = 1); 
+00037 
+00038 /* Unsigned long */
+00039 extern void pack (const unsigned long & __ul, int __nitem = 1); 
+00040 
+00041 /* String */
+00042 extern void pack (const char * __str); 
+00043 
+00044 /* Pointer */
+00045 template <class T> void pack (const T * __ptr) {
+00046   
+00047   pack ((unsigned long) __ptr); 
+00048 }
+00049 
+00050 /* Pair */
+00051 template <class U, class V> void pack (const std :: pair <U, V> & __pair) {
+00052   
+00053   pack (__pair.first);
+00054   pack (__pair.second);
+00055 }
+00056 
+00057 //
+00058 
+00059 /* Float */
+00060 extern void unpack (char & __c); 
+00061 
+00062 /* Float */
+00063 extern void unpack (float & __f, int __nitem = 1); 
+00064 
+00065 /* Double */
+00066 extern void unpack (double & __d, int __nitem = 1); 
+00067 
+00068 /* Integer */
+00069 extern void unpack (int & __i, int __nitem = 1); 
+00070 
+00071 /* Unsigned int. */
+00072 extern void unpack (unsigned int & __ui, int __nitem = 1); 
+00073 
+00074 /* Short int. */
+00075 extern void unpack (short & __sh, int __nitem = 1); 
+00076 
+00077 /* Unsigned short */
+00078 extern void unpack (unsigned short & __ush, int __nitem = 1);
+00079 
+00080 /* Long */
+00081 extern void unpack (long & __l, int __nitem = 1); 
+00082 
+00083 /* Unsigned long */
+00084 extern void unpack (unsigned long & __ul, int __nitem = 1); 
+00085 
+00086 /* String */
+00087 extern void unpack (char * __str); 
+00088 
+00089 /* Pointer */
+00090 template <class T> void unpack (T * & __ptr) {
+00091   
+00092   unsigned long p;
+00093   unpack (p);
+00094   __ptr = (T *) p;
+00095 }
+00096 
+00097 /* Pair */
+00098 template <class U, class V> void unpack (std :: pair <U, V> & __pair) {
+00099   
+00100   unpack (__pair.first);
+00101   unpack (__pair.second);
+00102 }
+00103 
+00104 #endif
+

Generated on Thu Jul 5 13:43:30 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/namespacemembers.html b/branches/paradiseo-peo-meta-model/doc/html/namespacemembers.html new file mode 100644 index 000000000..109c93d9e --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/namespacemembers.html @@ -0,0 +1,51 @@ + + +ParadisEO-PEO: Class Members + + + + +
+
+ +
+ +
+Here is a list of all documented namespace members with links to the namespaces they belong to: +

+

+
Generated on Thu Jul 5 13:43:31 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/namespacemembers_func.html b/branches/paradiseo-peo-meta-model/doc/html/namespacemembers_func.html new file mode 100644 index 000000000..0d0d5cb4a --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/namespacemembers_func.html @@ -0,0 +1,49 @@ + + +ParadisEO-PEO: Class Members + + + + +
+
+ +
+ +
+  +

+

    +
  • finalize() +: peo
  • init() +: peo
  • loadParameters() +: peo
  • run() +: peo
+
Generated on Thu Jul 5 13:43:31 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/namespacemembers_vars.html b/branches/paradiseo-peo-meta-model/doc/html/namespacemembers_vars.html new file mode 100644 index 000000000..07a05bdb4 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/namespacemembers_vars.html @@ -0,0 +1,47 @@ + + +ParadisEO-PEO: Class Members + + + + +
+
+ +
+ +
+  +

+

+
Generated on Thu Jul 5 13:43:31 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/namespacepeo.html b/branches/paradiseo-peo-meta-model/doc/html/namespacepeo.html new file mode 100644 index 000000000..6d21f01fe --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/namespacepeo.html @@ -0,0 +1,65 @@ + + +ParadisEO-PEO: peo Namespace Reference + + + + +
+
+ +

peo Namespace Reference

+

+ + + + + + + + + + + + + + + + + + + + +

Functions

+void finalize ()
+void init (int &__argc, char **&__argv)
+void loadParameters (int &__argc, char **&__argv)
+void run ()

Variables

+int * argc
+char *** argv
+int * argc
+char *** argv
+


Generated on Thu Jul 5 13:43:31 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/namespaces.html b/branches/paradiseo-peo-meta-model/doc/html/namespaces.html new file mode 100644 index 000000000..4bc5709b7 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/namespaces.html @@ -0,0 +1,37 @@ + + +ParadisEO-PEO: Namespace Index + + + + +
+
+ +

ParadisEO-PEO Namespace List

Here is a list of all documented namespaces with brief descriptions: + +
peo
+
Generated on Thu Jul 5 13:43:31 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/node_8cpp-source.html b/branches/paradiseo-peo-meta-model/doc/html/node_8cpp-source.html new file mode 100644 index 000000000..e67d771dc --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/node_8cpp-source.html @@ -0,0 +1,87 @@ + + +ParadisEO-PEO: node.cpp Source File + + + + +
+
+

node.cpp

00001 // "node.cpp"
+00002 
+00003 // (c) OPAC Team, LIFL, August 2005
+00004 
+00005 /* 
+00006    Contact: paradiseo-help@lists.gforge.inria.fr
+00007 */
+00008 
+00009 #include <mpi.h>
+00010 #include <vector>
+00011 #include <map>
+00012 #include <string>
+00013 #include <cassert>
+00014 
+00015 static int rk, sz; /* Rank & size */
+00016 
+00017 static std :: map <std :: string, int> name_to_rk;
+00018 
+00019 static std :: vector <std :: string> rk_to_name;
+00020 
+00021 int getNodeRank () {
+00022 
+00023   return rk;
+00024 }
+00025 
+00026 int getNumberOfNodes () {
+00027 
+00028   return sz;
+00029 }
+00030 
+00031 int getRankFromName (const std :: string & __name) {
+00032   
+00033   return atoi (__name.c_str ());  
+00034 }
+00035 
+00036 void initNode (int * __argc, char * * * __argv) {
+00037   
+00038   int provided;
+00039   MPI_Init_thread (__argc,  __argv, MPI_THREAD_FUNNELED, & provided);  
+00040   assert (provided == MPI_THREAD_FUNNELED); /* The MPI implementation must be multi-threaded.
+00041                                                Yet, only one thread performs the comm.
+00042                                                operations */
+00043   MPI_Comm_rank (MPI_COMM_WORLD, & rk);   /* Who ? */
+00044   MPI_Comm_size (MPI_COMM_WORLD, & sz);    /* How many ? */
+00045 
+00046   char names [sz] [MPI_MAX_PROCESSOR_NAME];
+00047   int len;
+00048 
+00049   /* Processor names */ 
+00050   MPI_Get_processor_name (names [0], & len);   /* Me */  
+00051   MPI_Allgather (names, MPI_MAX_PROCESSOR_NAME, MPI_CHAR, names, MPI_MAX_PROCESSOR_NAME, MPI_CHAR, MPI_COMM_WORLD); /* Broadcast */
+00052   
+00053   for (int i = 0; i < sz; i ++) {
+00054     rk_to_name.push_back (names [i]);
+00055     name_to_rk [names [i]] = i;
+00056   }
+00057 }
+00058 
+

Generated on Thu Jul 5 13:43:30 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/node_8h-source.html b/branches/paradiseo-peo-meta-model/doc/html/node_8h-source.html new file mode 100644 index 000000000..457f6e4aa --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/node_8h-source.html @@ -0,0 +1,53 @@ + + +ParadisEO-PEO: node.h Source File + + + + +
+
+

node.h

00001 // "node.h"
+00002 
+00003 // (c) OPAC Team, LIFL, August 2005
+00004 
+00005 /* 
+00006    Contact: paradiseo-help@lists.gforge.inria.fr
+00007 */
+00008 
+00009 #ifndef __node_h
+00010 #define __node_h
+00011 
+00012 #include <string>
+00013 #include <cassert>
+00014 
+00015 extern int getNodeRank (); /* It gives the rank of the calling process */
+00016 
+00017 extern int getNumberOfNodes (); /* It gives the size of the environment (Total number of nodes) */
+00018 
+00019 extern int getRankFromName (const std :: string & __name); /* It gives the rank of the process
+00020                                                               expressed by its name */
+00021 
+00022 extern void initNode (int * __argc, char * * * __argv);
+00023 
+00024 #endif
+

Generated on Thu Jul 5 13:43:30 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/paradiseo_8h-source.html b/branches/paradiseo-peo-meta-model/doc/html/paradiseo_8h-source.html new file mode 100644 index 000000000..fb84c6c22 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/paradiseo_8h-source.html @@ -0,0 +1,70 @@ + + +ParadisEO-PEO: paradiseo.h Source File + + + + +
+
+

paradiseo.h

00001 // "paradiseo.h"
+00002 
+00003 // (c) OPAC Team, LIFL, August 2005
+00004 
+00005 /* 
+00006    Contact: paradiseo-help@lists.gforge.inria.fr
+00007 */
+00008 
+00009 #ifndef __paradiseo_h_
+00010 #define __paradiseo_h_
+00011 
+00012 #include <eo>
+00013 #include <mo>
+00014 
+00015 
+00260 
+00261 
+00262 
+00263 #include "core/peo_init.h"
+00264 #include "core/peo_run.h"
+00265 #include "core/peo_fin.h"
+00266 
+00267 #include "core/eoVector_comm.h"
+00268 
+00269 #include "peoEA.h"
+00270 
+00271 /* Parallel steps of the E.A. */
+00272 #include "peoSeqTransform.h"
+00273 #include "peoParaSGATransform.h"
+00274 #include "peoSeqPopEval.h"
+00275 #include "peoParaPopEval.h"
+00276 
+00277 /* Cooperative island model */
+00278 #include "core/ring_topo.h"
+00279 #include "peoAsyncIslandMig.h"
+00280 #include "peoSyncIslandMig.h"
+00281 
+00282 /* Synchronous multi-start model */
+00283 #include "peoSyncMultiStart.h"
+00284 
+00285 #endif
+

Generated on Thu Jul 5 13:43:30 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/param_8cpp-source.html b/branches/paradiseo-peo-meta-model/doc/html/param_8cpp-source.html new file mode 100644 index 000000000..819d3aaab --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/param_8cpp-source.html @@ -0,0 +1,50 @@ + + +ParadisEO-PEO: param.cpp Source File + + + + +
+
+

param.cpp

00001 // "param.cpp"
+00002 
+00003 // (c) OPAC Team, LIFL, August 2005
+00004 
+00005 /* 
+00006    Contact: paradiseo-help@lists.gforge.inria.fr
+00007 */
+00008 
+00009 #include <utils/eoParser.h>
+00010 
+00011 #include "schema.h"
+00012 
+00013 void loadRMCParameters (int & __argc, char * * & __argv) {
+00014 
+00015   eoParser parser (__argc, __argv);
+00016 
+00017   /* Schema */
+00018   eoValueParam <std :: string> schema_param ("schema.xml", "schema", "?");
+00019   parser.processParam (schema_param);
+00020   loadSchema (schema_param.value ().c_str ());
+00021 }
+

Generated on Thu Jul 5 13:43:30 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/param_8h-source.html b/branches/paradiseo-peo-meta-model/doc/html/param_8h-source.html new file mode 100644 index 000000000..39df99494 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/param_8h-source.html @@ -0,0 +1,43 @@ + + +ParadisEO-PEO: param.h Source File + + + + +
+
+

param.h

00001 // "param.h"
+00002 
+00003 // (c) OPAC Team, LIFL, August 2005
+00004 
+00005 /* 
+00006    Contact: paradiseo-help@lists.gforge.inria.fr
+00007 */
+00008 
+00009 #ifndef __rmc_param_h
+00010 #define __rmc_param_h
+00011 
+00012 extern void loadRMCParameters (int & __argc, char * * & __argv);
+00013 
+00014 #endif
+

Generated on Thu Jul 5 13:43:30 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/peoAggEvalFunc_8h-source.html b/branches/paradiseo-peo-meta-model/doc/html/peoAggEvalFunc_8h-source.html new file mode 100644 index 000000000..4f975e5c3 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/peoAggEvalFunc_8h-source.html @@ -0,0 +1,49 @@ + + +ParadisEO-PEO: peoAggEvalFunc.h Source File + + + + +
+
+

peoAggEvalFunc.h

00001 // "peoAggEvalFunc.h"
+00002 
+00003 // (c) OPAC Team, LIFL, August 2005
+00004 
+00005 /* 
+00006    Contact: paradiseo-help@lists.gforge.inria.fr
+00007 */
+00008 
+00009 #ifndef __peoAggEvalFunc_h
+00010 #define __peoAggEvalFunc_h
+00011 
+00012 #include <eoFunctor.h>
+00013 
+00015 
+00025 template< class EOT > class peoAggEvalFunc : public eoBF< EOT&, const typename EOT :: Fitness&, void > {
+00026 
+00027 };
+00028 
+00029 
+00030 #endif
+

Generated on Thu Jul 5 13:43:30 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/peoAsyncIslandMig_8h-source.html b/branches/paradiseo-peo-meta-model/doc/html/peoAsyncIslandMig_8h-source.html new file mode 100644 index 000000000..5fd95a748 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/peoAsyncIslandMig_8h-source.html @@ -0,0 +1,189 @@ + + +ParadisEO-PEO: peoAsyncIslandMig.h Source File + + + + +
+
+

peoAsyncIslandMig.h

00001 // "peoAsyncIslandMig.h"
+00002 
+00003 // (c) OPAC Team, LIFL, August 2005
+00004 
+00005 /* 
+00006    Contact: paradiseo-help@lists.gforge.inria.fr
+00007 */
+00008 
+00009 #ifndef __peoAsyncIslandMig_h
+00010 #define __peoAsyncIslandMig_h
+00011 
+00012 
+00013 #include <queue>
+00014 
+00015 #include <utils/eoUpdater.h>
+00016 
+00017 #include <eoContinue.h>
+00018 #include <eoSelect.h>
+00019 #include <eoReplacement.h>
+00020 #include <eoPop.h>
+00021 
+00022 #include "core/topology.h"
+00023 #include "core/cooperative.h"
+00024 #include "core/eoPop_comm.h"
+00025 #include "core/peo_debug.h"
+00026 
+00027 
+00029 
+00112 template< class EOT > class peoAsyncIslandMig : public Cooperative, public eoUpdater {
+00113 
+00114 public:
+00115 
+00125         peoAsyncIslandMig( 
+00126                                 eoContinue< EOT >& __cont,
+00127                                 eoSelect< EOT >& __select,
+00128                                 eoReplacement< EOT >& __replace,
+00129                                 Topology& __topology,
+00130                                 eoPop< EOT >& __source,
+00131                                 eoPop< EOT >& __destination 
+00132         );
+00133 
+00138         void operator()();
+00139         
+00141         void pack();
+00143         void unpack();
+00144 
+00145 
+00146 private:
+00147 
+00148         void emigrate();
+00149         void immigrate();
+00150 
+00151 
+00152 private:
+00153 
+00154         eoContinue< EOT >& cont;        // continuator
+00155         eoSelect< EOT >& select;        // the selection strategy
+00156         eoReplacement< EOT >& replace;  // the replacement strategy
+00157         Topology& topology;             // the neighboring topology
+00158         
+00159         // source and destination populations
+00160         eoPop< EOT >& source;
+00161         eoPop< EOT >& destination;
+00162         
+00163         // immigrants & emigrants in the queue
+00164         std :: queue< eoPop< EOT > > imm;
+00165         std :: queue< eoPop< EOT > > em;
+00166         
+00167         std :: queue< Cooperative* > coop_em;
+00168 };
+00169 
+00170 
+00171 template< class EOT > peoAsyncIslandMig< EOT > :: peoAsyncIslandMig(
+00172 
+00173                 eoContinue< EOT >& __cont,
+00174                 eoSelect< EOT >& __select,
+00175                 eoReplacement< EOT >& __replace,
+00176                 Topology& __topology,
+00177                 eoPop< EOT >& __source,
+00178                 eoPop< EOT >& __destination
+00179 
+00180         ) : cont( __cont ), select( __select ), replace( __replace ), topology( __topology ), source( __source ), destination( __destination )
+00181 {
+00182 
+00183         __topology.add( *this );
+00184 }
+00185 
+00186 
+00187 template< class EOT > void peoAsyncIslandMig< EOT > :: pack()
+00188 {
+00189 
+00190         lock(); {
+00191 
+00192 		 :: pack( coop_em.front()->getKey() );
+00193 		 :: pack( em.front() );
+00194                 coop_em.pop();
+00195                 em.pop();
+00196         }
+00197         unlock();
+00198 }
+00199 
+00200 
+00201 template< class EOT > void peoAsyncIslandMig< EOT > :: unpack()
+00202 {
+00203 
+00204         lock(); {
+00205 
+00206                 eoPop< EOT > mig;
+00207 		 :: unpack( mig );
+00208                 imm.push( mig );
+00209         }
+00210         unlock();
+00211 }
+00212 
+00213 
+00214 template< class EOT > void peoAsyncIslandMig< EOT > :: emigrate()
+00215 {
+00216 
+00217         std :: vector< Cooperative* >in, out;
+00218         topology.setNeighbors( this, in, out );
+00219 
+00220         for ( unsigned i = 0; i < out.size(); i++ ) {
+00221         
+00222                 eoPop< EOT > mig;
+00223                 select( source, mig );
+00224                 em.push( mig );
+00225                 coop_em.push( out[i] );
+00226                 send( out[i] );
+00227                 printDebugMessage( "sending some emigrants." );
+00228         }
+00229 }
+00230 
+00231 
+00232 template< class EOT > void peoAsyncIslandMig< EOT > :: immigrate()
+00233 {
+00234 
+00235         lock(); {
+00236 
+00237                 while ( !imm.empty() ) {
+00238 
+00239                         replace( destination, imm.front() );
+00240                         imm.pop();
+00241                         printDebugMessage( "receiving some immigrants." );
+00242                 }
+00243         }
+00244         unlock();
+00245 }
+00246 
+00247 
+00248 template< class EOT > void peoAsyncIslandMig< EOT > :: operator()() {
+00249 
+00250         if ( !cont( source ) ) {
+00251 
+00252                 emigrate();     // sending emigrants
+00253                 immigrate();    // receiving immigrants
+00254         }
+00255 }
+00256 
+00257 
+00258 #endif
+

Generated on Thu Jul 5 13:43:30 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/peoEA_8h-source.html b/branches/paradiseo-peo-meta-model/doc/html/peoEA_8h-source.html new file mode 100644 index 000000000..3b64581a1 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/peoEA_8h-source.html @@ -0,0 +1,128 @@ + + +ParadisEO-PEO: peoEA.h Source File + + + + +
+
+

peoEA.h

00001 // "peoEA.h"
+00002 
+00003 // (c) OPAC Team, LIFL, August 2005
+00004 
+00005 /* 
+00006    Contact: paradiseo-help@lists.gforge.inria.fr
+00007 */
+00008 
+00009 #ifndef __peoEA_h
+00010 #define __peoEA_h
+00011 
+00012 #include <eoContinue.h>
+00013 #include <eoEvalFunc.h>
+00014 #include <eoSelect.h>
+00015 #include <eoPopEvalFunc.h>
+00016 #include <eoReplacement.h>
+00017 
+00018 #include "peoPopEval.h"
+00019 #include "peoTransform.h"
+00020 #include "core/runner.h"
+00021 #include "core/peo_debug.h"
+00022 
+00024 
+00054 template < class EOT > class peoEA : public Runner {
+00055 
+00056 public:
+00057 
+00069         peoEA( 
+00070                 eoContinue< EOT >& __cont,
+00071                 peoPopEval< EOT >& __pop_eval,
+00072                 eoSelect< EOT >& __select,
+00073                 peoTransform< EOT >& __trans,
+00074                 eoReplacement< EOT >& __replace 
+00075         );
+00076 
+00079         void run();
+00080         
+00084         void operator()( eoPop< EOT >& __pop );
+00085 
+00086 private:
+00087 
+00088 
+00089         eoContinue< EOT >& cont;
+00090         peoPopEval< EOT >& pop_eval;
+00091         eoSelect< EOT >& select;
+00092         peoTransform< EOT >& trans;
+00093         eoReplacement< EOT >& replace;
+00094         eoPop< EOT >* pop;
+00095 };
+00096 
+00097 
+00098 template < class EOT > peoEA< EOT > :: peoEA( 
+00099 
+00100                                 eoContinue< EOT >& __cont, 
+00101                                 peoPopEval< EOT >& __pop_eval, 
+00102                                 eoSelect< EOT >& __select, 
+00103                                 peoTransform< EOT >& __trans, 
+00104                                 eoReplacement< EOT >& __replace
+00105 
+00106                 ) : cont( __cont ), pop_eval( __pop_eval ), select( __select ), trans( __trans ), replace( __replace )
+00107 {
+00108 
+00109         trans.setOwner( *this );
+00110         pop_eval.setOwner( *this );
+00111 }
+00112 
+00113 
+00114 template< class EOT > void peoEA< EOT > :: operator ()( eoPop< EOT >& __pop ) {
+00115 
+00116         pop = &__pop;
+00117 }
+00118 
+00119 
+00120 template< class EOT > void peoEA< EOT > :: run() {
+00121 
+00122         printDebugMessage( "performing the first evaluation of the population." );
+00123         pop_eval( *pop );
+00124         
+00125         do {
+00126 
+00127                 eoPop< EOT > off;
+00128 
+00129                 printDebugMessage( "performing the selection step." );
+00130                 select( *pop, off );
+00131                 trans( off );
+00132 
+00133                 printDebugMessage( "performing the evaluation of the population." );
+00134                 pop_eval( off );
+00135 
+00136                 printDebugMessage( "performing the replacement of the population." );
+00137                 replace( *pop, off );
+00138 
+00139                 printDebugMessage( "deciding of the continuation." );
+00140         
+00141         } while ( cont( *pop ) );
+00142 }
+00143 
+00144 
+00145 #endif
+

Generated on Thu Jul 5 13:43:30 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/peoNoAggEvalFunc_8h-source.html b/branches/paradiseo-peo-meta-model/doc/html/peoNoAggEvalFunc_8h-source.html new file mode 100644 index 000000000..fb31231eb --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/peoNoAggEvalFunc_8h-source.html @@ -0,0 +1,58 @@ + + +ParadisEO-PEO: peoNoAggEvalFunc.h Source File + + + + +
+
+

peoNoAggEvalFunc.h

00001 // "peoNoAggEvalFunc.h"
+00002 
+00003 // (c) OPAC Team, LIFL, August 2005
+00004 
+00005 /* 
+00006    Contact: paradiseo-help@lists.gforge.inria.fr
+00007 */
+00008 
+00009 #ifndef __peoNoAggEvalFunc_h
+00010 #define __peoNoAggEvalFunc_h
+00011 
+00012 #include "peoAggEvalFunc.h"
+00013 
+00015 
+00019 template< class EOT > class peoNoAggEvalFunc : public peoAggEvalFunc< EOT > {
+00020 
+00021 public :
+00022 
+00024         void operator()( EOT& __sol, const typename EOT :: Fitness& __fit );
+00025 };
+00026 
+00027 
+00028 template< class EOT > void peoNoAggEvalFunc< EOT > :: operator()( EOT& __sol, const typename EOT :: Fitness& __fit ) {
+00029 
+00030         __sol.fitness( __fit );
+00031 }
+00032 
+00033 
+00034 #endif
+

Generated on Thu Jul 5 13:43:30 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/peoParaPopEval_8h-source.html b/branches/paradiseo-peo-meta-model/doc/html/peoParaPopEval_8h-source.html new file mode 100644 index 000000000..ea7e7852a --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/peoParaPopEval_8h-source.html @@ -0,0 +1,226 @@ + + +ParadisEO-PEO: peoParaPopEval.h Source File + + + + +
+
+

peoParaPopEval.h

00001 // "peoParaPopEval.h"
+00002 
+00003 // (c) OPAC Team, LIFL, August 2005
+00004 
+00005 /* 
+00006    Contact: paradiseo-help@lists.gforge.inria.fr
+00007 */
+00008 
+00009 #ifndef __peoParaPopEval_h
+00010 #define __peoParaPopEval_h
+00011 
+00012 #include <queue>
+00013 #include <eoEvalFunc.h>
+00014 
+00015 #include "core/messaging.h"
+00016 #include "core/peo_debug.h"
+00017 #include "peoAggEvalFunc.h"
+00018 #include "peoNoAggEvalFunc.h"
+00019 
+00020 
+00022 
+00026 template< class EOT > class peoParaPopEval : public peoPopEval< EOT > {
+00027 
+00028 public:
+00029 
+00030         using peoPopEval< EOT > :: requestResourceRequest;
+00031         using peoPopEval< EOT > :: resume;
+00032         using peoPopEval< EOT > :: stop;
+00033         using peoPopEval< EOT > :: getOwner;
+00034         
+00039         peoParaPopEval( eoEvalFunc< EOT >& __eval_func );
+00040 
+00045         peoParaPopEval( const std :: vector< eoEvalFunc < EOT >* >& __funcs, peoAggEvalFunc< EOT >& __merge_eval );
+00046 
+00050         void operator()( eoPop< EOT >& __pop );
+00051 
+00054         void packData();
+00055         
+00058         void unpackData();
+00059 
+00061         void execute();
+00062         
+00065         void packResult();
+00066         
+00069         void unpackResult();
+00070         
+00073         void notifySendingData();
+00074 
+00077         void notifySendingAllResourceRequests();
+00078 
+00079 private:
+00080 
+00081 
+00082         const std :: vector< eoEvalFunc < EOT >* >& funcs;
+00083         std :: vector< eoEvalFunc < EOT >* > one_func;
+00084         
+00085         peoAggEvalFunc< EOT >& merge_eval;
+00086         peoNoAggEvalFunc< EOT > no_merge_eval;
+00087         
+00088         std :: queue< EOT* >tasks;
+00089         
+00090         std :: map< EOT*, std :: pair< unsigned, unsigned > > progression;
+00091         
+00092         unsigned num_func;
+00093         
+00094         EOT sol;
+00095         
+00096         EOT *ad_sol;
+00097         
+00098         unsigned total;
+00099 };
+00100 
+00101 
+00102 template< class EOT > peoParaPopEval< EOT > :: peoParaPopEval( eoEvalFunc< EOT >& __eval_func ) : 
+00103 
+00104                 funcs( one_func ), merge_eval( no_merge_eval )
+00105 {
+00106 
+00107         one_func.push_back( &__eval_func );
+00108 }
+00109 
+00110 
+00111 template< class EOT > peoParaPopEval< EOT > :: peoParaPopEval( 
+00112 
+00113                                 const std :: vector< eoEvalFunc< EOT >* >& __funcs,
+00114                                 peoAggEvalFunc< EOT >& __merge_eval 
+00115 
+00116                 ) : funcs( __funcs ), merge_eval( __merge_eval )
+00117 {
+00118 
+00119 }
+00120 
+00121 
+00122 template< class EOT > void peoParaPopEval< EOT >::operator()( eoPop< EOT >& __pop ) {
+00123 
+00124         for ( unsigned i = 0; i < __pop.size(); i++ ) {
+00125 
+00126                 __pop[ i ].fitness( typename EOT :: Fitness() );
+00127 
+00128                 progression[ &__pop[ i ] ].first = funcs.size() - 1;
+00129                 progression[ &__pop[ i ] ].second = funcs.size();
+00130                 
+00131                 for ( unsigned j = 0; j < funcs.size(); j++ ) {
+00132                         /* Queuing the 'invalid' solution and its associated owner */
+00133                         tasks.push( &__pop[ i ] );
+00134                 }
+00135         }
+00136         
+00137         total = funcs.size() * __pop.size();
+00138         requestResourceRequest( funcs.size() * __pop.size() );
+00139         stop();
+00140 }
+00141 
+00142 
+00143 template< class EOT > void peoParaPopEval< EOT > :: packData() {
+00144 
+00145         //  printDebugMessage ("debut pakc data");
+00146         pack( progression[ tasks.front() ].first-- );
+00147         
+00148         /* Packing the contents :-) of the solution */
+00149         pack( *tasks.front() );
+00150         
+00151         /* Packing the addresses of both the solution and the owner */
+00152         pack( tasks.front() );
+00153         tasks.pop(  );
+00154 }
+00155 
+00156 
+00157 template< class EOT > void peoParaPopEval< EOT > :: unpackData() {
+00158 
+00159         unpack( num_func );
+00160         /* Unpacking the solution */
+00161         unpack( sol );
+00162         /* Unpacking the @ of that one */
+00163         unpack( ad_sol );
+00164 }
+00165 
+00166 
+00167 template< class EOT > void peoParaPopEval< EOT > :: execute() {
+00168 
+00169         /* Computing the fitness of the solution */
+00170         funcs[ num_func ]->operator()( sol );
+00171 }
+00172 
+00173 
+00174 template< class EOT > void peoParaPopEval< EOT > :: packResult() {
+00175 
+00176         /* Packing the fitness of the solution */
+00177         pack( sol.fitness() );
+00178         /* Packing the @ of the individual */
+00179         pack( ad_sol );
+00180 }
+00181 
+00182 
+00183 template< class EOT > void peoParaPopEval< EOT > :: unpackResult() {
+00184 
+00185         typename EOT :: Fitness fit;
+00186         
+00187         /* Unpacking the computed fitness */
+00188         unpack( fit );
+00189                 
+00190         /* Unpacking the @ of the associated individual */
+00191         unpack( ad_sol );
+00192         
+00193         
+00194         /* Associating the fitness the local solution */
+00195         merge_eval( *ad_sol, fit );
+00196 
+00197         progression[ ad_sol ].second--;
+00198 
+00199         /* Notifying the container of the termination of the evaluation */
+00200         if ( !progression[ ad_sol ].second ) {
+00201 
+00202                 progression.erase( ad_sol );
+00203         }
+00204         
+00205         total--;
+00206         if ( !total ) {
+00207 
+00208                 getOwner()->setActive();
+00209                 resume();
+00210         }
+00211 }
+00212 
+00213 
+00214 template< class EOT > void peoParaPopEval< EOT > :: notifySendingData() {
+00215 
+00216 }
+00217 
+00218 
+00219 template< class EOT > void peoParaPopEval< EOT > :: notifySendingAllResourceRequests() {
+00220 
+00221         getOwner()->setPassive();
+00222 }
+00223 
+00224 
+00225 #endif
+

Generated on Thu Jul 5 13:43:30 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/peoParaSGATransform_8h-source.html b/branches/paradiseo-peo-meta-model/doc/html/peoParaSGATransform_8h-source.html new file mode 100644 index 000000000..bad15f80b --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/peoParaSGATransform_8h-source.html @@ -0,0 +1,184 @@ + + +ParadisEO-PEO: peoParaSGATransform.h Source File + + + + +
+
+

peoParaSGATransform.h

00001 // "peoParaSGATransform.h"
+00002 
+00003 //(c) OPAC Team, LIFL, August 2005
+00004 
+00005 /* 
+00006    Contact: paradiseo-help@lists.gforge.inria.fr
+00007 */
+00008 
+00009 #ifndef __peoParaSGATransform_h
+00010 #define __peoParaSGATransform_h
+00011 
+00012 #include "peoTransform.h"
+00013 #include "core/thread.h"
+00014 #include "core/messaging.h"
+00015 #include "core/peo_debug.h"
+00016 
+00017 
+00018 extern int getNodeRank();
+00019 
+00020 
+00021 template< class EOT > class peoParaSGATransform : public peoTransform< EOT > {
+00022 
+00023 public:
+00024 
+00025         using peoTransform< EOT > :: requestResourceRequest;
+00026         using peoTransform< EOT > :: resume;
+00027         using peoTransform< EOT > :: stop;
+00028         using peoTransform< EOT > :: getOwner;
+00029 
+00030         peoParaSGATransform( 
+00031 
+00032                                 eoQuadOp< EOT >& __cross,
+00033                                 double __cross_rate,
+00034                                 eoMonOp< EOT >& __mut, 
+00035                                 double __mut_rate 
+00036         );
+00037 
+00038         void operator()( eoPop< EOT >& __pop );
+00039         
+00040         void packData();
+00041         
+00042         void unpackData();
+00043         
+00044         void execute();
+00045         
+00046         void packResult();
+00047         
+00048         void unpackResult();
+00049         
+00050         void notifySendingData();
+00051         void notifySendingAllResourceRequests();
+00052 
+00053 private:
+00054 
+00055     eoQuadOp< EOT >& cross;
+00056     double cross_rate;
+00057 
+00058     eoMonOp< EOT >& mut;
+00059     double mut_rate;
+00060 
+00061     unsigned idx;
+00062 
+00063     eoPop< EOT >* pop;
+00064 
+00065     EOT father, mother;
+00066 
+00067     unsigned num_term;
+00068 };
+00069 
+00070 template< class EOT > peoParaSGATransform< EOT > :: peoParaSGATransform( 
+00071 
+00072                                 eoQuadOp< EOT >& __cross,
+00073                                 double __cross_rate,
+00074                                 eoMonOp < EOT >& __mut,
+00075                                 double __mut_rate 
+00076 
+00077                 ) : cross( __cross ), cross_rate( __cross_rate ), mut( __mut ), mut_rate( __mut_rate )
+00078 {
+00079 
+00080 }
+00081 
+00082 
+00083 template< class EOT > void peoParaSGATransform< EOT > :: packData() {
+00084 
+00085         pack( idx );
+00086          :: pack( pop->operator[]( idx++ ) );
+00087          :: pack( pop->operator[]( idx++ ) );
+00088 }
+00089 
+00090 
+00091 template< class EOT > void peoParaSGATransform< EOT > :: unpackData() {
+00092 
+00093         unpack( idx );
+00094          :: unpack( father );
+00095          :: unpack( mother );
+00096 }
+00097 
+00098 
+00099 template< class EOT > void peoParaSGATransform< EOT > :: execute() {
+00100 
+00101         if( rng.uniform() < cross_rate ) cross( mother, father );
+00102 
+00103         if( rng.uniform() < mut_rate ) mut( mother );
+00104         if( rng.uniform() < mut_rate ) mut( father );
+00105 }
+00106 
+00107 
+00108 template< class EOT > void peoParaSGATransform< EOT > :: packResult() {
+00109 
+00110         pack( idx );
+00111          :: pack( father );
+00112          :: pack( mother );
+00113 }
+00114 
+00115 
+00116 template< class EOT > void peoParaSGATransform< EOT > :: unpackResult() {
+00117 
+00118         unsigned sidx;
+00119         
+00120         unpack( sidx );
+00121          :: unpack( pop->operator[]( sidx++ ) );
+00122          :: unpack( pop->operator[]( sidx ) );
+00123         num_term += 2;
+00124         
+00125         if( num_term == pop->size() ) {
+00126 
+00127                 getOwner()->setActive();
+00128                 resume();
+00129         }
+00130 }
+00131 
+00132 
+00133 template< class EOT > void peoParaSGATransform< EOT > :: operator()( eoPop < EOT >& __pop ) {
+00134 
+00135         printDebugMessage( "performing the parallel transformation step." );
+00136         pop = &__pop;
+00137         idx = 0;
+00138         num_term = 0;
+00139         requestResourceRequest( __pop.size() / 2 );
+00140         stop();
+00141 }
+00142 
+00143 
+00144 template< class EOT > void peoParaSGATransform< EOT > :: notifySendingData() {
+00145 
+00146 }
+00147 
+00148 
+00149 template< class EOT > void peoParaSGATransform< EOT > :: notifySendingAllResourceRequests() {
+00150 
+00151         getOwner()->setPassive();
+00152 }
+00153 
+00154 
+00155 #endif
+

Generated on Thu Jul 5 13:43:30 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/peoPopEval_8h-source.html b/branches/paradiseo-peo-meta-model/doc/html/peoPopEval_8h-source.html new file mode 100644 index 000000000..18da7a60b --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/peoPopEval_8h-source.html @@ -0,0 +1,52 @@ + + +ParadisEO-PEO: peoPopEval.h Source File + + + + +
+
+

peoPopEval.h

00001 // "peoPopEval.h"
+00002 
+00003 // (c) OPAC Team, LIFL, August 2005
+00004 
+00005 /* 
+00006    Contact: paradiseo-help@lists.gforge.inria.fr
+00007 */
+00008 
+00009 #ifndef __peoPopEval_h
+00010 #define __peoPopEval_h
+00011 
+00012 #include "core/service.h"
+00013 
+00015 
+00019 template< class EOT > class peoPopEval : public Service {
+00020 
+00021 public:
+00022 
+00024         virtual void operator()( eoPop< EOT >& __pop ) = 0;
+00025 };
+00026 
+00027 
+00028 #endif
+

Generated on Thu Jul 5 13:43:30 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/peoSeqPopEval_8h-source.html b/branches/paradiseo-peo-meta-model/doc/html/peoSeqPopEval_8h-source.html new file mode 100644 index 000000000..3d6718a68 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/peoSeqPopEval_8h-source.html @@ -0,0 +1,72 @@ + + +ParadisEO-PEO: peoSeqPopEval.h Source File + + + + +
+
+

peoSeqPopEval.h

00001 // "peoSeqPopEval.h"
+00002 
+00003 // (c) OPAC Team, LIFL, August 2005
+00004 
+00005 /* 
+00006    Contact: paradiseo-help@lists.gforge.inria.fr
+00007 */
+00008 
+00009 #ifndef __peoSeqPopEval_h
+00010 #define __peoSeqPopEval_h
+00011 
+00012 #include <eoEvalFunc.h>
+00013 
+00014 #include "peoPopEval.h"
+00015 
+00017 
+00021 template< class EOT > class peoSeqPopEval : public peoPopEval< EOT > {
+00022 
+00023 public:
+00024 
+00028         peoSeqPopEval( eoEvalFunc< EOT >& __eval );
+00029 
+00033         void operator()( eoPop< EOT >& __pop );
+00034 
+00035 private:
+00036 
+00037         eoEvalFunc< EOT >& eval;
+00038 };
+00039 
+00040 
+00041 template< class EOT > peoSeqPopEval< EOT > :: peoSeqPopEval( eoEvalFunc< EOT >& __eval ) : eval( __eval ) {
+00042 
+00043 }
+00044 
+00045 
+00046 template< class EOT > void peoSeqPopEval< EOT > :: operator()( eoPop< EOT >& __pop ) {
+00047 
+00048         for ( unsigned i = 0; i < __pop.size(); i++ )
+00049                 eval( __pop[i] );
+00050 }
+00051 
+00052 
+00053 #endif
+

Generated on Thu Jul 5 13:43:30 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/peoSeqTransform_8h-source.html b/branches/paradiseo-peo-meta-model/doc/html/peoSeqTransform_8h-source.html new file mode 100644 index 000000000..6685ac360 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/peoSeqTransform_8h-source.html @@ -0,0 +1,80 @@ + + +ParadisEO-PEO: peoSeqTransform.h Source File + + + + +
+
+

peoSeqTransform.h

00001 // "peoSeqTransform.h"
+00002 
+00003 // (c) OPAC Team, LIFL, August 2005
+00004 
+00005 /* 
+00006    Contact: paradiseo-help@lists.gforge.inria.fr
+00007 */
+00008 
+00009 #ifndef __peoSeqTransform_h
+00010 #define __peoSeqTransform_h
+00011 
+00012 #include "peoTransform.h"
+00013 
+00014 
+00016 
+00020 template< class EOT > class peoSeqTransform : public peoTransform< EOT > {
+00021 
+00022 public:
+00023 
+00027         peoSeqTransform( eoTransform< EOT >& __trans );
+00028         
+00032         void operator()( eoPop< EOT >& __pop );
+00033         
+00035         virtual void packData() { }
+00036 
+00038         virtual void unpackData() { }
+00039         
+00041         virtual void execute() { }
+00042         
+00044         virtual void packResult() { }
+00045 
+00047         virtual void unpackResult() { }
+00048 
+00049 private:
+00050 
+00051         eoTransform< EOT >& trans;
+00052 };
+00053 
+00054 
+00055 template< class EOT > peoSeqTransform< EOT > :: peoSeqTransform( eoTransform< EOT >& __trans ) : trans( __trans ) {
+00056 
+00057 }
+00058 
+00059 
+00060 template< class EOT > void peoSeqTransform< EOT > :: operator()( eoPop< EOT >& __pop ) {
+00061 
+00062         trans( __pop );
+00063 }
+00064 
+00065 
+00066 #endif
+

Generated on Thu Jul 5 13:43:30 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/peoSyncIslandMig_8h-source.html b/branches/paradiseo-peo-meta-model/doc/html/peoSyncIslandMig_8h-source.html new file mode 100644 index 000000000..595287f9e --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/peoSyncIslandMig_8h-source.html @@ -0,0 +1,217 @@ + + +ParadisEO-PEO: peoSyncIslandMig.h Source File + + + + +
+
+

peoSyncIslandMig.h

00001 // "peoSyncIslandMig.h"
+00002 
+00003 // (c) OPAC Team, LIFL, August 2005
+00004 
+00005 /* 
+00006    Contact: paradiseo-help@lists.gforge.inria.fr
+00007 */
+00008 
+00009 #ifndef __peoSyncIslandMig_h
+00010 #define __peoSyncIslandMig_h
+00011 
+00012 
+00013 #include <queue>
+00014 #include <cassert>
+00015 
+00016 #include <eoPeriodicContinue.h>
+00017 
+00018 #include <utils/eoUpdater.h>
+00019 
+00020 #include <eoContinue.h>
+00021 #include <eoSelect.h>
+00022 #include <eoReplacement.h>
+00023 #include <eoPop.h>
+00024 
+00025 #include "core/topology.h"
+00026 #include "core/thread.h"
+00027 #include "core/eoPop_comm.h"
+00028 #include "core/peo_debug.h"
+00029 
+00030 
+00032 
+00114 template< class EOT > class peoSyncIslandMig : public Cooperative, public eoUpdater {
+00115 
+00116 public:
+00117 
+00127         peoSyncIslandMig(
+00128                                 unsigned __frequency,
+00129                                 eoSelect< EOT >& __select,
+00130                                 eoReplacement< EOT >& __replace,
+00131                                 Topology& __topology,
+00132                                 eoPop< EOT >& __source,
+00133                                 eoPop< EOT >& __destination
+00134         );
+00135 
+00140         void operator()();
+00141 
+00143         void pack();
+00145         void unpack();
+00146 
+00148         void notifySending();
+00149 
+00150 
+00151 private:
+00152 
+00153         void emigrate();
+00154         void immigrate();
+00155 
+00156 
+00157 private:
+00158 
+00159         eoPeriodicContinue< EOT > cont;
+00160         eoSelect< EOT >& select;        // selection strategy
+00161         eoReplacement< EOT >& replace;  // replacement strategy
+00162         Topology& topology;             // neighboring topology
+00163 
+00164         // source and target populations
+00165         eoPop< EOT >& source;
+00166         eoPop< EOT >& destination;
+00167 
+00168         // immigrants & emigrants in the queue
+00169         std :: queue< eoPop< EOT > > imm;
+00170         std :: queue< eoPop< EOT > > em;
+00171 
+00172         std :: queue< Cooperative* > coop_em;
+00173 
+00174         sem_t sync;
+00175 };
+00176 
+00177 
+00178 template< class EOT > peoSyncIslandMig< EOT > :: peoSyncIslandMig(
+00179 
+00180                 unsigned __frequency,
+00181                 eoSelect< EOT >& __select,
+00182                 eoReplacement< EOT >& __replace,
+00183                 Topology& __topology,
+00184                 eoPop< EOT >& __source,
+00185                 eoPop< EOT >& __destination
+00186 
+00187         ) : cont( __frequency ), select( __select ), replace( __replace ), topology( __topology ), source( __source ), destination( __destination ) 
+00188 {
+00189 
+00190         __topology.add( *this );
+00191         sem_init( &sync, 0, 0 );
+00192 }
+00193 
+00194 
+00195 template< class EOT > void peoSyncIslandMig< EOT > :: pack() {
+00196 
+00197         lock(); {
+00198 
+00199 		 :: pack( coop_em.front()->getKey() );
+00200 		 :: pack( em.front() );
+00201                 coop_em.pop();
+00202                 em.pop();
+00203         }
+00204         unlock();
+00205 }
+00206 
+00207 
+00208 template< class EOT > void peoSyncIslandMig< EOT > :: unpack() {
+00209 
+00210         lock(); {
+00211 
+00212                 eoPop< EOT > mig;
+00213 		 :: unpack( mig );
+00214                 imm.push( mig );
+00215         }
+00216         unlock();
+00217 
+00218         sem_post( &sync );
+00219 }
+00220 
+00221 
+00222 template< class EOT > void peoSyncIslandMig< EOT > :: emigrate() {
+00223 
+00224         std :: vector< Cooperative* > in, out;
+00225         topology.setNeighbors( this, in, out );
+00226         
+00227         for ( unsigned i = 0; i < out.size(); i ++ ) {
+00228 
+00229                 eoPop< EOT > mig;
+00230                 select( source, mig );
+00231                 em.push( mig );
+00232                 coop_em.push( out[ i ] );
+00233                 send( out[ i ] );
+00234                 printDebugMessage( "sending some emigrants." );
+00235         }
+00236 }
+00237 
+00238 
+00239 template< class EOT > void peoSyncIslandMig< EOT > :: immigrate() {
+00240 
+00241         lock(); {
+00242 
+00243                 assert( imm.size() );
+00244                 replace( destination, imm.front() ) ;
+00245                 imm.pop();
+00246                 printDebugMessage( "receiving some immigrants." );
+00247         }
+00248         unlock();
+00249 }
+00250 
+00251 
+00252 template< class EOT > void peoSyncIslandMig< EOT > :: operator()() {
+00253 
+00254         if ( !cont( source ) ) {
+00255         
+00256                 // sending emigrants
+00257                 emigrate();
+00258                 stop();
+00259 
+00260                 // synchronizing
+00261                 sem_wait( &sync );
+00262                 getOwner()->setActive();
+00263 
+00264                 // receiving immigrants
+00265                 immigrate();
+00266         }
+00267 }
+00268 
+00269 
+00270 template< class EOT > void peoSyncIslandMig< EOT > :: notifySending() {
+00271 
+00272         lock(); {
+00273 
+00274                 if ( imm.empty() ) {
+00275 
+00276                         printDebugMessage( "entering pasive mode\n" );
+00277                         getOwner()->setPassive();
+00278                 }
+00279         }
+00280         unlock();
+00281 
+00282         resume();
+00283 }
+00284 
+00285 
+00286 #endif
+

Generated on Thu Jul 5 13:43:30 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/peoSyncMultiStart_8h-source.html b/branches/paradiseo-peo-meta-model/doc/html/peoSyncMultiStart_8h-source.html new file mode 100644 index 000000000..50744549d --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/peoSyncMultiStart_8h-source.html @@ -0,0 +1,181 @@ + + +ParadisEO-PEO: peoSyncMultiStart.h Source File + + + + +
+
+

peoSyncMultiStart.h

00001 // "peoSyncMultiStart.h"
+00002 
+00003 // (c) OPAC Team, LIFL, August 2005
+00004 
+00005 /* 
+00006    Contact: paradiseo-help@lists.gforge.inria.fr
+00007 */
+00008 
+00009 #ifndef __peoSyncMultiStart_h
+00010 #define __peoSyncMultiStart_h
+00011 
+00012 #include <utils/eoUpdater.h>
+00013 #include <moAlgo.h>
+00014 
+00015 #include <eoSelect.h>
+00016 #include <eoReplacement.h>
+00017 #include <eoContinue.h>
+00018 
+00019 #include "core/service.h"
+00020 #include "core/messaging.h"
+00021 #include "core/peo_debug.h"
+00022 
+00023 
+00024 extern int getNodeRank();
+00025 
+00026 
+00028 
+00036 template< class EOT > class peoSyncMultiStart : public Service, public eoUpdater {
+00037 
+00038 public:
+00039 
+00047         peoSyncMultiStart( 
+00048 
+00049                                 eoContinue< EOT >& __cont,
+00050                                 eoSelect< EOT >& __select,
+00051                                 eoReplacement< EOT >& __replace,
+00052                                 moAlgo< EOT >& __ls, 
+00053                                 eoPop< EOT >& __pop 
+00054                 );
+00055 
+00058         void operator()();
+00059 
+00062         void packData();
+00063 
+00066         void unpackData();
+00067 
+00070         void execute();
+00071 
+00074         void packResult();
+00075 
+00078         void unpackResult();
+00079 
+00082         void notifySendingData();
+00083 
+00086         void notifySendingAllResourceRequests();
+00087 
+00088 private:
+00089 
+00090         eoContinue< EOT >& cont;
+00091         eoSelect< EOT >& select;
+00092         eoReplacement< EOT >& replace;
+00093 
+00094         moAlgo< EOT >& ls;
+00095 
+00096         eoPop< EOT >& pop;
+00097         eoPop< EOT > sel;
+00098         eoPop< EOT > impr_sel;
+00099 
+00100         EOT sol;
+00101         unsigned idx;
+00102         unsigned num_term;
+00103 };
+00104 
+00105 
+00106 template< class EOT > peoSyncMultiStart< EOT > :: peoSyncMultiStart( 
+00107 
+00108                                 eoContinue < EOT >& __cont, 
+00109                                 eoSelect< EOT >& __select,
+00110                                 eoReplacement< EOT >& __replace, 
+00111                                 moAlgo < EOT >& __ls,
+00112                                 eoPop< EOT >& __pop 
+00113 
+00114                 ) : cont( __cont ), select( __select ), replace( __replace ), ls( __ls ), pop( __pop )
+00115 {
+00116 
+00117 }
+00118 
+00119 
+00120 template< class EOT > void peoSyncMultiStart< EOT > :: packData() {
+00121 
+00122          :: pack( sel[ idx++ ] );
+00123 }
+00124 
+00125 
+00126 template< class EOT > void peoSyncMultiStart< EOT > :: unpackData() {
+00127 
+00128         unpack( sol );
+00129 }
+00130 
+00131 
+00132 template< class EOT > void peoSyncMultiStart< EOT > :: execute() {
+00133 
+00134         ls( sol );
+00135 }
+00136 
+00137 
+00138 template< class EOT > void peoSyncMultiStart< EOT > :: packResult() {
+00139 
+00140         pack( sol );
+00141 }
+00142 
+00143 
+00144 template< class EOT > void peoSyncMultiStart< EOT > :: unpackResult() {
+00145 
+00146         unpack( sol );
+00147         impr_sel.push_back( sol );
+00148         num_term++;
+00149 
+00150         if ( num_term == sel.size() ) {
+00151 
+00152                 getOwner()->setActive();
+00153                 replace( pop, impr_sel );
+00154 
+00155                 printDebugMessage( "replacing the improved individuals in the population." );
+00156                 resume();
+00157         }
+00158 }
+00159 
+00160 
+00161 template< class EOT > void peoSyncMultiStart< EOT > :: operator()() {
+00162 
+00163         printDebugMessage( "performing the parallel multi-start hybridization." );
+00164         select( pop, sel );
+00165         impr_sel.clear();
+00166         idx = num_term = 0;
+00167         requestResourceRequest( sel.size() );
+00168         stop();
+00169 }
+00170 
+00171 
+00172 template< class EOT > void peoSyncMultiStart< EOT > :: notifySendingData() {
+00173 
+00174 }
+00175 
+00176 
+00177 template< class EOT > void peoSyncMultiStart< EOT > :: notifySendingAllResourceRequests() {
+00178 
+00179         getOwner()->setPassive();
+00180 }
+00181 
+00182 
+00183 #endif
+

Generated on Thu Jul 5 13:43:30 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/peoTransform_8h-source.html b/branches/paradiseo-peo-meta-model/doc/html/peoTransform_8h-source.html new file mode 100644 index 000000000..47a0554b9 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/peoTransform_8h-source.html @@ -0,0 +1,51 @@ + + +ParadisEO-PEO: peoTransform.h Source File + + + + +
+
+

peoTransform.h

00001 // "peoTransform.h"
+00002 
+00003 // (c) OPAC Team, LIFL, August 2005
+00004 
+00005 /* 
+00006    Contact: paradiseo-help@lists.gforge.inria.fr
+00007 */
+00008 
+00009 #ifndef __peoTransform_h
+00010 #define __peoTransform_h
+00011 
+00012 #include <eoTransform.h>
+00013 
+00014 #include "core/service.h"
+00015 
+00017 
+00020 template< class EOT > class peoTransform : public Service, public eoTransform< EOT > {
+00021 
+00022 };
+00023 
+00024 
+00025 #endif
+

Generated on Thu Jul 5 13:43:30 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/peo__debug_8cpp-source.html b/branches/paradiseo-peo-meta-model/doc/html/peo__debug_8cpp-source.html new file mode 100644 index 000000000..8777a83fd --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/peo__debug_8cpp-source.html @@ -0,0 +1,106 @@ + + +ParadisEO-PEO: peo_debug.cpp Source File + + + + +
+
+

peo_debug.cpp

00001 // "peo_debug.cpp"
+00002 
+00003 // (c) OPAC Team, LIFL, August 2005
+00004 
+00005 /* 
+00006    Contact: paradiseo-help@lists.gforge.inria.fr
+00007 */
+00008 
+00009 #include "peo_debug.h"
+00010 
+00011 #include <stdio.h>
+00012 #include <time.h>
+00013 #include <unistd.h>
+00014 #include <string.h>
+00015 #include <sys/types.h>
+00016 #include <sys/stat.h>
+00017 #include <vector>
+00018 
+00019 #include "peo_debug.h"
+00020 
+00021 #define MAX_BUFF_SIZE 1000
+00022 
+00023 #define DEBUG_PATH "./log/"
+00024 
+00025 static bool debug = true;
+00026 
+00027 static char host [MAX_BUFF_SIZE];
+00028 
+00029 std :: vector <FILE *> files;
+00030 
+00031 void setDebugMode (bool __dbg) {
+00032 
+00033   debug = __dbg;
+00034   gethostname (host, MAX_BUFF_SIZE);
+00035 }
+00036 
+00037 extern int getNodeRank ();
+00038 
+00039 void initDebugging () {
+00040   
+00041   mkdir (DEBUG_PATH, S_IRWXU);
+00042   //  files.push_back (stdout);
+00043   char buff [MAX_BUFF_SIZE];
+00044   sprintf (buff, "%s/%d", DEBUG_PATH, getNodeRank ());
+00045   files.push_back (fopen (buff, "w"));
+00046 }
+00047 
+00048 void endDebugging () {
+00049 
+00050   for (unsigned i = 0; i < files.size (); i ++)
+00051     if (files [i] != stdout)
+00052       fclose (files [i]);
+00053 }
+00054 
+00055 void printDebugMessage (const char * __mess) {
+00056 
+00057   if (debug) {
+00058 
+00059     char buff [MAX_BUFF_SIZE];
+00060     time_t t = time (0);
+00061 
+00062     /* Date */
+00063     sprintf (buff, "[%s][%s: ", host, ctime (& t));
+00064     * strchr (buff, '\n') = ']';
+00065     for (unsigned i = 0; i < files.size (); i ++)
+00066       fprintf (files [i], buff);
+00067 
+00068     /* Message */
+00069     sprintf (buff, "%s", __mess);
+00070     
+00071     for (unsigned i = 0; i < files.size (); i ++) {
+00072       fputs (buff, files [i]);
+00073       fputs ("\n", files [i]);
+00074       fflush (files [i]);
+00075     }
+00076   }
+00077 }
+

Generated on Thu Jul 5 13:43:30 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/peo__debug_8h-source.html b/branches/paradiseo-peo-meta-model/doc/html/peo__debug_8h-source.html new file mode 100644 index 000000000..b3959e910 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/peo__debug_8h-source.html @@ -0,0 +1,51 @@ + + +ParadisEO-PEO: peo_debug.h Source File + + + + +
+
+

peo_debug.h

00001 // "peo_debug.h"
+00002 
+00003 // (c) OPAC Team, LIFL, August 2005
+00004 
+00005 /* 
+00006    Contact: paradiseo-help@lists.gforge.inria.fr
+00007 */
+00008 
+00009 #ifndef __peo_debug_h
+00010 #define __peo_debug_h
+00011 
+00012 extern void initDebugging ();
+00013 
+00014 extern void endDebugging ();
+00015 
+00016 extern void setDebugMode (bool __dbg = true); /* (Des)activating the Debugging mode */
+00017 
+00018 extern void printDebugMessage (const char * __mess); /* Print a new message both on the
+00019                                                         standard output and a target
+00020                                                         text-file in a subdirectory) */
+00021 
+00022 #endif
+

Generated on Thu Jul 5 13:43:30 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/peo__fin_8cpp-source.html b/branches/paradiseo-peo-meta-model/doc/html/peo__fin_8cpp-source.html new file mode 100644 index 000000000..c7cdd1385 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/peo__fin_8cpp-source.html @@ -0,0 +1,53 @@ + + +ParadisEO-PEO: peo_fin.cpp Source File + + + + +
+
+

peo_fin.cpp

00001 // "peo_finalize.cpp"
+00002 
+00003 // (c) OPAC Team, LIFL, August 2005
+00004 
+00005 /* 
+00006    Contact: paradiseo-help@lists.gforge.inria.fr
+00007 */
+00008 
+00009 #include "peo_fin.h"
+00010 #include "peo_debug.h"
+00011 #include "runner.h"
+00012 #include "rmc.h"
+00013 
+00014 void peo :: finalize () {
+00015 
+00016   printDebugMessage ("waiting for the termination of all threads");
+00017 
+00018   joinRunners ();
+00019 
+00020   finalizeRMC ();
+00021 
+00022   printDebugMessage ("this is the end");
+00023   endDebugging ();
+00024 }
+

Generated on Thu Jul 5 13:43:30 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/peo__fin_8h-source.html b/branches/paradiseo-peo-meta-model/doc/html/peo__fin_8h-source.html new file mode 100644 index 000000000..8d5165b91 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/peo__fin_8h-source.html @@ -0,0 +1,46 @@ + + +ParadisEO-PEO: peo_fin.h Source File + + + + +
+
+

peo_fin.h

00001 // "peo_finalize.h"
+00002 
+00003 // (c) OPAC Team, LIFL, August 2005
+00004 
+00005 /* 
+00006    Contact: paradiseo-help@lists.gforge.inria.fr
+00007 */
+00008 
+00009 #ifndef __peo_finalize_h
+00010 #define __peo_finalize_h
+00011 
+00012 namespace peo {
+00013   
+00014   extern void finalize ();
+00015 }
+00016 
+00017 #endif
+

Generated on Thu Jul 5 13:43:30 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/peo__init_8cpp-source.html b/branches/paradiseo-peo-meta-model/doc/html/peo__init_8cpp-source.html new file mode 100644 index 000000000..bf790cf1e --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/peo__init_8cpp-source.html @@ -0,0 +1,66 @@ + + +ParadisEO-PEO: peo_init.cpp Source File + + + + +
+
+

peo_init.cpp

00001 // "peo_init.cpp"
+00002 
+00003 // (c) OPAC Team, LIFL, August 2005
+00004 
+00005 /* 
+00006    Contact: paradiseo-help@lists.gforge.inria.fr
+00007 */
+00008 
+00009 #include <stdio.h>
+00010 
+00011 #include "peo_init.h"
+00012 #include "peo_param.h"
+00013 #include "peo_debug.h"
+00014 #include "rmc.h"
+00015 
+00016 namespace peo {
+00017 
+00018   int * argc;
+00019   
+00020   char * * * argv;
+00021 
+00022   void init (int & __argc, char * * & __argv) {
+00023 
+00024     argc = & __argc;
+00025     
+00026     argv = & __argv;
+00027     
+00028     /* Initializing the the Resource Management and Communication */
+00029     initRMC (__argc, __argv);
+00030 
+00031     /* Loading the common parameters */ 
+00032     loadParameters (__argc, __argv);
+00033     
+00034     /* */
+00035     initDebugging ();
+00036   }
+00037 }
+

Generated on Thu Jul 5 13:43:30 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/peo__init_8h-source.html b/branches/paradiseo-peo-meta-model/doc/html/peo__init_8h-source.html new file mode 100644 index 000000000..1464fd89f --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/peo__init_8h-source.html @@ -0,0 +1,50 @@ + + +ParadisEO-PEO: peo_init.h Source File + + + + +
+
+

peo_init.h

00001 // "peo_init.h"
+00002 
+00003 // (c) OPAC Team, LIFL, August 2005
+00004 
+00005 /* 
+00006    Contact: paradiseo-help@lists.gforge.inria.fr
+00007 */
+00008 
+00009 #ifndef __peo_init_h
+00010 #define __peo_init_h
+00011 
+00012 namespace peo {
+00013 
+00014   extern int * argc;
+00015   
+00016   extern char * * * argv;
+00017   
+00018   extern void init (int & __argc, char * * & __argv);
+00019 }
+00020 
+00021 #endif
+

Generated on Thu Jul 5 13:43:30 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/peo__param_8cpp-source.html b/branches/paradiseo-peo-meta-model/doc/html/peo__param_8cpp-source.html new file mode 100644 index 000000000..25b3bd139 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/peo__param_8cpp-source.html @@ -0,0 +1,54 @@ + + +ParadisEO-PEO: peo_param.cpp Source File + + + + +
+
+

peo_param.cpp

00001 // "peo_param.cpp"
+00002 
+00003 // (c) OPAC Team, LIFL, August 2005
+00004 
+00005 /* 
+00006    Contact: paradiseo-help@lists.gforge.inria.fr
+00007 */
+00008 
+00009 #include <utils/eoParser.h>
+00010 
+00011 #include "peo_param.h"
+00012 #include "peo_debug.h"
+00013 
+00014 
+00015 
+00016 void peo :: loadParameters (int & __argc, char * * & __argv) {
+00017 
+00018   eoParser parser (__argc, __argv);
+00019 
+00020   /* Debug */
+00021   eoValueParam <std :: string> debug_param ("false", "debug", "?");
+00022   parser.processParam (debug_param);
+00023   if (debug_param.value () == "true")
+00024     setDebugMode ();
+00025 }
+

Generated on Thu Jul 5 13:43:30 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/peo__param_8h-source.html b/branches/paradiseo-peo-meta-model/doc/html/peo__param_8h-source.html new file mode 100644 index 000000000..01a4bec6c --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/peo__param_8h-source.html @@ -0,0 +1,46 @@ + + +ParadisEO-PEO: peo_param.h Source File + + + + +
+
+

peo_param.h

00001 // "peo_param.h"
+00002 
+00003 // (c) OPAC Team, LIFL, August 2005
+00004 
+00005 /* 
+00006    Contact: paradiseo-help@lists.gforge.inria.fr
+00007 */
+00008 
+00009 #ifndef __peo_param_h
+00010 #define __peo_param_h
+00011 
+00012 namespace peo {
+00013   
+00014   extern void loadParameters (int & __argc, char * * & __argv);
+00015 }
+00016 
+00017 #endif
+

Generated on Thu Jul 5 13:43:30 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/peo__run_8cpp-source.html b/branches/paradiseo-peo-meta-model/doc/html/peo__run_8cpp-source.html new file mode 100644 index 000000000..9a559e91a --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/peo__run_8cpp-source.html @@ -0,0 +1,48 @@ + + +ParadisEO-PEO: peo_run.cpp Source File + + + + +
+
+

peo_run.cpp

00001 // "peo_run.cpp"
+00002 
+00003 // (c) OPAC Team, LIFL, August 2005
+00004 
+00005 /* 
+00006    Contact: paradiseo-help@lists.gforge.inria.fr
+00007 */
+00008 
+00009 #include "peo_init.h"
+00010 #include "peo_run.h"
+00011 #include "rmc.h"
+00012 #include "runner.h"
+00013 
+00014 void peo :: run () {
+00015   
+00016   startRunners ();
+00017 
+00018   runRMC ();
+00019 }
+

Generated on Thu Jul 5 13:43:30 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/peo__run_8h-source.html b/branches/paradiseo-peo-meta-model/doc/html/peo__run_8h-source.html new file mode 100644 index 000000000..b9aa59574 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/peo__run_8h-source.html @@ -0,0 +1,46 @@ + + +ParadisEO-PEO: peo_run.h Source File + + + + +
+
+

peo_run.h

00001 // "peo_run.h"
+00002 
+00003 // (c) OPAC Team, LIFL, August 2005
+00004 
+00005 /* 
+00006    Contact: paradiseo-help@lists.gforge.inria.fr
+00007 */
+00008 
+00009 #ifndef __peo_run_h
+00010 #define __peo_run_h
+00011 
+00012 namespace peo {
+00013   
+00014   extern void run ();
+00015 }
+00016 
+00017 #endif
+

Generated on Thu Jul 5 13:43:30 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/reac__thread_8cpp-source.html b/branches/paradiseo-peo-meta-model/doc/html/reac__thread_8cpp-source.html new file mode 100644 index 000000000..cf6c88d99 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/reac__thread_8cpp-source.html @@ -0,0 +1,65 @@ + + +ParadisEO-PEO: reac_thread.cpp Source File + + + + +
+
+

reac_thread.cpp

00001 // "reac_thread.cpp"
+00002 
+00003 // (c) OPAC Team, LIFL, August 2005
+00004 
+00005 /* 
+00006    Contact: paradiseo-help@lists.gforge.inria.fr
+00007 */
+00008 
+00009 #include "reac_thread.h"
+00010 
+00011 static bool the_end = false;
+00012 
+00013 static std :: vector <ReactiveThread *> reac_threads;
+00014 
+00015 ReactiveThread :: ReactiveThread () {
+00016 
+00017   reac_threads.push_back (this);
+00018   sem_init (& sem, 0, 0);
+00019 }
+00020 
+00021 void ReactiveThread :: sleep () {
+00022 
+00023   sem_wait (& sem);     
+00024 }
+00025 
+00026 void ReactiveThread :: wakeUp () {
+00027 
+00028   sem_post (& sem);     
+00029 }
+00030 
+00031 void stopReactiveThreads () {
+00032 
+00033   the_end = true;
+00034   for (unsigned i = 0; i < reac_threads.size (); i ++)
+00035     reac_threads [i] -> wakeUp  ();     
+00036 }
+

Generated on Thu Jul 5 13:43:30 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/reac__thread_8h-source.html b/branches/paradiseo-peo-meta-model/doc/html/reac__thread_8h-source.html new file mode 100644 index 000000000..d751daec9 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/reac__thread_8h-source.html @@ -0,0 +1,64 @@ + + +ParadisEO-PEO: reac_thread.h Source File + + + + +
+
+

reac_thread.h

00001 // "reac_thread.h"
+00002 
+00003 // (c) OPAC Team, LIFL, August 2005
+00004 
+00005 /* 
+00006    Contact: paradiseo-help@lists.gforge.inria.fr
+00007 */
+00008 
+00009 #ifndef REAC_THREAD_H_
+00010 #define REAC_THREAD_H_
+00011 
+00012 #include <semaphore.h>
+00013 
+00014 #include "thread.h"
+00015 
+00016 class ReactiveThread : public Thread {
+00017         
+00018 public:
+00019 
+00020   /* Ctor */
+00021   ReactiveThread ();
+00022 
+00023   void sleep ();
+00024   
+00025   void wakeUp ();
+00026     
+00027 private:
+00028 
+00029   sem_t sem;
+00030    
+00031 };
+00032 
+00033 extern void stopReactiveThreads ();
+00034 
+00035 #endif /*THREAD_H_*/
+

Generated on Thu Jul 5 13:43:30 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/recv_8cpp-source.html b/branches/paradiseo-peo-meta-model/doc/html/recv_8cpp-source.html new file mode 100644 index 000000000..344a0fc41 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/recv_8cpp-source.html @@ -0,0 +1,141 @@ + + +ParadisEO-PEO: recv.cpp Source File + + + + +
+
+

recv.cpp

00001 // "recv.cpp"
+00002 
+00003 // (c) OPAC Team, LIFL, August 2005
+00004 
+00005 /* 
+00006    Contact: paradiseo-help@lists.gforge.inria.fr
+00007 */
+00008 
+00009 #include "comm.h"
+00010 #include "tags.h"
+00011 #include "worker.h"
+00012 #include "scheduler.h"
+00013 #include "mess.h"
+00014 #include "node.h"
+00015 #include "../../core/runner.h"
+00016 #include "../../core/cooperative.h"
+00017 #include "../../core/peo_debug.h"
+00018 
+00019 void receiveMessages () {
+00020 
+00021   cleanBuffers ();
+00022     
+00023   do {
+00024 
+00025     if (! atLeastOneActiveThread ()) {
+00026       //      printDebugMessage ("debut wait");
+00027       waitMessage ();
+00028       //printDebugMessage ("fin wait");
+00029     }
+00030     
+00031     int src, tag;
+00032 
+00033     while (probeMessage (src, tag)) {
+00034       
+00035       receiveMessage (src, tag);
+00036       initMessage ();
+00037       /*
+00038       char b [1000];
+00039       sprintf (b, "traitement recv %d\n", tag);
+00040       printDebugMessage (b);
+00041       */
+00042       
+00043       switch (tag) {
+00044         
+00045       case RUNNER_STOP_TAG:     
+00046         unpackTerminationOfRunner ();   
+00047         wakeUpCommunicator ();
+00048         break;
+00049       
+00050       case COOP_TAG:
+00051         //      printDebugMessage ("reception de message de cooperation");
+00052         COOP_ID coop_id;
+00053         unpack (coop_id);
+00054         getCooperative (coop_id) -> unpack ();
+00055         break;
+00056 
+00057       case SCHED_REQUEST_TAG:   
+00058         unpackResourceRequest ();
+00059         break;
+00060         
+00061       case SCHED_RESULT_TAG:
+00062         {         
+00063           /* Unpacking the resource */
+00064           SERVICE_ID serv_id;
+00065           unpack (serv_id);
+00066           Service * serv = getService (serv_id);
+00067           int dest;
+00068           unpack (dest);
+00069           WORKER_ID worker_id;
+00070           unpack (worker_id);
+00071 
+00072           /* Going back ... */
+00073           initMessage ();
+00074           pack (worker_id);
+00075           pack (serv_id); 
+00076           serv -> packData ();
+00077           serv -> notifySendingData ();
+00078           sendMessage (dest, TASK_DATA_TAG);
+00079           break;
+00080         }
+00081 
+00082       case TASK_DATA_TAG:
+00083       {
+00084         WORKER_ID worker_id;
+00085         unpack (worker_id);             
+00086         Worker * worker = getWorker (worker_id);
+00087         worker -> setSource (src);
+00088         worker -> unpackData ();
+00089         worker -> wakeUp ();
+00090         break; 
+00091       }
+00092       
+00093       case TASK_RESULT_TAG:
+00094         {
+00095           SERVICE_ID serv_id;
+00096           unpack (serv_id);
+00097           Service * serv = getService (serv_id);
+00098           serv -> unpackResult ();
+00099           break;
+00100         }
+00101 
+00102       case TASK_DONE_TAG:
+00103         unpackTaskDone ();
+00104         break;
+00105 
+00106       default:
+00107         ;
+00108       };
+00109     }
+00110         
+00111   } while (! atLeastOneActiveThread () && atLeastOneActiveRunner () /*&& ! allResourcesFree ()*/);
+00112 }
+

Generated on Thu Jul 5 13:43:30 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/recv_8h-source.html b/branches/paradiseo-peo-meta-model/doc/html/recv_8h-source.html new file mode 100644 index 000000000..223cc9eb3 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/recv_8h-source.html @@ -0,0 +1,43 @@ + + +ParadisEO-PEO: recv.h Source File + + + + +
+
+

recv.h

00001 // "recv.h"
+00002 
+00003 // (c) OPAC Team, LIFL, August 2005
+00004 
+00005 /* 
+00006    Contact: paradiseo-help@lists.gforge.inria.fr
+00007 */
+00008 
+00009 #ifndef __recv_h
+00010 #define __recv_h
+00011 
+00012 extern void receiveMessages ();
+00013 
+00014 #endif
+

Generated on Thu Jul 5 13:43:30 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/ring__topo_8cpp-source.html b/branches/paradiseo-peo-meta-model/doc/html/ring__topo_8cpp-source.html new file mode 100644 index 000000000..d08dc44e8 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/ring__topo_8cpp-source.html @@ -0,0 +1,54 @@ + + +ParadisEO-PEO: ring_topo.cpp Source File + + + + +
+
+

ring_topo.cpp

00001 // "ring_topo.cpp"
+00002 
+00003 // (c) OPAC Team, LIFL, September 2005
+00004 
+00005 /* 
+00006    Contact: paradiseo-help@lists.gforge.inria.fr
+00007 */
+00008 
+00009 #include "ring_topo.h"
+00010 
+00011 void RingTopology :: setNeighbors (Cooperative * __mig,
+00012                                    std :: vector <Cooperative *> & __from,
+00013                                    std :: vector <Cooperative *> & __to) {
+00014   __from.clear () ;
+00015   __to.clear () ;
+00016 
+00017     int len = mig.size () ;
+00018     
+00019     for (int i = 0 ; i < len ; i ++)      
+00020       if (mig [i] == __mig) {   
+00021         __from.push_back (mig [(i - 1 + len) % len]) ;
+00022         __to.push_back (mig [(i + 1) % len]) ;  
+00023         break;
+00024       }
+00025 }
+

Generated on Thu Jul 5 13:43:30 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/ring__topo_8h-source.html b/branches/paradiseo-peo-meta-model/doc/html/ring__topo_8h-source.html new file mode 100644 index 000000000..e0e119d00 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/ring__topo_8h-source.html @@ -0,0 +1,53 @@ + + +ParadisEO-PEO: ring_topo.h Source File + + + + +
+
+

ring_topo.h

00001 // "ring_topo.h"
+00002 
+00003 // (c) OPAC Team, LIFL, September 2005
+00004 
+00005 /* 
+00006    Contact: paradiseo-help@lists.gforge.inria.fr
+00007 */
+00008 
+00009 #ifndef __ring_topo_h
+00010 #define __ring_topo_h
+00011 
+00012 #include "topology.h"
+00013 
+00014 class RingTopology : public Topology {
+00015   
+00016 public :
+00017    
+00018   void setNeighbors (Cooperative * __mig,
+00019                      std :: vector <Cooperative *> & __from,
+00020                      std :: vector <Cooperative *> & __to);
+00021   
+00022 };
+00023 
+00024 #endif
+

Generated on Thu Jul 5 13:43:30 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/rmc_2mpi_2runner_8cpp-source.html b/branches/paradiseo-peo-meta-model/doc/html/rmc_2mpi_2runner_8cpp-source.html new file mode 100644 index 000000000..c9cd7213f --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/rmc_2mpi_2runner_8cpp-source.html @@ -0,0 +1,62 @@ + + +ParadisEO-PEO: runner.cpp Source File + + + + +
+
+

runner.cpp

00001 // "runner.cpp"
+00002 
+00003 // (c) OPAC Team, LIFL, August 2005
+00004 
+00005 /* 
+00006    Contact: paradiseo-help@lists.gforge.inria.fr
+00007 */
+00008 
+00009 #include "../../core/messaging.h"
+00010 #include "../../core/runner.h"
+00011 #include "node.h"
+00012 #include "send.h"
+00013 #include "tags.h"
+00014 #include "schema.h"
+00015 
+00016 bool Runner :: isLocal () {
+00017 
+00018   for (unsigned i = 0; i < my_node -> id_run.size (); i ++)
+00019     if (my_node -> id_run [i] == id)
+00020       return true;
+00021   return false;
+00022 }
+00023 
+00024 void Runner :: packTermination () {
+00025 
+00026   pack (id);
+00027 }
+00028 
+00029 void Runner :: terminate () {
+00030 
+00031   sendToAll (this, RUNNER_STOP_TAG);     
+00032 }
+00033 
+

Generated on Thu Jul 5 13:43:30 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/rmc_2mpi_2service_8cpp-source.html b/branches/paradiseo-peo-meta-model/doc/html/rmc_2mpi_2service_8cpp-source.html new file mode 100644 index 000000000..4b69a6a50 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/rmc_2mpi_2service_8cpp-source.html @@ -0,0 +1,59 @@ + + +ParadisEO-PEO: service.cpp Source File + + + + +
+
+

service.cpp

00001 // "service.h"
+00002 
+00003 // (c) OPAC Team, LIFL, August 2005
+00004 
+00005 /* 
+00006    Contact: paradiseo-help@lists.gforge.inria.fr
+00007 */
+00008 
+00009 #include "../../core/service.h"
+00010 #include "../../core/messaging.h"
+00011 #include "node.h"
+00012 #include "tags.h"
+00013 #include "send.h"
+00014 #include "scheduler.h"
+00015 
+00016 void Service :: requestResourceRequest (unsigned __how_many) {
+00017 
+00018   num_sent_rr = __how_many;
+00019   for (unsigned i = 0; i < __how_many; i ++)
+00020     send (this, my_node -> rk_sched, SCHED_REQUEST_TAG);
+00021 }
+00022 
+00023 void Service :: packResourceRequest () {
+00024 
+00025   SCHED_REQUEST req;
+00026   req.first = getNodeRank ();
+00027   req.second = getKey ();
+00028   //  printf ("demande de ressource pour %d\n", req.second);
+00029   :: pack (req);
+00030 }
+

Generated on Thu Jul 5 13:43:30 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/rmc_8cpp-source.html b/branches/paradiseo-peo-meta-model/doc/html/rmc_8cpp-source.html new file mode 100644 index 000000000..0b3a67ef1 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/rmc_8cpp-source.html @@ -0,0 +1,75 @@ + + +ParadisEO-PEO: rmc.cpp Source File + + + + +
+
+

rmc.cpp

00001 // "rmc.cpp"
+00002 
+00003 // (c) OPAC Team, LIFL, August 2005
+00004 
+00005 /* 
+00006    Contact: paradiseo-help@lists.gforge.inria.fr
+00007 */
+00008 
+00009 #include "send.h"
+00010 #include "worker.h"
+00011 #include "schema.h"
+00012 #include "comm.h"
+00013 #include "scheduler.h"
+00014 #include "../../core/peo_debug.h"
+00015 
+00016 static std :: vector <pthread_t *> ll_threads; /* Low level threads */
+00017 
+00018 void runRMC () {
+00019 
+00020   /* Worker(s) ? */
+00021   for (unsigned i = 0; i < my_node -> num_workers; i ++) 
+00022     addThread (new Worker, ll_threads);
+00023 
+00024   wakeUpCommunicator ();
+00025 }
+00026 
+00027 void initRMC (int & __argc, char * * & __argv) {
+00028 
+00029   /* Communication */
+00030   initCommunication ();
+00031   addThread (new Communicator (& __argc, & __argv), ll_threads);
+00032   waitNodeInitialization ();
+00033   initSending ();
+00034 
+00035   /* Scheduler */
+00036   if (isScheduleNode ())
+00037     initScheduler ();
+00038 
+00040 }
+00041 
+00042 void finalizeRMC () {
+00043 
+00044   printDebugMessage ("before join threads RMC");
+00045   joinThreads (ll_threads);
+00046   printDebugMessage ("after join threads RMC");
+00047 }
+

Generated on Thu Jul 5 13:43:30 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/rmc_8h-source.html b/branches/paradiseo-peo-meta-model/doc/html/rmc_8h-source.html new file mode 100644 index 000000000..d2e2e20c5 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/rmc_8h-source.html @@ -0,0 +1,47 @@ + + +ParadisEO-PEO: rmc.h Source File + + + + +
+
+

rmc.h

00001 // "rmc.h"
+00002 
+00003 // (c) OPAC Team, LIFL, August 2005
+00004 
+00005 /* 
+00006    Contact: paradiseo-help@lists.gforge.inria.fr
+00007 */
+00008 
+00009 #ifndef __rmc_h
+00010 #define __rmc_h
+00011 
+00012 extern void initRMC (int & __argc, char * * & __argv);
+00013 
+00014 extern void runRMC (); /* Resource Management and Communication */ 
+00015 
+00016 extern void finalizeRMC ();
+00017 
+00018 #endif
+

Generated on Thu Jul 5 13:43:30 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/runner_8h-source.html b/branches/paradiseo-peo-meta-model/doc/html/runner_8h-source.html new file mode 100644 index 000000000..51d47a794 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/runner_8h-source.html @@ -0,0 +1,87 @@ + + +ParadisEO-PEO: runner.h Source File + + + + +
+
+

runner.h

00001 // "runner.h"
+00002 
+00003 // (c) OPAC Team, LIFL, August 2005
+00004 
+00005 /* 
+00006    Contact: paradiseo-help@lists.gforge.inria.fr
+00007 */
+00008 
+00009 #ifndef __runner_h
+00010 #define __runner_h
+00011 
+00012 #include <eoFunctor.h>
+00013 
+00014 #include "communicable.h"
+00015 #include "thread.h"
+00016 
+00017 typedef unsigned RUNNER_ID;
+00018 
+00019 class Runner : public Communicable, public Thread {
+00020 
+00021 public :
+00022 
+00023   Runner ();
+00024 
+00025   void start ();
+00026 
+00027   void waitStarting ();
+00028 
+00029   bool isLocal ();
+00030 
+00031   void terminate ();
+00032 
+00033   virtual void run () = 0;
+00034   
+00035   RUNNER_ID getID (); 
+00036 
+00037   void packTermination ();
+00038 
+00039   void notifySendingTermination ();
+00040 
+00041 private :
+00042 
+00043   sem_t sem_start;
+00044 
+00045   unsigned id;
+00046 };
+00047 
+00048 extern bool atLeastOneActiveRunner ();
+00049 
+00050 extern void unpackTerminationOfRunner ();
+00051 
+00052 extern Runner * getRunner (RUNNER_ID __key); 
+00053 
+00054 extern void startRunners ();
+00055 
+00056 extern void joinRunners ();
+00057 
+00058 #endif
+

Generated on Thu Jul 5 13:43:30 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/scheduler_8cpp-source.html b/branches/paradiseo-peo-meta-model/doc/html/scheduler_8cpp-source.html new file mode 100644 index 000000000..9302698fe --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/scheduler_8cpp-source.html @@ -0,0 +1,107 @@ + + +ParadisEO-PEO: scheduler.cpp Source File + + + + +
+
+

scheduler.cpp

00001 // "sched_thread.cpp"
+00002 
+00003 // (c) OPAC Team, LIFL, August 2005
+00004 
+00005 /* 
+00006    Contact: paradiseo-help@lists.gforge.inria.fr
+00007 */
+00008 
+00009 #include <queue>
+00010 
+00011 #include "scheduler.h"
+00012 #include "tags.h"
+00013 #include "mess.h"
+00014 #include "../../core/peo_debug.h"
+00015 
+00016 static std :: queue <SCHED_RESOURCE> resources; /* Free resources */
+00017 
+00018 static std :: queue <SCHED_REQUEST> requests; /* Requests */
+00019 
+00020 static unsigned initNumberOfRes = 0;
+00021 
+00022 void initScheduler () {
+00023   
+00024   for (unsigned i = 0; i < the_schema.size (); i ++) {
+00025     
+00026     const Node & node = the_schema [i];
+00027     
+00028     if (node.rk_sched == my_node -> rk)      
+00029       for (unsigned j = 0; j < node.num_workers; j ++)
+00030         resources.push (std :: pair <RANK_ID, WORKER_ID> (i, j + 1));    
+00031   }  
+00032   initNumberOfRes = resources.size ();
+00033 }
+00034 
+00035 bool allResourcesFree () {
+00036 
+00037   return resources.size () == initNumberOfRes;
+00038 }
+00039 
+00040 static void update () {
+00041 
+00042   unsigned num_alloc = std :: min (resources.size (), requests.size ());
+00043   
+00044   for (unsigned i = 0; i < num_alloc; i ++) {
+00045     
+00046     SCHED_REQUEST req = requests.front ();
+00047     requests.pop ();
+00048     
+00049     SCHED_RESOURCE res = resources.front ();
+00050     resources.pop ();
+00051 
+00052     printDebugMessage ("allocating a resource.");    
+00053     initMessage ();
+00054     pack (req.second);
+00055     pack (res);
+00056     sendMessage (req.first, SCHED_RESULT_TAG);
+00057   }  
+00058 }
+00059 
+00060 void unpackResourceRequest () {
+00061 
+00062   printDebugMessage ("queuing a resource request.");
+00063   SCHED_REQUEST req;
+00064   unpack (req);
+00065   requests.push (req);
+00066   update ();
+00067 }
+00068 
+00069 void unpackTaskDone () {
+00070 
+00071   printDebugMessage ("I'm notified a worker is now idle.");
+00072   SCHED_RESOURCE res;
+00073   unpack (res);
+00074   resources.push (res);
+00075   if (resources.size () == initNumberOfRes)
+00076     printDebugMessage ("all the resources are now free.");
+00077   update ();
+00078 }
+

Generated on Thu Jul 5 13:43:30 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/scheduler_8h-source.html b/branches/paradiseo-peo-meta-model/doc/html/scheduler_8h-source.html new file mode 100644 index 000000000..8ce0b5d1e --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/scheduler_8h-source.html @@ -0,0 +1,61 @@ + + +ParadisEO-PEO: scheduler.h Source File + + + + +
+
+

scheduler.h

00001 // "scheduler.h"
+00002 
+00003 // (c) OPAC Team, LIFL, August 2005
+00004 
+00005 /* 
+00006    Contact: paradiseo-help@lists.gforge.inria.fr
+00007 */
+00008 
+00009 #ifndef __scheduler_h
+00010 #define __scheduler_h
+00011 
+00012 #include <utility>
+00013 
+00014 #include "schema.h"
+00015 #include "worker.h"
+00016 
+00017 typedef std :: pair <RANK_ID, WORKER_ID> SCHED_RESOURCE;
+00018 
+00019 typedef std :: pair <RANK_ID, SERVICE_ID> SCHED_REQUEST;
+00020 
+00021 /* Initializing the list of available workers */
+00022 extern void initScheduler ();
+00023 
+00024 /* Processing a resource request from a service */
+00025 extern void unpackResourceRequest ();
+00026 
+00027 /* Being known a worker is now idle :-) */
+00028 extern void unpackTaskDone (); 
+00029 
+00030 extern bool allResourcesFree ();
+00031 
+00032 #endif
+

Generated on Thu Jul 5 13:43:30 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/schema_8cpp-source.html b/branches/paradiseo-peo-meta-model/doc/html/schema_8cpp-source.html new file mode 100644 index 000000000..47bfefa74 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/schema_8cpp-source.html @@ -0,0 +1,164 @@ + + +ParadisEO-PEO: schema.cpp Source File + + + + +
+
+

schema.cpp

00001 // "schema.cpp"
+00002 
+00003 // (c) OPAC Team, LIFL, August 2005
+00004 
+00005 /* 
+00006    Contact: paradiseo-help@lists.gforge.inria.fr
+00007 */
+00008 
+00009 #include <iostream>
+00010 #include <assert.h>
+00011 
+00012 #include "schema.h"
+00013 #include "xml_parser.h"
+00014 #include "comm.h"
+00015 #include "node.h"
+00016 #include "../../core/peo_debug.h"
+00017 
+00018 std :: vector <Node> the_schema;
+00019 
+00020 Node * my_node;
+00021 
+00022 RANK_ID getRankOfRunner (RUNNER_ID __key) {
+00023 
+00024   for (unsigned i = 0; i < the_schema.size (); i ++)
+00025     for (unsigned j = 0; j < the_schema [i].id_run.size (); j ++)
+00026       if (the_schema [i].id_run [j] == __key)
+00027         return the_schema [i].rk;
+00028   assert (false);
+00029   return 0; 
+00030 }
+00031 
+00032 static void loadNode (int __rk_sched) {
+00033 
+00034   Node node;
+00035   
+00036   node.rk_sched = __rk_sched;
+00037 
+00038   /* ATT: name*/
+00039   node.rk = getRankFromName (getAttributeValue ("name"));
+00040   /* ATT: num_workers */
+00041   node.num_workers = atoi (getAttributeValue ("num_workers").c_str ());
+00042 
+00043   while (true) {
+00044     
+00045     /* TAG: <runner> | </node> */
+00046     std :: string name = getNextNode ();
+00047     assert (name == "runner" || name == "node");    
+00048     if (name == "runner") {
+00049       /* TAG: </node> */
+00050       node.id_run.push_back (atoi (getNextNode ().c_str ()));
+00051       /* TAG: </runner> */
+00052       assert (getNextNode () == "runner");
+00053     }
+00054     else {      
+00055       /* TAG: </node> */
+00056       the_schema.push_back (node); 
+00057       break;
+00058     }
+00059   }
+00060 }
+00061 
+00062 static void loadGroup () {
+00063 
+00064   std :: string name;
+00065   
+00066   /* ATT: scheduler*/
+00067   int rk_sched = getRankFromName (getAttributeValue ("scheduler"));
+00068   
+00069   while (true) {
+00070 
+00071     /* TAG: <node> | </group> */
+00072     name = getNextNode ();
+00073     assert (name == "node" || name == "group");    
+00074     if (name == "node")
+00075       /* TAG: <node> */
+00076       loadNode (rk_sched);
+00077     else
+00078       /* TAG: </group> */
+00079       break;
+00080   }
+00081 }
+00082 
+00083 bool isScheduleNode () {
+00084   
+00085   return my_node -> rk == my_node -> rk_sched;
+00086 }
+00087 
+00088 void loadSchema (const char * __filename) {
+00089   
+00090   openXMLDocument (__filename);
+00091   
+00092   std :: string name;
+00093   
+00094   /* TAG: <schema> */
+00095   name = getNextNode ();
+00096   assert (name == "schema");
+00097     
+00098   while (true) {
+00099 
+00100     /* TAG: <group> | </schema> */
+00101     name = getNextNode ();
+00102     assert (name == "group" || name == "schema");    
+00103     if (name == "group")
+00104       /* TAG: <group> */
+00105       loadGroup ();
+00106     else
+00107       /* TAG: </schema> */
+00108       break;    
+00109   }
+00110 
+00111   /* Looking for my node */
+00112   for (unsigned i = 0; i < the_schema.size (); i ++)
+00113     if (the_schema [i].rk == getNodeRank ())
+00114       my_node = & (the_schema [i]);
+00115   
+00116   /* About me */
+00117   char mess [1000];
+00118   
+00119   sprintf (mess, "my rank is %d", my_node -> rk);
+00120   printDebugMessage (mess);
+00121   if (isScheduleNode ())
+00122     printDebugMessage ("I'am a scheduler");  
+00123   for (unsigned i = 0; i < my_node -> id_run.size (); i ++) {
+00124     sprintf (mess, "I manage the runner %d", my_node -> id_run [i]);
+00125     printDebugMessage (mess);
+00126   }
+00127   if (my_node -> num_workers) {
+00128     
+00129     sprintf (mess, "I manage %d worker(s)", my_node -> num_workers);
+00130     printDebugMessage (mess);
+00131   }
+00132           
+00133   closeXMLDocument ();
+00134 }
+00135 
+

Generated on Thu Jul 5 13:43:30 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/schema_8h-source.html b/branches/paradiseo-peo-meta-model/doc/html/schema_8h-source.html new file mode 100644 index 000000000..f6c05c6a9 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/schema_8h-source.html @@ -0,0 +1,68 @@ + + +ParadisEO-PEO: schema.h Source File + + + + +
+
+

schema.h

00001 // "schema.h"
+00002 
+00003 // (c) OPAC Team, LIFL, August 2005
+00004 
+00005 /* 
+00006    Contact: paradiseo-help@lists.gforge.inria.fr
+00007 */
+00008 
+00009 #ifndef __schema_h
+00010 #define __schema_h
+00011 
+00012 #include <string>
+00013 #include <vector>
+00014 #include <cassert>
+00015 
+00016 #include "../../core/runner.h"
+00017 
+00018 typedef int RANK_ID;
+00019 
+00020 struct Node {
+00021   
+00022   RANK_ID rk; /* Rank */
+00023   std :: string name; /* Host name */
+00024   unsigned num_workers; /* Number of parallel workers */
+00025   int rk_sched; /* rank of the scheduler */
+00026   std :: vector <RUNNER_ID> id_run; /* List of runners */
+00027 };
+00028 
+00029 extern std :: vector <Node> the_schema;
+00030 
+00031 extern Node * my_node;
+00032 
+00033 extern void loadSchema (const char * __filename);
+00034 
+00035 extern RANK_ID getRankOfRunner (RUNNER_ID __key);
+00036 
+00037 extern bool isScheduleNode ();
+00038 
+00039 #endif
+

Generated on Thu Jul 5 13:43:30 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/search.idx b/branches/paradiseo-peo-meta-model/doc/html/search.idx new file mode 100644 index 000000000..8a68e80f7 Binary files /dev/null and b/branches/paradiseo-peo-meta-model/doc/html/search.idx differ diff --git a/branches/paradiseo-peo-meta-model/doc/html/search.php b/branches/paradiseo-peo-meta-model/doc/html/search.php new file mode 100644 index 000000000..90be7458b --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/search.php @@ -0,0 +1,382 @@ + + +Search + + + + +
+
    +
  • Main Page
  • +
  • Namespaces
  • +
  • Classes
  • +
  • Files
  • +
  • +
    + + + + +1 document matching your query."; + } + else // $num>1 + { + return "Found $num documents matching your query. Showing best matches first."; + } +} + +function report_matches() +{ + return "Matches: "; +} +function end_form($value) +{ + echo " \n \n
    \n
    \n
  • \n
\n
\n"; +} + +function readInt($file) +{ + $b1 = ord(fgetc($file)); $b2 = ord(fgetc($file)); + $b3 = ord(fgetc($file)); $b4 = ord(fgetc($file)); + return ($b1<<24)|($b2<<16)|($b3<<8)|$b4; +} + +function readString($file) +{ + $result=""; + while (ord($c=fgetc($file))) $result.=$c; + return $result; +} + +function readHeader($file) +{ + $header =fgetc($file); $header.=fgetc($file); + $header.=fgetc($file); $header.=fgetc($file); + return $header; +} + +function computeIndex($word) +{ + // Fast string hashing + //$lword = strtolower($word); + //$l = strlen($lword); + //for ($i=0;$i<$l;$i++) + //{ + // $c = ord($lword{$i}); + // $v = (($v & 0xfc00) ^ ($v << 6) ^ $c) & 0xffff; + //} + //return $v; + + // Simple hashing that allows for substring search + if (strlen($word)<2) return -1; + // high char of the index + $hi = ord($word{0}); + if ($hi==0) return -1; + // low char of the index + $lo = ord($word{1}); + if ($lo==0) return -1; + // return index + return $hi*256+$lo; +} + +function search($file,$word,&$statsList) +{ + $index = computeIndex($word); + if ($index!=-1) // found a valid index + { + fseek($file,$index*4+4); // 4 bytes per entry, skip header + $index = readInt($file); + if ($index) // found words matching the hash key + { + $start=sizeof($statsList); + $count=$start; + fseek($file,$index); + $w = readString($file); + while ($w) + { + $statIdx = readInt($file); + if ($word==substr($w,0,strlen($word))) + { // found word that matches (as substring) + $statsList[$count++]=array( + "word"=>$word, + "match"=>$w, + "index"=>$statIdx, + "full"=>strlen($w)==strlen($word), + "docs"=>array() + ); + } + $w = readString($file); + } + $totalHi=0; + $totalFreqHi=0; + $totalFreqLo=0; + for ($count=$start;$count $idx, + "freq" => $freq>>1, + "rank" => 0.0, + "hi" => $freq&1 + ); + if ($freq&1) // word occurs in high priority doc + { + $totalHi++; + $totalFreqHi+=$freq*$multiplier; + } + else // word occurs in low priority doc + { + $totalFreqLo+=$freq*$multiplier; + } + } + // read name and url info for the doc + for ($i=0;$i<$numDocs;$i++) + { + fseek($file,$docInfo[$i]["idx"]); + $docInfo[$i]["name"]=readString($file); + $docInfo[$i]["url"]=readString($file); + } + $statInfo["docs"]=$docInfo; + } + $totalFreq=($totalHi+1)*$totalFreqLo + $totalFreqHi; + for ($count=$start;$count$key, + "name"=>$di["name"], + "rank"=>$rank + ); + } + $docs[$key]["words"][] = array( + "word"=>$wordInfo["word"], + "match"=>$wordInfo["match"], + "freq"=>$di["freq"] + ); + } + } + return $docs; +} + +function filter_results($docs,&$requiredWords,&$forbiddenWords) +{ + $filteredDocs=array(); + while (list ($key, $val) = each ($docs)) + { + $words = &$docs[$key]["words"]; + $copy=1; // copy entry by default + if (sizeof($requiredWords)>0) + { + foreach ($requiredWords as $reqWord) + { + $found=0; + foreach ($words as $wordInfo) + { + $found = $wordInfo["word"]==$reqWord; + if ($found) break; + } + if (!$found) + { + $copy=0; // document contains none of the required words + break; + } + } + } + if (sizeof($forbiddenWords)>0) + { + foreach ($words as $wordInfo) + { + if (in_array($wordInfo["word"],$forbiddenWords)) + { + $copy=0; // document contains a forbidden word + break; + } + } + } + if ($copy) $filteredDocs[$key]=$docs[$key]; + } + return $filteredDocs; +} + +function compare_rank($a,$b) +{ + if ($a["rank"] == $b["rank"]) + { + return 0; + } + return ($a["rank"]>$b["rank"]) ? -1 : 1; +} + +function sort_results($docs,&$sorted) +{ + $sorted = $docs; + usort($sorted,"compare_rank"); + return $sorted; +} + +function report_results(&$docs) +{ + echo "\n"; + echo " \n"; + echo " \n"; + echo " \n"; + $numDocs = sizeof($docs); + if ($numDocs==0) + { + echo " \n"; + echo " \n"; + echo " \n"; + } + else + { + echo " \n"; + echo " \n"; + echo " \n"; + $num=1; + foreach ($docs as $doc) + { + echo " \n"; + echo " "; + echo "\n"; + echo " \n"; + echo " \n"; + echo " \n"; + $num++; + } + } + echo "

".search_results()."

".matches_text(0)."
".matches_text($numDocs); + echo "\n"; + echo "
$num.".$doc["name"]."
".report_matches()." "; + foreach ($doc["words"] as $wordInfo) + { + $word = $wordInfo["word"]; + $matchRight = substr($wordInfo["match"],strlen($word)); + echo "$word$matchRight(".$wordInfo["freq"].") "; + } + echo "
\n"; +} + +function main() +{ + if(strcmp('4.1.0', phpversion()) > 0) + { + die("Error: PHP version 4.1.0 or above required!"); + } + if (!($file=fopen("search.idx","rb"))) + { + die("Error: Search index file could NOT be opened!"); + } + if (readHeader($file)!="DOXS") + { + die("Error: Header of index file is invalid!"); + } + $query=""; + if (array_key_exists("query", $_GET)) + { + $query=$_GET["query"]; + } + end_form($query); + echo " \n
\n"; + $results = array(); + $requiredWords = array(); + $forbiddenWords = array(); + $foundWords = array(); + $word=strtok($query," "); + while ($word) // for each word in the search query + { + if (($word{0}=='+')) { $word=substr($word,1); $requiredWords[]=$word; } + if (($word{0}=='-')) { $word=substr($word,1); $forbiddenWords[]=$word; } + if (!in_array($word,$foundWords)) + { + $foundWords[]=$word; + search($file,strtolower($word),$results); + } + $word=strtok(" "); + } + $docs = array(); + combine_results($results,$docs); + // filter out documents with forbidden word or that do not contain + // required words + $filteredDocs = filter_results($docs,$requiredWords,$forbiddenWords); + // sort the results based on rank + $sorted = array(); + sort_results($filteredDocs,$sorted); + // report results to the user + report_results($sorted); + echo "
\n"; + fclose($file); +} + +main(); + + +?> +
Generated on Thu Jul 5 13:43:31 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/send_8cpp-source.html b/branches/paradiseo-peo-meta-model/doc/html/send_8cpp-source.html new file mode 100644 index 000000000..8340a438d --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/send_8cpp-source.html @@ -0,0 +1,145 @@ + + +ParadisEO-PEO: send.cpp Source File + + + + +
+
+

send.cpp

00001 // "send.cpp"
+00002 
+00003 // (c) OPAC Team, LIFL, August 2005
+00004 
+00005 /* 
+00006    Contact: paradiseo-help@lists.gforge.inria.fr
+00007 */
+00008 
+00009 #include <mpi.h>
+00010 #include <semaphore.h>
+00011 #include <queue>
+00012 
+00013 #include "tags.h"
+00014 #include "comm.h"
+00015 #include "worker.h"
+00016 #include "scheduler.h"
+00017 #include "mess.h"
+00018 #include "node.h"
+00019 #include "../../core/cooperative.h"
+00020 #include "../../core/peo_debug.h"
+00021 
+00022 #define TO_ALL -1
+00023 
+00024 typedef struct {
+00025 
+00026   Communicable * comm;
+00027   int to;
+00028   int tag;
+00029 
+00030 } SEND_REQUEST;
+00031         
+00032 static std :: queue <SEND_REQUEST> mess;
+00033 
+00034 static sem_t sem_send;
+00035 
+00036 void initSending () {
+00037 
+00038   sem_init (& sem_send, 0, 1);
+00039 }
+00040 
+00041 void send (Communicable * __comm, int __to, int __tag) {
+00042 
+00043   SEND_REQUEST req;  
+00044   req.comm = __comm;
+00045   req.to = __to;
+00046   req.tag = __tag;
+00047 
+00048   sem_wait (& sem_send);
+00049   mess.push (req);
+00050   sem_post (& sem_send);
+00051   wakeUpCommunicator ();
+00052 }
+00053 
+00054 void sendToAll (Communicable * __comm, int __tag) {
+00055   
+00056   send (__comm, TO_ALL, __tag);
+00057 }
+00058 
+00059 void sendMessages () {
+00060 
+00061   sem_wait (& sem_send);
+00062 
+00063   while (! mess.empty ()) {
+00064     
+00065     SEND_REQUEST req = mess.front ();
+00066     /*
+00067     char b [1000];
+00068     sprintf (b, "traitement send %d\n", req.tag);
+00069     printDebugMessage (b);
+00070     */
+00071     
+00072     Communicable * comm = req.comm;
+00073 
+00074     initMessage ();
+00075 
+00076     switch (req.tag) {
+00077 
+00078     case RUNNER_STOP_TAG:
+00079       dynamic_cast <Runner *> (comm) -> packTermination ();            
+00080       dynamic_cast <Runner *> (comm) -> notifySendingTermination ();            
+00081       break;
+00082 
+00083     case COOP_TAG:
+00084       dynamic_cast <Cooperative *> (comm) -> pack ();      
+00085       dynamic_cast <Cooperative *> (comm) -> notifySending ();      
+00086       break;
+00087           
+00088     case SCHED_REQUEST_TAG:
+00089       dynamic_cast <Service *> (comm) -> packResourceRequest ();
+00090       dynamic_cast <Service *> (comm) -> notifySendingResourceRequest ();            
+00091       break;
+00092 
+00093     case TASK_RESULT_TAG:
+00094       dynamic_cast <Worker *> (comm) -> packResult ();
+00095       dynamic_cast <Worker *> (comm) -> notifySendingResult ();
+00096       break;
+00097 
+00098     case TASK_DONE_TAG:
+00099       dynamic_cast <Worker *> (comm) -> packTaskDone ();
+00100       dynamic_cast <Worker *> (comm) -> notifySendingTaskDone ();
+00101       break;
+00102       
+00103     default :
+00104       break;
+00105 
+00106     };
+00107     
+00108     if (req.to == TO_ALL)
+00109       sendMessageToAll (req.tag);
+00110     else
+00111       sendMessage (req.to, req.tag);
+00112     mess.pop ();
+00113   }
+00114 
+00115   sem_post (& sem_send);  
+00116 }
+

Generated on Thu Jul 5 13:43:30 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/send_8h-source.html b/branches/paradiseo-peo-meta-model/doc/html/send_8h-source.html new file mode 100644 index 000000000..7fe9eaec4 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/send_8h-source.html @@ -0,0 +1,51 @@ + + +ParadisEO-PEO: send.h Source File + + + + +
+
+

send.h

00001 // "send.h"
+00002 
+00003 // (c) OPAC Team, LIFL, August 2005
+00004 
+00005 /* 
+00006    Contact: paradiseo-help@lists.gforge.inria.fr
+00007 */
+00008 
+00009 #ifndef __send_h
+00010 #define __send_h
+00011 
+00012 #include "../../core/communicable.h"
+00013 
+00014 extern void initSending ();
+00015 
+00016 extern void send (Communicable * __comm, int __to, int __tag);
+00017 
+00018 extern void sendToAll (Communicable * __comm, int __tag);
+00019 
+00020 extern void sendMessages ();
+00021 
+00022 #endif
+

Generated on Thu Jul 5 13:43:30 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/service_8h-source.html b/branches/paradiseo-peo-meta-model/doc/html/service_8h-source.html new file mode 100644 index 000000000..915c38b4a --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/service_8h-source.html @@ -0,0 +1,79 @@ + + +ParadisEO-PEO: service.h Source File + + + + +
+
+

service.h

00001 // "service.h"
+00002 
+00003 // (c) OPAC Team, LIFL, August 2005
+00004 
+00005 /* 
+00006    Contact: paradiseo-help@lists.gforge.inria.fr
+00007 */
+00008 
+00009 #ifndef __service_h
+00010 #define __service_h
+00011 
+00012 #include "communicable.h"
+00013 #include "thread.h"
+00014 
+00015 typedef unsigned SERVICE_ID;
+00016 
+00017 class Service : public Communicable {
+00018 
+00019 public :
+00020 
+00021   void setOwner (Thread & __owner);
+00022   
+00023   Thread * getOwner (); 
+00024 
+00025   void requestResourceRequest (unsigned __how_many = 1);
+00026   void packResourceRequest ();
+00027 
+00028   virtual void packData ();
+00029   virtual void unpackData ();
+00030 
+00031   virtual void execute ();
+00032   
+00033   virtual void packResult ();
+00034   virtual void unpackResult ();
+00035 
+00036   virtual void notifySendingData ();
+00037   virtual void notifySendingResourceRequest ();
+00038   virtual void notifySendingAllResourceRequests ();
+00039 
+00040 private :
+00041 
+00042   Thread * owner; /* Owner thread (i.e. 'uses' that service) */ 
+00043 
+00044   unsigned num_sent_rr; /* Number of RR not really sent (i.e. still in the sending queue)*/
+00045 
+00046 };
+00047 
+00048 extern Service * getService (SERVICE_ID __key); 
+00049 
+00050 #endif
+

Generated on Thu Jul 5 13:43:30 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/structNode-members.html b/branches/paradiseo-peo-meta-model/doc/html/structNode-members.html new file mode 100644 index 000000000..607b10646 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/structNode-members.html @@ -0,0 +1,42 @@ + + +ParadisEO-PEO: Member List + + + + +
+
+ +

Node Member List

This is the complete list of members for Node, including all inherited members.

+ + + + + +
id_runNode
nameNode
num_workersNode
rkNode
rk_schedNode


Generated on Thu Jul 5 13:40:47 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/structNode.html b/branches/paradiseo-peo-meta-model/doc/html/structNode.html new file mode 100644 index 000000000..feca8d02e --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/structNode.html @@ -0,0 +1,62 @@ + + +ParadisEO-PEO: Node Struct Reference + + + + +
+
+ +

Node Struct Reference

List of all members. + + + + + + + + + + + + +

Public Attributes

+RANK_ID rk
+std::string name
+unsigned num_workers
+int rk_sched
+std::vector< RUNNER_ID > id_run
+

Detailed Description

+ +

+ +

+Definition at line 20 of file schema.h.


The documentation for this struct was generated from the following file: +
Generated on Thu Jul 5 13:40:47 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/structSEND__REQUEST-members.html b/branches/paradiseo-peo-meta-model/doc/html/structSEND__REQUEST-members.html new file mode 100644 index 000000000..f46bc26fc --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/structSEND__REQUEST-members.html @@ -0,0 +1,40 @@ + + +ParadisEO-PEO: Member List + + + + +
+
+ +

SEND_REQUEST Member List

This is the complete list of members for SEND_REQUEST, including all inherited members.

+ + + +
commSEND_REQUEST
tagSEND_REQUEST
toSEND_REQUEST


Generated on Thu Jul 5 13:43:31 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/structSEND__REQUEST.html b/branches/paradiseo-peo-meta-model/doc/html/structSEND__REQUEST.html new file mode 100644 index 000000000..acdd127c2 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/structSEND__REQUEST.html @@ -0,0 +1,56 @@ + + +ParadisEO-PEO: SEND_REQUEST Struct Reference + + + + +
+
+ +

SEND_REQUEST Struct Reference

List of all members. + + + + + + + + +

Public Attributes

+Communicablecomm
+int to
+int tag
+

Detailed Description

+ +

+ +

+Definition at line 24 of file send.cpp.


The documentation for this struct was generated from the following file: +
Generated on Thu Jul 5 13:43:31 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/tab_b.gif b/branches/paradiseo-peo-meta-model/doc/html/tab_b.gif new file mode 100644 index 000000000..0d623483f Binary files /dev/null and b/branches/paradiseo-peo-meta-model/doc/html/tab_b.gif differ diff --git a/branches/paradiseo-peo-meta-model/doc/html/tab_l.gif b/branches/paradiseo-peo-meta-model/doc/html/tab_l.gif new file mode 100644 index 000000000..9b1e6337c Binary files /dev/null and b/branches/paradiseo-peo-meta-model/doc/html/tab_l.gif differ diff --git a/branches/paradiseo-peo-meta-model/doc/html/tab_r.gif b/branches/paradiseo-peo-meta-model/doc/html/tab_r.gif new file mode 100644 index 000000000..ce9dd9f53 Binary files /dev/null and b/branches/paradiseo-peo-meta-model/doc/html/tab_r.gif differ diff --git a/branches/paradiseo-peo-meta-model/doc/html/tabs.css b/branches/paradiseo-peo-meta-model/doc/html/tabs.css new file mode 100644 index 000000000..a61552a67 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/tabs.css @@ -0,0 +1,102 @@ +/* tabs styles, based on http://www.alistapart.com/articles/slidingdoors */ + +DIV.tabs +{ + float : left; + width : 100%; + background : url("tab_b.gif") repeat-x bottom; + margin-bottom : 4px; +} + +DIV.tabs UL +{ + margin : 0px; + padding-left : 10px; + list-style : none; +} + +DIV.tabs LI, DIV.tabs FORM +{ + display : inline; + margin : 0px; + padding : 0px; +} + +DIV.tabs FORM +{ + float : right; +} + +DIV.tabs A +{ + float : left; + background : url("tab_r.gif") no-repeat right top; + border-bottom : 1px solid #84B0C7; + font-size : x-small; + font-weight : bold; + text-decoration : none; +} + +DIV.tabs A:hover +{ + background-position: 100% -150px; +} + +DIV.tabs A:link, DIV.tabs A:visited, +DIV.tabs A:active, DIV.tabs A:hover +{ + color: #1A419D; +} + +DIV.tabs SPAN +{ + float : left; + display : block; + background : url("tab_l.gif") no-repeat left top; + padding : 5px 9px; + white-space : nowrap; +} + +DIV.tabs INPUT +{ + float : right; + display : inline; + font-size : 1em; +} + +DIV.tabs TD +{ + font-size : x-small; + font-weight : bold; + text-decoration : none; +} + + + +/* Commented Backslash Hack hides rule from IE5-Mac \*/ +DIV.tabs SPAN {float : none;} +/* End IE5-Mac hack */ + +DIV.tabs A:hover SPAN +{ + background-position: 0% -150px; +} + +DIV.tabs LI#current A +{ + background-position: 100% -150px; + border-width : 0px; +} + +DIV.tabs LI#current SPAN +{ + background-position: 0% -150px; + padding-bottom : 6px; +} + +DIV.nav +{ + background : none; + border : none; + border-bottom : 1px solid #84B0C7; +} diff --git a/branches/paradiseo-peo-meta-model/doc/html/tags_8h-source.html b/branches/paradiseo-peo-meta-model/doc/html/tags_8h-source.html new file mode 100644 index 000000000..cdc71054d --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/tags_8h-source.html @@ -0,0 +1,53 @@ + + +ParadisEO-PEO: tags.h Source File + + + + +
+
+

tags.h

00001 // "tags.h"
+00002 
+00003 // (c) OPAC Team, LIFL, August 2005
+00004 
+00005 /* 
+00006    Contact: paradiseo-help@lists.gforge.inria.fr
+00007 */
+00008 
+00009 #ifndef __tags_h
+00010 #define __tags_h
+00011 
+00012 #define RUNNER_STOP_TAG 13
+00013 
+00014 #define COOP_TAG 14
+00015 
+00016 #define SCHED_REQUEST_TAG 16
+00017 
+00018 #define SCHED_RESULT_TAG 17
+00019 #define TASK_DATA_TAG 18
+00020 
+00021 #define TASK_RESULT_TAG 19
+00022 #define TASK_DONE_TAG 20
+00023 
+00024 #endif
+

Generated on Thu Jul 5 13:43:30 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/thread_8cpp-source.html b/branches/paradiseo-peo-meta-model/doc/html/thread_8cpp-source.html new file mode 100644 index 000000000..1454980b0 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/thread_8cpp-source.html @@ -0,0 +1,110 @@ + + +ParadisEO-PEO: thread.cpp Source File + + + + +
+
+

thread.cpp

00001 // "thread.cpp"
+00002 
+00003 // (c) OPAC Team, LIFL, August 2005
+00004 
+00005 /* 
+00006    Contact: paradiseo-help@lists.gforge.inria.fr
+00007 */
+00008 
+00009 #include <map>
+00010 
+00011 #include "thread.h"
+00012 
+00013 static std :: vector <Thread *> threads;
+00014 
+00015 unsigned num_act = 0;
+00016 
+00017 Thread :: Thread () {
+00018         
+00019   threads.push_back (this);
+00020   act = false;
+00021 }
+00022 
+00023 Thread :: ~ Thread () {
+00024 
+00025   /* Nothing ! */
+00026 }
+00027 
+00028 extern int getNodeRank ();
+00029 
+00030 void Thread :: setActive () {
+00031 
+00032   if (! act ) {
+00033 
+00034     act = true;
+00035     num_act ++;
+00036     //    if (getNodeRank () == 1)      
+00037     //   printf ("On passe a %d\n", num_act);
+00038   }
+00039 }
+00040 
+00041 void Thread :: setPassive () {
+00042 
+00043   if (act) {
+00044 
+00045    act = false;
+00046     num_act --;
+00047     //    if (getNodeRank () == 1)      
+00048     //  printf ("On passe a %d\n", num_act);
+00049 
+00050   } 
+00051 }
+00052 
+00053 bool atLeastOneActiveThread () {
+00054 
+00055   return num_act;
+00056 }
+00057 
+00058 unsigned numberOfActiveThreads () {
+00059 
+00060   return num_act;
+00061 }
+00062 
+00063 static void * launch (void * __arg) {
+00064 
+00065   Thread * thr = (Thread *) __arg;  
+00066   thr -> start ();
+00067   return 0;
+00068 }
+00069 
+00070 void addThread (Thread * __hl_thread, std :: vector <pthread_t *> & __ll_threads) {
+00071 
+00072   pthread_t * ll_thr = new pthread_t;
+00073   __ll_threads.push_back (ll_thr);
+00074   pthread_create (ll_thr, 0, launch, __hl_thread); 
+00075 }
+00076 
+00077 void joinThreads (std :: vector <pthread_t *> & __threads) {
+00078 
+00079   for (unsigned i = 0; i < __threads.size (); i ++)    
+00080     pthread_join (* __threads [i], 0);  
+00081 }
+

Generated on Thu Jul 5 13:43:30 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/thread_8h-source.html b/branches/paradiseo-peo-meta-model/doc/html/thread_8h-source.html new file mode 100644 index 000000000..a21693389 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/thread_8h-source.html @@ -0,0 +1,77 @@ + + +ParadisEO-PEO: thread.h Source File + + + + +
+
+

thread.h

00001 // "thread.h"
+00002 
+00003 // (c) OPAC Team, LIFL, August 2005
+00004 
+00005 /* 
+00006    Contact: paradiseo-help@lists.gforge.inria.fr
+00007 */
+00008 
+00009 #ifndef THREAD_H_
+00010 #define THREAD_H_
+00011 
+00012 #include <vector>
+00013 
+00014 /* A high-level thread */
+00015 
+00016 class Thread {
+00017         
+00018 public:
+00019 
+00020   /* Ctor */
+00021   Thread ();
+00022 
+00023   /* Dtor */
+00024   virtual ~ Thread ();
+00025   
+00026   /* Go ! */
+00027   virtual void start () = 0;
+00028 
+00029   void setActive ();/* It means the current process is going to send messages soon */
+00030   void setPassive ();/* The current process is not going to perform send operations
+00031                         (but it may receive messages) */
+00032 
+00033 private :
+00034   
+00035   bool act;
+00036 };
+00037 
+00038 extern void addThread (Thread * __hl_thread, std :: vector <pthread_t *> & __ll_threads);
+00039 
+00040 extern void joinThreads (std :: vector <pthread_t *> & __ll_threads);
+00041 
+00042 extern bool atLeastOneActiveThread (); /* It returns 'true' iff at least one process is going
+00043                                       to send messages */
+00044   
+00045 extern unsigned numberOfActiveThreads ();
+00046 
+00047 
+00048 #endif /*THREAD_H_*/
+

Generated on Thu Jul 5 13:43:30 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/topology_8cpp-source.html b/branches/paradiseo-peo-meta-model/doc/html/topology_8cpp-source.html new file mode 100644 index 000000000..678227cac --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/topology_8cpp-source.html @@ -0,0 +1,49 @@ + + +ParadisEO-PEO: topology.cpp Source File + + + + +
+
+

topology.cpp

00001 // "topo.cpp"
+00002 
+00003 // (c) OPAC Team, LIFL, September 2005
+00004 
+00005 /* 
+00006    Contact: paradiseo-help@lists.gforge.inria.fr
+00007 */
+00008 
+00009 #include "topology.h"
+00010 
+00011 Topology :: ~ Topology () {
+00012   
+00013   /* Nothing ! */
+00014 }
+00015 
+00016 void Topology :: add (Cooperative & __mig) {
+00017   
+00018   mig.push_back (& __mig) ;
+00019 } 
+00020 
+

Generated on Thu Jul 5 13:43:30 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/topology_8h-source.html b/branches/paradiseo-peo-meta-model/doc/html/topology_8h-source.html new file mode 100644 index 000000000..37c5b021d --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/topology_8h-source.html @@ -0,0 +1,62 @@ + + +ParadisEO-PEO: topology.h Source File + + + + +
+
+

topology.h

00001 // "topology.h"
+00002 
+00003 // (c) OPAC Team, LIFL, September 2005
+00004 
+00005 /* 
+00006    Contact: paradiseo-help@lists.gforge.inria.fr
+00007 */
+00008 
+00009 #ifndef __topology_h
+00010 #define __topology_h
+00011 
+00012 #include <vector>
+00013 
+00014 #include "cooperative.h"
+00015 
+00016 class Topology {
+00017 
+00018 public:
+00019 
+00020         virtual ~Topology ();
+00021 
+00022         void add (Cooperative & __mig); 
+00023 
+00024         virtual void setNeighbors (Cooperative * __mig,
+00025                                 std :: vector <Cooperative *> & __from,
+00026                                 std :: vector <Cooperative *> & __to) = 0;
+00027 
+00028 protected:
+00029 
+00030         std :: vector <Cooperative *> mig ;  
+00031 };
+00032 
+00033 #endif
+

Generated on Thu Jul 5 13:43:30 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/tree.html b/branches/paradiseo-peo-meta-model/doc/html/tree.html new file mode 100644 index 000000000..8e7d5e828 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/tree.html @@ -0,0 +1,242 @@ + + + + + + + TreeView + + + + +
+

ParadisEO-PEO

+
+

o*The ParadisEO-PEO Framework

+

o+Class List

+ +

o+Class Hierarchy

+ +

o*Class Members

+

o+Namespace List

+
+

|\*peo

+
+

o*Namespace Members

+

\+File List

+
+

 o*comm.cpp

+

 o*comm.h

+

 o*communicable.cpp

+

 o*communicable.h

+

 o*coop.cpp

+

 o*cooperative.h

+

 o*eoPop_comm.h

+

 o*eoVector_comm.h

+

 o*mess.cpp

+

 o*mess.h

+

 o*messaging.h

+

 o*node.cpp

+

 o*node.h

+

 o*paradiseo.h

+

 o*param.cpp

+

 o*param.h

+

 o*peo_debug.cpp

+

 o*peo_debug.h

+

 o*peo_fin.cpp

+

 o*peo_fin.h

+

 o*peo_init.cpp

+

 o*peo_init.h

+

 o*peo_param.cpp

+

 o*peo_param.h

+

 o*peo_run.cpp

+

 o*peo_run.h

+

 o*peoAggEvalFunc.h

+

 o*peoAsyncIslandMig.h

+

 o*peoEA.h

+

 o*peoNoAggEvalFunc.h

+

 o*peoParaPopEval.h

+

 o*peoParaSGATransform.h

+

 o*peoPopEval.h

+

 o*peoSeqPopEval.h

+

 o*peoSeqTransform.h

+

 o*peoSyncIslandMig.h

+

 o*peoSyncMultiStart.h

+

 o*peoTransform.h

+

 o*reac_thread.cpp

+

 o*reac_thread.h

+

 o*recv.cpp

+

 o*recv.h

+

 o*ring_topo.cpp

+

 o*ring_topo.h

+

 o*rmc.cpp

+

 o*rmc.h

+

 o*core/runner.cpp

+

 o*rmc/mpi/runner.cpp

+

 o*runner.h

+

 o*scheduler.cpp

+

 o*scheduler.h

+

 o*schema.cpp

+

 o*schema.h

+

 o*send.cpp

+

 o*send.h

+

 o*core/service.cpp

+

 o*rmc/mpi/service.cpp

+

 o*service.h

+

 o*tags.h

+

 o*thread.cpp

+

 o*thread.h

+

 o*topology.cpp

+

 o*topology.h

+

 o*worker.cpp

+

 o*worker.h

+

 o*xml_parser.cpp

+

 \*xml_parser.h

+
+
+
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/worker_8cpp-source.html b/branches/paradiseo-peo-meta-model/doc/html/worker_8cpp-source.html new file mode 100644 index 000000000..d148530b7 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/worker_8cpp-source.html @@ -0,0 +1,122 @@ + + +ParadisEO-PEO: worker.cpp Source File + + + + +
+
+

worker.cpp

00001 // "worker.cpp"
+00002 
+00003 // (c) OPAC Team, LIFL, August 2005
+00004 
+00005 /* 
+00006    Contact: paradiseo-help@lists.gforge.inria.fr
+00007 */
+00008 
+00009 #include <vector>
+00010 
+00011 #include "tags.h"
+00012 #include "send.h"
+00013 #include "node.h"
+00014 #include "schema.h"
+00015 #include "worker.h"
+00016 #include "mess.h"
+00017 #include "../../core/peo_debug.h"
+00018 
+00019 static std :: vector <Worker *> key_to_worker (1); /* Vector of registered workers */
+00020 
+00021 Worker * getWorker (WORKER_ID __key) {
+00022 
+00023   return key_to_worker [__key];  
+00024 }
+00025 
+00026 Worker :: Worker () {
+00027   
+00028   toto = false;
+00029   id = key_to_worker.size ();
+00030   key_to_worker.push_back (this);
+00031 }
+00032 
+00033 void Worker :: packResult () {
+00034   
+00035   pack (serv_id);
+00036   serv -> packResult ();    
+00037 }
+00038 
+00039 void Worker :: unpackData () {
+00040 
+00041   printDebugMessage ("unpacking the ID. of the service.");
+00042   unpack (serv_id);
+00043   serv = getService (serv_id); 
+00044   printDebugMessage ("found the service.");
+00045   serv -> unpackData (); 
+00046   printDebugMessage ("unpacking the data.");
+00047   setActive ();
+00048 }
+00049 
+00050 void Worker :: packTaskDone () {
+00051 
+00052   pack (getNodeRank ());
+00053   pack (id);
+00054 }
+00055 
+00056 void Worker :: notifySendingResult () {
+00057 
+00058   /* Notifying the scheduler of the termination */
+00059   toto = true;
+00060   wakeUp ();
+00061 }
+00062 
+00063 void Worker :: notifySendingTaskDone () {
+00064 
+00065   setPassive ();
+00066 }
+00067   
+00068 void Worker :: setSource (int __rank) {
+00069 
+00070   src = __rank;
+00071 }
+00072 
+00073 void Worker :: start () {
+00074 
+00075   while (true) {
+00076     
+00077     sleep (); 
+00078 
+00079     if (! atLeastOneActiveRunner ())
+00080       break;
+00081     
+00082     if (toto) {
+00083       send (this, my_node -> rk_sched, TASK_DONE_TAG);  
+00084       toto = false;
+00085     }
+00086     else {
+00087 
+00088       printDebugMessage ("executing the task.");
+00089       serv -> execute ();   
+00090       send (this, src, TASK_RESULT_TAG);    
+00091     }
+00092   }
+00093 }
+

Generated on Thu Jul 5 13:43:30 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/worker_8h-source.html b/branches/paradiseo-peo-meta-model/doc/html/worker_8h-source.html new file mode 100644 index 000000000..de64d53ea --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/worker_8h-source.html @@ -0,0 +1,79 @@ + + +ParadisEO-PEO: worker.h Source File + + + + +
+
+

worker.h

00001 // "worker.h"
+00002 
+00003 // (c) OPAC Team, LIFL, August 2005
+00004 
+00005 /* 
+00006    Contact: paradiseo-help@lists.gforge.inria.fr
+00007 */
+00008 
+00009 #ifndef __worker_h
+00010 #define __worker_h
+00011 
+00012 #include "../../core/communicable.h"
+00013 #include "../../core/reac_thread.h"
+00014 #include "../../core/service.h"
+00015 
+00016 typedef unsigned WORKER_ID; 
+00017 
+00018 class Worker : public Communicable, public ReactiveThread {
+00019 
+00020 public : 
+00021 
+00022   Worker ();
+00023 
+00024   void start ();
+00025 
+00026   void packResult ();
+00027 
+00028   void unpackData ();
+00029 
+00030   void packTaskDone (); 
+00031 
+00032   void notifySendingResult ();
+00033 
+00034   void notifySendingTaskDone ();
+00035   
+00036   void setSource (int __rank);
+00037   
+00038 private :
+00039 
+00040   WORKER_ID id;
+00041   SERVICE_ID serv_id;
+00042   Service * serv;
+00043   int src;
+00044 
+00045   bool toto;
+00046 };
+00047 
+00048 extern Worker * getWorker (WORKER_ID __key);
+00049 
+00050 #endif
+

Generated on Thu Jul 5 13:43:30 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/xml__parser_8cpp-source.html b/branches/paradiseo-peo-meta-model/doc/html/xml__parser_8cpp-source.html new file mode 100644 index 000000000..8cf975cee --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/xml__parser_8cpp-source.html @@ -0,0 +1,104 @@ + + +ParadisEO-PEO: xml_parser.cpp Source File + + + + +
+
+

xml_parser.cpp

00001 // "xml_parser.h"
+00002 
+00003 // (c) OPAC Team, LIFL, August 2005
+00004 
+00005 /* 
+00006    Contact: paradiseo-help@lists.gforge.inria.fr
+00007 */
+00008 
+00009 #include <libxml/xmlreader.h>
+00010 
+00011 #include "xml_parser.h"
+00012 
+00013 static xmlTextReaderPtr reader;
+00014 
+00015 void openXMLDocument (const char * __filename) {
+00016   
+00017   reader = xmlNewTextReaderFilename (__filename);
+00018   
+00019   if (! reader) {
+00020     
+00021     fprintf (stderr, "unable to open '%s'.\n", __filename);
+00022     exit (1);
+00023   }
+00024 }
+00025 
+00026 void closeXMLDocument () {
+00027 
+00028   xmlFreeTextReader (reader);
+00029 }
+00030 
+00031 std :: string getAttributeValue (const std :: string & __attr) {
+00032   
+00033   xmlChar * value = xmlTextReaderGetAttribute (reader, (const xmlChar *) __attr.c_str ());
+00034   
+00035   std :: string str ((const char *) value);
+00036   
+00037   xmlFree (value);
+00038   
+00039   return str;
+00040 }
+00041 
+00042 static bool isSep (const xmlChar * __text) {
+00043   
+00044   for (unsigned i = 0; i < strlen ((char *) __text); i ++)
+00045     if (__text [i] != ' ' && __text [i] != '\t' && __text [i] != '\n')
+00046       return false;
+00047   return true;
+00048 }
+00049 
+00050 std :: string getNextNode () {
+00051   
+00052   xmlChar * name, * value;
+00053 
+00054   do {
+00055     xmlTextReaderRead (reader);
+00056     name = xmlTextReaderName (reader);
+00057     value = xmlTextReaderValue (reader);
+00058     //    printf ("value = %s\n", value);
+00059   } while (! strcmp ((char *) name, "#text") && isSep (value));
+00060 
+00061   std :: string str;
+00062 
+00063   if (strcmp ((char *) name, "#text"))
+00064     str.assign ((char *) name);
+00065   else
+00066     str.assign ((char *) value);
+00067   
+00068   if (name)
+00069     xmlFree (name);
+00070   if (value)
+00071     xmlFree (value);
+00072     
+00073   return str;
+00074 }
+00075 
+

Generated on Thu Jul 5 13:43:30 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/html/xml__parser_8h-source.html b/branches/paradiseo-peo-meta-model/doc/html/xml__parser_8h-source.html new file mode 100644 index 000000000..cdaf4e109 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/html/xml__parser_8h-source.html @@ -0,0 +1,51 @@ + + +ParadisEO-PEO: xml_parser.h Source File + + + + +
+
+

xml_parser.h

00001 // "xml_parser.h"
+00002 
+00003 // (c) OPAC Team, LIFL, August 2005
+00004 
+00005 /* 
+00006    Contact: paradiseo-help@lists.gforge.inria.fr
+00007 */
+00008 
+00009 #ifndef __xml_parser_h
+00010 #define __xml_parser_h
+00011 
+00012 #include <string>
+00013 
+00014 extern void openXMLDocument (const char * __filename);
+00015 
+00016 extern void closeXMLDocument ();
+00017 
+00018 extern std :: string getAttributeValue (const std :: string & __attr);
+00019 
+00020 extern std :: string getNextNode ();
+00021 
+00022 #endif
+

Generated on Thu Jul 5 13:43:30 2007 for ParadisEO-PEO by  + +doxygen 1.4.7
+ + diff --git a/branches/paradiseo-peo-meta-model/doc/latex/FreeSans.ttf b/branches/paradiseo-peo-meta-model/doc/latex/FreeSans.ttf new file mode 100644 index 000000000..b550b90ba Binary files /dev/null and b/branches/paradiseo-peo-meta-model/doc/latex/FreeSans.ttf differ diff --git a/branches/paradiseo-peo-meta-model/doc/latex/Makefile b/branches/paradiseo-peo-meta-model/doc/latex/Makefile new file mode 100644 index 000000000..a67f1b7f6 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/latex/Makefile @@ -0,0 +1,17 @@ +all: clean refman.pdf + +refman.pdf: refman.tex + pdflatex refman.tex + makeindex refman.idx + pdflatex refman.tex + latex_count=5 ; \ + while egrep -s 'Rerun (LaTeX|to get cross-references right)' refman.log && [ $$latex_count -gt 0 ] ;\ + do \ + echo "Rerunning latex...." ;\ + pdflatex refman.tex ;\ + latex_count=`expr $$latex_count - 1` ;\ + done + + +clean: + rm -f *.ps *.dvi *.aux *.toc *.idx *.ind *.ilg *.log *.out refman.pdf diff --git a/branches/paradiseo-peo-meta-model/doc/latex/annotated.tex b/branches/paradiseo-peo-meta-model/doc/latex/annotated.tex new file mode 100644 index 000000000..765489ef1 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/latex/annotated.tex @@ -0,0 +1,26 @@ +\section{Paradis\-EO-PEO Class List} +Here are the classes, structs, unions and interfaces with brief descriptions:\begin{CompactList} +\item\contentsline{section}{\hyperlink{classCommunicable}{Communicable} }{\pageref{classCommunicable}}{} +\item\contentsline{section}{\hyperlink{classCommunicator}{Communicator} }{\pageref{classCommunicator}}{} +\item\contentsline{section}{\hyperlink{classCooperative}{Cooperative} }{\pageref{classCooperative}}{} +\item\contentsline{section}{\hyperlink{classpeoAggEvalFunc}{peo\-Agg\-Eval\-Func$<$ EOT $>$} (The \hyperlink{classpeoAggEvalFunc}{peo\-Agg\-Eval\-Func} class offers only the interface for creating aggregate evaluation functions - there are no direct internal functions provided )}{\pageref{classpeoAggEvalFunc}}{} +\item\contentsline{section}{\hyperlink{classpeoAsyncIslandMig}{peo\-Async\-Island\-Mig$<$ EOT $>$} (The \hyperlink{classpeoAsyncIslandMig}{peo\-Async\-Island\-Mig} class offers the elementary basis for implementating an asynchronous island migration model - requires the specification of several basic parameters, i.e )}{\pageref{classpeoAsyncIslandMig}}{} +\item\contentsline{section}{\hyperlink{classpeoEA}{peo\-EA$<$ EOT $>$} (The \hyperlink{classpeoEA}{peo\-EA} class offers an elementary evolutionary algorithm implementation )}{\pageref{classpeoEA}}{} +\item\contentsline{section}{\hyperlink{classpeoNoAggEvalFunc}{peo\-No\-Agg\-Eval\-Func$<$ EOT $>$} (The \hyperlink{classpeoNoAggEvalFunc}{peo\-No\-Agg\-Eval\-Func} class does nothing more than an association between a fitness value and a specified individual )}{\pageref{classpeoNoAggEvalFunc}}{} +\item\contentsline{section}{\hyperlink{classpeoParaPopEval}{peo\-Para\-Pop\-Eval$<$ EOT $>$} (The \hyperlink{classpeoParaPopEval}{peo\-Para\-Pop\-Eval} represents a wrapper for creating a functor capable of applying in parallel an EO-derived evaluation functor )}{\pageref{classpeoParaPopEval}}{} +\item\contentsline{section}{\hyperlink{classpeoParaSGATransform}{peo\-Para\-SGATransform$<$ EOT $>$} }{\pageref{classpeoParaSGATransform}}{} +\item\contentsline{section}{\hyperlink{classpeoPopEval}{peo\-Pop\-Eval$<$ EOT $>$} (The {\bf \hyperlink{classpeoPopEval}{peo\-Pop\-Eval}} class provides the interface for constructing Paradis\-EO specific evaluation functors )}{\pageref{classpeoPopEval}}{} +\item\contentsline{section}{\hyperlink{classpeoSeqPopEval}{peo\-Seq\-Pop\-Eval$<$ EOT $>$} (The \hyperlink{classpeoSeqPopEval}{peo\-Seq\-Pop\-Eval} class acts only as a Paradis\-EO specific sequential evaluation functor - a wrapper for incorporating an {\bf eo\-Eval\-Func$<$ EOT $>$}-derived class as evaluation functor )}{\pageref{classpeoSeqPopEval}}{} +\item\contentsline{section}{\hyperlink{classpeoSeqTransform}{peo\-Seq\-Transform$<$ EOT $>$} (The \hyperlink{classpeoSeqTransform}{peo\-Seq\-Transform} represent a wrapper for offering the possibility of using \doxyref{EO} derived transform operators along with the Paradis\-EO evolutionary algorithms )}{\pageref{classpeoSeqTransform}}{} +\item\contentsline{section}{\hyperlink{classpeoSyncIslandMig}{peo\-Sync\-Island\-Mig$<$ EOT $>$} (The \hyperlink{classpeoSyncIslandMig}{peo\-Sync\-Island\-Mig} class offers the elementary basis for implementating a synchronous island migration model - requires the specification of several basic parameters, i.e )}{\pageref{classpeoSyncIslandMig}}{} +\item\contentsline{section}{\hyperlink{classpeoSyncMultiStart}{peo\-Sync\-Multi\-Start$<$ EOT $>$} (The \hyperlink{classpeoSyncMultiStart}{peo\-Sync\-Multi\-Start} class provides the basis for implementing the synchronous multi-start model, for launching several solution-based algorithms in parallel on a specified initial population )}{\pageref{classpeoSyncMultiStart}}{} +\item\contentsline{section}{\hyperlink{classpeoTransform}{peo\-Transform$<$ EOT $>$} (The \hyperlink{classpeoTransform}{peo\-Transform} class acts only as an interface for creating transform operators - for an example please refer to the {\bf \hyperlink{classpeoSeqTransform}{peo\-Seq\-Transform}} and the {\bf \hyperlink{classpeoParaSGATransform}{peo\-Para\-SGATransform}} classes )}{\pageref{classpeoTransform}}{} +\item\contentsline{section}{\hyperlink{classReactiveThread}{Reactive\-Thread} }{\pageref{classReactiveThread}}{} +\item\contentsline{section}{\hyperlink{classRingTopology}{Ring\-Topology} }{\pageref{classRingTopology}}{} +\item\contentsline{section}{\hyperlink{classRunner}{Runner} }{\pageref{classRunner}}{} +\item\contentsline{section}{\hyperlink{structSEND__REQUEST}{SEND\_\-REQUEST} }{\pageref{structSEND__REQUEST}}{} +\item\contentsline{section}{\hyperlink{classService}{Service} }{\pageref{classService}}{} +\item\contentsline{section}{\hyperlink{classThread}{Thread} }{\pageref{classThread}}{} +\item\contentsline{section}{\hyperlink{classTopology}{Topology} }{\pageref{classTopology}}{} +\item\contentsline{section}{\hyperlink{classWorker}{Worker} }{\pageref{classWorker}}{} +\end{CompactList} diff --git a/branches/paradiseo-peo-meta-model/doc/latex/classCommunicable.eps b/branches/paradiseo-peo-meta-model/doc/latex/classCommunicable.eps new file mode 100644 index 000000000..a4f4be521 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/latex/classCommunicable.eps @@ -0,0 +1,269 @@ +%!PS-Adobe-2.0 EPSF-2.0 +%%Title: ClassName +%%Creator: Doxygen +%%CreationDate: Time +%%For: +%Magnification: 1.00 +%%Orientation: Portrait +%%BoundingBox: 0 0 500 57.1429 +%%Pages: 0 +%%BeginSetup +%%EndSetup +%%EndComments + +% ----- variables ----- + +/boxwidth 0 def +/boxheight 40 def +/fontheight 24 def +/marginwidth 10 def +/distx 20 def +/disty 40 def +/boundaspect 8.75 def % aspect ratio of the BoundingBox (width/height) +/boundx 500 def +/boundy boundx boundaspect div def +/xspacing 0 def +/yspacing 0 def +/rows 4 def +/cols 7 def +/scalefactor 0 def +/boxfont /Times-Roman findfont fontheight scalefont def + +% ----- procedures ----- + +/dotted { [1 4] 0 setdash } def +/dashed { [5] 0 setdash } def +/solid { [] 0 setdash } def + +/max % result = MAX(arg1,arg2) +{ + /a exch def + /b exch def + a b gt {a} {b} ifelse +} def + +/xoffset % result = MAX(0,(scalefactor-(boxwidth*cols+distx*(cols-1)))/2) +{ + 0 scalefactor boxwidth cols mul distx cols 1 sub mul add sub 2 div max +} def + +/cw % boxwidth = MAX(boxwidth, stringwidth(arg1)) +{ + /str exch def + /boxwidth boxwidth str stringwidth pop max def +} def + +/box % draws a box with text `arg1' at grid pos (arg2,arg3) +{ gsave + 2 setlinewidth + newpath + exch xspacing mul xoffset add + exch yspacing mul + moveto + boxwidth 0 rlineto + 0 boxheight rlineto + boxwidth neg 0 rlineto + 0 boxheight neg rlineto + closepath + dup stringwidth pop neg boxwidth add 2 div + boxheight fontheight 2 div sub 2 div + rmoveto show stroke + grestore +} def + +/mark +{ newpath + exch xspacing mul xoffset add boxwidth add + exch yspacing mul + moveto + 0 boxheight 4 div rlineto + boxheight neg 4 div boxheight neg 4 div rlineto + closepath + eofill + stroke +} def + +/arrow +{ newpath + moveto + 3 -8 rlineto + -6 0 rlineto + 3 8 rlineto + closepath + eofill + stroke +} def + +/out % draws an output connector for the block at (arg1,arg2) +{ + newpath + exch xspacing mul xoffset add boxwidth 2 div add + exch yspacing mul boxheight add + /y exch def + /x exch def + x y moveto + 0 disty 2 div rlineto + stroke + 1 eq { x y disty 2 div add arrow } if +} def + +/in % draws an input connector for the block at (arg1,arg2) +{ + newpath + exch xspacing mul xoffset add boxwidth 2 div add + exch yspacing mul disty 2 div sub + /y exch def + /x exch def + x y moveto + 0 disty 2 div rlineto + stroke + 1 eq { x y disty 2 div add arrow } if +} def + +/hedge +{ + exch xspacing mul xoffset add boxwidth 2 div add + exch yspacing mul boxheight 2 div sub + /y exch def + /x exch def + newpath + x y moveto + boxwidth 2 div distx add 0 rlineto + stroke + 1 eq + { newpath x boxwidth 2 div distx add add y moveto + -8 3 rlineto + 0 -6 rlineto + 8 3 rlineto + closepath + eofill + stroke + } if +} def + +/vedge +{ + /ye exch def + /ys exch def + /xs exch def + newpath + xs xspacing mul xoffset add boxwidth 2 div add dup + ys yspacing mul boxheight 2 div sub + moveto + ye yspacing mul boxheight 2 div sub + lineto + stroke +} def + +/conn % connections the blocks from col `arg1' to `arg2' of row `arg3' +{ + /ys exch def + /xe exch def + /xs exch def + newpath + xs xspacing mul xoffset add boxwidth 2 div add + ys yspacing mul disty 2 div sub + moveto + xspacing xe xs sub mul 0 + rlineto + stroke +} def + +% ----- main ------ + +boxfont setfont +1 boundaspect scale +(Communicable) cw +(Cooperative) cw +(Runner) cw +(Service) cw +(Worker) cw +(peoAsyncIslandMig< EOT >) cw +(peoSyncIslandMig< EOT >) cw +(peoEA< EOT >) cw +(peoPopEval< EOT >) cw +(peoSyncMultiStart< EOT >) cw +(peoTransform< EOT >) cw +(peoParaPopEval< EOT >) cw +(peoSeqPopEval< EOT >) cw +(peoParaSGATransform< EOT >) cw +(peoSeqTransform< EOT >) cw +/boxwidth boxwidth marginwidth 2 mul add def +/xspacing boxwidth distx add def +/yspacing boxheight disty add def +/scalefactor + boxwidth cols mul distx cols 1 sub mul add + boxheight rows mul disty rows 1 sub mul add boundaspect mul + max def +boundx scalefactor div boundy scalefactor div scale + +% ----- classes ----- + + (Communicable) 3 3 box + (Cooperative) 0.5 2 box + (Runner) 2 2 box + (Service) 4 2 box + (Worker) 5 2 box + (peoAsyncIslandMig< EOT >) 0 1 box + (peoSyncIslandMig< EOT >) 1 1 box + (peoEA< EOT >) 2 1 box + (peoPopEval< EOT >) 3 1 box + (peoSyncMultiStart< EOT >) 4 1 box + (peoTransform< EOT >) 5 1 box + (peoParaPopEval< EOT >) 2.5 0 box + (peoSeqPopEval< EOT >) 3.5 0 box + (peoParaSGATransform< EOT >) 4.5 0 box + (peoSeqTransform< EOT >) 5.5 0 box + +% ----- relations ----- + +solid +1 3 2.25 out +solid +0.5 5 3 conn +solid +0 0.5 2.75 in +solid +1 0.5 1.25 out +solid +0 1 2 conn +solid +0 2 2.75 in +solid +1 2 1.25 out +solid +0 4 2.75 in +solid +1 4 1.25 out +solid +3 5 2 conn +solid +0 5 2.75 in +solid +0 0 1.75 in +solid +0 1 1.75 in +solid +0 2 1.75 in +solid +0 3 1.75 in +solid +1 3 0.25 out +solid +2.5 3.5 1 conn +solid +0 4 1.75 in +solid +0 5 1.75 in +solid +1 5 0.25 out +solid +4.5 5.5 1 conn +solid +0 2.5 0.75 in +solid +0 3.5 0.75 in +solid +0 4.5 0.75 in +solid +0 5.5 0.75 in diff --git a/branches/paradiseo-peo-meta-model/doc/latex/classCommunicable.tex b/branches/paradiseo-peo-meta-model/doc/latex/classCommunicable.tex new file mode 100644 index 000000000..3d4ee6164 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/latex/classCommunicable.tex @@ -0,0 +1,87 @@ +\hypertarget{classCommunicable}{ +\section{Communicable Class Reference} +\label{classCommunicable}\index{Communicable@{Communicable}} +} +Inheritance diagram for Communicable::\begin{figure}[H] +\begin{center} +\leavevmode +\includegraphics[height=1.6cm]{classCommunicable} +\end{center} +\end{figure} +\subsection*{Public Member Functions} +\begin{CompactItemize} +\item +\hypertarget{classCommunicable_8ae1827ecf7569b3db1ed386c7d8ad78}{ +\hyperlink{classCommunicable_8ae1827ecf7569b3db1ed386c7d8ad78}{Communicable} ()} +\label{classCommunicable_8ae1827ecf7569b3db1ed386c7d8ad78} + +\item +\hypertarget{classCommunicable_2280b0dfa0d3a515fccf62c2a9fd5f41}{ +virtual \hyperlink{classCommunicable_2280b0dfa0d3a515fccf62c2a9fd5f41}{$\sim$Communicable} ()} +\label{classCommunicable_2280b0dfa0d3a515fccf62c2a9fd5f41} + +\item +\hypertarget{classCommunicable_db4307b69b9ccacff55fdbf84b8f50e4}{ +COMM\_\-ID \hyperlink{classCommunicable_db4307b69b9ccacff55fdbf84b8f50e4}{get\-Key} ()} +\label{classCommunicable_db4307b69b9ccacff55fdbf84b8f50e4} + +\item +\hypertarget{classCommunicable_e1f8bd1ee810fd73d44315c95998d19d}{ +void \hyperlink{classCommunicable_e1f8bd1ee810fd73d44315c95998d19d}{lock} ()} +\label{classCommunicable_e1f8bd1ee810fd73d44315c95998d19d} + +\item +\hypertarget{classCommunicable_caa814847192e71f434fbf9479ede862}{ +void \hyperlink{classCommunicable_caa814847192e71f434fbf9479ede862}{unlock} ()} +\label{classCommunicable_caa814847192e71f434fbf9479ede862} + +\item +\hypertarget{classCommunicable_cb53e6534b947bc889aa181d9dbbd13b}{ +void \hyperlink{classCommunicable_cb53e6534b947bc889aa181d9dbbd13b}{stop} ()} +\label{classCommunicable_cb53e6534b947bc889aa181d9dbbd13b} + +\item +\hypertarget{classCommunicable_3306a9adb11a0ab5af342c0db9f7bb2a}{ +void \hyperlink{classCommunicable_3306a9adb11a0ab5af342c0db9f7bb2a}{resume} ()} +\label{classCommunicable_3306a9adb11a0ab5af342c0db9f7bb2a} + +\end{CompactItemize} +\subsection*{Protected Attributes} +\begin{CompactItemize} +\item +\hypertarget{classCommunicable_605b0efeffe81326f216c9903f5bbf4c}{ +COMM\_\-ID \hyperlink{classCommunicable_605b0efeffe81326f216c9903f5bbf4c}{key}} +\label{classCommunicable_605b0efeffe81326f216c9903f5bbf4c} + +\item +\hypertarget{classCommunicable_cf9639312f71a2f348bc1e7789ccbd9d}{ +sem\_\-t \hyperlink{classCommunicable_cf9639312f71a2f348bc1e7789ccbd9d}{sem\_\-lock}} +\label{classCommunicable_cf9639312f71a2f348bc1e7789ccbd9d} + +\item +\hypertarget{classCommunicable_29c53b9191348e0505e3bcba6d8b82b1}{ +sem\_\-t \hyperlink{classCommunicable_29c53b9191348e0505e3bcba6d8b82b1}{sem\_\-stop}} +\label{classCommunicable_29c53b9191348e0505e3bcba6d8b82b1} + +\end{CompactItemize} +\subsection*{Static Protected Attributes} +\begin{CompactItemize} +\item +\hypertarget{classCommunicable_7a6acfdc781a67c9c0ec4f17893f86c3}{ +static unsigned \hyperlink{classCommunicable_7a6acfdc781a67c9c0ec4f17893f86c3}{num\_\-comm} = 0} +\label{classCommunicable_7a6acfdc781a67c9c0ec4f17893f86c3} + +\end{CompactItemize} + + +\subsection{Detailed Description} + + + + +Definition at line 16 of file communicable.h. + +The documentation for this class was generated from the following files:\begin{CompactItemize} +\item +communicable.h\item +communicable.cpp\end{CompactItemize} diff --git a/branches/paradiseo-peo-meta-model/doc/latex/classCommunicator.eps b/branches/paradiseo-peo-meta-model/doc/latex/classCommunicator.eps new file mode 100644 index 000000000..3d7cc0668 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/latex/classCommunicator.eps @@ -0,0 +1,203 @@ +%!PS-Adobe-2.0 EPSF-2.0 +%%Title: ClassName +%%Creator: Doxygen +%%CreationDate: Time +%%For: +%Magnification: 1.00 +%%Orientation: Portrait +%%BoundingBox: 0 0 500 550.459 +%%Pages: 0 +%%BeginSetup +%%EndSetup +%%EndComments + +% ----- variables ----- + +/boxwidth 0 def +/boxheight 40 def +/fontheight 24 def +/marginwidth 10 def +/distx 20 def +/disty 40 def +/boundaspect 0.908333 def % aspect ratio of the BoundingBox (width/height) +/boundx 500 def +/boundy boundx boundaspect div def +/xspacing 0 def +/yspacing 0 def +/rows 3 def +/cols 1 def +/scalefactor 0 def +/boxfont /Times-Roman findfont fontheight scalefont def + +% ----- procedures ----- + +/dotted { [1 4] 0 setdash } def +/dashed { [5] 0 setdash } def +/solid { [] 0 setdash } def + +/max % result = MAX(arg1,arg2) +{ + /a exch def + /b exch def + a b gt {a} {b} ifelse +} def + +/xoffset % result = MAX(0,(scalefactor-(boxwidth*cols+distx*(cols-1)))/2) +{ + 0 scalefactor boxwidth cols mul distx cols 1 sub mul add sub 2 div max +} def + +/cw % boxwidth = MAX(boxwidth, stringwidth(arg1)) +{ + /str exch def + /boxwidth boxwidth str stringwidth pop max def +} def + +/box % draws a box with text `arg1' at grid pos (arg2,arg3) +{ gsave + 2 setlinewidth + newpath + exch xspacing mul xoffset add + exch yspacing mul + moveto + boxwidth 0 rlineto + 0 boxheight rlineto + boxwidth neg 0 rlineto + 0 boxheight neg rlineto + closepath + dup stringwidth pop neg boxwidth add 2 div + boxheight fontheight 2 div sub 2 div + rmoveto show stroke + grestore +} def + +/mark +{ newpath + exch xspacing mul xoffset add boxwidth add + exch yspacing mul + moveto + 0 boxheight 4 div rlineto + boxheight neg 4 div boxheight neg 4 div rlineto + closepath + eofill + stroke +} def + +/arrow +{ newpath + moveto + 3 -8 rlineto + -6 0 rlineto + 3 8 rlineto + closepath + eofill + stroke +} def + +/out % draws an output connector for the block at (arg1,arg2) +{ + newpath + exch xspacing mul xoffset add boxwidth 2 div add + exch yspacing mul boxheight add + /y exch def + /x exch def + x y moveto + 0 disty 2 div rlineto + stroke + 1 eq { x y disty 2 div add arrow } if +} def + +/in % draws an input connector for the block at (arg1,arg2) +{ + newpath + exch xspacing mul xoffset add boxwidth 2 div add + exch yspacing mul disty 2 div sub + /y exch def + /x exch def + x y moveto + 0 disty 2 div rlineto + stroke + 1 eq { x y disty 2 div add arrow } if +} def + +/hedge +{ + exch xspacing mul xoffset add boxwidth 2 div add + exch yspacing mul boxheight 2 div sub + /y exch def + /x exch def + newpath + x y moveto + boxwidth 2 div distx add 0 rlineto + stroke + 1 eq + { newpath x boxwidth 2 div distx add add y moveto + -8 3 rlineto + 0 -6 rlineto + 8 3 rlineto + closepath + eofill + stroke + } if +} def + +/vedge +{ + /ye exch def + /ys exch def + /xs exch def + newpath + xs xspacing mul xoffset add boxwidth 2 div add dup + ys yspacing mul boxheight 2 div sub + moveto + ye yspacing mul boxheight 2 div sub + lineto + stroke +} def + +/conn % connections the blocks from col `arg1' to `arg2' of row `arg3' +{ + /ys exch def + /xe exch def + /xs exch def + newpath + xs xspacing mul xoffset add boxwidth 2 div add + ys yspacing mul disty 2 div sub + moveto + xspacing xe xs sub mul 0 + rlineto + stroke +} def + +% ----- main ------ + +boxfont setfont +1 boundaspect scale +(Communicator) cw +(ReactiveThread) cw +(Thread) cw +/boxwidth boxwidth marginwidth 2 mul add def +/xspacing boxwidth distx add def +/yspacing boxheight disty add def +/scalefactor + boxwidth cols mul distx cols 1 sub mul add + boxheight rows mul disty rows 1 sub mul add boundaspect mul + max def +boundx scalefactor div boundy scalefactor div scale + +% ----- classes ----- + + (Communicator) 0 0 box + (ReactiveThread) 0 1 box + (Thread) 0 2 box + +% ----- relations ----- + +solid +0 0 0 out +solid +1 0 1 in +solid +0 0 1 out +solid +1 0 2 in diff --git a/branches/paradiseo-peo-meta-model/doc/latex/classCommunicator.tex b/branches/paradiseo-peo-meta-model/doc/latex/classCommunicator.tex new file mode 100644 index 000000000..a8d08b499 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/latex/classCommunicator.tex @@ -0,0 +1,36 @@ +\hypertarget{classCommunicator}{ +\section{Communicator Class Reference} +\label{classCommunicator}\index{Communicator@{Communicator}} +} +Inheritance diagram for Communicator::\begin{figure}[H] +\begin{center} +\leavevmode +\includegraphics[height=3cm]{classCommunicator} +\end{center} +\end{figure} +\subsection*{Public Member Functions} +\begin{CompactItemize} +\item +\hypertarget{classCommunicator_7c9dce4ea92bd04d01d53f80c0ef08ee}{ +\hyperlink{classCommunicator_7c9dce4ea92bd04d01d53f80c0ef08ee}{Communicator} (int $\ast$\_\-\_\-argc, char $\ast$$\ast$$\ast$\_\-\_\-argv)} +\label{classCommunicator_7c9dce4ea92bd04d01d53f80c0ef08ee} + +\item +\hypertarget{classCommunicator_142fae13b16b166519315f248a513c62}{ +void \hyperlink{classCommunicator_142fae13b16b166519315f248a513c62}{start} ()} +\label{classCommunicator_142fae13b16b166519315f248a513c62} + +\end{CompactItemize} + + +\subsection{Detailed Description} + + + + +Definition at line 15 of file comm.h. + +The documentation for this class was generated from the following files:\begin{CompactItemize} +\item +comm.h\item +comm.cpp\end{CompactItemize} diff --git a/branches/paradiseo-peo-meta-model/doc/latex/classCooperative.eps b/branches/paradiseo-peo-meta-model/doc/latex/classCooperative.eps new file mode 100644 index 000000000..60c6b6b94 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/latex/classCooperative.eps @@ -0,0 +1,209 @@ +%!PS-Adobe-2.0 EPSF-2.0 +%%Title: ClassName +%%Creator: Doxygen +%%CreationDate: Time +%%For: +%Magnification: 1.00 +%%Orientation: Portrait +%%BoundingBox: 0 0 500 166.667 +%%Pages: 0 +%%BeginSetup +%%EndSetup +%%EndComments + +% ----- variables ----- + +/boxwidth 0 def +/boxheight 40 def +/fontheight 24 def +/marginwidth 10 def +/distx 20 def +/disty 40 def +/boundaspect 3 def % aspect ratio of the BoundingBox (width/height) +/boundx 500 def +/boundy boundx boundaspect div def +/xspacing 0 def +/yspacing 0 def +/rows 3 def +/cols 2 def +/scalefactor 0 def +/boxfont /Times-Roman findfont fontheight scalefont def + +% ----- procedures ----- + +/dotted { [1 4] 0 setdash } def +/dashed { [5] 0 setdash } def +/solid { [] 0 setdash } def + +/max % result = MAX(arg1,arg2) +{ + /a exch def + /b exch def + a b gt {a} {b} ifelse +} def + +/xoffset % result = MAX(0,(scalefactor-(boxwidth*cols+distx*(cols-1)))/2) +{ + 0 scalefactor boxwidth cols mul distx cols 1 sub mul add sub 2 div max +} def + +/cw % boxwidth = MAX(boxwidth, stringwidth(arg1)) +{ + /str exch def + /boxwidth boxwidth str stringwidth pop max def +} def + +/box % draws a box with text `arg1' at grid pos (arg2,arg3) +{ gsave + 2 setlinewidth + newpath + exch xspacing mul xoffset add + exch yspacing mul + moveto + boxwidth 0 rlineto + 0 boxheight rlineto + boxwidth neg 0 rlineto + 0 boxheight neg rlineto + closepath + dup stringwidth pop neg boxwidth add 2 div + boxheight fontheight 2 div sub 2 div + rmoveto show stroke + grestore +} def + +/mark +{ newpath + exch xspacing mul xoffset add boxwidth add + exch yspacing mul + moveto + 0 boxheight 4 div rlineto + boxheight neg 4 div boxheight neg 4 div rlineto + closepath + eofill + stroke +} def + +/arrow +{ newpath + moveto + 3 -8 rlineto + -6 0 rlineto + 3 8 rlineto + closepath + eofill + stroke +} def + +/out % draws an output connector for the block at (arg1,arg2) +{ + newpath + exch xspacing mul xoffset add boxwidth 2 div add + exch yspacing mul boxheight add + /y exch def + /x exch def + x y moveto + 0 disty 2 div rlineto + stroke + 1 eq { x y disty 2 div add arrow } if +} def + +/in % draws an input connector for the block at (arg1,arg2) +{ + newpath + exch xspacing mul xoffset add boxwidth 2 div add + exch yspacing mul disty 2 div sub + /y exch def + /x exch def + x y moveto + 0 disty 2 div rlineto + stroke + 1 eq { x y disty 2 div add arrow } if +} def + +/hedge +{ + exch xspacing mul xoffset add boxwidth 2 div add + exch yspacing mul boxheight 2 div sub + /y exch def + /x exch def + newpath + x y moveto + boxwidth 2 div distx add 0 rlineto + stroke + 1 eq + { newpath x boxwidth 2 div distx add add y moveto + -8 3 rlineto + 0 -6 rlineto + 8 3 rlineto + closepath + eofill + stroke + } if +} def + +/vedge +{ + /ye exch def + /ys exch def + /xs exch def + newpath + xs xspacing mul xoffset add boxwidth 2 div add dup + ys yspacing mul boxheight 2 div sub + moveto + ye yspacing mul boxheight 2 div sub + lineto + stroke +} def + +/conn % connections the blocks from col `arg1' to `arg2' of row `arg3' +{ + /ys exch def + /xe exch def + /xs exch def + newpath + xs xspacing mul xoffset add boxwidth 2 div add + ys yspacing mul disty 2 div sub + moveto + xspacing xe xs sub mul 0 + rlineto + stroke +} def + +% ----- main ------ + +boxfont setfont +1 boundaspect scale +(Cooperative) cw +(Communicable) cw +(peoAsyncIslandMig< EOT >) cw +(peoSyncIslandMig< EOT >) cw +/boxwidth boxwidth marginwidth 2 mul add def +/xspacing boxwidth distx add def +/yspacing boxheight disty add def +/scalefactor + boxwidth cols mul distx cols 1 sub mul add + boxheight rows mul disty rows 1 sub mul add boundaspect mul + max def +boundx scalefactor div boundy scalefactor div scale + +% ----- classes ----- + + (Cooperative) 0.5 1 box + (Communicable) 0.5 2 box + (peoAsyncIslandMig< EOT >) 0 0 box + (peoSyncIslandMig< EOT >) 1 0 box + +% ----- relations ----- + +solid +0 0.5 1 out +solid +1 0.5 2 in +solid +1 0.5 0.25 out +solid +0 1 1 conn +solid +0 0 0.75 in +solid +0 1 0.75 in diff --git a/branches/paradiseo-peo-meta-model/doc/latex/classCooperative.tex b/branches/paradiseo-peo-meta-model/doc/latex/classCooperative.tex new file mode 100644 index 000000000..43224f537 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/latex/classCooperative.tex @@ -0,0 +1,54 @@ +\hypertarget{classCooperative}{ +\section{Cooperative Class Reference} +\label{classCooperative}\index{Cooperative@{Cooperative}} +} +Inheritance diagram for Cooperative::\begin{figure}[H] +\begin{center} +\leavevmode +\includegraphics[height=3cm]{classCooperative} +\end{center} +\end{figure} +\subsection*{Public Member Functions} +\begin{CompactItemize} +\item +\hypertarget{classCooperative_4012b4e8329e87d26ee266491e1a883e}{ +\hyperlink{classRunner}{Runner} $\ast$ \hyperlink{classCooperative_4012b4e8329e87d26ee266491e1a883e}{get\-Owner} ()} +\label{classCooperative_4012b4e8329e87d26ee266491e1a883e} + +\item +\hypertarget{classCooperative_fe7b022567174c8305bc78d8c5749b12}{ +void \hyperlink{classCooperative_fe7b022567174c8305bc78d8c5749b12}{set\-Owner} (\hyperlink{classRunner}{Runner} \&\_\-\_\-runner)} +\label{classCooperative_fe7b022567174c8305bc78d8c5749b12} + +\item +\hypertarget{classCooperative_c609f2a1200da7d1ac96005602515fc6}{ +void \hyperlink{classCooperative_c609f2a1200da7d1ac96005602515fc6}{send} (\hyperlink{classCooperative}{Cooperative} $\ast$\_\-\_\-coop)} +\label{classCooperative_c609f2a1200da7d1ac96005602515fc6} + +\item +\hypertarget{classCooperative_4439ddeaa1246a2e44c003bfb781739b}{ +virtual void \hyperlink{classCooperative_4439ddeaa1246a2e44c003bfb781739b}{notify\-Sending} ()} +\label{classCooperative_4439ddeaa1246a2e44c003bfb781739b} + +\end{CompactItemize} +\subsection*{Private Attributes} +\begin{CompactItemize} +\item +\hypertarget{classCooperative_7604f094479d08154ede4996a45bf79e}{ +\hyperlink{classRunner}{Runner} $\ast$ \hyperlink{classCooperative_7604f094479d08154ede4996a45bf79e}{owner}} +\label{classCooperative_7604f094479d08154ede4996a45bf79e} + +\end{CompactItemize} + + +\subsection{Detailed Description} + + + + +Definition at line 17 of file cooperative.h. + +The documentation for this class was generated from the following files:\begin{CompactItemize} +\item +cooperative.h\item +coop.cpp\end{CompactItemize} diff --git a/branches/paradiseo-peo-meta-model/doc/latex/classReactiveThread.eps b/branches/paradiseo-peo-meta-model/doc/latex/classReactiveThread.eps new file mode 100644 index 000000000..9c8a085ba --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/latex/classReactiveThread.eps @@ -0,0 +1,209 @@ +%!PS-Adobe-2.0 EPSF-2.0 +%%Title: ClassName +%%Creator: Doxygen +%%CreationDate: Time +%%For: +%Magnification: 1.00 +%%Orientation: Portrait +%%BoundingBox: 0 0 500 275.229 +%%Pages: 0 +%%BeginSetup +%%EndSetup +%%EndComments + +% ----- variables ----- + +/boxwidth 0 def +/boxheight 40 def +/fontheight 24 def +/marginwidth 10 def +/distx 20 def +/disty 40 def +/boundaspect 1.81667 def % aspect ratio of the BoundingBox (width/height) +/boundx 500 def +/boundy boundx boundaspect div def +/xspacing 0 def +/yspacing 0 def +/rows 3 def +/cols 2 def +/scalefactor 0 def +/boxfont /Times-Roman findfont fontheight scalefont def + +% ----- procedures ----- + +/dotted { [1 4] 0 setdash } def +/dashed { [5] 0 setdash } def +/solid { [] 0 setdash } def + +/max % result = MAX(arg1,arg2) +{ + /a exch def + /b exch def + a b gt {a} {b} ifelse +} def + +/xoffset % result = MAX(0,(scalefactor-(boxwidth*cols+distx*(cols-1)))/2) +{ + 0 scalefactor boxwidth cols mul distx cols 1 sub mul add sub 2 div max +} def + +/cw % boxwidth = MAX(boxwidth, stringwidth(arg1)) +{ + /str exch def + /boxwidth boxwidth str stringwidth pop max def +} def + +/box % draws a box with text `arg1' at grid pos (arg2,arg3) +{ gsave + 2 setlinewidth + newpath + exch xspacing mul xoffset add + exch yspacing mul + moveto + boxwidth 0 rlineto + 0 boxheight rlineto + boxwidth neg 0 rlineto + 0 boxheight neg rlineto + closepath + dup stringwidth pop neg boxwidth add 2 div + boxheight fontheight 2 div sub 2 div + rmoveto show stroke + grestore +} def + +/mark +{ newpath + exch xspacing mul xoffset add boxwidth add + exch yspacing mul + moveto + 0 boxheight 4 div rlineto + boxheight neg 4 div boxheight neg 4 div rlineto + closepath + eofill + stroke +} def + +/arrow +{ newpath + moveto + 3 -8 rlineto + -6 0 rlineto + 3 8 rlineto + closepath + eofill + stroke +} def + +/out % draws an output connector for the block at (arg1,arg2) +{ + newpath + exch xspacing mul xoffset add boxwidth 2 div add + exch yspacing mul boxheight add + /y exch def + /x exch def + x y moveto + 0 disty 2 div rlineto + stroke + 1 eq { x y disty 2 div add arrow } if +} def + +/in % draws an input connector for the block at (arg1,arg2) +{ + newpath + exch xspacing mul xoffset add boxwidth 2 div add + exch yspacing mul disty 2 div sub + /y exch def + /x exch def + x y moveto + 0 disty 2 div rlineto + stroke + 1 eq { x y disty 2 div add arrow } if +} def + +/hedge +{ + exch xspacing mul xoffset add boxwidth 2 div add + exch yspacing mul boxheight 2 div sub + /y exch def + /x exch def + newpath + x y moveto + boxwidth 2 div distx add 0 rlineto + stroke + 1 eq + { newpath x boxwidth 2 div distx add add y moveto + -8 3 rlineto + 0 -6 rlineto + 8 3 rlineto + closepath + eofill + stroke + } if +} def + +/vedge +{ + /ye exch def + /ys exch def + /xs exch def + newpath + xs xspacing mul xoffset add boxwidth 2 div add dup + ys yspacing mul boxheight 2 div sub + moveto + ye yspacing mul boxheight 2 div sub + lineto + stroke +} def + +/conn % connections the blocks from col `arg1' to `arg2' of row `arg3' +{ + /ys exch def + /xe exch def + /xs exch def + newpath + xs xspacing mul xoffset add boxwidth 2 div add + ys yspacing mul disty 2 div sub + moveto + xspacing xe xs sub mul 0 + rlineto + stroke +} def + +% ----- main ------ + +boxfont setfont +1 boundaspect scale +(ReactiveThread) cw +(Thread) cw +(Communicator) cw +(Worker) cw +/boxwidth boxwidth marginwidth 2 mul add def +/xspacing boxwidth distx add def +/yspacing boxheight disty add def +/scalefactor + boxwidth cols mul distx cols 1 sub mul add + boxheight rows mul disty rows 1 sub mul add boundaspect mul + max def +boundx scalefactor div boundy scalefactor div scale + +% ----- classes ----- + + (ReactiveThread) 0.5 1 box + (Thread) 0.5 2 box + (Communicator) 0 0 box + (Worker) 1 0 box + +% ----- relations ----- + +solid +0 0.5 1 out +solid +1 0.5 2 in +solid +1 0.5 0.25 out +solid +0 1 1 conn +solid +0 0 0.75 in +solid +0 1 0.75 in diff --git a/branches/paradiseo-peo-meta-model/doc/latex/classReactiveThread.tex b/branches/paradiseo-peo-meta-model/doc/latex/classReactiveThread.tex new file mode 100644 index 000000000..c350c6eef --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/latex/classReactiveThread.tex @@ -0,0 +1,49 @@ +\hypertarget{classReactiveThread}{ +\section{Reactive\-Thread Class Reference} +\label{classReactiveThread}\index{ReactiveThread@{ReactiveThread}} +} +Inheritance diagram for Reactive\-Thread::\begin{figure}[H] +\begin{center} +\leavevmode +\includegraphics[height=3cm]{classReactiveThread} +\end{center} +\end{figure} +\subsection*{Public Member Functions} +\begin{CompactItemize} +\item +\hypertarget{classReactiveThread_77381649429941c99a3e3d568113d6cf}{ +\hyperlink{classReactiveThread_77381649429941c99a3e3d568113d6cf}{Reactive\-Thread} ()} +\label{classReactiveThread_77381649429941c99a3e3d568113d6cf} + +\item +\hypertarget{classReactiveThread_8263c2a32d8c99a49a05f1a7717d4262}{ +void \hyperlink{classReactiveThread_8263c2a32d8c99a49a05f1a7717d4262}{sleep} ()} +\label{classReactiveThread_8263c2a32d8c99a49a05f1a7717d4262} + +\item +\hypertarget{classReactiveThread_a724a54575de10f09cc03ab7aa4e59ce}{ +void \hyperlink{classReactiveThread_a724a54575de10f09cc03ab7aa4e59ce}{wake\-Up} ()} +\label{classReactiveThread_a724a54575de10f09cc03ab7aa4e59ce} + +\end{CompactItemize} +\subsection*{Private Attributes} +\begin{CompactItemize} +\item +\hypertarget{classReactiveThread_915e5a42dc8cb1bcf6738d5fe883a4e7}{ +sem\_\-t \hyperlink{classReactiveThread_915e5a42dc8cb1bcf6738d5fe883a4e7}{sem}} +\label{classReactiveThread_915e5a42dc8cb1bcf6738d5fe883a4e7} + +\end{CompactItemize} + + +\subsection{Detailed Description} + + + + +Definition at line 16 of file reac\_\-thread.h. + +The documentation for this class was generated from the following files:\begin{CompactItemize} +\item +reac\_\-thread.h\item +reac\_\-thread.cpp\end{CompactItemize} diff --git a/branches/paradiseo-peo-meta-model/doc/latex/classRingTopology.eps b/branches/paradiseo-peo-meta-model/doc/latex/classRingTopology.eps new file mode 100644 index 000000000..04c98c56e --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/latex/classRingTopology.eps @@ -0,0 +1,197 @@ +%!PS-Adobe-2.0 EPSF-2.0 +%%Title: ClassName +%%Creator: Doxygen +%%CreationDate: Time +%%For: +%Magnification: 1.00 +%%Orientation: Portrait +%%BoundingBox: 0 0 500 412.371 +%%Pages: 0 +%%BeginSetup +%%EndSetup +%%EndComments + +% ----- variables ----- + +/boxwidth 0 def +/boxheight 40 def +/fontheight 24 def +/marginwidth 10 def +/distx 20 def +/disty 40 def +/boundaspect 1.2125 def % aspect ratio of the BoundingBox (width/height) +/boundx 500 def +/boundy boundx boundaspect div def +/xspacing 0 def +/yspacing 0 def +/rows 2 def +/cols 1 def +/scalefactor 0 def +/boxfont /Times-Roman findfont fontheight scalefont def + +% ----- procedures ----- + +/dotted { [1 4] 0 setdash } def +/dashed { [5] 0 setdash } def +/solid { [] 0 setdash } def + +/max % result = MAX(arg1,arg2) +{ + /a exch def + /b exch def + a b gt {a} {b} ifelse +} def + +/xoffset % result = MAX(0,(scalefactor-(boxwidth*cols+distx*(cols-1)))/2) +{ + 0 scalefactor boxwidth cols mul distx cols 1 sub mul add sub 2 div max +} def + +/cw % boxwidth = MAX(boxwidth, stringwidth(arg1)) +{ + /str exch def + /boxwidth boxwidth str stringwidth pop max def +} def + +/box % draws a box with text `arg1' at grid pos (arg2,arg3) +{ gsave + 2 setlinewidth + newpath + exch xspacing mul xoffset add + exch yspacing mul + moveto + boxwidth 0 rlineto + 0 boxheight rlineto + boxwidth neg 0 rlineto + 0 boxheight neg rlineto + closepath + dup stringwidth pop neg boxwidth add 2 div + boxheight fontheight 2 div sub 2 div + rmoveto show stroke + grestore +} def + +/mark +{ newpath + exch xspacing mul xoffset add boxwidth add + exch yspacing mul + moveto + 0 boxheight 4 div rlineto + boxheight neg 4 div boxheight neg 4 div rlineto + closepath + eofill + stroke +} def + +/arrow +{ newpath + moveto + 3 -8 rlineto + -6 0 rlineto + 3 8 rlineto + closepath + eofill + stroke +} def + +/out % draws an output connector for the block at (arg1,arg2) +{ + newpath + exch xspacing mul xoffset add boxwidth 2 div add + exch yspacing mul boxheight add + /y exch def + /x exch def + x y moveto + 0 disty 2 div rlineto + stroke + 1 eq { x y disty 2 div add arrow } if +} def + +/in % draws an input connector for the block at (arg1,arg2) +{ + newpath + exch xspacing mul xoffset add boxwidth 2 div add + exch yspacing mul disty 2 div sub + /y exch def + /x exch def + x y moveto + 0 disty 2 div rlineto + stroke + 1 eq { x y disty 2 div add arrow } if +} def + +/hedge +{ + exch xspacing mul xoffset add boxwidth 2 div add + exch yspacing mul boxheight 2 div sub + /y exch def + /x exch def + newpath + x y moveto + boxwidth 2 div distx add 0 rlineto + stroke + 1 eq + { newpath x boxwidth 2 div distx add add y moveto + -8 3 rlineto + 0 -6 rlineto + 8 3 rlineto + closepath + eofill + stroke + } if +} def + +/vedge +{ + /ye exch def + /ys exch def + /xs exch def + newpath + xs xspacing mul xoffset add boxwidth 2 div add dup + ys yspacing mul boxheight 2 div sub + moveto + ye yspacing mul boxheight 2 div sub + lineto + stroke +} def + +/conn % connections the blocks from col `arg1' to `arg2' of row `arg3' +{ + /ys exch def + /xe exch def + /xs exch def + newpath + xs xspacing mul xoffset add boxwidth 2 div add + ys yspacing mul disty 2 div sub + moveto + xspacing xe xs sub mul 0 + rlineto + stroke +} def + +% ----- main ------ + +boxfont setfont +1 boundaspect scale +(RingTopology) cw +(Topology) cw +/boxwidth boxwidth marginwidth 2 mul add def +/xspacing boxwidth distx add def +/yspacing boxheight disty add def +/scalefactor + boxwidth cols mul distx cols 1 sub mul add + boxheight rows mul disty rows 1 sub mul add boundaspect mul + max def +boundx scalefactor div boundy scalefactor div scale + +% ----- classes ----- + + (RingTopology) 0 0 box + (Topology) 0 1 box + +% ----- relations ----- + +solid +0 0 0 out +solid +1 0 1 in diff --git a/branches/paradiseo-peo-meta-model/doc/latex/classRingTopology.tex b/branches/paradiseo-peo-meta-model/doc/latex/classRingTopology.tex new file mode 100644 index 000000000..379dd1961 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/latex/classRingTopology.tex @@ -0,0 +1,31 @@ +\hypertarget{classRingTopology}{ +\section{Ring\-Topology Class Reference} +\label{classRingTopology}\index{RingTopology@{RingTopology}} +} +Inheritance diagram for Ring\-Topology::\begin{figure}[H] +\begin{center} +\leavevmode +\includegraphics[height=2cm]{classRingTopology} +\end{center} +\end{figure} +\subsection*{Public Member Functions} +\begin{CompactItemize} +\item +\hypertarget{classRingTopology_292a7746993788f96042f2f628cfcbc5}{ +void \hyperlink{classRingTopology_292a7746993788f96042f2f628cfcbc5}{set\-Neighbors} (\hyperlink{classCooperative}{Cooperative} $\ast$\_\-\_\-mig, std::vector$<$ \hyperlink{classCooperative}{Cooperative} $\ast$ $>$ \&\_\-\_\-from, std::vector$<$ \hyperlink{classCooperative}{Cooperative} $\ast$ $>$ \&\_\-\_\-to)} +\label{classRingTopology_292a7746993788f96042f2f628cfcbc5} + +\end{CompactItemize} + + +\subsection{Detailed Description} + + + + +Definition at line 14 of file ring\_\-topo.h. + +The documentation for this class was generated from the following files:\begin{CompactItemize} +\item +ring\_\-topo.h\item +ring\_\-topo.cpp\end{CompactItemize} diff --git a/branches/paradiseo-peo-meta-model/doc/latex/classRunner.eps b/branches/paradiseo-peo-meta-model/doc/latex/classRunner.eps new file mode 100644 index 000000000..6e1d6846c --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/latex/classRunner.eps @@ -0,0 +1,209 @@ +%!PS-Adobe-2.0 EPSF-2.0 +%%Title: ClassName +%%Creator: Doxygen +%%CreationDate: Time +%%For: +%Magnification: 1.00 +%%Orientation: Portrait +%%BoundingBox: 0 0 500 280.374 +%%Pages: 0 +%%BeginSetup +%%EndSetup +%%EndComments + +% ----- variables ----- + +/boxwidth 0 def +/boxheight 40 def +/fontheight 24 def +/marginwidth 10 def +/distx 20 def +/disty 40 def +/boundaspect 1.78333 def % aspect ratio of the BoundingBox (width/height) +/boundx 500 def +/boundy boundx boundaspect div def +/xspacing 0 def +/yspacing 0 def +/rows 3 def +/cols 2 def +/scalefactor 0 def +/boxfont /Times-Roman findfont fontheight scalefont def + +% ----- procedures ----- + +/dotted { [1 4] 0 setdash } def +/dashed { [5] 0 setdash } def +/solid { [] 0 setdash } def + +/max % result = MAX(arg1,arg2) +{ + /a exch def + /b exch def + a b gt {a} {b} ifelse +} def + +/xoffset % result = MAX(0,(scalefactor-(boxwidth*cols+distx*(cols-1)))/2) +{ + 0 scalefactor boxwidth cols mul distx cols 1 sub mul add sub 2 div max +} def + +/cw % boxwidth = MAX(boxwidth, stringwidth(arg1)) +{ + /str exch def + /boxwidth boxwidth str stringwidth pop max def +} def + +/box % draws a box with text `arg1' at grid pos (arg2,arg3) +{ gsave + 2 setlinewidth + newpath + exch xspacing mul xoffset add + exch yspacing mul + moveto + boxwidth 0 rlineto + 0 boxheight rlineto + boxwidth neg 0 rlineto + 0 boxheight neg rlineto + closepath + dup stringwidth pop neg boxwidth add 2 div + boxheight fontheight 2 div sub 2 div + rmoveto show stroke + grestore +} def + +/mark +{ newpath + exch xspacing mul xoffset add boxwidth add + exch yspacing mul + moveto + 0 boxheight 4 div rlineto + boxheight neg 4 div boxheight neg 4 div rlineto + closepath + eofill + stroke +} def + +/arrow +{ newpath + moveto + 3 -8 rlineto + -6 0 rlineto + 3 8 rlineto + closepath + eofill + stroke +} def + +/out % draws an output connector for the block at (arg1,arg2) +{ + newpath + exch xspacing mul xoffset add boxwidth 2 div add + exch yspacing mul boxheight add + /y exch def + /x exch def + x y moveto + 0 disty 2 div rlineto + stroke + 1 eq { x y disty 2 div add arrow } if +} def + +/in % draws an input connector for the block at (arg1,arg2) +{ + newpath + exch xspacing mul xoffset add boxwidth 2 div add + exch yspacing mul disty 2 div sub + /y exch def + /x exch def + x y moveto + 0 disty 2 div rlineto + stroke + 1 eq { x y disty 2 div add arrow } if +} def + +/hedge +{ + exch xspacing mul xoffset add boxwidth 2 div add + exch yspacing mul boxheight 2 div sub + /y exch def + /x exch def + newpath + x y moveto + boxwidth 2 div distx add 0 rlineto + stroke + 1 eq + { newpath x boxwidth 2 div distx add add y moveto + -8 3 rlineto + 0 -6 rlineto + 8 3 rlineto + closepath + eofill + stroke + } if +} def + +/vedge +{ + /ye exch def + /ys exch def + /xs exch def + newpath + xs xspacing mul xoffset add boxwidth 2 div add dup + ys yspacing mul boxheight 2 div sub + moveto + ye yspacing mul boxheight 2 div sub + lineto + stroke +} def + +/conn % connections the blocks from col `arg1' to `arg2' of row `arg3' +{ + /ys exch def + /xe exch def + /xs exch def + newpath + xs xspacing mul xoffset add boxwidth 2 div add + ys yspacing mul disty 2 div sub + moveto + xspacing xe xs sub mul 0 + rlineto + stroke +} def + +% ----- main ------ + +boxfont setfont +1 boundaspect scale +(Runner) cw +(Communicable) cw +(Thread) cw +(peoEA< EOT >) cw +/boxwidth boxwidth marginwidth 2 mul add def +/xspacing boxwidth distx add def +/yspacing boxheight disty add def +/scalefactor + boxwidth cols mul distx cols 1 sub mul add + boxheight rows mul disty rows 1 sub mul add boundaspect mul + max def +boundx scalefactor div boundy scalefactor div scale + +% ----- classes ----- + + (Runner) 0.5 1 box + (Communicable) 0 2 box + (Thread) 1 2 box + (peoEA< EOT >) 0.5 0 box + +% ----- relations ----- + +solid +0 0.5 1 out +solid +0 1 2 conn +solid +1 0 2 in +solid +1 1 2 in +solid +1 0.5 0.25 out +solid +0 0.5 0.75 in diff --git a/branches/paradiseo-peo-meta-model/doc/latex/classRunner.tex b/branches/paradiseo-peo-meta-model/doc/latex/classRunner.tex new file mode 100644 index 000000000..5fc2e5e12 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/latex/classRunner.tex @@ -0,0 +1,80 @@ +\hypertarget{classRunner}{ +\section{Runner Class Reference} +\label{classRunner}\index{Runner@{Runner}} +} +Inheritance diagram for Runner::\begin{figure}[H] +\begin{center} +\leavevmode +\includegraphics[height=3cm]{classRunner} +\end{center} +\end{figure} +\subsection*{Public Member Functions} +\begin{CompactItemize} +\item +\hypertarget{classRunner_7acb8258c21da9daa62f9a177a2e5acd}{ +\hyperlink{classRunner_7acb8258c21da9daa62f9a177a2e5acd}{Runner} ()} +\label{classRunner_7acb8258c21da9daa62f9a177a2e5acd} + +\item +\hypertarget{classRunner_7dc4419051fcc5cc9dadd54ecc9cd47d}{ +void \hyperlink{classRunner_7dc4419051fcc5cc9dadd54ecc9cd47d}{start} ()} +\label{classRunner_7dc4419051fcc5cc9dadd54ecc9cd47d} + +\item +\hypertarget{classRunner_5bc239db2be753b77369fa9a038769fd}{ +void \hyperlink{classRunner_5bc239db2be753b77369fa9a038769fd}{wait\-Starting} ()} +\label{classRunner_5bc239db2be753b77369fa9a038769fd} + +\item +\hypertarget{classRunner_40adbfb7d6944189b4fff60b02e669ca}{ +bool \hyperlink{classRunner_40adbfb7d6944189b4fff60b02e669ca}{is\-Local} ()} +\label{classRunner_40adbfb7d6944189b4fff60b02e669ca} + +\item +\hypertarget{classRunner_0f133e75c28fb8264549814f80608e68}{ +void \hyperlink{classRunner_0f133e75c28fb8264549814f80608e68}{terminate} ()} +\label{classRunner_0f133e75c28fb8264549814f80608e68} + +\item +\hypertarget{classRunner_5026c74eec184e3a15cb3c0ec4200a57}{ +RUNNER\_\-ID \hyperlink{classRunner_5026c74eec184e3a15cb3c0ec4200a57}{get\-ID} ()} +\label{classRunner_5026c74eec184e3a15cb3c0ec4200a57} + +\item +\hypertarget{classRunner_2ad6d199d684d6f34347fc202ffe2fa3}{ +void \hyperlink{classRunner_2ad6d199d684d6f34347fc202ffe2fa3}{pack\-Termination} ()} +\label{classRunner_2ad6d199d684d6f34347fc202ffe2fa3} + +\item +\hypertarget{classRunner_3591be473e0fcee1105fb57319b529aa}{ +void \hyperlink{classRunner_3591be473e0fcee1105fb57319b529aa}{notify\-Sending\-Termination} ()} +\label{classRunner_3591be473e0fcee1105fb57319b529aa} + +\end{CompactItemize} +\subsection*{Private Attributes} +\begin{CompactItemize} +\item +\hypertarget{classRunner_4b0827d5df2df632db4ab71dd55e81b2}{ +sem\_\-t \hyperlink{classRunner_4b0827d5df2df632db4ab71dd55e81b2}{sem\_\-start}} +\label{classRunner_4b0827d5df2df632db4ab71dd55e81b2} + +\item +\hypertarget{classRunner_1989c1f8e0b0b54ad2e60a341007e59d}{ +unsigned \hyperlink{classRunner_1989c1f8e0b0b54ad2e60a341007e59d}{id}} +\label{classRunner_1989c1f8e0b0b54ad2e60a341007e59d} + +\end{CompactItemize} + + +\subsection{Detailed Description} + + + + +Definition at line 19 of file runner.h. + +The documentation for this class was generated from the following files:\begin{CompactItemize} +\item +runner.h\item +core/runner.cpp\item +rmc/mpi/runner.cpp\end{CompactItemize} diff --git a/branches/paradiseo-peo-meta-model/doc/latex/classService.eps b/branches/paradiseo-peo-meta-model/doc/latex/classService.eps new file mode 100644 index 000000000..77ffc2408 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/latex/classService.eps @@ -0,0 +1,237 @@ +%!PS-Adobe-2.0 EPSF-2.0 +%%Title: ClassName +%%Creator: Doxygen +%%CreationDate: Time +%%For: +%Magnification: 1.00 +%%Orientation: Portrait +%%BoundingBox: 0 0 500 100 +%%Pages: 0 +%%BeginSetup +%%EndSetup +%%EndComments + +% ----- variables ----- + +/boxwidth 0 def +/boxheight 40 def +/fontheight 24 def +/marginwidth 10 def +/distx 20 def +/disty 40 def +/boundaspect 5 def % aspect ratio of the BoundingBox (width/height) +/boundx 500 def +/boundy boundx boundaspect div def +/xspacing 0 def +/yspacing 0 def +/rows 4 def +/cols 4 def +/scalefactor 0 def +/boxfont /Times-Roman findfont fontheight scalefont def + +% ----- procedures ----- + +/dotted { [1 4] 0 setdash } def +/dashed { [5] 0 setdash } def +/solid { [] 0 setdash } def + +/max % result = MAX(arg1,arg2) +{ + /a exch def + /b exch def + a b gt {a} {b} ifelse +} def + +/xoffset % result = MAX(0,(scalefactor-(boxwidth*cols+distx*(cols-1)))/2) +{ + 0 scalefactor boxwidth cols mul distx cols 1 sub mul add sub 2 div max +} def + +/cw % boxwidth = MAX(boxwidth, stringwidth(arg1)) +{ + /str exch def + /boxwidth boxwidth str stringwidth pop max def +} def + +/box % draws a box with text `arg1' at grid pos (arg2,arg3) +{ gsave + 2 setlinewidth + newpath + exch xspacing mul xoffset add + exch yspacing mul + moveto + boxwidth 0 rlineto + 0 boxheight rlineto + boxwidth neg 0 rlineto + 0 boxheight neg rlineto + closepath + dup stringwidth pop neg boxwidth add 2 div + boxheight fontheight 2 div sub 2 div + rmoveto show stroke + grestore +} def + +/mark +{ newpath + exch xspacing mul xoffset add boxwidth add + exch yspacing mul + moveto + 0 boxheight 4 div rlineto + boxheight neg 4 div boxheight neg 4 div rlineto + closepath + eofill + stroke +} def + +/arrow +{ newpath + moveto + 3 -8 rlineto + -6 0 rlineto + 3 8 rlineto + closepath + eofill + stroke +} def + +/out % draws an output connector for the block at (arg1,arg2) +{ + newpath + exch xspacing mul xoffset add boxwidth 2 div add + exch yspacing mul boxheight add + /y exch def + /x exch def + x y moveto + 0 disty 2 div rlineto + stroke + 1 eq { x y disty 2 div add arrow } if +} def + +/in % draws an input connector for the block at (arg1,arg2) +{ + newpath + exch xspacing mul xoffset add boxwidth 2 div add + exch yspacing mul disty 2 div sub + /y exch def + /x exch def + x y moveto + 0 disty 2 div rlineto + stroke + 1 eq { x y disty 2 div add arrow } if +} def + +/hedge +{ + exch xspacing mul xoffset add boxwidth 2 div add + exch yspacing mul boxheight 2 div sub + /y exch def + /x exch def + newpath + x y moveto + boxwidth 2 div distx add 0 rlineto + stroke + 1 eq + { newpath x boxwidth 2 div distx add add y moveto + -8 3 rlineto + 0 -6 rlineto + 8 3 rlineto + closepath + eofill + stroke + } if +} def + +/vedge +{ + /ye exch def + /ys exch def + /xs exch def + newpath + xs xspacing mul xoffset add boxwidth 2 div add dup + ys yspacing mul boxheight 2 div sub + moveto + ye yspacing mul boxheight 2 div sub + lineto + stroke +} def + +/conn % connections the blocks from col `arg1' to `arg2' of row `arg3' +{ + /ys exch def + /xe exch def + /xs exch def + newpath + xs xspacing mul xoffset add boxwidth 2 div add + ys yspacing mul disty 2 div sub + moveto + xspacing xe xs sub mul 0 + rlineto + stroke +} def + +% ----- main ------ + +boxfont setfont +1 boundaspect scale +(Service) cw +(Communicable) cw +(peoPopEval< EOT >) cw +(peoSyncMultiStart< EOT >) cw +(peoTransform< EOT >) cw +(peoParaPopEval< EOT >) cw +(peoSeqPopEval< EOT >) cw +(peoParaSGATransform< EOT >) cw +(peoSeqTransform< EOT >) cw +/boxwidth boxwidth marginwidth 2 mul add def +/xspacing boxwidth distx add def +/yspacing boxheight disty add def +/scalefactor + boxwidth cols mul distx cols 1 sub mul add + boxheight rows mul disty rows 1 sub mul add boundaspect mul + max def +boundx scalefactor div boundy scalefactor div scale + +% ----- classes ----- + + (Service) 1.5 2 box + (Communicable) 1.5 3 box + (peoPopEval< EOT >) 0.5 1 box + (peoSyncMultiStart< EOT >) 1.5 1 box + (peoTransform< EOT >) 2.5 1 box + (peoParaPopEval< EOT >) 0 0 box + (peoSeqPopEval< EOT >) 1 0 box + (peoParaSGATransform< EOT >) 2 0 box + (peoSeqTransform< EOT >) 3 0 box + +% ----- relations ----- + +solid +0 1.5 2 out +solid +1 1.5 3 in +solid +1 1.5 1.25 out +solid +0.5 2.5 2 conn +solid +0 0.5 1.75 in +solid +1 0.5 0.25 out +solid +0 1 1 conn +solid +0 1.5 1.75 in +solid +0 2.5 1.75 in +solid +1 2.5 0.25 out +solid +2 3 1 conn +solid +0 0 0.75 in +solid +0 1 0.75 in +solid +0 2 0.75 in +solid +0 3 0.75 in diff --git a/branches/paradiseo-peo-meta-model/doc/latex/classService.tex b/branches/paradiseo-peo-meta-model/doc/latex/classService.tex new file mode 100644 index 000000000..7d0ea5f92 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/latex/classService.tex @@ -0,0 +1,100 @@ +\hypertarget{classService}{ +\section{Service Class Reference} +\label{classService}\index{Service@{Service}} +} +Inheritance diagram for Service::\begin{figure}[H] +\begin{center} +\leavevmode +\includegraphics[height=2.8cm]{classService} +\end{center} +\end{figure} +\subsection*{Public Member Functions} +\begin{CompactItemize} +\item +\hypertarget{classService_33b149b98498c0e7e401b0f0839d7f0d}{ +void \hyperlink{classService_33b149b98498c0e7e401b0f0839d7f0d}{set\-Owner} (\hyperlink{classThread}{Thread} \&\_\-\_\-owner)} +\label{classService_33b149b98498c0e7e401b0f0839d7f0d} + +\item +\hypertarget{classService_0dae00309c51a7b7069788142aed799f}{ +\hyperlink{classThread}{Thread} $\ast$ \hyperlink{classService_0dae00309c51a7b7069788142aed799f}{get\-Owner} ()} +\label{classService_0dae00309c51a7b7069788142aed799f} + +\item +\hypertarget{classService_7e2ae35a9070a05dcd46488df649896d}{ +void \hyperlink{classService_7e2ae35a9070a05dcd46488df649896d}{request\-Resource\-Request} (unsigned \_\-\_\-how\_\-many=1)} +\label{classService_7e2ae35a9070a05dcd46488df649896d} + +\item +\hypertarget{classService_c4289f98d1cd9ed53e850efbb6a947bd}{ +void \hyperlink{classService_c4289f98d1cd9ed53e850efbb6a947bd}{pack\-Resource\-Request} ()} +\label{classService_c4289f98d1cd9ed53e850efbb6a947bd} + +\item +\hypertarget{classService_aea4b8f7f8fb88e83862ee4bfd9ab207}{ +virtual void \hyperlink{classService_aea4b8f7f8fb88e83862ee4bfd9ab207}{pack\-Data} ()} +\label{classService_aea4b8f7f8fb88e83862ee4bfd9ab207} + +\item +\hypertarget{classService_3bd87b444710813d30fd754d4d0b4df3}{ +virtual void \hyperlink{classService_3bd87b444710813d30fd754d4d0b4df3}{unpack\-Data} ()} +\label{classService_3bd87b444710813d30fd754d4d0b4df3} + +\item +\hypertarget{classService_e4f2894e6121e60f38d41cfbd7447ae4}{ +virtual void \hyperlink{classService_e4f2894e6121e60f38d41cfbd7447ae4}{execute} ()} +\label{classService_e4f2894e6121e60f38d41cfbd7447ae4} + +\item +\hypertarget{classService_e5e4f90b2315e15c2a2913bd370f4cf5}{ +virtual void \hyperlink{classService_e5e4f90b2315e15c2a2913bd370f4cf5}{pack\-Result} ()} +\label{classService_e5e4f90b2315e15c2a2913bd370f4cf5} + +\item +\hypertarget{classService_45c06344edbfa482b91f68e2035a6099}{ +virtual void \hyperlink{classService_45c06344edbfa482b91f68e2035a6099}{unpack\-Result} ()} +\label{classService_45c06344edbfa482b91f68e2035a6099} + +\item +\hypertarget{classService_81ad4d6ebb50045b8977e2ab74826f30}{ +virtual void \hyperlink{classService_81ad4d6ebb50045b8977e2ab74826f30}{notify\-Sending\-Data} ()} +\label{classService_81ad4d6ebb50045b8977e2ab74826f30} + +\item +\hypertarget{classService_94e2012e76aaae3aa8199250f558d503}{ +virtual void \hyperlink{classService_94e2012e76aaae3aa8199250f558d503}{notify\-Sending\-Resource\-Request} ()} +\label{classService_94e2012e76aaae3aa8199250f558d503} + +\item +\hypertarget{classService_f94cc8a5c2665d4574041737e61e9ffc}{ +virtual void \hyperlink{classService_f94cc8a5c2665d4574041737e61e9ffc}{notify\-Sending\-All\-Resource\-Requests} ()} +\label{classService_f94cc8a5c2665d4574041737e61e9ffc} + +\end{CompactItemize} +\subsection*{Private Attributes} +\begin{CompactItemize} +\item +\hypertarget{classService_8b615c65c876f342fe8209eb7e36d7b2}{ +\hyperlink{classThread}{Thread} $\ast$ \hyperlink{classService_8b615c65c876f342fe8209eb7e36d7b2}{owner}} +\label{classService_8b615c65c876f342fe8209eb7e36d7b2} + +\item +\hypertarget{classService_a5b2ad9520bb3710b54348b99acebd58}{ +unsigned \hyperlink{classService_a5b2ad9520bb3710b54348b99acebd58}{num\_\-sent\_\-rr}} +\label{classService_a5b2ad9520bb3710b54348b99acebd58} + +\end{CompactItemize} + + +\subsection{Detailed Description} + + + + +Definition at line 17 of file service.h. + +The documentation for this class was generated from the following files:\begin{CompactItemize} +\item +service.h\item +core/service.cpp\item +rmc/mpi/service.cpp\end{CompactItemize} diff --git a/branches/paradiseo-peo-meta-model/doc/latex/classThread.eps b/branches/paradiseo-peo-meta-model/doc/latex/classThread.eps new file mode 100644 index 000000000..e02a5f5fe --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/latex/classThread.eps @@ -0,0 +1,221 @@ +%!PS-Adobe-2.0 EPSF-2.0 +%%Title: ClassName +%%Creator: Doxygen +%%CreationDate: Time +%%For: +%Magnification: 1.00 +%%Orientation: Portrait +%%BoundingBox: 0 0 500 183.486 +%%Pages: 0 +%%BeginSetup +%%EndSetup +%%EndComments + +% ----- variables ----- + +/boxwidth 0 def +/boxheight 40 def +/fontheight 24 def +/marginwidth 10 def +/distx 20 def +/disty 40 def +/boundaspect 2.725 def % aspect ratio of the BoundingBox (width/height) +/boundx 500 def +/boundy boundx boundaspect div def +/xspacing 0 def +/yspacing 0 def +/rows 3 def +/cols 3 def +/scalefactor 0 def +/boxfont /Times-Roman findfont fontheight scalefont def + +% ----- procedures ----- + +/dotted { [1 4] 0 setdash } def +/dashed { [5] 0 setdash } def +/solid { [] 0 setdash } def + +/max % result = MAX(arg1,arg2) +{ + /a exch def + /b exch def + a b gt {a} {b} ifelse +} def + +/xoffset % result = MAX(0,(scalefactor-(boxwidth*cols+distx*(cols-1)))/2) +{ + 0 scalefactor boxwidth cols mul distx cols 1 sub mul add sub 2 div max +} def + +/cw % boxwidth = MAX(boxwidth, stringwidth(arg1)) +{ + /str exch def + /boxwidth boxwidth str stringwidth pop max def +} def + +/box % draws a box with text `arg1' at grid pos (arg2,arg3) +{ gsave + 2 setlinewidth + newpath + exch xspacing mul xoffset add + exch yspacing mul + moveto + boxwidth 0 rlineto + 0 boxheight rlineto + boxwidth neg 0 rlineto + 0 boxheight neg rlineto + closepath + dup stringwidth pop neg boxwidth add 2 div + boxheight fontheight 2 div sub 2 div + rmoveto show stroke + grestore +} def + +/mark +{ newpath + exch xspacing mul xoffset add boxwidth add + exch yspacing mul + moveto + 0 boxheight 4 div rlineto + boxheight neg 4 div boxheight neg 4 div rlineto + closepath + eofill + stroke +} def + +/arrow +{ newpath + moveto + 3 -8 rlineto + -6 0 rlineto + 3 8 rlineto + closepath + eofill + stroke +} def + +/out % draws an output connector for the block at (arg1,arg2) +{ + newpath + exch xspacing mul xoffset add boxwidth 2 div add + exch yspacing mul boxheight add + /y exch def + /x exch def + x y moveto + 0 disty 2 div rlineto + stroke + 1 eq { x y disty 2 div add arrow } if +} def + +/in % draws an input connector for the block at (arg1,arg2) +{ + newpath + exch xspacing mul xoffset add boxwidth 2 div add + exch yspacing mul disty 2 div sub + /y exch def + /x exch def + x y moveto + 0 disty 2 div rlineto + stroke + 1 eq { x y disty 2 div add arrow } if +} def + +/hedge +{ + exch xspacing mul xoffset add boxwidth 2 div add + exch yspacing mul boxheight 2 div sub + /y exch def + /x exch def + newpath + x y moveto + boxwidth 2 div distx add 0 rlineto + stroke + 1 eq + { newpath x boxwidth 2 div distx add add y moveto + -8 3 rlineto + 0 -6 rlineto + 8 3 rlineto + closepath + eofill + stroke + } if +} def + +/vedge +{ + /ye exch def + /ys exch def + /xs exch def + newpath + xs xspacing mul xoffset add boxwidth 2 div add dup + ys yspacing mul boxheight 2 div sub + moveto + ye yspacing mul boxheight 2 div sub + lineto + stroke +} def + +/conn % connections the blocks from col `arg1' to `arg2' of row `arg3' +{ + /ys exch def + /xe exch def + /xs exch def + newpath + xs xspacing mul xoffset add boxwidth 2 div add + ys yspacing mul disty 2 div sub + moveto + xspacing xe xs sub mul 0 + rlineto + stroke +} def + +% ----- main ------ + +boxfont setfont +1 boundaspect scale +(Thread) cw +(ReactiveThread) cw +(Runner) cw +(Communicator) cw +(Worker) cw +(peoEA< EOT >) cw +/boxwidth boxwidth marginwidth 2 mul add def +/xspacing boxwidth distx add def +/yspacing boxheight disty add def +/scalefactor + boxwidth cols mul distx cols 1 sub mul add + boxheight rows mul disty rows 1 sub mul add boundaspect mul + max def +boundx scalefactor div boundy scalefactor div scale + +% ----- classes ----- + + (Thread) 1.25 2 box + (ReactiveThread) 0.5 1 box + (Runner) 2 1 box + (Communicator) 0 0 box + (Worker) 1 0 box + (peoEA< EOT >) 2 0 box + +% ----- relations ----- + +solid +1 1.25 1.25 out +solid +0.5 2 2 conn +solid +0 0.5 1.75 in +solid +1 0.5 0.25 out +solid +0 1 1 conn +solid +0 2 1.75 in +solid +1 2 0.25 out +solid +0 0 0.75 in +solid +0 1 0.75 in +solid +0 2 0.75 in diff --git a/branches/paradiseo-peo-meta-model/doc/latex/classThread.tex b/branches/paradiseo-peo-meta-model/doc/latex/classThread.tex new file mode 100644 index 000000000..46d9b9d3e --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/latex/classThread.tex @@ -0,0 +1,54 @@ +\hypertarget{classThread}{ +\section{Thread Class Reference} +\label{classThread}\index{Thread@{Thread}} +} +Inheritance diagram for Thread::\begin{figure}[H] +\begin{center} +\leavevmode +\includegraphics[height=3cm]{classThread} +\end{center} +\end{figure} +\subsection*{Public Member Functions} +\begin{CompactItemize} +\item +\hypertarget{classThread_95c703fb8f2f27cb64f475a8c940864a}{ +\hyperlink{classThread_95c703fb8f2f27cb64f475a8c940864a}{Thread} ()} +\label{classThread_95c703fb8f2f27cb64f475a8c940864a} + +\item +\hypertarget{classThread_37d9edd3a1a776cbc27dedff949c9726}{ +virtual \hyperlink{classThread_37d9edd3a1a776cbc27dedff949c9726}{$\sim$Thread} ()} +\label{classThread_37d9edd3a1a776cbc27dedff949c9726} + +\item +\hypertarget{classThread_e197c46f8f62ecce6d2a7fe95bdc5b38}{ +void \hyperlink{classThread_e197c46f8f62ecce6d2a7fe95bdc5b38}{set\-Active} ()} +\label{classThread_e197c46f8f62ecce6d2a7fe95bdc5b38} + +\item +\hypertarget{classThread_20632ffe9ddfa2a478afb0c84dc1096b}{ +void \hyperlink{classThread_20632ffe9ddfa2a478afb0c84dc1096b}{set\-Passive} ()} +\label{classThread_20632ffe9ddfa2a478afb0c84dc1096b} + +\end{CompactItemize} +\subsection*{Private Attributes} +\begin{CompactItemize} +\item +\hypertarget{classThread_1b155d63bca3096ac4a1d039aea83c7c}{ +bool \hyperlink{classThread_1b155d63bca3096ac4a1d039aea83c7c}{act}} +\label{classThread_1b155d63bca3096ac4a1d039aea83c7c} + +\end{CompactItemize} + + +\subsection{Detailed Description} + + + + +Definition at line 16 of file thread.h. + +The documentation for this class was generated from the following files:\begin{CompactItemize} +\item +thread.h\item +thread.cpp\end{CompactItemize} diff --git a/branches/paradiseo-peo-meta-model/doc/latex/classTopology.eps b/branches/paradiseo-peo-meta-model/doc/latex/classTopology.eps new file mode 100644 index 000000000..45dacefa6 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/latex/classTopology.eps @@ -0,0 +1,197 @@ +%!PS-Adobe-2.0 EPSF-2.0 +%%Title: ClassName +%%Creator: Doxygen +%%CreationDate: Time +%%For: +%Magnification: 1.00 +%%Orientation: Portrait +%%BoundingBox: 0 0 500 412.371 +%%Pages: 0 +%%BeginSetup +%%EndSetup +%%EndComments + +% ----- variables ----- + +/boxwidth 0 def +/boxheight 40 def +/fontheight 24 def +/marginwidth 10 def +/distx 20 def +/disty 40 def +/boundaspect 1.2125 def % aspect ratio of the BoundingBox (width/height) +/boundx 500 def +/boundy boundx boundaspect div def +/xspacing 0 def +/yspacing 0 def +/rows 2 def +/cols 1 def +/scalefactor 0 def +/boxfont /Times-Roman findfont fontheight scalefont def + +% ----- procedures ----- + +/dotted { [1 4] 0 setdash } def +/dashed { [5] 0 setdash } def +/solid { [] 0 setdash } def + +/max % result = MAX(arg1,arg2) +{ + /a exch def + /b exch def + a b gt {a} {b} ifelse +} def + +/xoffset % result = MAX(0,(scalefactor-(boxwidth*cols+distx*(cols-1)))/2) +{ + 0 scalefactor boxwidth cols mul distx cols 1 sub mul add sub 2 div max +} def + +/cw % boxwidth = MAX(boxwidth, stringwidth(arg1)) +{ + /str exch def + /boxwidth boxwidth str stringwidth pop max def +} def + +/box % draws a box with text `arg1' at grid pos (arg2,arg3) +{ gsave + 2 setlinewidth + newpath + exch xspacing mul xoffset add + exch yspacing mul + moveto + boxwidth 0 rlineto + 0 boxheight rlineto + boxwidth neg 0 rlineto + 0 boxheight neg rlineto + closepath + dup stringwidth pop neg boxwidth add 2 div + boxheight fontheight 2 div sub 2 div + rmoveto show stroke + grestore +} def + +/mark +{ newpath + exch xspacing mul xoffset add boxwidth add + exch yspacing mul + moveto + 0 boxheight 4 div rlineto + boxheight neg 4 div boxheight neg 4 div rlineto + closepath + eofill + stroke +} def + +/arrow +{ newpath + moveto + 3 -8 rlineto + -6 0 rlineto + 3 8 rlineto + closepath + eofill + stroke +} def + +/out % draws an output connector for the block at (arg1,arg2) +{ + newpath + exch xspacing mul xoffset add boxwidth 2 div add + exch yspacing mul boxheight add + /y exch def + /x exch def + x y moveto + 0 disty 2 div rlineto + stroke + 1 eq { x y disty 2 div add arrow } if +} def + +/in % draws an input connector for the block at (arg1,arg2) +{ + newpath + exch xspacing mul xoffset add boxwidth 2 div add + exch yspacing mul disty 2 div sub + /y exch def + /x exch def + x y moveto + 0 disty 2 div rlineto + stroke + 1 eq { x y disty 2 div add arrow } if +} def + +/hedge +{ + exch xspacing mul xoffset add boxwidth 2 div add + exch yspacing mul boxheight 2 div sub + /y exch def + /x exch def + newpath + x y moveto + boxwidth 2 div distx add 0 rlineto + stroke + 1 eq + { newpath x boxwidth 2 div distx add add y moveto + -8 3 rlineto + 0 -6 rlineto + 8 3 rlineto + closepath + eofill + stroke + } if +} def + +/vedge +{ + /ye exch def + /ys exch def + /xs exch def + newpath + xs xspacing mul xoffset add boxwidth 2 div add dup + ys yspacing mul boxheight 2 div sub + moveto + ye yspacing mul boxheight 2 div sub + lineto + stroke +} def + +/conn % connections the blocks from col `arg1' to `arg2' of row `arg3' +{ + /ys exch def + /xe exch def + /xs exch def + newpath + xs xspacing mul xoffset add boxwidth 2 div add + ys yspacing mul disty 2 div sub + moveto + xspacing xe xs sub mul 0 + rlineto + stroke +} def + +% ----- main ------ + +boxfont setfont +1 boundaspect scale +(Topology) cw +(RingTopology) cw +/boxwidth boxwidth marginwidth 2 mul add def +/xspacing boxwidth distx add def +/yspacing boxheight disty add def +/scalefactor + boxwidth cols mul distx cols 1 sub mul add + boxheight rows mul disty rows 1 sub mul add boundaspect mul + max def +boundx scalefactor div boundy scalefactor div scale + +% ----- classes ----- + + (Topology) 0 1 box + (RingTopology) 0 0 box + +% ----- relations ----- + +solid +1 0 0.25 out +solid +0 0 0.75 in diff --git a/branches/paradiseo-peo-meta-model/doc/latex/classTopology.tex b/branches/paradiseo-peo-meta-model/doc/latex/classTopology.tex new file mode 100644 index 000000000..3bdb11a3e --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/latex/classTopology.tex @@ -0,0 +1,44 @@ +\hypertarget{classTopology}{ +\section{Topology Class Reference} +\label{classTopology}\index{Topology@{Topology}} +} +Inheritance diagram for Topology::\begin{figure}[H] +\begin{center} +\leavevmode +\includegraphics[height=2cm]{classTopology} +\end{center} +\end{figure} +\subsection*{Public Member Functions} +\begin{CompactItemize} +\item +\hypertarget{classTopology_3e447669757c8311c7f6f8edc705abf2}{ +virtual \hyperlink{classTopology_3e447669757c8311c7f6f8edc705abf2}{$\sim$Topology} ()} +\label{classTopology_3e447669757c8311c7f6f8edc705abf2} + +\item +\hypertarget{classTopology_62bc46d8c20fdc71dad9e7c7a0d7aded}{ +void \hyperlink{classTopology_62bc46d8c20fdc71dad9e7c7a0d7aded}{add} (\hyperlink{classCooperative}{Cooperative} \&\_\-\_\-mig)} +\label{classTopology_62bc46d8c20fdc71dad9e7c7a0d7aded} + +\end{CompactItemize} +\subsection*{Protected Attributes} +\begin{CompactItemize} +\item +\hypertarget{classTopology_247a2faa8568b678f0b7b11e62c7812c}{ +std::vector$<$ \hyperlink{classCooperative}{Cooperative} $\ast$ $>$ \hyperlink{classTopology_247a2faa8568b678f0b7b11e62c7812c}{mig}} +\label{classTopology_247a2faa8568b678f0b7b11e62c7812c} + +\end{CompactItemize} + + +\subsection{Detailed Description} + + + + +Definition at line 16 of file topology.h. + +The documentation for this class was generated from the following files:\begin{CompactItemize} +\item +topology.h\item +topology.cpp\end{CompactItemize} diff --git a/branches/paradiseo-peo-meta-model/doc/latex/classWorker.eps b/branches/paradiseo-peo-meta-model/doc/latex/classWorker.eps new file mode 100644 index 000000000..5972d40a6 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/latex/classWorker.eps @@ -0,0 +1,209 @@ +%!PS-Adobe-2.0 EPSF-2.0 +%%Title: ClassName +%%Creator: Doxygen +%%CreationDate: Time +%%For: +%Magnification: 1.00 +%%Orientation: Portrait +%%BoundingBox: 0 0 500 275.229 +%%Pages: 0 +%%BeginSetup +%%EndSetup +%%EndComments + +% ----- variables ----- + +/boxwidth 0 def +/boxheight 40 def +/fontheight 24 def +/marginwidth 10 def +/distx 20 def +/disty 40 def +/boundaspect 1.81667 def % aspect ratio of the BoundingBox (width/height) +/boundx 500 def +/boundy boundx boundaspect div def +/xspacing 0 def +/yspacing 0 def +/rows 3 def +/cols 2 def +/scalefactor 0 def +/boxfont /Times-Roman findfont fontheight scalefont def + +% ----- procedures ----- + +/dotted { [1 4] 0 setdash } def +/dashed { [5] 0 setdash } def +/solid { [] 0 setdash } def + +/max % result = MAX(arg1,arg2) +{ + /a exch def + /b exch def + a b gt {a} {b} ifelse +} def + +/xoffset % result = MAX(0,(scalefactor-(boxwidth*cols+distx*(cols-1)))/2) +{ + 0 scalefactor boxwidth cols mul distx cols 1 sub mul add sub 2 div max +} def + +/cw % boxwidth = MAX(boxwidth, stringwidth(arg1)) +{ + /str exch def + /boxwidth boxwidth str stringwidth pop max def +} def + +/box % draws a box with text `arg1' at grid pos (arg2,arg3) +{ gsave + 2 setlinewidth + newpath + exch xspacing mul xoffset add + exch yspacing mul + moveto + boxwidth 0 rlineto + 0 boxheight rlineto + boxwidth neg 0 rlineto + 0 boxheight neg rlineto + closepath + dup stringwidth pop neg boxwidth add 2 div + boxheight fontheight 2 div sub 2 div + rmoveto show stroke + grestore +} def + +/mark +{ newpath + exch xspacing mul xoffset add boxwidth add + exch yspacing mul + moveto + 0 boxheight 4 div rlineto + boxheight neg 4 div boxheight neg 4 div rlineto + closepath + eofill + stroke +} def + +/arrow +{ newpath + moveto + 3 -8 rlineto + -6 0 rlineto + 3 8 rlineto + closepath + eofill + stroke +} def + +/out % draws an output connector for the block at (arg1,arg2) +{ + newpath + exch xspacing mul xoffset add boxwidth 2 div add + exch yspacing mul boxheight add + /y exch def + /x exch def + x y moveto + 0 disty 2 div rlineto + stroke + 1 eq { x y disty 2 div add arrow } if +} def + +/in % draws an input connector for the block at (arg1,arg2) +{ + newpath + exch xspacing mul xoffset add boxwidth 2 div add + exch yspacing mul disty 2 div sub + /y exch def + /x exch def + x y moveto + 0 disty 2 div rlineto + stroke + 1 eq { x y disty 2 div add arrow } if +} def + +/hedge +{ + exch xspacing mul xoffset add boxwidth 2 div add + exch yspacing mul boxheight 2 div sub + /y exch def + /x exch def + newpath + x y moveto + boxwidth 2 div distx add 0 rlineto + stroke + 1 eq + { newpath x boxwidth 2 div distx add add y moveto + -8 3 rlineto + 0 -6 rlineto + 8 3 rlineto + closepath + eofill + stroke + } if +} def + +/vedge +{ + /ye exch def + /ys exch def + /xs exch def + newpath + xs xspacing mul xoffset add boxwidth 2 div add dup + ys yspacing mul boxheight 2 div sub + moveto + ye yspacing mul boxheight 2 div sub + lineto + stroke +} def + +/conn % connections the blocks from col `arg1' to `arg2' of row `arg3' +{ + /ys exch def + /xe exch def + /xs exch def + newpath + xs xspacing mul xoffset add boxwidth 2 div add + ys yspacing mul disty 2 div sub + moveto + xspacing xe xs sub mul 0 + rlineto + stroke +} def + +% ----- main ------ + +boxfont setfont +1 boundaspect scale +(Worker) cw +(Communicable) cw +(ReactiveThread) cw +(Thread) cw +/boxwidth boxwidth marginwidth 2 mul add def +/xspacing boxwidth distx add def +/yspacing boxheight disty add def +/scalefactor + boxwidth cols mul distx cols 1 sub mul add + boxheight rows mul disty rows 1 sub mul add boundaspect mul + max def +boundx scalefactor div boundy scalefactor div scale + +% ----- classes ----- + + (Worker) 0.5 0 box + (Communicable) 0 1 box + (ReactiveThread) 1 1 box + (Thread) 1 2 box + +% ----- relations ----- + +solid +0 0.5 0 out +solid +0 1 1 conn +solid +1 0 1 in +solid +1 1 1 in +solid +0 1 1 out +solid +1 1 2 in diff --git a/branches/paradiseo-peo-meta-model/doc/latex/classWorker.tex b/branches/paradiseo-peo-meta-model/doc/latex/classWorker.tex new file mode 100644 index 000000000..fe55f2a2f --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/latex/classWorker.tex @@ -0,0 +1,94 @@ +\hypertarget{classWorker}{ +\section{Worker Class Reference} +\label{classWorker}\index{Worker@{Worker}} +} +Inheritance diagram for Worker::\begin{figure}[H] +\begin{center} +\leavevmode +\includegraphics[height=3cm]{classWorker} +\end{center} +\end{figure} +\subsection*{Public Member Functions} +\begin{CompactItemize} +\item +\hypertarget{classWorker_3754817df06ffe220f7f0d903c78ccac}{ +\hyperlink{classWorker_3754817df06ffe220f7f0d903c78ccac}{Worker} ()} +\label{classWorker_3754817df06ffe220f7f0d903c78ccac} + +\item +\hypertarget{classWorker_abcbbace05c6113f1959c494b3577291}{ +void \hyperlink{classWorker_abcbbace05c6113f1959c494b3577291}{start} ()} +\label{classWorker_abcbbace05c6113f1959c494b3577291} + +\item +\hypertarget{classWorker_83780920118e6c2b67d9477bdf8be248}{ +void \hyperlink{classWorker_83780920118e6c2b67d9477bdf8be248}{pack\-Result} ()} +\label{classWorker_83780920118e6c2b67d9477bdf8be248} + +\item +\hypertarget{classWorker_bff2bdcd64fe5400156cc78704c64953}{ +void \hyperlink{classWorker_bff2bdcd64fe5400156cc78704c64953}{unpack\-Data} ()} +\label{classWorker_bff2bdcd64fe5400156cc78704c64953} + +\item +\hypertarget{classWorker_60d2e8eba85b9ef403d94be54c391640}{ +void \hyperlink{classWorker_60d2e8eba85b9ef403d94be54c391640}{pack\-Task\-Done} ()} +\label{classWorker_60d2e8eba85b9ef403d94be54c391640} + +\item +\hypertarget{classWorker_e2f487014766a73c5788bdcfd58ad863}{ +void \hyperlink{classWorker_e2f487014766a73c5788bdcfd58ad863}{notify\-Sending\-Result} ()} +\label{classWorker_e2f487014766a73c5788bdcfd58ad863} + +\item +\hypertarget{classWorker_13efd6a8e275745329a4a8e23a0eb0bb}{ +void \hyperlink{classWorker_13efd6a8e275745329a4a8e23a0eb0bb}{notify\-Sending\-Task\-Done} ()} +\label{classWorker_13efd6a8e275745329a4a8e23a0eb0bb} + +\item +\hypertarget{classWorker_5dab4ea663546b5a49d9398d7a624d27}{ +void \hyperlink{classWorker_5dab4ea663546b5a49d9398d7a624d27}{set\-Source} (int \_\-\_\-rank)} +\label{classWorker_5dab4ea663546b5a49d9398d7a624d27} + +\end{CompactItemize} +\subsection*{Private Attributes} +\begin{CompactItemize} +\item +\hypertarget{classWorker_b5ffcb995e12fa71b9551e91729d6972}{ +WORKER\_\-ID \hyperlink{classWorker_b5ffcb995e12fa71b9551e91729d6972}{id}} +\label{classWorker_b5ffcb995e12fa71b9551e91729d6972} + +\item +\hypertarget{classWorker_d7dc76e301fd2bcf5d3a2088a59f1378}{ +SERVICE\_\-ID \hyperlink{classWorker_d7dc76e301fd2bcf5d3a2088a59f1378}{serv\_\-id}} +\label{classWorker_d7dc76e301fd2bcf5d3a2088a59f1378} + +\item +\hypertarget{classWorker_454e1764ed165af733cc44a73e395692}{ +\hyperlink{classService}{Service} $\ast$ \hyperlink{classWorker_454e1764ed165af733cc44a73e395692}{serv}} +\label{classWorker_454e1764ed165af733cc44a73e395692} + +\item +\hypertarget{classWorker_895c3ebc198018ea3391c09bc802d2f6}{ +int \hyperlink{classWorker_895c3ebc198018ea3391c09bc802d2f6}{src}} +\label{classWorker_895c3ebc198018ea3391c09bc802d2f6} + +\item +\hypertarget{classWorker_7ba5a18b2918cf9e704536b763be37f7}{ +bool \hyperlink{classWorker_7ba5a18b2918cf9e704536b763be37f7}{toto}} +\label{classWorker_7ba5a18b2918cf9e704536b763be37f7} + +\end{CompactItemize} + + +\subsection{Detailed Description} + + + + +Definition at line 18 of file worker.h. + +The documentation for this class was generated from the following files:\begin{CompactItemize} +\item +worker.h\item +worker.cpp\end{CompactItemize} diff --git a/branches/paradiseo-peo-meta-model/doc/latex/classpeoAggEvalFunc.eps b/branches/paradiseo-peo-meta-model/doc/latex/classpeoAggEvalFunc.eps new file mode 100644 index 000000000..b8d4453ed --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/latex/classpeoAggEvalFunc.eps @@ -0,0 +1,209 @@ +%!PS-Adobe-2.0 EPSF-2.0 +%%Title: ClassName +%%Creator: Doxygen +%%CreationDate: Time +%%For: +%Magnification: 1.00 +%%Orientation: Portrait +%%BoundingBox: 0 0 500 437.158 +%%Pages: 0 +%%BeginSetup +%%EndSetup +%%EndComments + +% ----- variables ----- + +/boxwidth 0 def +/boxheight 40 def +/fontheight 24 def +/marginwidth 10 def +/distx 20 def +/disty 40 def +/boundaspect 1.14375 def % aspect ratio of the BoundingBox (width/height) +/boundx 500 def +/boundy boundx boundaspect div def +/xspacing 0 def +/yspacing 0 def +/rows 4 def +/cols 1 def +/scalefactor 0 def +/boxfont /Times-Roman findfont fontheight scalefont def + +% ----- procedures ----- + +/dotted { [1 4] 0 setdash } def +/dashed { [5] 0 setdash } def +/solid { [] 0 setdash } def + +/max % result = MAX(arg1,arg2) +{ + /a exch def + /b exch def + a b gt {a} {b} ifelse +} def + +/xoffset % result = MAX(0,(scalefactor-(boxwidth*cols+distx*(cols-1)))/2) +{ + 0 scalefactor boxwidth cols mul distx cols 1 sub mul add sub 2 div max +} def + +/cw % boxwidth = MAX(boxwidth, stringwidth(arg1)) +{ + /str exch def + /boxwidth boxwidth str stringwidth pop max def +} def + +/box % draws a box with text `arg1' at grid pos (arg2,arg3) +{ gsave + 2 setlinewidth + newpath + exch xspacing mul xoffset add + exch yspacing mul + moveto + boxwidth 0 rlineto + 0 boxheight rlineto + boxwidth neg 0 rlineto + 0 boxheight neg rlineto + closepath + dup stringwidth pop neg boxwidth add 2 div + boxheight fontheight 2 div sub 2 div + rmoveto show stroke + grestore +} def + +/mark +{ newpath + exch xspacing mul xoffset add boxwidth add + exch yspacing mul + moveto + 0 boxheight 4 div rlineto + boxheight neg 4 div boxheight neg 4 div rlineto + closepath + eofill + stroke +} def + +/arrow +{ newpath + moveto + 3 -8 rlineto + -6 0 rlineto + 3 8 rlineto + closepath + eofill + stroke +} def + +/out % draws an output connector for the block at (arg1,arg2) +{ + newpath + exch xspacing mul xoffset add boxwidth 2 div add + exch yspacing mul boxheight add + /y exch def + /x exch def + x y moveto + 0 disty 2 div rlineto + stroke + 1 eq { x y disty 2 div add arrow } if +} def + +/in % draws an input connector for the block at (arg1,arg2) +{ + newpath + exch xspacing mul xoffset add boxwidth 2 div add + exch yspacing mul disty 2 div sub + /y exch def + /x exch def + x y moveto + 0 disty 2 div rlineto + stroke + 1 eq { x y disty 2 div add arrow } if +} def + +/hedge +{ + exch xspacing mul xoffset add boxwidth 2 div add + exch yspacing mul boxheight 2 div sub + /y exch def + /x exch def + newpath + x y moveto + boxwidth 2 div distx add 0 rlineto + stroke + 1 eq + { newpath x boxwidth 2 div distx add add y moveto + -8 3 rlineto + 0 -6 rlineto + 8 3 rlineto + closepath + eofill + stroke + } if +} def + +/vedge +{ + /ye exch def + /ys exch def + /xs exch def + newpath + xs xspacing mul xoffset add boxwidth 2 div add dup + ys yspacing mul boxheight 2 div sub + moveto + ye yspacing mul boxheight 2 div sub + lineto + stroke +} def + +/conn % connections the blocks from col `arg1' to `arg2' of row `arg3' +{ + /ys exch def + /xe exch def + /xs exch def + newpath + xs xspacing mul xoffset add boxwidth 2 div add + ys yspacing mul disty 2 div sub + moveto + xspacing xe xs sub mul 0 + rlineto + stroke +} def + +% ----- main ------ + +boxfont setfont +1 boundaspect scale +(peoAggEvalFunc< EOT >) cw +(eoBF< A1, A2, R >) cw +(eoFunctorBase) cw +(peoNoAggEvalFunc< EOT >) cw +/boxwidth boxwidth marginwidth 2 mul add def +/xspacing boxwidth distx add def +/yspacing boxheight disty add def +/scalefactor + boxwidth cols mul distx cols 1 sub mul add + boxheight rows mul disty rows 1 sub mul add boundaspect mul + max def +boundx scalefactor div boundy scalefactor div scale + +% ----- classes ----- + + (peoAggEvalFunc< EOT >) 0 1 box + (eoBF< A1, A2, R >) 0 2 box + (eoFunctorBase) 0 3 box + (peoNoAggEvalFunc< EOT >) 0 0 box + +% ----- relations ----- + +solid +0 0 1 out +solid +1 0 2 in +solid +0 0 2 out +solid +1 0 3 in +solid +1 0 0.25 out +solid +0 0 0.75 in diff --git a/branches/paradiseo-peo-meta-model/doc/latex/classpeoAggEvalFunc.tex b/branches/paradiseo-peo-meta-model/doc/latex/classpeoAggEvalFunc.tex new file mode 100644 index 000000000..ac91f551f --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/latex/classpeoAggEvalFunc.tex @@ -0,0 +1,39 @@ +\hypertarget{classpeoAggEvalFunc}{ +\section{peo\-Agg\-Eval\-Func$<$ EOT $>$ Class Template Reference} +\label{classpeoAggEvalFunc}\index{peoAggEvalFunc@{peoAggEvalFunc}} +} +The \hyperlink{classpeoAggEvalFunc}{peo\-Agg\-Eval\-Func} class offers only the interface for creating aggregate evaluation functions - there are no direct internal functions provided. + + +{\tt \#include $<$peo\-Agg\-Eval\-Func.h$>$} + +Inheritance diagram for peo\-Agg\-Eval\-Func$<$ EOT $>$::\begin{figure}[H] +\begin{center} +\leavevmode +\includegraphics[height=4cm]{classpeoAggEvalFunc} +\end{center} +\end{figure} + + +\subsection{Detailed Description} +\subsubsection*{template$<$class EOT$>$ class peo\-Agg\-Eval\-Func$<$ EOT $>$} + +The \hyperlink{classpeoAggEvalFunc}{peo\-Agg\-Eval\-Func} class offers only the interface for creating aggregate evaluation functions - there are no direct internal functions provided. + +The class inherits {\bf public eo\-BF$<$ EOT\&, const typename EOT :: Fitness\&, void $>$} thus requiring, for the derived classes, the creation of a function having the following signature: + +\begin{TabularC}{2} +\hline +void operator()( EOT\& \_\-\_\-eot, const typename EOT :: Fitness\& \_\-\_\-partial\_\-fittness ); ~ &~ \\\hline +\end{TabularC} + + +The aggregation object is called in an iterative manner for each of the results obtained by applying partial evaluation functions. + + + +Definition at line 25 of file peo\-Agg\-Eval\-Func.h. + +The documentation for this class was generated from the following file:\begin{CompactItemize} +\item +peo\-Agg\-Eval\-Func.h\end{CompactItemize} diff --git a/branches/paradiseo-peo-meta-model/doc/latex/classpeoAsyncIslandMig.eps b/branches/paradiseo-peo-meta-model/doc/latex/classpeoAsyncIslandMig.eps new file mode 100644 index 000000000..292b6cce7 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/latex/classpeoAsyncIslandMig.eps @@ -0,0 +1,221 @@ +%!PS-Adobe-2.0 EPSF-2.0 +%%Title: ClassName +%%Creator: Doxygen +%%CreationDate: Time +%%For: +%Magnification: 1.00 +%%Orientation: Portrait +%%BoundingBox: 0 0 500 222.222 +%%Pages: 0 +%%BeginSetup +%%EndSetup +%%EndComments + +% ----- variables ----- + +/boxwidth 0 def +/boxheight 40 def +/fontheight 24 def +/marginwidth 10 def +/distx 20 def +/disty 40 def +/boundaspect 2.25 def % aspect ratio of the BoundingBox (width/height) +/boundx 500 def +/boundy boundx boundaspect div def +/xspacing 0 def +/yspacing 0 def +/rows 4 def +/cols 2 def +/scalefactor 0 def +/boxfont /Times-Roman findfont fontheight scalefont def + +% ----- procedures ----- + +/dotted { [1 4] 0 setdash } def +/dashed { [5] 0 setdash } def +/solid { [] 0 setdash } def + +/max % result = MAX(arg1,arg2) +{ + /a exch def + /b exch def + a b gt {a} {b} ifelse +} def + +/xoffset % result = MAX(0,(scalefactor-(boxwidth*cols+distx*(cols-1)))/2) +{ + 0 scalefactor boxwidth cols mul distx cols 1 sub mul add sub 2 div max +} def + +/cw % boxwidth = MAX(boxwidth, stringwidth(arg1)) +{ + /str exch def + /boxwidth boxwidth str stringwidth pop max def +} def + +/box % draws a box with text `arg1' at grid pos (arg2,arg3) +{ gsave + 2 setlinewidth + newpath + exch xspacing mul xoffset add + exch yspacing mul + moveto + boxwidth 0 rlineto + 0 boxheight rlineto + boxwidth neg 0 rlineto + 0 boxheight neg rlineto + closepath + dup stringwidth pop neg boxwidth add 2 div + boxheight fontheight 2 div sub 2 div + rmoveto show stroke + grestore +} def + +/mark +{ newpath + exch xspacing mul xoffset add boxwidth add + exch yspacing mul + moveto + 0 boxheight 4 div rlineto + boxheight neg 4 div boxheight neg 4 div rlineto + closepath + eofill + stroke +} def + +/arrow +{ newpath + moveto + 3 -8 rlineto + -6 0 rlineto + 3 8 rlineto + closepath + eofill + stroke +} def + +/out % draws an output connector for the block at (arg1,arg2) +{ + newpath + exch xspacing mul xoffset add boxwidth 2 div add + exch yspacing mul boxheight add + /y exch def + /x exch def + x y moveto + 0 disty 2 div rlineto + stroke + 1 eq { x y disty 2 div add arrow } if +} def + +/in % draws an input connector for the block at (arg1,arg2) +{ + newpath + exch xspacing mul xoffset add boxwidth 2 div add + exch yspacing mul disty 2 div sub + /y exch def + /x exch def + x y moveto + 0 disty 2 div rlineto + stroke + 1 eq { x y disty 2 div add arrow } if +} def + +/hedge +{ + exch xspacing mul xoffset add boxwidth 2 div add + exch yspacing mul boxheight 2 div sub + /y exch def + /x exch def + newpath + x y moveto + boxwidth 2 div distx add 0 rlineto + stroke + 1 eq + { newpath x boxwidth 2 div distx add add y moveto + -8 3 rlineto + 0 -6 rlineto + 8 3 rlineto + closepath + eofill + stroke + } if +} def + +/vedge +{ + /ye exch def + /ys exch def + /xs exch def + newpath + xs xspacing mul xoffset add boxwidth 2 div add dup + ys yspacing mul boxheight 2 div sub + moveto + ye yspacing mul boxheight 2 div sub + lineto + stroke +} def + +/conn % connections the blocks from col `arg1' to `arg2' of row `arg3' +{ + /ys exch def + /xe exch def + /xs exch def + newpath + xs xspacing mul xoffset add boxwidth 2 div add + ys yspacing mul disty 2 div sub + moveto + xspacing xe xs sub mul 0 + rlineto + stroke +} def + +% ----- main ------ + +boxfont setfont +1 boundaspect scale +(peoAsyncIslandMig< EOT >) cw +(Cooperative) cw +(eoUpdater) cw +(Communicable) cw +(eoF< void >) cw +(eoFunctorBase) cw +/boxwidth boxwidth marginwidth 2 mul add def +/xspacing boxwidth distx add def +/yspacing boxheight disty add def +/scalefactor + boxwidth cols mul distx cols 1 sub mul add + boxheight rows mul disty rows 1 sub mul add boundaspect mul + max def +boundx scalefactor div boundy scalefactor div scale + +% ----- classes ----- + + (peoAsyncIslandMig< EOT >) 0.5 0 box + (Cooperative) 0 1 box + (eoUpdater) 1 1 box + (Communicable) 0 2 box + (eoF< void >) 1 2 box + (eoFunctorBase) 1 3 box + +% ----- relations ----- + +solid +0 0.5 0 out +solid +0 1 1 conn +solid +1 0 1 in +solid +0 0 1 out +solid +1 1 1 in +solid +0 1 1 out +solid +1 0 2 in +solid +1 1 2 in +solid +0 1 2 out +solid +1 1 3 in diff --git a/branches/paradiseo-peo-meta-model/doc/latex/classpeoAsyncIslandMig.tex b/branches/paradiseo-peo-meta-model/doc/latex/classpeoAsyncIslandMig.tex new file mode 100644 index 000000000..3970c8539 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/latex/classpeoAsyncIslandMig.tex @@ -0,0 +1,218 @@ +\hypertarget{classpeoAsyncIslandMig}{ +\section{peo\-Async\-Island\-Mig$<$ EOT $>$ Class Template Reference} +\label{classpeoAsyncIslandMig}\index{peoAsyncIslandMig@{peoAsyncIslandMig}} +} +The \hyperlink{classpeoAsyncIslandMig}{peo\-Async\-Island\-Mig} class offers the elementary basis for implementating an asynchronous island migration model - requires the specification of several basic parameters, i.e. + + +{\tt \#include $<$peo\-Async\-Island\-Mig.h$>$} + +Inheritance diagram for peo\-Async\-Island\-Mig$<$ EOT $>$::\begin{figure}[H] +\begin{center} +\leavevmode +\includegraphics[height=4cm]{classpeoAsyncIslandMig} +\end{center} +\end{figure} +\subsection*{Public Member Functions} +\begin{CompactItemize} +\item +\hyperlink{classpeoAsyncIslandMig_e0f706cbf4148d3ca327227a5c7a9fdf}{peo\-Async\-Island\-Mig} (\bf{eo\-Continue}$<$ EOT $>$ \&\_\-\_\-cont, \bf{eo\-Select}$<$ EOT $>$ \&\_\-\_\-select, \bf{eo\-Replacement}$<$ EOT $>$ \&\_\-\_\-replace, \hyperlink{classTopology}{Topology} \&\_\-\_\-topology, \bf{eo\-Pop}$<$ EOT $>$ \&\_\-\_\-source, \bf{eo\-Pop}$<$ EOT $>$ \&\_\-\_\-destination) +\begin{CompactList}\small\item\em Constructor for the \hyperlink{classpeoAsyncIslandMig}{peo\-Async\-Island\-Mig} class; the characteristics of the migration model are defined through the specified parameters - out of the box objects provided in \doxyref{EO}, etc., or custom, derived objects may be passed as parameters. \item\end{CompactList}\item +void \hyperlink{classpeoAsyncIslandMig_13581e54425727a7f785ca8a6df527b5}{operator()} () +\begin{CompactList}\small\item\em \doxyref{Function} operator to be called as checkpoint for performing the migration step. \item\end{CompactList}\item +\hypertarget{classpeoAsyncIslandMig_6d790a5d0b6ac510cac4f61a1c0d8f16}{ +void \hyperlink{classpeoAsyncIslandMig_6d790a5d0b6ac510cac4f61a1c0d8f16}{pack} ()} +\label{classpeoAsyncIslandMig_6d790a5d0b6ac510cac4f61a1c0d8f16} + +\begin{CompactList}\small\item\em Auxiliary function dealing with sending the emigrant individuals. There is no need to explicitly call the function. \item\end{CompactList}\item +\hypertarget{classpeoAsyncIslandMig_455501aee5db2bbfbae15779c8429369}{ +void \hyperlink{classpeoAsyncIslandMig_455501aee5db2bbfbae15779c8429369}{unpack} ()} +\label{classpeoAsyncIslandMig_455501aee5db2bbfbae15779c8429369} + +\begin{CompactList}\small\item\em Auxiliary function dealing with receiving immigrant individuals. There is no need to explicitly call the function. \item\end{CompactList}\end{CompactItemize} +\subsection*{Private Member Functions} +\begin{CompactItemize} +\item +\hypertarget{classpeoAsyncIslandMig_87a4ef7d4bd30d349a801bf0f9e87c82}{ +void \hyperlink{classpeoAsyncIslandMig_87a4ef7d4bd30d349a801bf0f9e87c82}{emigrate} ()} +\label{classpeoAsyncIslandMig_87a4ef7d4bd30d349a801bf0f9e87c82} + +\item +\hypertarget{classpeoAsyncIslandMig_5a9a64ba51a696e45f91b362c39c9a64}{ +void \hyperlink{classpeoAsyncIslandMig_5a9a64ba51a696e45f91b362c39c9a64}{immigrate} ()} +\label{classpeoAsyncIslandMig_5a9a64ba51a696e45f91b362c39c9a64} + +\end{CompactItemize} +\subsection*{Private Attributes} +\begin{CompactItemize} +\item +\hypertarget{classpeoAsyncIslandMig_2fc077d02ef9ea4595cfe883af0d4f83}{ +\bf{eo\-Continue}$<$ EOT $>$ \& \hyperlink{classpeoAsyncIslandMig_2fc077d02ef9ea4595cfe883af0d4f83}{cont}} +\label{classpeoAsyncIslandMig_2fc077d02ef9ea4595cfe883af0d4f83} + +\item +\hypertarget{classpeoAsyncIslandMig_b1fa045094c8a411323e75b5820c80c2}{ +\bf{eo\-Select}$<$ EOT $>$ \& \hyperlink{classpeoAsyncIslandMig_b1fa045094c8a411323e75b5820c80c2}{select}} +\label{classpeoAsyncIslandMig_b1fa045094c8a411323e75b5820c80c2} + +\item +\hypertarget{classpeoAsyncIslandMig_b761dbd880ee32e170741ecd78da6f48}{ +\bf{eo\-Replacement}$<$ EOT $>$ \& \hyperlink{classpeoAsyncIslandMig_b761dbd880ee32e170741ecd78da6f48}{replace}} +\label{classpeoAsyncIslandMig_b761dbd880ee32e170741ecd78da6f48} + +\item +\hypertarget{classpeoAsyncIslandMig_e45e5a808a96f0853ab6ba42339fe679}{ +\hyperlink{classTopology}{Topology} \& \hyperlink{classpeoAsyncIslandMig_e45e5a808a96f0853ab6ba42339fe679}{topology}} +\label{classpeoAsyncIslandMig_e45e5a808a96f0853ab6ba42339fe679} + +\item +\hypertarget{classpeoAsyncIslandMig_8a502d82c773033e274dca932fc2d4ee}{ +\bf{eo\-Pop}$<$ EOT $>$ \& \hyperlink{classpeoAsyncIslandMig_8a502d82c773033e274dca932fc2d4ee}{source}} +\label{classpeoAsyncIslandMig_8a502d82c773033e274dca932fc2d4ee} + +\item +\hypertarget{classpeoAsyncIslandMig_e407f411d08ae7d96992603c145a7e43}{ +\bf{eo\-Pop}$<$ EOT $>$ \& \hyperlink{classpeoAsyncIslandMig_e407f411d08ae7d96992603c145a7e43}{destination}} +\label{classpeoAsyncIslandMig_e407f411d08ae7d96992603c145a7e43} + +\item +\hypertarget{classpeoAsyncIslandMig_b8c76d98d9ae99dd930a77c12860519a}{ +std::queue$<$ \bf{eo\-Pop}$<$ EOT $>$ $>$ \hyperlink{classpeoAsyncIslandMig_b8c76d98d9ae99dd930a77c12860519a}{imm}} +\label{classpeoAsyncIslandMig_b8c76d98d9ae99dd930a77c12860519a} + +\item +\hypertarget{classpeoAsyncIslandMig_a9cc0e2d61cac6e11647b141962adc89}{ +std::queue$<$ \bf{eo\-Pop}$<$ EOT $>$ $>$ \hyperlink{classpeoAsyncIslandMig_a9cc0e2d61cac6e11647b141962adc89}{em}} +\label{classpeoAsyncIslandMig_a9cc0e2d61cac6e11647b141962adc89} + +\item +\hypertarget{classpeoAsyncIslandMig_1a2c0004d23bc303420af137a8c8bd27}{ +std::queue$<$ \hyperlink{classCooperative}{Cooperative} $\ast$ $>$ \hyperlink{classpeoAsyncIslandMig_1a2c0004d23bc303420af137a8c8bd27}{coop\_\-em}} +\label{classpeoAsyncIslandMig_1a2c0004d23bc303420af137a8c8bd27} + +\end{CompactItemize} + + +\subsection{Detailed Description} +\subsubsection*{template$<$class EOT$>$ class peo\-Async\-Island\-Mig$<$ EOT $>$} + +The \hyperlink{classpeoAsyncIslandMig}{peo\-Async\-Island\-Mig} class offers the elementary basis for implementating an asynchronous island migration model - requires the specification of several basic parameters, i.e. + +continuation criterion, selection and replacement strategies, a topological model and the source and destination population for the migrating individuals. As opposed to the synchronous migration model, in the asynchronous migration approach, there is no synchronization step between islands after performing the emigration phase. + +The migration operator is called at the end of each generation of an evolutionary algorithms as a checkpoint object - the following code exposes the structure of a classic evolutionary algorithm: + +\begin{TabularC}{2} +\hline +{\bf do} \{ ~ &~ \\\hline +~~~~~~~~ select( population, offsprings ); ~ &// select the offsprings from the current population \\\hline +~~~~~~~~ transform( offsprings ); ~ &// crossover and mutation operators are applied on the selected offsprings \\\hline +~~~~~~~~ evaluate( offsprings ); ~ &// evaluation step of the resulting offsprings \\\hline +~~~~~~~~ replace( population, offsprings ); ~ &// replace the individuals in the current population whith individuals from the offspring population, according to a specified replacement strategy \\\hline +\} {\bf while} ( ea\-Checkpoint\-Continue( population ) ); ~ &// checkpoint operators are applied on the current population, including the migration operator, if any specified \\\hline +\end{TabularC} + + +Constructing an asynchronous island migration model requires having defined (1) a topological migration model, (2) the control parameters of the migration process, (3) a checkpoint object associated with an evolutionary algorithm, and (4) an owner object must be set. The owner object must be derived from the {\bf \hyperlink{classRunner}{Runner}} class (for example a \hyperlink{classpeoEA}{peo\-EA} object represents a possible owner). A simple example is offered bellow: + +\begin{enumerate} +\item topological model to be followed when performing migrations: \par + \par + \begin{TabularC}{2} +\hline +\hyperlink{classRingTopology}{Ring\-Topology} mig\-Topology; ~ &// a simple ring topological model - each island communicates with two other islands \\\hline +\end{TabularC} + + +\item the continuation criterion, selection and replacement strategy etc. are defined: \par + \par + \begin{TabularC}{2} +\hline +eo\-Pop$<$ EOT $>$ population( POP\_\-SIZE, pop\-Initializer ); ~ &// population of individuals to be used for the evolutionary algorithm \\\hline +~ &~ \\\hline +eo\-Periodic\-Continue$<$ EOT $>$ mig\-Cont( MIG\_\-FREQ ); ~ &// migrations occur periodically at MIG\_\-FREQ iterations \\\hline +eo\-Random\-Select$<$ EOT $>$ mig\-Select\-Strategy; ~ &// selection strategy - in this case a random selection is applied \\\hline +eo\-Select\-Number$<$ EOT $>$ mig\-Select( mig\-Select\-Strategy, MIG\_\-SIZE ); ~ &// number of individuals to be selected using the specified strategy \\\hline +eo\-Plus\-Replacement$<$ EOT $>$ mig\-Replace; ~ &// immigration strategy - the worse individuals in the destination population are replaced by the immigrant individuals \\\hline +~ &~ \\\hline +peo\-Async\-Island\-Mig$<$ EOT $>$ async\-Migration( \par + ~~~~~~~~ mig\-Cont, mig\-Select, mig\-Replace, mig\-Topology, \par + ~~~~~~~~ population, population \par + ); ~ &// asynchronous migration object - the emigrant individuals are selected from the same from population in which the immigrant individuals are being integrated \\\hline +\end{TabularC} + + +\item creation of a checkpoint object as part of the definition of an evolutionary algoritm (details of th EA not given as being out of scope): \par + \par + \begin{TabularC}{2} +\hline +... ~ &~ \\\hline +eo\-Gen\-Continue$<$ EOT $>$ ea\-Cont( NUM\_\-GEN ); ~ &// the evolutionary algorithm will stop after NUM\_\-GEN generations \\\hline +eo\-Check\-Point$<$ EOT $>$ ea\-Checkpoint\-Continue( ea\-Cont ); ~ &// number of individuals to be selected using the specified strategy \\\hline +... ~ &~ \\\hline +ea\-Checkpoint\-Continue.add( async\-Migration ); ~ &// adding the migration operator as checkpoint element \\\hline +... ~ &~ \\\hline +\end{TabularC} + + +\item definition of an owner evolutionary algorithm (an object inheriting the {\bf \hyperlink{classRunner}{Runner}} class): \par + \par + \begin{TabularC}{2} +\hline +peo\-EA$<$ EOT $>$ ea\-Alg( ea\-Checkpoint\-Continue, ea\-Pop\-Eval, ea\-Select, ea\-Transform, ea\-Replace); ~ &// evolutionary algorithm having as checkpoint the ea\-Checkpoint\-Continue object defined above \\\hline +async\-Migration.set\-Owner( ea\-Alg ); ~ &// setting the evolutionary algorithm as owner of the migration object \\\hline +ea\-Alg( population ); ~ &// applying the evolutionary algorithm on a given population \\\hline +\end{TabularC} +\end{enumerate} + + +The source and the destination population for the migration object were specified as being the same, in step no. 2, as we are usually interested in selecting the emigrants and integrating the immigrant individuals from and in, respectively, one unique population, iteratively evolved by an evolutionary algorithm. There is no restriction in having two distinct populations as source and destination for the emigrant and immigrant individuals respectively. + +The above steps only create an asynchronous migration object associated to an evolutionary algorithm. The creation of several islands requires the reiteration of the steps 2 through 4 for creating distinct algorithms, with distinct populations and the associated distinctly parametrized migration objects. The interconnecting element is the underlying topology, defined at step 1 (the same C++ mig\-Topology object has to be passed as parameter for all the migration objects, in order to interconnect them). + + + +Definition at line 112 of file peo\-Async\-Island\-Mig.h. + +\subsection{Constructor \& Destructor Documentation} +\hypertarget{classpeoAsyncIslandMig_e0f706cbf4148d3ca327227a5c7a9fdf}{ +\index{peoAsyncIslandMig@{peo\-Async\-Island\-Mig}!peoAsyncIslandMig@{peoAsyncIslandMig}} +\index{peoAsyncIslandMig@{peoAsyncIslandMig}!peoAsyncIslandMig@{peo\-Async\-Island\-Mig}} +\subsubsection[peoAsyncIslandMig]{\setlength{\rightskip}{0pt plus 5cm}template$<$class EOT$>$ \hyperlink{classpeoAsyncIslandMig}{peo\-Async\-Island\-Mig}$<$ EOT $>$::\hyperlink{classpeoAsyncIslandMig}{peo\-Async\-Island\-Mig} (\bf{eo\-Continue}$<$ EOT $>$ \& {\em \_\-\_\-cont}, \bf{eo\-Select}$<$ EOT $>$ \& {\em \_\-\_\-select}, \bf{eo\-Replacement}$<$ EOT $>$ \& {\em \_\-\_\-replace}, \hyperlink{classTopology}{Topology} \& {\em \_\-\_\-topology}, \bf{eo\-Pop}$<$ EOT $>$ \& {\em \_\-\_\-source}, \bf{eo\-Pop}$<$ EOT $>$ \& {\em \_\-\_\-destination})}} +\label{classpeoAsyncIslandMig_e0f706cbf4148d3ca327227a5c7a9fdf} + + +Constructor for the \hyperlink{classpeoAsyncIslandMig}{peo\-Async\-Island\-Mig} class; the characteristics of the migration model are defined through the specified parameters - out of the box objects provided in \doxyref{EO}, etc., or custom, derived objects may be passed as parameters. + +\begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em eo\-Continue$<$}]EOT $>$\& \_\-\_\-cont - continuation criterion specifying whether the migration is performed or not; \item[{\em eo\-Select$<$}]EOT $>$\& \_\-\_\-select - selection strategy to be applied for constructing a list of emigrant individuals out of the source population; \item[{\em eo\-Replacement$<$}]EOT $>$\& \_\-\_\-replace - replacement strategy used for integrating the immigrant individuals in the destination population; \item[{\em Topology\&}]\_\-\_\-topology - topological model to be followed when performing migrations; \item[{\em eo\-Pop$<$}]EOT $>$\& \_\-\_\-source - source population from which the emigrant individuals are selected; \item[{\em eo\-Pop$<$}]EOT $>$\& \_\-\_\-destination - destination population in which the immigrant population are integrated. \end{description} +\end{Desc} + + +Definition at line 171 of file peo\-Async\-Island\-Mig.h. + +References Topology::add(). + +\subsection{Member Function Documentation} +\hypertarget{classpeoAsyncIslandMig_13581e54425727a7f785ca8a6df527b5}{ +\index{peoAsyncIslandMig@{peo\-Async\-Island\-Mig}!operator()@{operator()}} +\index{operator()@{operator()}!peoAsyncIslandMig@{peo\-Async\-Island\-Mig}} +\subsubsection[operator()]{\setlength{\rightskip}{0pt plus 5cm}template$<$class EOT$>$ void \hyperlink{classpeoAsyncIslandMig}{peo\-Async\-Island\-Mig}$<$ EOT $>$::operator() ()\hspace{0.3cm}{\tt \mbox{[}virtual\mbox{]}}}} +\label{classpeoAsyncIslandMig_13581e54425727a7f785ca8a6df527b5} + + +\doxyref{Function} operator to be called as checkpoint for performing the migration step. + +The emigrant individuals are selected from the source population and sent to the next island (defined by the topology object) while the immigrant individuals are integrated in the destination population. There is no need to explicitly call the function - the wrapper checkpoint object (please refer to the above example) will perform the call when required. + +Implements \bf{eo\-F$<$ void $>$}. + +Definition at line 248 of file peo\-Async\-Island\-Mig.h. + +References peo\-Async\-Island\-Mig$<$ EOT $>$::cont, peo\-Async\-Island\-Mig$<$ EOT $>$::emigrate(), peo\-Async\-Island\-Mig$<$ EOT $>$::immigrate(), and peo\-Async\-Island\-Mig$<$ EOT $>$::source. + +The documentation for this class was generated from the following file:\begin{CompactItemize} +\item +peo\-Async\-Island\-Mig.h\end{CompactItemize} diff --git a/branches/paradiseo-peo-meta-model/doc/latex/classpeoEA.eps b/branches/paradiseo-peo-meta-model/doc/latex/classpeoEA.eps new file mode 100644 index 000000000..e4aabc826 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/latex/classpeoEA.eps @@ -0,0 +1,209 @@ +%!PS-Adobe-2.0 EPSF-2.0 +%%Title: ClassName +%%Creator: Doxygen +%%CreationDate: Time +%%For: +%Magnification: 1.00 +%%Orientation: Portrait +%%BoundingBox: 0 0 500 280.374 +%%Pages: 0 +%%BeginSetup +%%EndSetup +%%EndComments + +% ----- variables ----- + +/boxwidth 0 def +/boxheight 40 def +/fontheight 24 def +/marginwidth 10 def +/distx 20 def +/disty 40 def +/boundaspect 1.78333 def % aspect ratio of the BoundingBox (width/height) +/boundx 500 def +/boundy boundx boundaspect div def +/xspacing 0 def +/yspacing 0 def +/rows 3 def +/cols 2 def +/scalefactor 0 def +/boxfont /Times-Roman findfont fontheight scalefont def + +% ----- procedures ----- + +/dotted { [1 4] 0 setdash } def +/dashed { [5] 0 setdash } def +/solid { [] 0 setdash } def + +/max % result = MAX(arg1,arg2) +{ + /a exch def + /b exch def + a b gt {a} {b} ifelse +} def + +/xoffset % result = MAX(0,(scalefactor-(boxwidth*cols+distx*(cols-1)))/2) +{ + 0 scalefactor boxwidth cols mul distx cols 1 sub mul add sub 2 div max +} def + +/cw % boxwidth = MAX(boxwidth, stringwidth(arg1)) +{ + /str exch def + /boxwidth boxwidth str stringwidth pop max def +} def + +/box % draws a box with text `arg1' at grid pos (arg2,arg3) +{ gsave + 2 setlinewidth + newpath + exch xspacing mul xoffset add + exch yspacing mul + moveto + boxwidth 0 rlineto + 0 boxheight rlineto + boxwidth neg 0 rlineto + 0 boxheight neg rlineto + closepath + dup stringwidth pop neg boxwidth add 2 div + boxheight fontheight 2 div sub 2 div + rmoveto show stroke + grestore +} def + +/mark +{ newpath + exch xspacing mul xoffset add boxwidth add + exch yspacing mul + moveto + 0 boxheight 4 div rlineto + boxheight neg 4 div boxheight neg 4 div rlineto + closepath + eofill + stroke +} def + +/arrow +{ newpath + moveto + 3 -8 rlineto + -6 0 rlineto + 3 8 rlineto + closepath + eofill + stroke +} def + +/out % draws an output connector for the block at (arg1,arg2) +{ + newpath + exch xspacing mul xoffset add boxwidth 2 div add + exch yspacing mul boxheight add + /y exch def + /x exch def + x y moveto + 0 disty 2 div rlineto + stroke + 1 eq { x y disty 2 div add arrow } if +} def + +/in % draws an input connector for the block at (arg1,arg2) +{ + newpath + exch xspacing mul xoffset add boxwidth 2 div add + exch yspacing mul disty 2 div sub + /y exch def + /x exch def + x y moveto + 0 disty 2 div rlineto + stroke + 1 eq { x y disty 2 div add arrow } if +} def + +/hedge +{ + exch xspacing mul xoffset add boxwidth 2 div add + exch yspacing mul boxheight 2 div sub + /y exch def + /x exch def + newpath + x y moveto + boxwidth 2 div distx add 0 rlineto + stroke + 1 eq + { newpath x boxwidth 2 div distx add add y moveto + -8 3 rlineto + 0 -6 rlineto + 8 3 rlineto + closepath + eofill + stroke + } if +} def + +/vedge +{ + /ye exch def + /ys exch def + /xs exch def + newpath + xs xspacing mul xoffset add boxwidth 2 div add dup + ys yspacing mul boxheight 2 div sub + moveto + ye yspacing mul boxheight 2 div sub + lineto + stroke +} def + +/conn % connections the blocks from col `arg1' to `arg2' of row `arg3' +{ + /ys exch def + /xe exch def + /xs exch def + newpath + xs xspacing mul xoffset add boxwidth 2 div add + ys yspacing mul disty 2 div sub + moveto + xspacing xe xs sub mul 0 + rlineto + stroke +} def + +% ----- main ------ + +boxfont setfont +1 boundaspect scale +(peoEA< EOT >) cw +(Runner) cw +(Communicable) cw +(Thread) cw +/boxwidth boxwidth marginwidth 2 mul add def +/xspacing boxwidth distx add def +/yspacing boxheight disty add def +/scalefactor + boxwidth cols mul distx cols 1 sub mul add + boxheight rows mul disty rows 1 sub mul add boundaspect mul + max def +boundx scalefactor div boundy scalefactor div scale + +% ----- classes ----- + + (peoEA< EOT >) 0.5 0 box + (Runner) 0.5 1 box + (Communicable) 0 2 box + (Thread) 1 2 box + +% ----- relations ----- + +solid +0 0.5 0 out +solid +1 0.5 1 in +solid +0 0.5 1 out +solid +0 1 2 conn +solid +1 0 2 in +solid +1 1 2 in diff --git a/branches/paradiseo-peo-meta-model/doc/latex/classpeoEA.tex b/branches/paradiseo-peo-meta-model/doc/latex/classpeoEA.tex new file mode 100644 index 000000000..4d7a535ad --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/latex/classpeoEA.tex @@ -0,0 +1,145 @@ +\hypertarget{classpeoEA}{ +\section{peo\-EA$<$ EOT $>$ Class Template Reference} +\label{classpeoEA}\index{peoEA@{peoEA}} +} +The \hyperlink{classpeoEA}{peo\-EA} class offers an elementary evolutionary algorithm implementation. + + +{\tt \#include $<$peo\-EA.h$>$} + +Inheritance diagram for peo\-EA$<$ EOT $>$::\begin{figure}[H] +\begin{center} +\leavevmode +\includegraphics[height=3cm]{classpeoEA} +\end{center} +\end{figure} +\subsection*{Public Member Functions} +\begin{CompactItemize} +\item +\hyperlink{classpeoEA_dbfc4f8907bef234602149229f132371}{peo\-EA} (\bf{eo\-Continue}$<$ EOT $>$ \&\_\-\_\-cont, \hyperlink{classpeoPopEval}{peo\-Pop\-Eval}$<$ EOT $>$ \&\_\-\_\-pop\_\-eval, \bf{eo\-Select}$<$ EOT $>$ \&\_\-\_\-select, \hyperlink{classpeoTransform}{peo\-Transform}$<$ EOT $>$ \&\_\-\_\-trans, \bf{eo\-Replacement}$<$ EOT $>$ \&\_\-\_\-replace) +\begin{CompactList}\small\item\em Constructor for the evolutionary algorithm object - several basic parameters have to be specified, allowing for different levels of parallelism. \item\end{CompactList}\item +\hypertarget{classpeoEA_6ab8c321d29350634143a2a01cf2ad24}{ +void \hyperlink{classpeoEA_6ab8c321d29350634143a2a01cf2ad24}{run} ()} +\label{classpeoEA_6ab8c321d29350634143a2a01cf2ad24} + +\begin{CompactList}\small\item\em Evolutionary algorithm function - a side effect of the fact that the class is derived from the {\bf \hyperlink{classRunner}{Runner}} class, thus requiring the existence of a {\em run\/} function, the algorithm being executed on a distinct thread. \item\end{CompactList}\item +void \hyperlink{classpeoEA_3c709e3b2491147d26fee36138644613}{operator()} (\bf{eo\-Pop}$<$ EOT $>$ \&\_\-\_\-pop) +\begin{CompactList}\small\item\em \doxyref{Function} operator for specifying the population to be associated with the algorithm. \item\end{CompactList}\end{CompactItemize} +\subsection*{Private Attributes} +\begin{CompactItemize} +\item +\hypertarget{classpeoEA_5f015eebf42f176b9fe322488c446c2a}{ +\bf{eo\-Continue}$<$ EOT $>$ \& \hyperlink{classpeoEA_5f015eebf42f176b9fe322488c446c2a}{cont}} +\label{classpeoEA_5f015eebf42f176b9fe322488c446c2a} + +\item +\hypertarget{classpeoEA_9140259f50c9186edcb062b023624c96}{ +\hyperlink{classpeoPopEval}{peo\-Pop\-Eval}$<$ EOT $>$ \& \hyperlink{classpeoEA_9140259f50c9186edcb062b023624c96}{pop\_\-eval}} +\label{classpeoEA_9140259f50c9186edcb062b023624c96} + +\item +\hypertarget{classpeoEA_2d8428d69fdd6aefefbaf543fdd46d19}{ +\bf{eo\-Select}$<$ EOT $>$ \& \hyperlink{classpeoEA_2d8428d69fdd6aefefbaf543fdd46d19}{select}} +\label{classpeoEA_2d8428d69fdd6aefefbaf543fdd46d19} + +\item +\hypertarget{classpeoEA_713c77935eb8aafebfb9488cfaa4a363}{ +\hyperlink{classpeoTransform}{peo\-Transform}$<$ EOT $>$ \& \hyperlink{classpeoEA_713c77935eb8aafebfb9488cfaa4a363}{trans}} +\label{classpeoEA_713c77935eb8aafebfb9488cfaa4a363} + +\item +\hypertarget{classpeoEA_9bd2d4356cf7e69e3141dc269213aa8a}{ +\bf{eo\-Replacement}$<$ EOT $>$ \& \hyperlink{classpeoEA_9bd2d4356cf7e69e3141dc269213aa8a}{replace}} +\label{classpeoEA_9bd2d4356cf7e69e3141dc269213aa8a} + +\item +\hypertarget{classpeoEA_c0b110e410bc16283e8339f24b733772}{ +\bf{eo\-Pop}$<$ EOT $>$ $\ast$ \hyperlink{classpeoEA_c0b110e410bc16283e8339f24b733772}{pop}} +\label{classpeoEA_c0b110e410bc16283e8339f24b733772} + +\end{CompactItemize} + + +\subsection{Detailed Description} +\subsubsection*{template$<$class EOT$>$ class peo\-EA$<$ EOT $>$} + +The \hyperlink{classpeoEA}{peo\-EA} class offers an elementary evolutionary algorithm implementation. + +In addition, as compared with the algorithms provided by the \doxyref{EO} framework, the \hyperlink{classpeoEA}{peo\-EA} class has the underlying necessary structure for including, for example, parallel evaluation and parallel transformation operators, migration operators etc. Although there is no restriction on using the algorithms provided by the \doxyref{EO} framework, the drawback resides in the fact that the \doxyref{EO} implementation is exclusively sequential and, in consequence, no parallelism is provided. A simple example for constructing a \hyperlink{classpeoEA}{peo\-EA} object: + +\begin{TabularC}{2} +\hline +... ~ &~ \\\hline +eo\-Pop$<$ EOT $>$ population( POP\_\-SIZE, pop\-Initializer ); ~ &// creation of a population with POP\_\-SIZE individuals - the pop\-Initializer is a functor to be called for each individual \\\hline +~ &~ \\\hline +eo\-Gen\-Continue$<$ EOT $>$ ea\-Cont( NUM\_\-GEN ); ~ &// number of generations for the evolutionary algorithm \\\hline +eo\-Check\-Point$<$ EOT $>$ ea\-Checkpoint\-Continue( ea\-Cont ); ~ &// checkpoint incorporating the continuation criterion - startpoint for adding other checkpoint objects \\\hline +~ &~ \\\hline +peo\-Seq\-Pop\-Eval$<$ EOT $>$ ea\-Pop\-Eval( eval\-Function ); ~ &// sequential evaluation functor wrapper - eval\-Function represents the actual evaluation functor \\\hline +~ &~ \\\hline +eo\-Ranking\-Select$<$ EOT $>$ selection\-Strategy; ~ &// selection strategy for creating the offspring population - a simple ranking selection in this case \\\hline +eo\-Select\-Number$<$ EOT $>$ ea\-Select( selection\-Strategy, POP\_\-SIZE ); ~ &// the number of individuals to be selected for creating the offspring population \\\hline +eo\-Ranking\-Select$<$ EOT $>$ selection\-Strategy; ~ &// selection strategy for creating the offspring population - a simple ranking selection in this case \\\hline +~ &~ \\\hline +eo\-SGATransform$<$ EOT $>$ transform( crossover, CROSS\_\-RATE, mutation, MUT\_\-RATE ); ~ &// transformation operator - crossover and mutation operators with their associated probabilities \\\hline +peo\-Seq\-Transform$<$ EOT $>$ ea\-Transform( transform ); ~ &// Paradis\-EO specific sequential operator - a parallel version may be specified in the same manner \\\hline +~ &~ \\\hline +eo\-Plus\-Replacement$<$ EOT $>$ ea\-Replace; ~ &// replacement strategy - for integrating the offspring resulting individuals in the initial population \\\hline +~ &~ \\\hline +peo\-EA$<$ EOT $>$ ea\-Alg( ea\-Checkpoint\-Continue, ea\-Pop\-Eval, ea\-Select, ea\-Transform, ea\-Replace ); ~ &// Paradis\-EO evolutionary algorithm integrating the above defined objects \\\hline +ea\-Alg( population ); ~ &// specifying the initial population for the algorithm \\\hline +... ~ &~ \\\hline +\end{TabularC} + + + + +Definition at line 54 of file peo\-EA.h. + +\subsection{Constructor \& Destructor Documentation} +\hypertarget{classpeoEA_dbfc4f8907bef234602149229f132371}{ +\index{peoEA@{peo\-EA}!peoEA@{peoEA}} +\index{peoEA@{peoEA}!peoEA@{peo\-EA}} +\subsubsection[peoEA]{\setlength{\rightskip}{0pt plus 5cm}template$<$class EOT$>$ \hyperlink{classpeoEA}{peo\-EA}$<$ EOT $>$::\hyperlink{classpeoEA}{peo\-EA} (\bf{eo\-Continue}$<$ EOT $>$ \& {\em \_\-\_\-cont}, \hyperlink{classpeoPopEval}{peo\-Pop\-Eval}$<$ EOT $>$ \& {\em \_\-\_\-pop\_\-eval}, \bf{eo\-Select}$<$ EOT $>$ \& {\em \_\-\_\-select}, \hyperlink{classpeoTransform}{peo\-Transform}$<$ EOT $>$ \& {\em \_\-\_\-trans}, \bf{eo\-Replacement}$<$ EOT $>$ \& {\em \_\-\_\-replace})}} +\label{classpeoEA_dbfc4f8907bef234602149229f132371} + + +Constructor for the evolutionary algorithm object - several basic parameters have to be specified, allowing for different levels of parallelism. + +Depending on the requirements, a sequential or a parallel evaluation operator may be specified or, in the same manner, a sequential or a parallel transformation operator may be given as parameter. Out of the box objects may be provided, from the \doxyref{EO} package, for example, or custom defined ones may be specified, provided that they are derived from the correct base classes. + +\begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em eo\-Continue$<$}]EOT $>$\& \_\-\_\-cont - continuation criterion specifying whether the algorithm should continue or not; \item[{\em peo\-Pop\-Eval$<$}]EOT $>$\& \_\-\_\-pop\_\-eval - evaluation operator; it allows the specification of parallel evaluation operators, aggregate evaluation functions, etc.; \item[{\em eo\-Select$<$}]EOT $>$\& \_\-\_\-select - selection strategy to be applied for constructing a list of offspring individuals; \item[{\em peo\-Transform$<$}]EOT $>$\& \_\-\_\-trans - transformation operator, i.e. crossover and mutation; allows for sequential or parallel transform; \item[{\em eo\-Replacement$<$}]EOT $>$\& \_\-\_\-replace - replacement strategy for integrating the offspring individuals in the initial population; \end{description} +\end{Desc} + + +Definition at line 98 of file peo\-EA.h. + +References peo\-EA$<$ EOT $>$::pop\_\-eval, and peo\-EA$<$ EOT $>$::trans. + +\subsection{Member Function Documentation} +\hypertarget{classpeoEA_3c709e3b2491147d26fee36138644613}{ +\index{peoEA@{peo\-EA}!operator()@{operator()}} +\index{operator()@{operator()}!peoEA@{peo\-EA}} +\subsubsection[operator()]{\setlength{\rightskip}{0pt plus 5cm}template$<$class EOT$>$ void \hyperlink{classpeoEA}{peo\-EA}$<$ EOT $>$::operator() (\bf{eo\-Pop}$<$ EOT $>$ \& {\em \_\-\_\-pop})}} +\label{classpeoEA_3c709e3b2491147d26fee36138644613} + + +\doxyref{Function} operator for specifying the population to be associated with the algorithm. + +\begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em eo\-Pop$<$}]EOT $>$\& \_\-\_\-pop - initial population of the algorithm, to be iteratively evolved; \end{description} +\end{Desc} + + +Definition at line 114 of file peo\-EA.h. + +References peo\-EA$<$ EOT $>$::pop. + +The documentation for this class was generated from the following file:\begin{CompactItemize} +\item +peo\-EA.h\end{CompactItemize} diff --git a/branches/paradiseo-peo-meta-model/doc/latex/classpeoNoAggEvalFunc.eps b/branches/paradiseo-peo-meta-model/doc/latex/classpeoNoAggEvalFunc.eps new file mode 100644 index 000000000..b9f8ee753 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/latex/classpeoNoAggEvalFunc.eps @@ -0,0 +1,209 @@ +%!PS-Adobe-2.0 EPSF-2.0 +%%Title: ClassName +%%Creator: Doxygen +%%CreationDate: Time +%%For: +%Magnification: 1.00 +%%Orientation: Portrait +%%BoundingBox: 0 0 500 437.158 +%%Pages: 0 +%%BeginSetup +%%EndSetup +%%EndComments + +% ----- variables ----- + +/boxwidth 0 def +/boxheight 40 def +/fontheight 24 def +/marginwidth 10 def +/distx 20 def +/disty 40 def +/boundaspect 1.14375 def % aspect ratio of the BoundingBox (width/height) +/boundx 500 def +/boundy boundx boundaspect div def +/xspacing 0 def +/yspacing 0 def +/rows 4 def +/cols 1 def +/scalefactor 0 def +/boxfont /Times-Roman findfont fontheight scalefont def + +% ----- procedures ----- + +/dotted { [1 4] 0 setdash } def +/dashed { [5] 0 setdash } def +/solid { [] 0 setdash } def + +/max % result = MAX(arg1,arg2) +{ + /a exch def + /b exch def + a b gt {a} {b} ifelse +} def + +/xoffset % result = MAX(0,(scalefactor-(boxwidth*cols+distx*(cols-1)))/2) +{ + 0 scalefactor boxwidth cols mul distx cols 1 sub mul add sub 2 div max +} def + +/cw % boxwidth = MAX(boxwidth, stringwidth(arg1)) +{ + /str exch def + /boxwidth boxwidth str stringwidth pop max def +} def + +/box % draws a box with text `arg1' at grid pos (arg2,arg3) +{ gsave + 2 setlinewidth + newpath + exch xspacing mul xoffset add + exch yspacing mul + moveto + boxwidth 0 rlineto + 0 boxheight rlineto + boxwidth neg 0 rlineto + 0 boxheight neg rlineto + closepath + dup stringwidth pop neg boxwidth add 2 div + boxheight fontheight 2 div sub 2 div + rmoveto show stroke + grestore +} def + +/mark +{ newpath + exch xspacing mul xoffset add boxwidth add + exch yspacing mul + moveto + 0 boxheight 4 div rlineto + boxheight neg 4 div boxheight neg 4 div rlineto + closepath + eofill + stroke +} def + +/arrow +{ newpath + moveto + 3 -8 rlineto + -6 0 rlineto + 3 8 rlineto + closepath + eofill + stroke +} def + +/out % draws an output connector for the block at (arg1,arg2) +{ + newpath + exch xspacing mul xoffset add boxwidth 2 div add + exch yspacing mul boxheight add + /y exch def + /x exch def + x y moveto + 0 disty 2 div rlineto + stroke + 1 eq { x y disty 2 div add arrow } if +} def + +/in % draws an input connector for the block at (arg1,arg2) +{ + newpath + exch xspacing mul xoffset add boxwidth 2 div add + exch yspacing mul disty 2 div sub + /y exch def + /x exch def + x y moveto + 0 disty 2 div rlineto + stroke + 1 eq { x y disty 2 div add arrow } if +} def + +/hedge +{ + exch xspacing mul xoffset add boxwidth 2 div add + exch yspacing mul boxheight 2 div sub + /y exch def + /x exch def + newpath + x y moveto + boxwidth 2 div distx add 0 rlineto + stroke + 1 eq + { newpath x boxwidth 2 div distx add add y moveto + -8 3 rlineto + 0 -6 rlineto + 8 3 rlineto + closepath + eofill + stroke + } if +} def + +/vedge +{ + /ye exch def + /ys exch def + /xs exch def + newpath + xs xspacing mul xoffset add boxwidth 2 div add dup + ys yspacing mul boxheight 2 div sub + moveto + ye yspacing mul boxheight 2 div sub + lineto + stroke +} def + +/conn % connections the blocks from col `arg1' to `arg2' of row `arg3' +{ + /ys exch def + /xe exch def + /xs exch def + newpath + xs xspacing mul xoffset add boxwidth 2 div add + ys yspacing mul disty 2 div sub + moveto + xspacing xe xs sub mul 0 + rlineto + stroke +} def + +% ----- main ------ + +boxfont setfont +1 boundaspect scale +(peoNoAggEvalFunc< EOT >) cw +(peoAggEvalFunc< EOT >) cw +(eoBF< A1, A2, R >) cw +(eoFunctorBase) cw +/boxwidth boxwidth marginwidth 2 mul add def +/xspacing boxwidth distx add def +/yspacing boxheight disty add def +/scalefactor + boxwidth cols mul distx cols 1 sub mul add + boxheight rows mul disty rows 1 sub mul add boundaspect mul + max def +boundx scalefactor div boundy scalefactor div scale + +% ----- classes ----- + + (peoNoAggEvalFunc< EOT >) 0 0 box + (peoAggEvalFunc< EOT >) 0 1 box + (eoBF< A1, A2, R >) 0 2 box + (eoFunctorBase) 0 3 box + +% ----- relations ----- + +solid +0 0 0 out +solid +1 0 1 in +solid +0 0 1 out +solid +1 0 2 in +solid +0 0 2 out +solid +1 0 3 in diff --git a/branches/paradiseo-peo-meta-model/doc/latex/classpeoNoAggEvalFunc.tex b/branches/paradiseo-peo-meta-model/doc/latex/classpeoNoAggEvalFunc.tex new file mode 100644 index 000000000..5604e3840 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/latex/classpeoNoAggEvalFunc.tex @@ -0,0 +1,39 @@ +\hypertarget{classpeoNoAggEvalFunc}{ +\section{peo\-No\-Agg\-Eval\-Func$<$ EOT $>$ Class Template Reference} +\label{classpeoNoAggEvalFunc}\index{peoNoAggEvalFunc@{peoNoAggEvalFunc}} +} +The \hyperlink{classpeoNoAggEvalFunc}{peo\-No\-Agg\-Eval\-Func} class does nothing more than an association between a fitness value and a specified individual. + + +{\tt \#include $<$peo\-No\-Agg\-Eval\-Func.h$>$} + +Inheritance diagram for peo\-No\-Agg\-Eval\-Func$<$ EOT $>$::\begin{figure}[H] +\begin{center} +\leavevmode +\includegraphics[height=4cm]{classpeoNoAggEvalFunc} +\end{center} +\end{figure} +\subsection*{Public Member Functions} +\begin{CompactItemize} +\item +\hypertarget{classpeoNoAggEvalFunc_1a69ee1af8745ac75c864bf884436de5}{ +void \hyperlink{classpeoNoAggEvalFunc_1a69ee1af8745ac75c864bf884436de5}{operator()} (EOT \&\_\-\_\-sol, const typename EOT::Fitness \&\_\-\_\-fit)} +\label{classpeoNoAggEvalFunc_1a69ee1af8745ac75c864bf884436de5} + +\begin{CompactList}\small\item\em Operator which sets as fitness the {\bf \_\-\_\-fit} value for the {\bf \_\-\_\-sol} individual. \item\end{CompactList}\end{CompactItemize} + + +\subsection{Detailed Description} +\subsubsection*{template$<$class EOT$>$ class peo\-No\-Agg\-Eval\-Func$<$ EOT $>$} + +The \hyperlink{classpeoNoAggEvalFunc}{peo\-No\-Agg\-Eval\-Func} class does nothing more than an association between a fitness value and a specified individual. + +The class is provided as a mean of declaring that no aggregation is required for the evaluation function - the fitness value is explicitly specified. + + + +Definition at line 19 of file peo\-No\-Agg\-Eval\-Func.h. + +The documentation for this class was generated from the following file:\begin{CompactItemize} +\item +peo\-No\-Agg\-Eval\-Func.h\end{CompactItemize} diff --git a/branches/paradiseo-peo-meta-model/doc/latex/classpeoParaPopEval.eps b/branches/paradiseo-peo-meta-model/doc/latex/classpeoParaPopEval.eps new file mode 100644 index 000000000..25c8b8af1 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/latex/classpeoParaPopEval.eps @@ -0,0 +1,209 @@ +%!PS-Adobe-2.0 EPSF-2.0 +%%Title: ClassName +%%Creator: Doxygen +%%CreationDate: Time +%%For: +%Magnification: 1.00 +%%Orientation: Portrait +%%BoundingBox: 0 0 500 487.805 +%%Pages: 0 +%%BeginSetup +%%EndSetup +%%EndComments + +% ----- variables ----- + +/boxwidth 0 def +/boxheight 40 def +/fontheight 24 def +/marginwidth 10 def +/distx 20 def +/disty 40 def +/boundaspect 1.025 def % aspect ratio of the BoundingBox (width/height) +/boundx 500 def +/boundy boundx boundaspect div def +/xspacing 0 def +/yspacing 0 def +/rows 4 def +/cols 1 def +/scalefactor 0 def +/boxfont /Times-Roman findfont fontheight scalefont def + +% ----- procedures ----- + +/dotted { [1 4] 0 setdash } def +/dashed { [5] 0 setdash } def +/solid { [] 0 setdash } def + +/max % result = MAX(arg1,arg2) +{ + /a exch def + /b exch def + a b gt {a} {b} ifelse +} def + +/xoffset % result = MAX(0,(scalefactor-(boxwidth*cols+distx*(cols-1)))/2) +{ + 0 scalefactor boxwidth cols mul distx cols 1 sub mul add sub 2 div max +} def + +/cw % boxwidth = MAX(boxwidth, stringwidth(arg1)) +{ + /str exch def + /boxwidth boxwidth str stringwidth pop max def +} def + +/box % draws a box with text `arg1' at grid pos (arg2,arg3) +{ gsave + 2 setlinewidth + newpath + exch xspacing mul xoffset add + exch yspacing mul + moveto + boxwidth 0 rlineto + 0 boxheight rlineto + boxwidth neg 0 rlineto + 0 boxheight neg rlineto + closepath + dup stringwidth pop neg boxwidth add 2 div + boxheight fontheight 2 div sub 2 div + rmoveto show stroke + grestore +} def + +/mark +{ newpath + exch xspacing mul xoffset add boxwidth add + exch yspacing mul + moveto + 0 boxheight 4 div rlineto + boxheight neg 4 div boxheight neg 4 div rlineto + closepath + eofill + stroke +} def + +/arrow +{ newpath + moveto + 3 -8 rlineto + -6 0 rlineto + 3 8 rlineto + closepath + eofill + stroke +} def + +/out % draws an output connector for the block at (arg1,arg2) +{ + newpath + exch xspacing mul xoffset add boxwidth 2 div add + exch yspacing mul boxheight add + /y exch def + /x exch def + x y moveto + 0 disty 2 div rlineto + stroke + 1 eq { x y disty 2 div add arrow } if +} def + +/in % draws an input connector for the block at (arg1,arg2) +{ + newpath + exch xspacing mul xoffset add boxwidth 2 div add + exch yspacing mul disty 2 div sub + /y exch def + /x exch def + x y moveto + 0 disty 2 div rlineto + stroke + 1 eq { x y disty 2 div add arrow } if +} def + +/hedge +{ + exch xspacing mul xoffset add boxwidth 2 div add + exch yspacing mul boxheight 2 div sub + /y exch def + /x exch def + newpath + x y moveto + boxwidth 2 div distx add 0 rlineto + stroke + 1 eq + { newpath x boxwidth 2 div distx add add y moveto + -8 3 rlineto + 0 -6 rlineto + 8 3 rlineto + closepath + eofill + stroke + } if +} def + +/vedge +{ + /ye exch def + /ys exch def + /xs exch def + newpath + xs xspacing mul xoffset add boxwidth 2 div add dup + ys yspacing mul boxheight 2 div sub + moveto + ye yspacing mul boxheight 2 div sub + lineto + stroke +} def + +/conn % connections the blocks from col `arg1' to `arg2' of row `arg3' +{ + /ys exch def + /xe exch def + /xs exch def + newpath + xs xspacing mul xoffset add boxwidth 2 div add + ys yspacing mul disty 2 div sub + moveto + xspacing xe xs sub mul 0 + rlineto + stroke +} def + +% ----- main ------ + +boxfont setfont +1 boundaspect scale +(peoParaPopEval< EOT >) cw +(peoPopEval< EOT >) cw +(Service) cw +(Communicable) cw +/boxwidth boxwidth marginwidth 2 mul add def +/xspacing boxwidth distx add def +/yspacing boxheight disty add def +/scalefactor + boxwidth cols mul distx cols 1 sub mul add + boxheight rows mul disty rows 1 sub mul add boundaspect mul + max def +boundx scalefactor div boundy scalefactor div scale + +% ----- classes ----- + + (peoParaPopEval< EOT >) 0 0 box + (peoPopEval< EOT >) 0 1 box + (Service) 0 2 box + (Communicable) 0 3 box + +% ----- relations ----- + +solid +0 0 0 out +solid +1 0 1 in +solid +0 0 1 out +solid +1 0 2 in +solid +0 0 2 out +solid +1 0 3 in diff --git a/branches/paradiseo-peo-meta-model/doc/latex/classpeoParaPopEval.tex b/branches/paradiseo-peo-meta-model/doc/latex/classpeoParaPopEval.tex new file mode 100644 index 000000000..1d94eb62c --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/latex/classpeoParaPopEval.tex @@ -0,0 +1,258 @@ +\hypertarget{classpeoParaPopEval}{ +\section{peo\-Para\-Pop\-Eval$<$ EOT $>$ Class Template Reference} +\label{classpeoParaPopEval}\index{peoParaPopEval@{peoParaPopEval}} +} +The \hyperlink{classpeoParaPopEval}{peo\-Para\-Pop\-Eval} represents a wrapper for creating a functor capable of applying in parallel an EO-derived evaluation functor. + + +{\tt \#include $<$peo\-Para\-Pop\-Eval.h$>$} + +Inheritance diagram for peo\-Para\-Pop\-Eval$<$ EOT $>$::\begin{figure}[H] +\begin{center} +\leavevmode +\includegraphics[height=4cm]{classpeoParaPopEval} +\end{center} +\end{figure} +\subsection*{Public Member Functions} +\begin{CompactItemize} +\item +\hyperlink{classpeoParaPopEval_bcb540510a7038520bec41a7af332daf}{peo\-Para\-Pop\-Eval} (\bf{eo\-Eval\-Func}$<$ EOT $>$ \&\_\-\_\-eval\_\-func) +\begin{CompactList}\small\item\em Constructor function - an EO-derived evaluation functor has to be specified; an internal reference is set towards the specified evaluation functor. \item\end{CompactList}\item +\hyperlink{classpeoParaPopEval_1cc13a1ec366f95d219d682eccb455bc}{peo\-Para\-Pop\-Eval} (const std::vector$<$ \bf{eo\-Eval\-Func}$<$ EOT $>$ $\ast$ $>$ \&\_\-\_\-funcs, \hyperlink{classpeoAggEvalFunc}{peo\-Agg\-Eval\-Func}$<$ EOT $>$ \&\_\-\_\-merge\_\-eval) +\begin{CompactList}\small\item\em Constructor function - a vector of EO-derived evaluation functors has to be specified as well as an aggregation function. \item\end{CompactList}\item +void \hyperlink{classpeoParaPopEval_aeaa4fca4f8650e453e308838b4a2cb5}{operator()} (\bf{eo\-Pop}$<$ EOT $>$ \&\_\-\_\-pop) +\begin{CompactList}\small\item\em Operator for applying the evaluation functor (direct or aggregate) for each individual of the specified population. \item\end{CompactList}\item +void \hyperlink{classpeoParaPopEval_fea632bd645ab11182782fd3c038d6d8}{pack\-Data} () +\begin{CompactList}\small\item\em Auxiliary function for transferring data between the process requesting an evaluation operation and the process that performs the actual evaluation phase. \item\end{CompactList}\item +void \hyperlink{classpeoParaPopEval_410bf4c173e2f36df82251cb16ce1b05}{unpack\-Data} () +\begin{CompactList}\small\item\em Auxiliary function for transferring data between the process requesting an evaluation operation and the process that performs the actual evaluation phase. \item\end{CompactList}\item +\hypertarget{classpeoParaPopEval_3af76378611eac5a36da9a0a00aeeb6c}{ +void \hyperlink{classpeoParaPopEval_3af76378611eac5a36da9a0a00aeeb6c}{execute} ()} +\label{classpeoParaPopEval_3af76378611eac5a36da9a0a00aeeb6c} + +\begin{CompactList}\small\item\em Auxiliary function - it calls the specified evaluation functor(s). There is no need to explicitly call the function. \item\end{CompactList}\item +void \hyperlink{classpeoParaPopEval_24bb4ae84b0b9f64e7170e3d2b0e1223}{pack\-Result} () +\begin{CompactList}\small\item\em Auxiliary function for transferring data between the process requesting an evaluation operation and the process that performs the actual evaluation phase. \item\end{CompactList}\item +void \hyperlink{classpeoParaPopEval_fd7f0afe9cba30be39269d16097e190e}{unpack\-Result} () +\begin{CompactList}\small\item\em Auxiliary function for transferring data between the process requesting an evaluation operation and the process that performs the actual evaluation phase. \item\end{CompactList}\item +void \hyperlink{classpeoParaPopEval_1f78c3cec2940af08a059cc1aa96a9c8}{notify\-Sending\-Data} () +\begin{CompactList}\small\item\em Auxiliary function for notifications between the process requesting an evaluation operation and the processes that performs the actual evaluation phase. \item\end{CompactList}\item +void \hyperlink{classpeoParaPopEval_b77031fc4807921ffaf7cf6b669a7665}{notify\-Sending\-All\-Resource\-Requests} () +\begin{CompactList}\small\item\em Auxiliary function for notifications between the process requesting an evaluation operation and the processes that performs the actual evaluation phase. \item\end{CompactList}\end{CompactItemize} +\subsection*{Private Attributes} +\begin{CompactItemize} +\item +\hypertarget{classpeoParaPopEval_6d69b8f73c0b5d72baf75d6e53f025b7}{ +const std::vector$<$ \bf{eo\-Eval\-Func}$<$ EOT $>$ $\ast$ $>$ \& \hyperlink{classpeoParaPopEval_6d69b8f73c0b5d72baf75d6e53f025b7}{funcs}} +\label{classpeoParaPopEval_6d69b8f73c0b5d72baf75d6e53f025b7} + +\item +\hypertarget{classpeoParaPopEval_f0e8af3ee442d2b6baf0bd122226be3c}{ +std::vector$<$ \bf{eo\-Eval\-Func}$<$ EOT $>$ $\ast$ $>$ \hyperlink{classpeoParaPopEval_f0e8af3ee442d2b6baf0bd122226be3c}{one\_\-func}} +\label{classpeoParaPopEval_f0e8af3ee442d2b6baf0bd122226be3c} + +\item +\hypertarget{classpeoParaPopEval_b48bcd4e9f92f364118304535c089456}{ +\hyperlink{classpeoAggEvalFunc}{peo\-Agg\-Eval\-Func}$<$ EOT $>$ \& \hyperlink{classpeoParaPopEval_b48bcd4e9f92f364118304535c089456}{merge\_\-eval}} +\label{classpeoParaPopEval_b48bcd4e9f92f364118304535c089456} + +\item +\hypertarget{classpeoParaPopEval_bf255dd5861e27108c2abae7309d7690}{ +\hyperlink{classpeoNoAggEvalFunc}{peo\-No\-Agg\-Eval\-Func}$<$ EOT $>$ \hyperlink{classpeoParaPopEval_bf255dd5861e27108c2abae7309d7690}{no\_\-merge\_\-eval}} +\label{classpeoParaPopEval_bf255dd5861e27108c2abae7309d7690} + +\item +\hypertarget{classpeoParaPopEval_af76cd18368a0f6185878f37f0b5f272}{ +std::queue$<$ EOT $\ast$ $>$ \hyperlink{classpeoParaPopEval_af76cd18368a0f6185878f37f0b5f272}{tasks}} +\label{classpeoParaPopEval_af76cd18368a0f6185878f37f0b5f272} + +\item +\hypertarget{classpeoParaPopEval_80e7e34bb1bb2d12f1f2eed3feac6ecf}{ +std::map$<$ EOT $\ast$, std::pair$<$ unsigned, unsigned $>$ $>$ \hyperlink{classpeoParaPopEval_80e7e34bb1bb2d12f1f2eed3feac6ecf}{progression}} +\label{classpeoParaPopEval_80e7e34bb1bb2d12f1f2eed3feac6ecf} + +\item +\hypertarget{classpeoParaPopEval_87abb090c0de39f0ccc36af1f07cca0c}{ +unsigned \hyperlink{classpeoParaPopEval_87abb090c0de39f0ccc36af1f07cca0c}{num\_\-func}} +\label{classpeoParaPopEval_87abb090c0de39f0ccc36af1f07cca0c} + +\item +\hypertarget{classpeoParaPopEval_fb6941e0455515a908eb82342b995163}{ +EOT \hyperlink{classpeoParaPopEval_fb6941e0455515a908eb82342b995163}{sol}} +\label{classpeoParaPopEval_fb6941e0455515a908eb82342b995163} + +\item +\hypertarget{classpeoParaPopEval_60cafeab376262af675fdff43434c8d8}{ +EOT $\ast$ \hyperlink{classpeoParaPopEval_60cafeab376262af675fdff43434c8d8}{ad\_\-sol}} +\label{classpeoParaPopEval_60cafeab376262af675fdff43434c8d8} + +\item +\hypertarget{classpeoParaPopEval_b528ad9dd9006c3dd57f149a3843e57d}{ +unsigned \hyperlink{classpeoParaPopEval_b528ad9dd9006c3dd57f149a3843e57d}{total}} +\label{classpeoParaPopEval_b528ad9dd9006c3dd57f149a3843e57d} + +\end{CompactItemize} + + +\subsection{Detailed Description} +\subsubsection*{template$<$class EOT$>$ class peo\-Para\-Pop\-Eval$<$ EOT $>$} + +The \hyperlink{classpeoParaPopEval}{peo\-Para\-Pop\-Eval} represents a wrapper for creating a functor capable of applying in parallel an EO-derived evaluation functor. + +The class offers the possibility of chosing between a single-function evaluation and an aggregate evaluation function, including several sub-evalution functions. + + + +Definition at line 26 of file peo\-Para\-Pop\-Eval.h. + +\subsection{Constructor \& Destructor Documentation} +\hypertarget{classpeoParaPopEval_bcb540510a7038520bec41a7af332daf}{ +\index{peoParaPopEval@{peo\-Para\-Pop\-Eval}!peoParaPopEval@{peoParaPopEval}} +\index{peoParaPopEval@{peoParaPopEval}!peoParaPopEval@{peo\-Para\-Pop\-Eval}} +\subsubsection[peoParaPopEval]{\setlength{\rightskip}{0pt plus 5cm}template$<$class EOT$>$ \hyperlink{classpeoParaPopEval}{peo\-Para\-Pop\-Eval}$<$ EOT $>$::\hyperlink{classpeoParaPopEval}{peo\-Para\-Pop\-Eval} (\bf{eo\-Eval\-Func}$<$ EOT $>$ \& {\em \_\-\_\-eval\_\-func})}} +\label{classpeoParaPopEval_bcb540510a7038520bec41a7af332daf} + + +Constructor function - an EO-derived evaluation functor has to be specified; an internal reference is set towards the specified evaluation functor. + +\begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em eo\-Eval\-Func$<$}]EOT $>$\& \_\-\_\-eval\_\-func - EO-derived evaluation functor to be applied in parallel on each individual of a specified population \end{description} +\end{Desc} + + +Definition at line 102 of file peo\-Para\-Pop\-Eval.h. + +References peo\-Para\-Pop\-Eval$<$ EOT $>$::one\_\-func.\hypertarget{classpeoParaPopEval_1cc13a1ec366f95d219d682eccb455bc}{ +\index{peoParaPopEval@{peo\-Para\-Pop\-Eval}!peoParaPopEval@{peoParaPopEval}} +\index{peoParaPopEval@{peoParaPopEval}!peoParaPopEval@{peo\-Para\-Pop\-Eval}} +\subsubsection[peoParaPopEval]{\setlength{\rightskip}{0pt plus 5cm}template$<$class EOT$>$ \hyperlink{classpeoParaPopEval}{peo\-Para\-Pop\-Eval}$<$ EOT $>$::\hyperlink{classpeoParaPopEval}{peo\-Para\-Pop\-Eval} (const std::vector$<$ \bf{eo\-Eval\-Func}$<$ EOT $>$ $\ast$ $>$ \& {\em \_\-\_\-funcs}, \hyperlink{classpeoAggEvalFunc}{peo\-Agg\-Eval\-Func}$<$ EOT $>$ \& {\em \_\-\_\-merge\_\-eval})}} +\label{classpeoParaPopEval_1cc13a1ec366f95d219d682eccb455bc} + + +Constructor function - a vector of EO-derived evaluation functors has to be specified as well as an aggregation function. + +\begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em const}]std :: vector$<$ \doxyref{eo\-Eval\-Func} $<$ EOT $>$$\ast$ $>$\& \_\-\_\-funcs - vector of EO-derived partial evaluation functors; \item[{\em peo\-Agg\-Eval\-Func$<$}]EOT $>$\& \_\-\_\-merge\_\-eval - aggregation functor for creating a fitness value out of the partial fitness values. \end{description} +\end{Desc} + + +Definition at line 111 of file peo\-Para\-Pop\-Eval.h. + +\subsection{Member Function Documentation} +\hypertarget{classpeoParaPopEval_aeaa4fca4f8650e453e308838b4a2cb5}{ +\index{peoParaPopEval@{peo\-Para\-Pop\-Eval}!operator()@{operator()}} +\index{operator()@{operator()}!peoParaPopEval@{peo\-Para\-Pop\-Eval}} +\subsubsection[operator()]{\setlength{\rightskip}{0pt plus 5cm}template$<$class EOT$>$ void \hyperlink{classpeoParaPopEval}{peo\-Para\-Pop\-Eval}$<$ EOT $>$::operator() (\bf{eo\-Pop}$<$ EOT $>$ \& {\em \_\-\_\-pop})\hspace{0.3cm}{\tt \mbox{[}virtual\mbox{]}}}} +\label{classpeoParaPopEval_aeaa4fca4f8650e453e308838b4a2cb5} + + +Operator for applying the evaluation functor (direct or aggregate) for each individual of the specified population. + +\begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em eo\-Pop$<$}]EOT $>$\& \_\-\_\-pop - population to be evaluated by applying the evaluation functor specified in the constructor. \end{description} +\end{Desc} + + +Implements \hyperlink{classpeoPopEval_2f208067a5e39c3b26c1234050a41e8f}{peo\-Pop\-Eval$<$ EOT $>$}. + +Definition at line 122 of file peo\-Para\-Pop\-Eval.h. + +References peo\-Para\-Pop\-Eval$<$ EOT $>$::funcs, peo\-Para\-Pop\-Eval$<$ EOT $>$::progression, Service::request\-Resource\-Request(), Communicable::stop(), peo\-Para\-Pop\-Eval$<$ EOT $>$::tasks, and peo\-Para\-Pop\-Eval$<$ EOT $>$::total.\hypertarget{classpeoParaPopEval_fea632bd645ab11182782fd3c038d6d8}{ +\index{peoParaPopEval@{peo\-Para\-Pop\-Eval}!packData@{packData}} +\index{packData@{packData}!peoParaPopEval@{peo\-Para\-Pop\-Eval}} +\subsubsection[packData]{\setlength{\rightskip}{0pt plus 5cm}template$<$class EOT$>$ void \hyperlink{classpeoParaPopEval}{peo\-Para\-Pop\-Eval}$<$ EOT $>$::pack\-Data ()\hspace{0.3cm}{\tt \mbox{[}virtual\mbox{]}}}} +\label{classpeoParaPopEval_fea632bd645ab11182782fd3c038d6d8} + + +Auxiliary function for transferring data between the process requesting an evaluation operation and the process that performs the actual evaluation phase. + +There is no need to explicitly call the function. + +Reimplemented from \hyperlink{classService_aea4b8f7f8fb88e83862ee4bfd9ab207}{Service}. + +Definition at line 143 of file peo\-Para\-Pop\-Eval.h. + +References peo\-Para\-Pop\-Eval$<$ EOT $>$::progression, and peo\-Para\-Pop\-Eval$<$ EOT $>$::tasks.\hypertarget{classpeoParaPopEval_410bf4c173e2f36df82251cb16ce1b05}{ +\index{peoParaPopEval@{peo\-Para\-Pop\-Eval}!unpackData@{unpackData}} +\index{unpackData@{unpackData}!peoParaPopEval@{peo\-Para\-Pop\-Eval}} +\subsubsection[unpackData]{\setlength{\rightskip}{0pt plus 5cm}template$<$class EOT$>$ void \hyperlink{classpeoParaPopEval}{peo\-Para\-Pop\-Eval}$<$ EOT $>$::unpack\-Data ()\hspace{0.3cm}{\tt \mbox{[}virtual\mbox{]}}}} +\label{classpeoParaPopEval_410bf4c173e2f36df82251cb16ce1b05} + + +Auxiliary function for transferring data between the process requesting an evaluation operation and the process that performs the actual evaluation phase. + +There is no need to explicitly call the function. + +Reimplemented from \hyperlink{classService_3bd87b444710813d30fd754d4d0b4df3}{Service}. + +Definition at line 157 of file peo\-Para\-Pop\-Eval.h. + +References peo\-Para\-Pop\-Eval$<$ EOT $>$::ad\_\-sol, peo\-Para\-Pop\-Eval$<$ EOT $>$::num\_\-func, and peo\-Para\-Pop\-Eval$<$ EOT $>$::sol.\hypertarget{classpeoParaPopEval_24bb4ae84b0b9f64e7170e3d2b0e1223}{ +\index{peoParaPopEval@{peo\-Para\-Pop\-Eval}!packResult@{packResult}} +\index{packResult@{packResult}!peoParaPopEval@{peo\-Para\-Pop\-Eval}} +\subsubsection[packResult]{\setlength{\rightskip}{0pt plus 5cm}template$<$class EOT$>$ void \hyperlink{classpeoParaPopEval}{peo\-Para\-Pop\-Eval}$<$ EOT $>$::pack\-Result ()\hspace{0.3cm}{\tt \mbox{[}virtual\mbox{]}}}} +\label{classpeoParaPopEval_24bb4ae84b0b9f64e7170e3d2b0e1223} + + +Auxiliary function for transferring data between the process requesting an evaluation operation and the process that performs the actual evaluation phase. + +There is no need to explicitly call the function. + +Reimplemented from \hyperlink{classService_e5e4f90b2315e15c2a2913bd370f4cf5}{Service}. + +Definition at line 174 of file peo\-Para\-Pop\-Eval.h. + +References peo\-Para\-Pop\-Eval$<$ EOT $>$::ad\_\-sol, and peo\-Para\-Pop\-Eval$<$ EOT $>$::sol.\hypertarget{classpeoParaPopEval_fd7f0afe9cba30be39269d16097e190e}{ +\index{peoParaPopEval@{peo\-Para\-Pop\-Eval}!unpackResult@{unpackResult}} +\index{unpackResult@{unpackResult}!peoParaPopEval@{peo\-Para\-Pop\-Eval}} +\subsubsection[unpackResult]{\setlength{\rightskip}{0pt plus 5cm}template$<$class EOT$>$ void \hyperlink{classpeoParaPopEval}{peo\-Para\-Pop\-Eval}$<$ EOT $>$::unpack\-Result ()\hspace{0.3cm}{\tt \mbox{[}virtual\mbox{]}}}} +\label{classpeoParaPopEval_fd7f0afe9cba30be39269d16097e190e} + + +Auxiliary function for transferring data between the process requesting an evaluation operation and the process that performs the actual evaluation phase. + +There is no need to explicitly call the function. + +Reimplemented from \hyperlink{classService_45c06344edbfa482b91f68e2035a6099}{Service}. + +Definition at line 183 of file peo\-Para\-Pop\-Eval.h. + +References peo\-Para\-Pop\-Eval$<$ EOT $>$::ad\_\-sol, Service::get\-Owner(), peo\-Para\-Pop\-Eval$<$ EOT $>$::merge\_\-eval, peo\-Para\-Pop\-Eval$<$ EOT $>$::progression, Communicable::resume(), Thread::set\-Active(), and peo\-Para\-Pop\-Eval$<$ EOT $>$::total.\hypertarget{classpeoParaPopEval_1f78c3cec2940af08a059cc1aa96a9c8}{ +\index{peoParaPopEval@{peo\-Para\-Pop\-Eval}!notifySendingData@{notifySendingData}} +\index{notifySendingData@{notifySendingData}!peoParaPopEval@{peo\-Para\-Pop\-Eval}} +\subsubsection[notifySendingData]{\setlength{\rightskip}{0pt plus 5cm}template$<$class EOT$>$ void \hyperlink{classpeoParaPopEval}{peo\-Para\-Pop\-Eval}$<$ EOT $>$::notify\-Sending\-Data ()\hspace{0.3cm}{\tt \mbox{[}virtual\mbox{]}}}} +\label{classpeoParaPopEval_1f78c3cec2940af08a059cc1aa96a9c8} + + +Auxiliary function for notifications between the process requesting an evaluation operation and the processes that performs the actual evaluation phase. + +There is no need to explicitly call the function. + +Reimplemented from \hyperlink{classService_81ad4d6ebb50045b8977e2ab74826f30}{Service}. + +Definition at line 214 of file peo\-Para\-Pop\-Eval.h.\hypertarget{classpeoParaPopEval_b77031fc4807921ffaf7cf6b669a7665}{ +\index{peoParaPopEval@{peo\-Para\-Pop\-Eval}!notifySendingAllResourceRequests@{notifySendingAllResourceRequests}} +\index{notifySendingAllResourceRequests@{notifySendingAllResourceRequests}!peoParaPopEval@{peo\-Para\-Pop\-Eval}} +\subsubsection[notifySendingAllResourceRequests]{\setlength{\rightskip}{0pt plus 5cm}template$<$class EOT$>$ void \hyperlink{classpeoParaPopEval}{peo\-Para\-Pop\-Eval}$<$ EOT $>$::notify\-Sending\-All\-Resource\-Requests ()\hspace{0.3cm}{\tt \mbox{[}virtual\mbox{]}}}} +\label{classpeoParaPopEval_b77031fc4807921ffaf7cf6b669a7665} + + +Auxiliary function for notifications between the process requesting an evaluation operation and the processes that performs the actual evaluation phase. + +There is no need to explicitly call the function. + +Reimplemented from \hyperlink{classService_f94cc8a5c2665d4574041737e61e9ffc}{Service}. + +Definition at line 219 of file peo\-Para\-Pop\-Eval.h. + +References Service::get\-Owner(), and Thread::set\-Passive(). + +The documentation for this class was generated from the following file:\begin{CompactItemize} +\item +peo\-Para\-Pop\-Eval.h\end{CompactItemize} diff --git a/branches/paradiseo-peo-meta-model/doc/latex/classpeoParaSGATransform.eps b/branches/paradiseo-peo-meta-model/doc/latex/classpeoParaSGATransform.eps new file mode 100644 index 000000000..7b2968db4 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/latex/classpeoParaSGATransform.eps @@ -0,0 +1,227 @@ +%!PS-Adobe-2.0 EPSF-2.0 +%%Title: ClassName +%%Creator: Doxygen +%%CreationDate: Time +%%For: +%Magnification: 1.00 +%%Orientation: Portrait +%%BoundingBox: 0 0 500 250 +%%Pages: 0 +%%BeginSetup +%%EndSetup +%%EndComments + +% ----- variables ----- + +/boxwidth 0 def +/boxheight 40 def +/fontheight 24 def +/marginwidth 10 def +/distx 20 def +/disty 40 def +/boundaspect 2 def % aspect ratio of the BoundingBox (width/height) +/boundx 500 def +/boundy boundx boundaspect div def +/xspacing 0 def +/yspacing 0 def +/rows 5 def +/cols 2 def +/scalefactor 0 def +/boxfont /Times-Roman findfont fontheight scalefont def + +% ----- procedures ----- + +/dotted { [1 4] 0 setdash } def +/dashed { [5] 0 setdash } def +/solid { [] 0 setdash } def + +/max % result = MAX(arg1,arg2) +{ + /a exch def + /b exch def + a b gt {a} {b} ifelse +} def + +/xoffset % result = MAX(0,(scalefactor-(boxwidth*cols+distx*(cols-1)))/2) +{ + 0 scalefactor boxwidth cols mul distx cols 1 sub mul add sub 2 div max +} def + +/cw % boxwidth = MAX(boxwidth, stringwidth(arg1)) +{ + /str exch def + /boxwidth boxwidth str stringwidth pop max def +} def + +/box % draws a box with text `arg1' at grid pos (arg2,arg3) +{ gsave + 2 setlinewidth + newpath + exch xspacing mul xoffset add + exch yspacing mul + moveto + boxwidth 0 rlineto + 0 boxheight rlineto + boxwidth neg 0 rlineto + 0 boxheight neg rlineto + closepath + dup stringwidth pop neg boxwidth add 2 div + boxheight fontheight 2 div sub 2 div + rmoveto show stroke + grestore +} def + +/mark +{ newpath + exch xspacing mul xoffset add boxwidth add + exch yspacing mul + moveto + 0 boxheight 4 div rlineto + boxheight neg 4 div boxheight neg 4 div rlineto + closepath + eofill + stroke +} def + +/arrow +{ newpath + moveto + 3 -8 rlineto + -6 0 rlineto + 3 8 rlineto + closepath + eofill + stroke +} def + +/out % draws an output connector for the block at (arg1,arg2) +{ + newpath + exch xspacing mul xoffset add boxwidth 2 div add + exch yspacing mul boxheight add + /y exch def + /x exch def + x y moveto + 0 disty 2 div rlineto + stroke + 1 eq { x y disty 2 div add arrow } if +} def + +/in % draws an input connector for the block at (arg1,arg2) +{ + newpath + exch xspacing mul xoffset add boxwidth 2 div add + exch yspacing mul disty 2 div sub + /y exch def + /x exch def + x y moveto + 0 disty 2 div rlineto + stroke + 1 eq { x y disty 2 div add arrow } if +} def + +/hedge +{ + exch xspacing mul xoffset add boxwidth 2 div add + exch yspacing mul boxheight 2 div sub + /y exch def + /x exch def + newpath + x y moveto + boxwidth 2 div distx add 0 rlineto + stroke + 1 eq + { newpath x boxwidth 2 div distx add add y moveto + -8 3 rlineto + 0 -6 rlineto + 8 3 rlineto + closepath + eofill + stroke + } if +} def + +/vedge +{ + /ye exch def + /ys exch def + /xs exch def + newpath + xs xspacing mul xoffset add boxwidth 2 div add dup + ys yspacing mul boxheight 2 div sub + moveto + ye yspacing mul boxheight 2 div sub + lineto + stroke +} def + +/conn % connections the blocks from col `arg1' to `arg2' of row `arg3' +{ + /ys exch def + /xe exch def + /xs exch def + newpath + xs xspacing mul xoffset add boxwidth 2 div add + ys yspacing mul disty 2 div sub + moveto + xspacing xe xs sub mul 0 + rlineto + stroke +} def + +% ----- main ------ + +boxfont setfont +1 boundaspect scale +(peoParaSGATransform< EOT >) cw +(peoTransform< EOT >) cw +(Service) cw +(eoTransform< EOT >) cw +(Communicable) cw +(eoUF< A1, R >) cw +(eoFunctorBase) cw +/boxwidth boxwidth marginwidth 2 mul add def +/xspacing boxwidth distx add def +/yspacing boxheight disty add def +/scalefactor + boxwidth cols mul distx cols 1 sub mul add + boxheight rows mul disty rows 1 sub mul add boundaspect mul + max def +boundx scalefactor div boundy scalefactor div scale + +% ----- classes ----- + + (peoParaSGATransform< EOT >) 0.5 0 box + (peoTransform< EOT >) 0.5 1 box + (Service) 0 2 box + (eoTransform< EOT >) 1 2 box + (Communicable) 0 3 box + (eoUF< A1, R >) 1 3 box + (eoFunctorBase) 1 4 box + +% ----- relations ----- + +solid +0 0.5 0 out +solid +1 0.5 1 in +solid +0 0.5 1 out +solid +0 1 2 conn +solid +1 0 2 in +solid +0 0 2 out +solid +1 1 2 in +solid +0 1 2 out +solid +1 0 3 in +solid +1 1 3 in +solid +0 1 3 out +solid +1 1 4 in diff --git a/branches/paradiseo-peo-meta-model/doc/latex/classpeoParaSGATransform.tex b/branches/paradiseo-peo-meta-model/doc/latex/classpeoParaSGATransform.tex new file mode 100644 index 000000000..805baa496 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/latex/classpeoParaSGATransform.tex @@ -0,0 +1,120 @@ +\hypertarget{classpeoParaSGATransform}{ +\section{peo\-Para\-SGATransform$<$ EOT $>$ Class Template Reference} +\label{classpeoParaSGATransform}\index{peoParaSGATransform@{peoParaSGATransform}} +} +Inheritance diagram for peo\-Para\-SGATransform$<$ EOT $>$::\begin{figure}[H] +\begin{center} +\leavevmode +\includegraphics[height=5cm]{classpeoParaSGATransform} +\end{center} +\end{figure} +\subsection*{Public Member Functions} +\begin{CompactItemize} +\item +\hypertarget{classpeoParaSGATransform_2052bca82fbbfe5455bf6f69246d4dbf}{ +\hyperlink{classpeoParaSGATransform_2052bca82fbbfe5455bf6f69246d4dbf}{peo\-Para\-SGATransform} (\bf{eo\-Quad\-Op}$<$ EOT $>$ \&\_\-\_\-cross, double \_\-\_\-cross\_\-rate, \bf{eo\-Mon\-Op}$<$ EOT $>$ \&\_\-\_\-mut, double \_\-\_\-mut\_\-rate)} +\label{classpeoParaSGATransform_2052bca82fbbfe5455bf6f69246d4dbf} + +\item +\hypertarget{classpeoParaSGATransform_669de7f7c6316fa745a15b909efb6527}{ +void \hyperlink{classpeoParaSGATransform_669de7f7c6316fa745a15b909efb6527}{operator()} (\bf{eo\-Pop}$<$ EOT $>$ \&\_\-\_\-pop)} +\label{classpeoParaSGATransform_669de7f7c6316fa745a15b909efb6527} + +\item +\hypertarget{classpeoParaSGATransform_fd278bcde58d29c9a343d5cbead81a1e}{ +void \hyperlink{classpeoParaSGATransform_fd278bcde58d29c9a343d5cbead81a1e}{pack\-Data} ()} +\label{classpeoParaSGATransform_fd278bcde58d29c9a343d5cbead81a1e} + +\item +\hypertarget{classpeoParaSGATransform_a43a487a6e81791c8bbf6ce30f4336ab}{ +void \hyperlink{classpeoParaSGATransform_a43a487a6e81791c8bbf6ce30f4336ab}{unpack\-Data} ()} +\label{classpeoParaSGATransform_a43a487a6e81791c8bbf6ce30f4336ab} + +\item +\hypertarget{classpeoParaSGATransform_c9de2100fb897177a401c634002f6dd9}{ +void \hyperlink{classpeoParaSGATransform_c9de2100fb897177a401c634002f6dd9}{execute} ()} +\label{classpeoParaSGATransform_c9de2100fb897177a401c634002f6dd9} + +\item +\hypertarget{classpeoParaSGATransform_ba08e224ceaa4149e8e1a88694a2ccf2}{ +void \hyperlink{classpeoParaSGATransform_ba08e224ceaa4149e8e1a88694a2ccf2}{pack\-Result} ()} +\label{classpeoParaSGATransform_ba08e224ceaa4149e8e1a88694a2ccf2} + +\item +\hypertarget{classpeoParaSGATransform_257663dcdc6cc95b6183d472ffba1b2f}{ +void \hyperlink{classpeoParaSGATransform_257663dcdc6cc95b6183d472ffba1b2f}{unpack\-Result} ()} +\label{classpeoParaSGATransform_257663dcdc6cc95b6183d472ffba1b2f} + +\item +\hypertarget{classpeoParaSGATransform_4e19dfc22b6f69fa8b93537226551866}{ +void \hyperlink{classpeoParaSGATransform_4e19dfc22b6f69fa8b93537226551866}{notify\-Sending\-Data} ()} +\label{classpeoParaSGATransform_4e19dfc22b6f69fa8b93537226551866} + +\item +\hypertarget{classpeoParaSGATransform_8a0316e33897c395a81787f59ea7a1c8}{ +void \hyperlink{classpeoParaSGATransform_8a0316e33897c395a81787f59ea7a1c8}{notify\-Sending\-All\-Resource\-Requests} ()} +\label{classpeoParaSGATransform_8a0316e33897c395a81787f59ea7a1c8} + +\end{CompactItemize} +\subsection*{Private Attributes} +\begin{CompactItemize} +\item +\hypertarget{classpeoParaSGATransform_c6f97deabe7502c84f5b6c479013f6dc}{ +\bf{eo\-Quad\-Op}$<$ EOT $>$ \& \hyperlink{classpeoParaSGATransform_c6f97deabe7502c84f5b6c479013f6dc}{cross}} +\label{classpeoParaSGATransform_c6f97deabe7502c84f5b6c479013f6dc} + +\item +\hypertarget{classpeoParaSGATransform_dfcf216e2df05016db4d57a5ffb0b0e2}{ +double \hyperlink{classpeoParaSGATransform_dfcf216e2df05016db4d57a5ffb0b0e2}{cross\_\-rate}} +\label{classpeoParaSGATransform_dfcf216e2df05016db4d57a5ffb0b0e2} + +\item +\hypertarget{classpeoParaSGATransform_34ff5f9d285ca4879cf8865fb425a311}{ +\bf{eo\-Mon\-Op}$<$ EOT $>$ \& \hyperlink{classpeoParaSGATransform_34ff5f9d285ca4879cf8865fb425a311}{mut}} +\label{classpeoParaSGATransform_34ff5f9d285ca4879cf8865fb425a311} + +\item +\hypertarget{classpeoParaSGATransform_b9d3a2094737d0bbd034aac942cc53e3}{ +double \hyperlink{classpeoParaSGATransform_b9d3a2094737d0bbd034aac942cc53e3}{mut\_\-rate}} +\label{classpeoParaSGATransform_b9d3a2094737d0bbd034aac942cc53e3} + +\item +\hypertarget{classpeoParaSGATransform_03972feadc86626e58fe60bd4061b57e}{ +unsigned \hyperlink{classpeoParaSGATransform_03972feadc86626e58fe60bd4061b57e}{idx}} +\label{classpeoParaSGATransform_03972feadc86626e58fe60bd4061b57e} + +\item +\hypertarget{classpeoParaSGATransform_94e10a1285e128aba6e71517c941f961}{ +\bf{eo\-Pop}$<$ EOT $>$ $\ast$ \hyperlink{classpeoParaSGATransform_94e10a1285e128aba6e71517c941f961}{pop}} +\label{classpeoParaSGATransform_94e10a1285e128aba6e71517c941f961} + +\item +\hypertarget{classpeoParaSGATransform_9ef60190e2e3bd5961a93d1b52cb275d}{ +EOT \hyperlink{classpeoParaSGATransform_9ef60190e2e3bd5961a93d1b52cb275d}{father}} +\label{classpeoParaSGATransform_9ef60190e2e3bd5961a93d1b52cb275d} + +\item +\hypertarget{classpeoParaSGATransform_e991ad2af6d116afd855de2db46e1d27}{ +EOT \hyperlink{classpeoParaSGATransform_e991ad2af6d116afd855de2db46e1d27}{mother}} +\label{classpeoParaSGATransform_e991ad2af6d116afd855de2db46e1d27} + +\item +\hypertarget{classpeoParaSGATransform_589ea7cd72d522ae51a07de4d8ffbf11}{ +unsigned \hyperlink{classpeoParaSGATransform_589ea7cd72d522ae51a07de4d8ffbf11}{num\_\-term}} +\label{classpeoParaSGATransform_589ea7cd72d522ae51a07de4d8ffbf11} + +\end{CompactItemize} + + +\subsection{Detailed Description} +\subsubsection*{template$<$class EOT$>$ class peo\-Para\-SGATransform$<$ EOT $>$} + + + + + +Definition at line 21 of file peo\-Para\-SGATransform.h. + +The documentation for this class was generated from the following file:\begin{CompactItemize} +\item +peo\-Para\-SGATransform.h\end{CompactItemize} diff --git a/branches/paradiseo-peo-meta-model/doc/latex/classpeoPopEval.eps b/branches/paradiseo-peo-meta-model/doc/latex/classpeoPopEval.eps new file mode 100644 index 000000000..b486aceee --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/latex/classpeoPopEval.eps @@ -0,0 +1,215 @@ +%!PS-Adobe-2.0 EPSF-2.0 +%%Title: ClassName +%%Creator: Doxygen +%%CreationDate: Time +%%For: +%Magnification: 1.00 +%%Orientation: Portrait +%%BoundingBox: 0 0 500 243.902 +%%Pages: 0 +%%BeginSetup +%%EndSetup +%%EndComments + +% ----- variables ----- + +/boxwidth 0 def +/boxheight 40 def +/fontheight 24 def +/marginwidth 10 def +/distx 20 def +/disty 40 def +/boundaspect 2.05 def % aspect ratio of the BoundingBox (width/height) +/boundx 500 def +/boundy boundx boundaspect div def +/xspacing 0 def +/yspacing 0 def +/rows 4 def +/cols 2 def +/scalefactor 0 def +/boxfont /Times-Roman findfont fontheight scalefont def + +% ----- procedures ----- + +/dotted { [1 4] 0 setdash } def +/dashed { [5] 0 setdash } def +/solid { [] 0 setdash } def + +/max % result = MAX(arg1,arg2) +{ + /a exch def + /b exch def + a b gt {a} {b} ifelse +} def + +/xoffset % result = MAX(0,(scalefactor-(boxwidth*cols+distx*(cols-1)))/2) +{ + 0 scalefactor boxwidth cols mul distx cols 1 sub mul add sub 2 div max +} def + +/cw % boxwidth = MAX(boxwidth, stringwidth(arg1)) +{ + /str exch def + /boxwidth boxwidth str stringwidth pop max def +} def + +/box % draws a box with text `arg1' at grid pos (arg2,arg3) +{ gsave + 2 setlinewidth + newpath + exch xspacing mul xoffset add + exch yspacing mul + moveto + boxwidth 0 rlineto + 0 boxheight rlineto + boxwidth neg 0 rlineto + 0 boxheight neg rlineto + closepath + dup stringwidth pop neg boxwidth add 2 div + boxheight fontheight 2 div sub 2 div + rmoveto show stroke + grestore +} def + +/mark +{ newpath + exch xspacing mul xoffset add boxwidth add + exch yspacing mul + moveto + 0 boxheight 4 div rlineto + boxheight neg 4 div boxheight neg 4 div rlineto + closepath + eofill + stroke +} def + +/arrow +{ newpath + moveto + 3 -8 rlineto + -6 0 rlineto + 3 8 rlineto + closepath + eofill + stroke +} def + +/out % draws an output connector for the block at (arg1,arg2) +{ + newpath + exch xspacing mul xoffset add boxwidth 2 div add + exch yspacing mul boxheight add + /y exch def + /x exch def + x y moveto + 0 disty 2 div rlineto + stroke + 1 eq { x y disty 2 div add arrow } if +} def + +/in % draws an input connector for the block at (arg1,arg2) +{ + newpath + exch xspacing mul xoffset add boxwidth 2 div add + exch yspacing mul disty 2 div sub + /y exch def + /x exch def + x y moveto + 0 disty 2 div rlineto + stroke + 1 eq { x y disty 2 div add arrow } if +} def + +/hedge +{ + exch xspacing mul xoffset add boxwidth 2 div add + exch yspacing mul boxheight 2 div sub + /y exch def + /x exch def + newpath + x y moveto + boxwidth 2 div distx add 0 rlineto + stroke + 1 eq + { newpath x boxwidth 2 div distx add add y moveto + -8 3 rlineto + 0 -6 rlineto + 8 3 rlineto + closepath + eofill + stroke + } if +} def + +/vedge +{ + /ye exch def + /ys exch def + /xs exch def + newpath + xs xspacing mul xoffset add boxwidth 2 div add dup + ys yspacing mul boxheight 2 div sub + moveto + ye yspacing mul boxheight 2 div sub + lineto + stroke +} def + +/conn % connections the blocks from col `arg1' to `arg2' of row `arg3' +{ + /ys exch def + /xe exch def + /xs exch def + newpath + xs xspacing mul xoffset add boxwidth 2 div add + ys yspacing mul disty 2 div sub + moveto + xspacing xe xs sub mul 0 + rlineto + stroke +} def + +% ----- main ------ + +boxfont setfont +1 boundaspect scale +(peoPopEval< EOT >) cw +(Service) cw +(Communicable) cw +(peoParaPopEval< EOT >) cw +(peoSeqPopEval< EOT >) cw +/boxwidth boxwidth marginwidth 2 mul add def +/xspacing boxwidth distx add def +/yspacing boxheight disty add def +/scalefactor + boxwidth cols mul distx cols 1 sub mul add + boxheight rows mul disty rows 1 sub mul add boundaspect mul + max def +boundx scalefactor div boundy scalefactor div scale + +% ----- classes ----- + + (peoPopEval< EOT >) 0.5 1 box + (Service) 0.5 2 box + (Communicable) 0.5 3 box + (peoParaPopEval< EOT >) 0 0 box + (peoSeqPopEval< EOT >) 1 0 box + +% ----- relations ----- + +solid +0 0.5 1 out +solid +1 0.5 2 in +solid +0 0.5 2 out +solid +1 0.5 3 in +solid +1 0.5 0.25 out +solid +0 1 1 conn +solid +0 0 0.75 in +solid +0 1 0.75 in diff --git a/branches/paradiseo-peo-meta-model/doc/latex/classpeoPopEval.tex b/branches/paradiseo-peo-meta-model/doc/latex/classpeoPopEval.tex new file mode 100644 index 000000000..f727c5fdc --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/latex/classpeoPopEval.tex @@ -0,0 +1,39 @@ +\hypertarget{classpeoPopEval}{ +\section{peo\-Pop\-Eval$<$ EOT $>$ Class Template Reference} +\label{classpeoPopEval}\index{peoPopEval@{peoPopEval}} +} +The {\bf \hyperlink{classpeoPopEval}{peo\-Pop\-Eval}} class provides the interface for constructing Paradis\-EO specific evaluation functors. + + +{\tt \#include $<$peo\-Pop\-Eval.h$>$} + +Inheritance diagram for peo\-Pop\-Eval$<$ EOT $>$::\begin{figure}[H] +\begin{center} +\leavevmode +\includegraphics[height=4cm]{classpeoPopEval} +\end{center} +\end{figure} +\subsection*{Public Member Functions} +\begin{CompactItemize} +\item +\hypertarget{classpeoPopEval_2f208067a5e39c3b26c1234050a41e8f}{ +virtual void \hyperlink{classpeoPopEval_2f208067a5e39c3b26c1234050a41e8f}{operator()} (\bf{eo\-Pop}$<$ EOT $>$ \&\_\-\_\-pop)=0} +\label{classpeoPopEval_2f208067a5e39c3b26c1234050a41e8f} + +\begin{CompactList}\small\item\em Interface function providing the signature for constructing an evaluation functor. \item\end{CompactList}\end{CompactItemize} + + +\subsection{Detailed Description} +\subsubsection*{template$<$class EOT$>$ class peo\-Pop\-Eval$<$ EOT $>$} + +The {\bf \hyperlink{classpeoPopEval}{peo\-Pop\-Eval}} class provides the interface for constructing Paradis\-EO specific evaluation functors. + +The derived classes may be used as wrappers for {\bf \doxyref{EO}}-derived evaluation functors. In order to have an example, please refer to the implementation of the {\bf \hyperlink{classpeoSeqPopEval}{peo\-Seq\-Pop\-Eval}} and {\bf \hyperlink{classpeoParaPopEval}{peo\-Para\-Pop\-Eval}} classes. + + + +Definition at line 19 of file peo\-Pop\-Eval.h. + +The documentation for this class was generated from the following file:\begin{CompactItemize} +\item +peo\-Pop\-Eval.h\end{CompactItemize} diff --git a/branches/paradiseo-peo-meta-model/doc/latex/classpeoSeqPopEval.eps b/branches/paradiseo-peo-meta-model/doc/latex/classpeoSeqPopEval.eps new file mode 100644 index 000000000..e8cf5fd7e --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/latex/classpeoSeqPopEval.eps @@ -0,0 +1,209 @@ +%!PS-Adobe-2.0 EPSF-2.0 +%%Title: ClassName +%%Creator: Doxygen +%%CreationDate: Time +%%For: +%Magnification: 1.00 +%%Orientation: Portrait +%%BoundingBox: 0 0 500 506.329 +%%Pages: 0 +%%BeginSetup +%%EndSetup +%%EndComments + +% ----- variables ----- + +/boxwidth 0 def +/boxheight 40 def +/fontheight 24 def +/marginwidth 10 def +/distx 20 def +/disty 40 def +/boundaspect 0.9875 def % aspect ratio of the BoundingBox (width/height) +/boundx 500 def +/boundy boundx boundaspect div def +/xspacing 0 def +/yspacing 0 def +/rows 4 def +/cols 1 def +/scalefactor 0 def +/boxfont /Times-Roman findfont fontheight scalefont def + +% ----- procedures ----- + +/dotted { [1 4] 0 setdash } def +/dashed { [5] 0 setdash } def +/solid { [] 0 setdash } def + +/max % result = MAX(arg1,arg2) +{ + /a exch def + /b exch def + a b gt {a} {b} ifelse +} def + +/xoffset % result = MAX(0,(scalefactor-(boxwidth*cols+distx*(cols-1)))/2) +{ + 0 scalefactor boxwidth cols mul distx cols 1 sub mul add sub 2 div max +} def + +/cw % boxwidth = MAX(boxwidth, stringwidth(arg1)) +{ + /str exch def + /boxwidth boxwidth str stringwidth pop max def +} def + +/box % draws a box with text `arg1' at grid pos (arg2,arg3) +{ gsave + 2 setlinewidth + newpath + exch xspacing mul xoffset add + exch yspacing mul + moveto + boxwidth 0 rlineto + 0 boxheight rlineto + boxwidth neg 0 rlineto + 0 boxheight neg rlineto + closepath + dup stringwidth pop neg boxwidth add 2 div + boxheight fontheight 2 div sub 2 div + rmoveto show stroke + grestore +} def + +/mark +{ newpath + exch xspacing mul xoffset add boxwidth add + exch yspacing mul + moveto + 0 boxheight 4 div rlineto + boxheight neg 4 div boxheight neg 4 div rlineto + closepath + eofill + stroke +} def + +/arrow +{ newpath + moveto + 3 -8 rlineto + -6 0 rlineto + 3 8 rlineto + closepath + eofill + stroke +} def + +/out % draws an output connector for the block at (arg1,arg2) +{ + newpath + exch xspacing mul xoffset add boxwidth 2 div add + exch yspacing mul boxheight add + /y exch def + /x exch def + x y moveto + 0 disty 2 div rlineto + stroke + 1 eq { x y disty 2 div add arrow } if +} def + +/in % draws an input connector for the block at (arg1,arg2) +{ + newpath + exch xspacing mul xoffset add boxwidth 2 div add + exch yspacing mul disty 2 div sub + /y exch def + /x exch def + x y moveto + 0 disty 2 div rlineto + stroke + 1 eq { x y disty 2 div add arrow } if +} def + +/hedge +{ + exch xspacing mul xoffset add boxwidth 2 div add + exch yspacing mul boxheight 2 div sub + /y exch def + /x exch def + newpath + x y moveto + boxwidth 2 div distx add 0 rlineto + stroke + 1 eq + { newpath x boxwidth 2 div distx add add y moveto + -8 3 rlineto + 0 -6 rlineto + 8 3 rlineto + closepath + eofill + stroke + } if +} def + +/vedge +{ + /ye exch def + /ys exch def + /xs exch def + newpath + xs xspacing mul xoffset add boxwidth 2 div add dup + ys yspacing mul boxheight 2 div sub + moveto + ye yspacing mul boxheight 2 div sub + lineto + stroke +} def + +/conn % connections the blocks from col `arg1' to `arg2' of row `arg3' +{ + /ys exch def + /xe exch def + /xs exch def + newpath + xs xspacing mul xoffset add boxwidth 2 div add + ys yspacing mul disty 2 div sub + moveto + xspacing xe xs sub mul 0 + rlineto + stroke +} def + +% ----- main ------ + +boxfont setfont +1 boundaspect scale +(peoSeqPopEval< EOT >) cw +(peoPopEval< EOT >) cw +(Service) cw +(Communicable) cw +/boxwidth boxwidth marginwidth 2 mul add def +/xspacing boxwidth distx add def +/yspacing boxheight disty add def +/scalefactor + boxwidth cols mul distx cols 1 sub mul add + boxheight rows mul disty rows 1 sub mul add boundaspect mul + max def +boundx scalefactor div boundy scalefactor div scale + +% ----- classes ----- + + (peoSeqPopEval< EOT >) 0 0 box + (peoPopEval< EOT >) 0 1 box + (Service) 0 2 box + (Communicable) 0 3 box + +% ----- relations ----- + +solid +0 0 0 out +solid +1 0 1 in +solid +0 0 1 out +solid +1 0 2 in +solid +0 0 2 out +solid +1 0 3 in diff --git a/branches/paradiseo-peo-meta-model/doc/latex/classpeoSeqPopEval.tex b/branches/paradiseo-peo-meta-model/doc/latex/classpeoSeqPopEval.tex new file mode 100644 index 000000000..2cc8ba91f --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/latex/classpeoSeqPopEval.tex @@ -0,0 +1,88 @@ +\hypertarget{classpeoSeqPopEval}{ +\section{peo\-Seq\-Pop\-Eval$<$ EOT $>$ Class Template Reference} +\label{classpeoSeqPopEval}\index{peoSeqPopEval@{peoSeqPopEval}} +} +The \hyperlink{classpeoSeqPopEval}{peo\-Seq\-Pop\-Eval} class acts only as a Paradis\-EO specific sequential evaluation functor - a wrapper for incorporating an {\bf eo\-Eval\-Func$<$ EOT $>$}-derived class as evaluation functor. + + +{\tt \#include $<$peo\-Seq\-Pop\-Eval.h$>$} + +Inheritance diagram for peo\-Seq\-Pop\-Eval$<$ EOT $>$::\begin{figure}[H] +\begin{center} +\leavevmode +\includegraphics[height=4cm]{classpeoSeqPopEval} +\end{center} +\end{figure} +\subsection*{Public Member Functions} +\begin{CompactItemize} +\item +\hyperlink{classpeoSeqPopEval_a41f91ab4b2aeb325ff75feb66d4e003}{peo\-Seq\-Pop\-Eval} (\bf{eo\-Eval\-Func}$<$ EOT $>$ \&\_\-\_\-eval) +\begin{CompactList}\small\item\em Constructor function - it only sets an internal reference to point to the specified evaluation object. \item\end{CompactList}\item +void \hyperlink{classpeoSeqPopEval_b2c88b9a3ad9091949acf741844eb02f}{operator()} (\bf{eo\-Pop}$<$ EOT $>$ \&\_\-\_\-pop) +\begin{CompactList}\small\item\em Operator for evaluating all the individuals of a given population - in a sequential iterative manner. \item\end{CompactList}\end{CompactItemize} +\subsection*{Private Attributes} +\begin{CompactItemize} +\item +\hypertarget{classpeoSeqPopEval_5465f31386c6b96bc8f7fb9393a28a2f}{ +\bf{eo\-Eval\-Func}$<$ EOT $>$ \& \hyperlink{classpeoSeqPopEval_5465f31386c6b96bc8f7fb9393a28a2f}{eval}} +\label{classpeoSeqPopEval_5465f31386c6b96bc8f7fb9393a28a2f} + +\end{CompactItemize} + + +\subsection{Detailed Description} +\subsubsection*{template$<$class EOT$>$ class peo\-Seq\-Pop\-Eval$<$ EOT $>$} + +The \hyperlink{classpeoSeqPopEval}{peo\-Seq\-Pop\-Eval} class acts only as a Paradis\-EO specific sequential evaluation functor - a wrapper for incorporating an {\bf eo\-Eval\-Func$<$ EOT $>$}-derived class as evaluation functor. + +The specified \doxyref{EO} evaluation object is applyied in an iterative manner to each individual of a specified population. + + + +Definition at line 21 of file peo\-Seq\-Pop\-Eval.h. + +\subsection{Constructor \& Destructor Documentation} +\hypertarget{classpeoSeqPopEval_a41f91ab4b2aeb325ff75feb66d4e003}{ +\index{peoSeqPopEval@{peo\-Seq\-Pop\-Eval}!peoSeqPopEval@{peoSeqPopEval}} +\index{peoSeqPopEval@{peoSeqPopEval}!peoSeqPopEval@{peo\-Seq\-Pop\-Eval}} +\subsubsection[peoSeqPopEval]{\setlength{\rightskip}{0pt plus 5cm}template$<$class EOT$>$ \hyperlink{classpeoSeqPopEval}{peo\-Seq\-Pop\-Eval}$<$ EOT $>$::\hyperlink{classpeoSeqPopEval}{peo\-Seq\-Pop\-Eval} (\bf{eo\-Eval\-Func}$<$ EOT $>$ \& {\em \_\-\_\-eval})}} +\label{classpeoSeqPopEval_a41f91ab4b2aeb325ff75feb66d4e003} + + +Constructor function - it only sets an internal reference to point to the specified evaluation object. + +\begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em eo\-Eval\-Func$<$}]EOT $>$\& \_\-\_\-eval - evaluation object to be applied for each individual of a specified population \end{description} +\end{Desc} + + +Definition at line 41 of file peo\-Seq\-Pop\-Eval.h. + +\subsection{Member Function Documentation} +\hypertarget{classpeoSeqPopEval_b2c88b9a3ad9091949acf741844eb02f}{ +\index{peoSeqPopEval@{peo\-Seq\-Pop\-Eval}!operator()@{operator()}} +\index{operator()@{operator()}!peoSeqPopEval@{peo\-Seq\-Pop\-Eval}} +\subsubsection[operator()]{\setlength{\rightskip}{0pt plus 5cm}template$<$class EOT$>$ void \hyperlink{classpeoSeqPopEval}{peo\-Seq\-Pop\-Eval}$<$ EOT $>$::operator() (\bf{eo\-Pop}$<$ EOT $>$ \& {\em \_\-\_\-pop})\hspace{0.3cm}{\tt \mbox{[}virtual\mbox{]}}}} +\label{classpeoSeqPopEval_b2c88b9a3ad9091949acf741844eb02f} + + +Operator for evaluating all the individuals of a given population - in a sequential iterative manner. + +\begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em eo\-Pop$<$}]EOT $>$\& \_\-\_\-pop - population to be evaluated. \end{description} +\end{Desc} + + +Implements \hyperlink{classpeoPopEval_2f208067a5e39c3b26c1234050a41e8f}{peo\-Pop\-Eval$<$ EOT $>$}. + +Definition at line 46 of file peo\-Seq\-Pop\-Eval.h. + +References peo\-Seq\-Pop\-Eval$<$ EOT $>$::eval. + +The documentation for this class was generated from the following file:\begin{CompactItemize} +\item +peo\-Seq\-Pop\-Eval.h\end{CompactItemize} diff --git a/branches/paradiseo-peo-meta-model/doc/latex/classpeoSeqTransform.eps b/branches/paradiseo-peo-meta-model/doc/latex/classpeoSeqTransform.eps new file mode 100644 index 000000000..200358ca0 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/latex/classpeoSeqTransform.eps @@ -0,0 +1,227 @@ +%!PS-Adobe-2.0 EPSF-2.0 +%%Title: ClassName +%%Creator: Doxygen +%%CreationDate: Time +%%For: +%Magnification: 1.00 +%%Orientation: Portrait +%%BoundingBox: 0 0 500 297.619 +%%Pages: 0 +%%BeginSetup +%%EndSetup +%%EndComments + +% ----- variables ----- + +/boxwidth 0 def +/boxheight 40 def +/fontheight 24 def +/marginwidth 10 def +/distx 20 def +/disty 40 def +/boundaspect 1.68 def % aspect ratio of the BoundingBox (width/height) +/boundx 500 def +/boundy boundx boundaspect div def +/xspacing 0 def +/yspacing 0 def +/rows 5 def +/cols 2 def +/scalefactor 0 def +/boxfont /Times-Roman findfont fontheight scalefont def + +% ----- procedures ----- + +/dotted { [1 4] 0 setdash } def +/dashed { [5] 0 setdash } def +/solid { [] 0 setdash } def + +/max % result = MAX(arg1,arg2) +{ + /a exch def + /b exch def + a b gt {a} {b} ifelse +} def + +/xoffset % result = MAX(0,(scalefactor-(boxwidth*cols+distx*(cols-1)))/2) +{ + 0 scalefactor boxwidth cols mul distx cols 1 sub mul add sub 2 div max +} def + +/cw % boxwidth = MAX(boxwidth, stringwidth(arg1)) +{ + /str exch def + /boxwidth boxwidth str stringwidth pop max def +} def + +/box % draws a box with text `arg1' at grid pos (arg2,arg3) +{ gsave + 2 setlinewidth + newpath + exch xspacing mul xoffset add + exch yspacing mul + moveto + boxwidth 0 rlineto + 0 boxheight rlineto + boxwidth neg 0 rlineto + 0 boxheight neg rlineto + closepath + dup stringwidth pop neg boxwidth add 2 div + boxheight fontheight 2 div sub 2 div + rmoveto show stroke + grestore +} def + +/mark +{ newpath + exch xspacing mul xoffset add boxwidth add + exch yspacing mul + moveto + 0 boxheight 4 div rlineto + boxheight neg 4 div boxheight neg 4 div rlineto + closepath + eofill + stroke +} def + +/arrow +{ newpath + moveto + 3 -8 rlineto + -6 0 rlineto + 3 8 rlineto + closepath + eofill + stroke +} def + +/out % draws an output connector for the block at (arg1,arg2) +{ + newpath + exch xspacing mul xoffset add boxwidth 2 div add + exch yspacing mul boxheight add + /y exch def + /x exch def + x y moveto + 0 disty 2 div rlineto + stroke + 1 eq { x y disty 2 div add arrow } if +} def + +/in % draws an input connector for the block at (arg1,arg2) +{ + newpath + exch xspacing mul xoffset add boxwidth 2 div add + exch yspacing mul disty 2 div sub + /y exch def + /x exch def + x y moveto + 0 disty 2 div rlineto + stroke + 1 eq { x y disty 2 div add arrow } if +} def + +/hedge +{ + exch xspacing mul xoffset add boxwidth 2 div add + exch yspacing mul boxheight 2 div sub + /y exch def + /x exch def + newpath + x y moveto + boxwidth 2 div distx add 0 rlineto + stroke + 1 eq + { newpath x boxwidth 2 div distx add add y moveto + -8 3 rlineto + 0 -6 rlineto + 8 3 rlineto + closepath + eofill + stroke + } if +} def + +/vedge +{ + /ye exch def + /ys exch def + /xs exch def + newpath + xs xspacing mul xoffset add boxwidth 2 div add dup + ys yspacing mul boxheight 2 div sub + moveto + ye yspacing mul boxheight 2 div sub + lineto + stroke +} def + +/conn % connections the blocks from col `arg1' to `arg2' of row `arg3' +{ + /ys exch def + /xe exch def + /xs exch def + newpath + xs xspacing mul xoffset add boxwidth 2 div add + ys yspacing mul disty 2 div sub + moveto + xspacing xe xs sub mul 0 + rlineto + stroke +} def + +% ----- main ------ + +boxfont setfont +1 boundaspect scale +(peoSeqTransform< EOT >) cw +(peoTransform< EOT >) cw +(Service) cw +(eoTransform< EOT >) cw +(Communicable) cw +(eoUF< A1, R >) cw +(eoFunctorBase) cw +/boxwidth boxwidth marginwidth 2 mul add def +/xspacing boxwidth distx add def +/yspacing boxheight disty add def +/scalefactor + boxwidth cols mul distx cols 1 sub mul add + boxheight rows mul disty rows 1 sub mul add boundaspect mul + max def +boundx scalefactor div boundy scalefactor div scale + +% ----- classes ----- + + (peoSeqTransform< EOT >) 0.5 0 box + (peoTransform< EOT >) 0.5 1 box + (Service) 0 2 box + (eoTransform< EOT >) 1 2 box + (Communicable) 0 3 box + (eoUF< A1, R >) 1 3 box + (eoFunctorBase) 1 4 box + +% ----- relations ----- + +solid +0 0.5 0 out +solid +1 0.5 1 in +solid +0 0.5 1 out +solid +0 1 2 conn +solid +1 0 2 in +solid +0 0 2 out +solid +1 1 2 in +solid +0 1 2 out +solid +1 0 3 in +solid +1 1 3 in +solid +0 1 3 out +solid +1 1 4 in diff --git a/branches/paradiseo-peo-meta-model/doc/latex/classpeoSeqTransform.tex b/branches/paradiseo-peo-meta-model/doc/latex/classpeoSeqTransform.tex new file mode 100644 index 000000000..363cb8141 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/latex/classpeoSeqTransform.tex @@ -0,0 +1,111 @@ +\hypertarget{classpeoSeqTransform}{ +\section{peo\-Seq\-Transform$<$ EOT $>$ Class Template Reference} +\label{classpeoSeqTransform}\index{peoSeqTransform@{peoSeqTransform}} +} +The \hyperlink{classpeoSeqTransform}{peo\-Seq\-Transform} represent a wrapper for offering the possibility of using \doxyref{EO} derived transform operators along with the Paradis\-EO evolutionary algorithms. + + +{\tt \#include $<$peo\-Seq\-Transform.h$>$} + +Inheritance diagram for peo\-Seq\-Transform$<$ EOT $>$::\begin{figure}[H] +\begin{center} +\leavevmode +\includegraphics[height=5cm]{classpeoSeqTransform} +\end{center} +\end{figure} +\subsection*{Public Member Functions} +\begin{CompactItemize} +\item +\hyperlink{classpeoSeqTransform_3b8e4ed19d9458938eb669d83a53c626}{peo\-Seq\-Transform} (\bf{eo\-Transform}$<$ EOT $>$ \&\_\-\_\-trans) +\begin{CompactList}\small\item\em Constructor function - sets an internal reference towards the specified EO-derived transform object. \item\end{CompactList}\item +void \hyperlink{classpeoSeqTransform_1ba63536abb6c4e1c369e0b7e066872e}{operator()} (\bf{eo\-Pop}$<$ EOT $>$ \&\_\-\_\-pop) +\begin{CompactList}\small\item\em Operator for applying the specified transform operators on each individual of the given population. \item\end{CompactList}\item +\hypertarget{classpeoSeqTransform_c4bf2724e9f6055f12bd169fad893be3}{ +virtual void \hyperlink{classpeoSeqTransform_c4bf2724e9f6055f12bd169fad893be3}{pack\-Data} ()} +\label{classpeoSeqTransform_c4bf2724e9f6055f12bd169fad893be3} + +\begin{CompactList}\small\item\em Interface function for providing a link with the parallel architecture of the Paradis\-EO framework. \item\end{CompactList}\item +\hypertarget{classpeoSeqTransform_24e6cf15ef230ed538031b522ddd4ae6}{ +virtual void \hyperlink{classpeoSeqTransform_24e6cf15ef230ed538031b522ddd4ae6}{unpack\-Data} ()} +\label{classpeoSeqTransform_24e6cf15ef230ed538031b522ddd4ae6} + +\begin{CompactList}\small\item\em Interface function for providing a link with the parallel architecture of the Paradis\-EO framework. \item\end{CompactList}\item +\hypertarget{classpeoSeqTransform_0294a2f9d6b44ec74d22eaceccdffc2b}{ +virtual void \hyperlink{classpeoSeqTransform_0294a2f9d6b44ec74d22eaceccdffc2b}{execute} ()} +\label{classpeoSeqTransform_0294a2f9d6b44ec74d22eaceccdffc2b} + +\begin{CompactList}\small\item\em Interface function for providing a link with the parallel architecture of the Paradis\-EO framework. \item\end{CompactList}\item +\hypertarget{classpeoSeqTransform_4861c61f9e46d83964ea8a156a9a3ee0}{ +virtual void \hyperlink{classpeoSeqTransform_4861c61f9e46d83964ea8a156a9a3ee0}{pack\-Result} ()} +\label{classpeoSeqTransform_4861c61f9e46d83964ea8a156a9a3ee0} + +\begin{CompactList}\small\item\em Interface function for providing a link with the parallel architecture of the Paradis\-EO framework. \item\end{CompactList}\item +\hypertarget{classpeoSeqTransform_5dd029fc011eb2a810ca1140025129b1}{ +virtual void \hyperlink{classpeoSeqTransform_5dd029fc011eb2a810ca1140025129b1}{unpack\-Result} ()} +\label{classpeoSeqTransform_5dd029fc011eb2a810ca1140025129b1} + +\begin{CompactList}\small\item\em Interface function for providing a link with the parallel architecture of the Paradis\-EO framework. \item\end{CompactList}\end{CompactItemize} +\subsection*{Private Attributes} +\begin{CompactItemize} +\item +\hypertarget{classpeoSeqTransform_ad3e16c59dd6c46dfc1baf7b88af30cf}{ +\bf{eo\-Transform}$<$ EOT $>$ \& \hyperlink{classpeoSeqTransform_ad3e16c59dd6c46dfc1baf7b88af30cf}{trans}} +\label{classpeoSeqTransform_ad3e16c59dd6c46dfc1baf7b88af30cf} + +\end{CompactItemize} + + +\subsection{Detailed Description} +\subsubsection*{template$<$class EOT$>$ class peo\-Seq\-Transform$<$ EOT $>$} + +The \hyperlink{classpeoSeqTransform}{peo\-Seq\-Transform} represent a wrapper for offering the possibility of using \doxyref{EO} derived transform operators along with the Paradis\-EO evolutionary algorithms. + +A minimal set of interface functions is also provided for creating the link with the parallel architecture of the Paradis\-EO framework. + + + +Definition at line 20 of file peo\-Seq\-Transform.h. + +\subsection{Constructor \& Destructor Documentation} +\hypertarget{classpeoSeqTransform_3b8e4ed19d9458938eb669d83a53c626}{ +\index{peoSeqTransform@{peo\-Seq\-Transform}!peoSeqTransform@{peoSeqTransform}} +\index{peoSeqTransform@{peoSeqTransform}!peoSeqTransform@{peo\-Seq\-Transform}} +\subsubsection[peoSeqTransform]{\setlength{\rightskip}{0pt plus 5cm}template$<$class EOT$>$ \hyperlink{classpeoSeqTransform}{peo\-Seq\-Transform}$<$ EOT $>$::\hyperlink{classpeoSeqTransform}{peo\-Seq\-Transform} (\bf{eo\-Transform}$<$ EOT $>$ \& {\em \_\-\_\-trans})}} +\label{classpeoSeqTransform_3b8e4ed19d9458938eb669d83a53c626} + + +Constructor function - sets an internal reference towards the specified EO-derived transform object. + +\begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em eo\-Transform$<$}]EOT $>$\& \_\-\_\-trans - EO-derived transform object including crossover and mutation operators. \end{description} +\end{Desc} + + +Definition at line 55 of file peo\-Seq\-Transform.h. + +\subsection{Member Function Documentation} +\hypertarget{classpeoSeqTransform_1ba63536abb6c4e1c369e0b7e066872e}{ +\index{peoSeqTransform@{peo\-Seq\-Transform}!operator()@{operator()}} +\index{operator()@{operator()}!peoSeqTransform@{peo\-Seq\-Transform}} +\subsubsection[operator()]{\setlength{\rightskip}{0pt plus 5cm}template$<$class EOT$>$ void \hyperlink{classpeoSeqTransform}{peo\-Seq\-Transform}$<$ EOT $>$::operator() (\bf{eo\-Pop}$<$ EOT $>$ \& {\em \_\-\_\-pop})}} +\label{classpeoSeqTransform_1ba63536abb6c4e1c369e0b7e066872e} + + +Operator for applying the specified transform operators on each individual of the given population. + +\begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em eo\-Pop$<$}]EOT $>$\& \_\-\_\-pop - population to be transformed by applying the crossover and mutation operators. \end{description} +\end{Desc} + + +Definition at line 60 of file peo\-Seq\-Transform.h. + +References peo\-Seq\-Transform$<$ EOT $>$::trans. + +The documentation for this class was generated from the following file:\begin{CompactItemize} +\item +peo\-Seq\-Transform.h\end{CompactItemize} diff --git a/branches/paradiseo-peo-meta-model/doc/latex/classpeoSyncIslandMig.eps b/branches/paradiseo-peo-meta-model/doc/latex/classpeoSyncIslandMig.eps new file mode 100644 index 000000000..6f0fb127a --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/latex/classpeoSyncIslandMig.eps @@ -0,0 +1,221 @@ +%!PS-Adobe-2.0 EPSF-2.0 +%%Title: ClassName +%%Creator: Doxygen +%%CreationDate: Time +%%For: +%Magnification: 1.00 +%%Orientation: Portrait +%%BoundingBox: 0 0 500 231.214 +%%Pages: 0 +%%BeginSetup +%%EndSetup +%%EndComments + +% ----- variables ----- + +/boxwidth 0 def +/boxheight 40 def +/fontheight 24 def +/marginwidth 10 def +/distx 20 def +/disty 40 def +/boundaspect 2.1625 def % aspect ratio of the BoundingBox (width/height) +/boundx 500 def +/boundy boundx boundaspect div def +/xspacing 0 def +/yspacing 0 def +/rows 4 def +/cols 2 def +/scalefactor 0 def +/boxfont /Times-Roman findfont fontheight scalefont def + +% ----- procedures ----- + +/dotted { [1 4] 0 setdash } def +/dashed { [5] 0 setdash } def +/solid { [] 0 setdash } def + +/max % result = MAX(arg1,arg2) +{ + /a exch def + /b exch def + a b gt {a} {b} ifelse +} def + +/xoffset % result = MAX(0,(scalefactor-(boxwidth*cols+distx*(cols-1)))/2) +{ + 0 scalefactor boxwidth cols mul distx cols 1 sub mul add sub 2 div max +} def + +/cw % boxwidth = MAX(boxwidth, stringwidth(arg1)) +{ + /str exch def + /boxwidth boxwidth str stringwidth pop max def +} def + +/box % draws a box with text `arg1' at grid pos (arg2,arg3) +{ gsave + 2 setlinewidth + newpath + exch xspacing mul xoffset add + exch yspacing mul + moveto + boxwidth 0 rlineto + 0 boxheight rlineto + boxwidth neg 0 rlineto + 0 boxheight neg rlineto + closepath + dup stringwidth pop neg boxwidth add 2 div + boxheight fontheight 2 div sub 2 div + rmoveto show stroke + grestore +} def + +/mark +{ newpath + exch xspacing mul xoffset add boxwidth add + exch yspacing mul + moveto + 0 boxheight 4 div rlineto + boxheight neg 4 div boxheight neg 4 div rlineto + closepath + eofill + stroke +} def + +/arrow +{ newpath + moveto + 3 -8 rlineto + -6 0 rlineto + 3 8 rlineto + closepath + eofill + stroke +} def + +/out % draws an output connector for the block at (arg1,arg2) +{ + newpath + exch xspacing mul xoffset add boxwidth 2 div add + exch yspacing mul boxheight add + /y exch def + /x exch def + x y moveto + 0 disty 2 div rlineto + stroke + 1 eq { x y disty 2 div add arrow } if +} def + +/in % draws an input connector for the block at (arg1,arg2) +{ + newpath + exch xspacing mul xoffset add boxwidth 2 div add + exch yspacing mul disty 2 div sub + /y exch def + /x exch def + x y moveto + 0 disty 2 div rlineto + stroke + 1 eq { x y disty 2 div add arrow } if +} def + +/hedge +{ + exch xspacing mul xoffset add boxwidth 2 div add + exch yspacing mul boxheight 2 div sub + /y exch def + /x exch def + newpath + x y moveto + boxwidth 2 div distx add 0 rlineto + stroke + 1 eq + { newpath x boxwidth 2 div distx add add y moveto + -8 3 rlineto + 0 -6 rlineto + 8 3 rlineto + closepath + eofill + stroke + } if +} def + +/vedge +{ + /ye exch def + /ys exch def + /xs exch def + newpath + xs xspacing mul xoffset add boxwidth 2 div add dup + ys yspacing mul boxheight 2 div sub + moveto + ye yspacing mul boxheight 2 div sub + lineto + stroke +} def + +/conn % connections the blocks from col `arg1' to `arg2' of row `arg3' +{ + /ys exch def + /xe exch def + /xs exch def + newpath + xs xspacing mul xoffset add boxwidth 2 div add + ys yspacing mul disty 2 div sub + moveto + xspacing xe xs sub mul 0 + rlineto + stroke +} def + +% ----- main ------ + +boxfont setfont +1 boundaspect scale +(peoSyncIslandMig< EOT >) cw +(Cooperative) cw +(eoUpdater) cw +(Communicable) cw +(eoF< void >) cw +(eoFunctorBase) cw +/boxwidth boxwidth marginwidth 2 mul add def +/xspacing boxwidth distx add def +/yspacing boxheight disty add def +/scalefactor + boxwidth cols mul distx cols 1 sub mul add + boxheight rows mul disty rows 1 sub mul add boundaspect mul + max def +boundx scalefactor div boundy scalefactor div scale + +% ----- classes ----- + + (peoSyncIslandMig< EOT >) 0.5 0 box + (Cooperative) 0 1 box + (eoUpdater) 1 1 box + (Communicable) 0 2 box + (eoF< void >) 1 2 box + (eoFunctorBase) 1 3 box + +% ----- relations ----- + +solid +0 0.5 0 out +solid +0 1 1 conn +solid +1 0 1 in +solid +0 0 1 out +solid +1 1 1 in +solid +0 1 1 out +solid +1 0 2 in +solid +1 1 2 in +solid +0 1 2 out +solid +1 1 3 in diff --git a/branches/paradiseo-peo-meta-model/doc/latex/classpeoSyncIslandMig.tex b/branches/paradiseo-peo-meta-model/doc/latex/classpeoSyncIslandMig.tex new file mode 100644 index 000000000..c49a5ec31 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/latex/classpeoSyncIslandMig.tex @@ -0,0 +1,227 @@ +\hypertarget{classpeoSyncIslandMig}{ +\section{peo\-Sync\-Island\-Mig$<$ EOT $>$ Class Template Reference} +\label{classpeoSyncIslandMig}\index{peoSyncIslandMig@{peoSyncIslandMig}} +} +The \hyperlink{classpeoSyncIslandMig}{peo\-Sync\-Island\-Mig} class offers the elementary basis for implementating a synchronous island migration model - requires the specification of several basic parameters, i.e. + + +{\tt \#include $<$peo\-Sync\-Island\-Mig.h$>$} + +Inheritance diagram for peo\-Sync\-Island\-Mig$<$ EOT $>$::\begin{figure}[H] +\begin{center} +\leavevmode +\includegraphics[height=4cm]{classpeoSyncIslandMig} +\end{center} +\end{figure} +\subsection*{Public Member Functions} +\begin{CompactItemize} +\item +\hyperlink{classpeoSyncIslandMig_96b7b6de20b5e318a8b1cde76842305c}{peo\-Sync\-Island\-Mig} (unsigned \_\-\_\-frequency, \bf{eo\-Select}$<$ EOT $>$ \&\_\-\_\-select, \bf{eo\-Replacement}$<$ EOT $>$ \&\_\-\_\-replace, \hyperlink{classTopology}{Topology} \&\_\-\_\-topology, \bf{eo\-Pop}$<$ EOT $>$ \&\_\-\_\-source, \bf{eo\-Pop}$<$ EOT $>$ \&\_\-\_\-destination) +\begin{CompactList}\small\item\em Constructor for the \hyperlink{classpeoSyncIslandMig}{peo\-Sync\-Island\-Mig} class; the characteristics of the migration model are defined through the specified parameters - out of the box objects provided in \doxyref{EO}, etc., or custom, derived objects may be passed as parameters. \item\end{CompactList}\item +void \hyperlink{classpeoSyncIslandMig_178476fd276f78b73607b33d19522c36}{operator()} () +\begin{CompactList}\small\item\em \doxyref{Function} operator to be called as checkpoint for performing the migration step. \item\end{CompactList}\item +\hypertarget{classpeoSyncIslandMig_e334188141eeba9f7b78bc6716f819ad}{ +void \hyperlink{classpeoSyncIslandMig_e334188141eeba9f7b78bc6716f819ad}{pack} ()} +\label{classpeoSyncIslandMig_e334188141eeba9f7b78bc6716f819ad} + +\begin{CompactList}\small\item\em Auxiliary function dealing with sending the emigrant individuals. There is no need to explicitly call the function. \item\end{CompactList}\item +\hypertarget{classpeoSyncIslandMig_85777bd9f709c5d4107799e8619948d1}{ +void \hyperlink{classpeoSyncIslandMig_85777bd9f709c5d4107799e8619948d1}{unpack} ()} +\label{classpeoSyncIslandMig_85777bd9f709c5d4107799e8619948d1} + +\begin{CompactList}\small\item\em Auxiliary function dealing with receiving immigrant individuals. There is no need to explicitly call the function. \item\end{CompactList}\item +\hypertarget{classpeoSyncIslandMig_8c427b3f91c19ff85f86930366b96008}{ +void \hyperlink{classpeoSyncIslandMig_8c427b3f91c19ff85f86930366b96008}{notify\-Sending} ()} +\label{classpeoSyncIslandMig_8c427b3f91c19ff85f86930366b96008} + +\begin{CompactList}\small\item\em Auxiliary function dealing with migration notifications. There is no need to explicitly call the function. \item\end{CompactList}\end{CompactItemize} +\subsection*{Private Member Functions} +\begin{CompactItemize} +\item +\hypertarget{classpeoSyncIslandMig_4c8416e3acce1a6e4c3b0a442d94b063}{ +void \hyperlink{classpeoSyncIslandMig_4c8416e3acce1a6e4c3b0a442d94b063}{emigrate} ()} +\label{classpeoSyncIslandMig_4c8416e3acce1a6e4c3b0a442d94b063} + +\item +\hypertarget{classpeoSyncIslandMig_38dd72312a3d16808af1aa7beb9ed4a7}{ +void \hyperlink{classpeoSyncIslandMig_38dd72312a3d16808af1aa7beb9ed4a7}{immigrate} ()} +\label{classpeoSyncIslandMig_38dd72312a3d16808af1aa7beb9ed4a7} + +\end{CompactItemize} +\subsection*{Private Attributes} +\begin{CompactItemize} +\item +\hypertarget{classpeoSyncIslandMig_2d8ae9104376f3e073e0b250d9b425a2}{ +\bf{eo\-Periodic\-Continue}$<$ EOT $>$ \hyperlink{classpeoSyncIslandMig_2d8ae9104376f3e073e0b250d9b425a2}{cont}} +\label{classpeoSyncIslandMig_2d8ae9104376f3e073e0b250d9b425a2} + +\item +\hypertarget{classpeoSyncIslandMig_5e9c9f5f65d6418ad46e647ee1804a3d}{ +\bf{eo\-Select}$<$ EOT $>$ \& \hyperlink{classpeoSyncIslandMig_5e9c9f5f65d6418ad46e647ee1804a3d}{select}} +\label{classpeoSyncIslandMig_5e9c9f5f65d6418ad46e647ee1804a3d} + +\item +\hypertarget{classpeoSyncIslandMig_cb6d2d909503a86415912900d6e1d891}{ +\bf{eo\-Replacement}$<$ EOT $>$ \& \hyperlink{classpeoSyncIslandMig_cb6d2d909503a86415912900d6e1d891}{replace}} +\label{classpeoSyncIslandMig_cb6d2d909503a86415912900d6e1d891} + +\item +\hypertarget{classpeoSyncIslandMig_ebfe6edb6be16d46bf6d71cb233fcace}{ +\hyperlink{classTopology}{Topology} \& \hyperlink{classpeoSyncIslandMig_ebfe6edb6be16d46bf6d71cb233fcace}{topology}} +\label{classpeoSyncIslandMig_ebfe6edb6be16d46bf6d71cb233fcace} + +\item +\hypertarget{classpeoSyncIslandMig_33fde1f09faf2a3f772d8b8f6a2615c6}{ +\bf{eo\-Pop}$<$ EOT $>$ \& \hyperlink{classpeoSyncIslandMig_33fde1f09faf2a3f772d8b8f6a2615c6}{source}} +\label{classpeoSyncIslandMig_33fde1f09faf2a3f772d8b8f6a2615c6} + +\item +\hypertarget{classpeoSyncIslandMig_a9bf4612c7c04da6cf69245c6617e6a6}{ +\bf{eo\-Pop}$<$ EOT $>$ \& \hyperlink{classpeoSyncIslandMig_a9bf4612c7c04da6cf69245c6617e6a6}{destination}} +\label{classpeoSyncIslandMig_a9bf4612c7c04da6cf69245c6617e6a6} + +\item +\hypertarget{classpeoSyncIslandMig_088c1623f32668dcd3683fceff9426c3}{ +std::queue$<$ \bf{eo\-Pop}$<$ EOT $>$ $>$ \hyperlink{classpeoSyncIslandMig_088c1623f32668dcd3683fceff9426c3}{imm}} +\label{classpeoSyncIslandMig_088c1623f32668dcd3683fceff9426c3} + +\item +\hypertarget{classpeoSyncIslandMig_11d6dd3e4a6db710433f501af0988322}{ +std::queue$<$ \bf{eo\-Pop}$<$ EOT $>$ $>$ \hyperlink{classpeoSyncIslandMig_11d6dd3e4a6db710433f501af0988322}{em}} +\label{classpeoSyncIslandMig_11d6dd3e4a6db710433f501af0988322} + +\item +\hypertarget{classpeoSyncIslandMig_2f7ca18d67ab7fb47a9851ab3179eb7d}{ +std::queue$<$ \hyperlink{classCooperative}{Cooperative} $\ast$ $>$ \hyperlink{classpeoSyncIslandMig_2f7ca18d67ab7fb47a9851ab3179eb7d}{coop\_\-em}} +\label{classpeoSyncIslandMig_2f7ca18d67ab7fb47a9851ab3179eb7d} + +\item +\hypertarget{classpeoSyncIslandMig_91e0e1ea59c2a6a66eb496bddd60a18f}{ +sem\_\-t \hyperlink{classpeoSyncIslandMig_91e0e1ea59c2a6a66eb496bddd60a18f}{sync}} +\label{classpeoSyncIslandMig_91e0e1ea59c2a6a66eb496bddd60a18f} + +\end{CompactItemize} + + +\subsection{Detailed Description} +\subsubsection*{template$<$class EOT$>$ class peo\-Sync\-Island\-Mig$<$ EOT $>$} + +The \hyperlink{classpeoSyncIslandMig}{peo\-Sync\-Island\-Mig} class offers the elementary basis for implementating a synchronous island migration model - requires the specification of several basic parameters, i.e. + +frequency of the migrations, selection and replacement strategies, a topological model and the source and destination population for the migrating individuals. The main difference as opposed to the asynchronous migration model is the synchronization step performed after selecting and sending the emigrant individuals. + +The migration operator is called at the end of each generation of an evolutionary algorithms as a checkpoint object - the following code exposes the structure of a classic evolutionary algorithm: + +\begin{TabularC}{2} +\hline +{\bf do} \{ ~ &~ \\\hline +~~~~~~~~ select( population, offsprings ); ~ &// select the offsprings from the current population \\\hline +~~~~~~~~ transform( offsprings ); ~ &// crossover and mutation operators are applied on the selected offsprings \\\hline +~~~~~~~~ evaluate( offsprings ); ~ &// evaluation step of the resulting offspring \\\hline +~~~~~~~~ replace( population, offsprings ); ~ &// replace the individuals in the current population whith individuals from the offspring population, according to a specified replacement strategy \\\hline +\} {\bf while} ( ea\-Checkpoint\-Continue( population ) ); ~ &// checkpoint operators are applied on the current population, including the migration operator, if any specified \\\hline +\end{TabularC} + + +Constructing a synchronous island migration model requires having defined (1) a topological migration model, (2) the control parameters of the migration process, (3) a checkpoint object associated with an evolutionary algorithm, and (4) an owner object must be set. The owner object must be derived from the {\bf \hyperlink{classRunner}{Runner}} class (for example a \hyperlink{classpeoEA}{peo\-EA} object represents a possible owner). A simple example is offered bellow: + +\begin{enumerate} +\item topological model to be followed when performing migrations: \par + \par + \begin{TabularC}{2} +\hline +\hyperlink{classRingTopology}{Ring\-Topology} mig\-Topology; ~ &// a simple ring topological model - each island communicates with two other islands \\\hline +\end{TabularC} + + +\item the continuation criterion, selection and replacement strategy etc. are defined: \par + \par + \begin{TabularC}{2} +\hline +eo\-Pop$<$ EOT $>$ population( POP\_\-SIZE, pop\-Initializer ); ~ &// population of individuals to be used for the evolutionary algorithm \\\hline +~ &~ \\\hline +eo\-Random\-Select$<$ EOT $>$ mig\-Select\-Strategy; ~ &// selection strategy - in this case a random selection is applied \\\hline +eo\-Select\-Number$<$ EOT $>$ mig\-Select( mig\-Select\-Strategy, MIG\_\-SIZE ); ~ &// number of individuals to be selected using the specified strategy \\\hline +eo\-Plus\-Replacement$<$ EOT $>$ mig\-Replace; ~ &// immigration strategy - the worse individuals in the destination population are replaced by the immigrant individuals \\\hline +~ &~ \\\hline +peo\-Sync\-Island\-Mig$<$ EOT $>$ sync\-Migration( \par + ~~~~~~~~ MIG\_\-FREQ, mig\-Select, mig\-Replace, mig\-Topology, \par + ~~~~~~~~ population, population \par + ); ~ &// synchronous migration object - the emigrant individuals are selected from the same from population in which the immigrant individuals are being integrated \\\hline +\end{TabularC} + + +\item creation of a checkpoint object as part of the definition of an evolutionary algoritm (details of th EA not given as being out of scope): \par + \par + \begin{TabularC}{2} +\hline +... ~ &~ \\\hline +eo\-Gen\-Continue$<$ EOT $>$ ea\-Cont( NUM\_\-GEN ); ~ &// the evolutionary algorithm will stop after NUM\_\-GEN generations \\\hline +eo\-Check\-Point$<$ EOT $>$ ea\-Checkpoint\-Continue( ea\-Cont ); ~ &// number of individuals to be selected using the specified strategy \\\hline +... ~ &~ \\\hline +ea\-Checkpoint\-Continue.add( sync\-Migration ); ~ &// adding the migration operator as checkpoint element \\\hline +... ~ &~ \\\hline +\end{TabularC} + + +\item definition of an owner evolutionary algorithm (an object inheriting the {\bf \hyperlink{classRunner}{Runner}} class): \par + \par + \begin{TabularC}{2} +\hline +peo\-EA$<$ EOT $>$ ea\-Alg( ea\-Checkpoint\-Continue, ea\-Pop\-Eval, ea\-Select, ea\-Transform, ea\-Replace); ~ &// evolutionary algorithm having as checkpoint the ea\-Checkpoint\-Continue object defined above \\\hline +sync\-Migration.set\-Owner( ea\-Alg ); ~ &// setting the evolutionary algorithm as owner of the migration object \\\hline +ea\-Alg( population ); ~ &// applying the evolutionary algorithm on a given population \\\hline +\end{TabularC} +\end{enumerate} + + +The source and the destination population for the migration object were specified as being the same, in step no. 2, as we are usually interested in selecting the emigrants and integrating the immigrant individuals from and in, respectively, one unique population, iteratively evolved by an evolutionary algorithm. There is no restriction in having two distinct populations as source and destination for the emigrant and immigrant individuals respectively. + +The above steps only create a synchronous migration object associated to an evolutionary algorithm. The creation of several islands requires the reiteration of the steps 2 through 4 for creating distinct algorithms, with distinct populations and the associated distinctly parametrized migration objects. The interconnecting element is the underlying topology, defined at step 1 (the same C++ mig\-Topology object has to be passed as parameter for all the migration objects, in order to interconnect them). + + + +Definition at line 114 of file peo\-Sync\-Island\-Mig.h. + +\subsection{Constructor \& Destructor Documentation} +\hypertarget{classpeoSyncIslandMig_96b7b6de20b5e318a8b1cde76842305c}{ +\index{peoSyncIslandMig@{peo\-Sync\-Island\-Mig}!peoSyncIslandMig@{peoSyncIslandMig}} +\index{peoSyncIslandMig@{peoSyncIslandMig}!peoSyncIslandMig@{peo\-Sync\-Island\-Mig}} +\subsubsection[peoSyncIslandMig]{\setlength{\rightskip}{0pt plus 5cm}template$<$class EOT$>$ \hyperlink{classpeoSyncIslandMig}{peo\-Sync\-Island\-Mig}$<$ EOT $>$::\hyperlink{classpeoSyncIslandMig}{peo\-Sync\-Island\-Mig} (unsigned {\em \_\-\_\-frequency}, \bf{eo\-Select}$<$ EOT $>$ \& {\em \_\-\_\-select}, \bf{eo\-Replacement}$<$ EOT $>$ \& {\em \_\-\_\-replace}, \hyperlink{classTopology}{Topology} \& {\em \_\-\_\-topology}, \bf{eo\-Pop}$<$ EOT $>$ \& {\em \_\-\_\-source}, \bf{eo\-Pop}$<$ EOT $>$ \& {\em \_\-\_\-destination})}} +\label{classpeoSyncIslandMig_96b7b6de20b5e318a8b1cde76842305c} + + +Constructor for the \hyperlink{classpeoSyncIslandMig}{peo\-Sync\-Island\-Mig} class; the characteristics of the migration model are defined through the specified parameters - out of the box objects provided in \doxyref{EO}, etc., or custom, derived objects may be passed as parameters. + +\begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em unsigned}]\_\-\_\-frequency - frequency of the migrations - the migrations occur periodically; \item[{\em eo\-Select$<$}]EOT $>$\& \_\-\_\-select - selection strategy to be applied for constructing a list of emigrant individuals out of the source population; \item[{\em eo\-Replacement$<$}]EOT $>$\& \_\-\_\-replace - replacement strategy used for integrating the immigrant individuals in the destination population; \item[{\em Topology\&}]\_\-\_\-topology - topological model to be followed when performing migrations; \item[{\em eo\-Pop$<$}]EOT $>$\& \_\-\_\-source - source population from which the emigrant individuals are selected; \item[{\em eo\-Pop$<$}]EOT $>$\& \_\-\_\-destination - destination population in which the immigrant population are integrated. \end{description} +\end{Desc} + + +Definition at line 178 of file peo\-Sync\-Island\-Mig.h. + +References Topology::add(), and peo\-Sync\-Island\-Mig$<$ EOT $>$::sync. + +\subsection{Member Function Documentation} +\hypertarget{classpeoSyncIslandMig_178476fd276f78b73607b33d19522c36}{ +\index{peoSyncIslandMig@{peo\-Sync\-Island\-Mig}!operator()@{operator()}} +\index{operator()@{operator()}!peoSyncIslandMig@{peo\-Sync\-Island\-Mig}} +\subsubsection[operator()]{\setlength{\rightskip}{0pt plus 5cm}template$<$class EOT$>$ void \hyperlink{classpeoSyncIslandMig}{peo\-Sync\-Island\-Mig}$<$ EOT $>$::operator() ()\hspace{0.3cm}{\tt \mbox{[}virtual\mbox{]}}}} +\label{classpeoSyncIslandMig_178476fd276f78b73607b33d19522c36} + + +\doxyref{Function} operator to be called as checkpoint for performing the migration step. + +The emigrant individuals are selected from the source population and sent to the next island (defined by the topology object) while the immigrant individuals are integrated in the destination population. There is no need to explicitly call the function - the wrapper checkpoint object (please refer to the above example) will perform the call when required. + +Implements \bf{eo\-F$<$ void $>$}. + +Definition at line 252 of file peo\-Sync\-Island\-Mig.h. + +References peo\-Sync\-Island\-Mig$<$ EOT $>$::cont, peo\-Sync\-Island\-Mig$<$ EOT $>$::emigrate(), Cooperative::get\-Owner(), peo\-Sync\-Island\-Mig$<$ EOT $>$::immigrate(), Thread::set\-Active(), peo\-Sync\-Island\-Mig$<$ EOT $>$::source, Communicable::stop(), and peo\-Sync\-Island\-Mig$<$ EOT $>$::sync. + +The documentation for this class was generated from the following file:\begin{CompactItemize} +\item +peo\-Sync\-Island\-Mig.h\end{CompactItemize} diff --git a/branches/paradiseo-peo-meta-model/doc/latex/classpeoSyncMultiStart.eps b/branches/paradiseo-peo-meta-model/doc/latex/classpeoSyncMultiStart.eps new file mode 100644 index 000000000..6a97a65f8 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/latex/classpeoSyncMultiStart.eps @@ -0,0 +1,221 @@ +%!PS-Adobe-2.0 EPSF-2.0 +%%Title: ClassName +%%Creator: Doxygen +%%CreationDate: Time +%%For: +%Magnification: 1.00 +%%Orientation: Portrait +%%BoundingBox: 0 0 500 232.558 +%%Pages: 0 +%%BeginSetup +%%EndSetup +%%EndComments + +% ----- variables ----- + +/boxwidth 0 def +/boxheight 40 def +/fontheight 24 def +/marginwidth 10 def +/distx 20 def +/disty 40 def +/boundaspect 2.15 def % aspect ratio of the BoundingBox (width/height) +/boundx 500 def +/boundy boundx boundaspect div def +/xspacing 0 def +/yspacing 0 def +/rows 4 def +/cols 2 def +/scalefactor 0 def +/boxfont /Times-Roman findfont fontheight scalefont def + +% ----- procedures ----- + +/dotted { [1 4] 0 setdash } def +/dashed { [5] 0 setdash } def +/solid { [] 0 setdash } def + +/max % result = MAX(arg1,arg2) +{ + /a exch def + /b exch def + a b gt {a} {b} ifelse +} def + +/xoffset % result = MAX(0,(scalefactor-(boxwidth*cols+distx*(cols-1)))/2) +{ + 0 scalefactor boxwidth cols mul distx cols 1 sub mul add sub 2 div max +} def + +/cw % boxwidth = MAX(boxwidth, stringwidth(arg1)) +{ + /str exch def + /boxwidth boxwidth str stringwidth pop max def +} def + +/box % draws a box with text `arg1' at grid pos (arg2,arg3) +{ gsave + 2 setlinewidth + newpath + exch xspacing mul xoffset add + exch yspacing mul + moveto + boxwidth 0 rlineto + 0 boxheight rlineto + boxwidth neg 0 rlineto + 0 boxheight neg rlineto + closepath + dup stringwidth pop neg boxwidth add 2 div + boxheight fontheight 2 div sub 2 div + rmoveto show stroke + grestore +} def + +/mark +{ newpath + exch xspacing mul xoffset add boxwidth add + exch yspacing mul + moveto + 0 boxheight 4 div rlineto + boxheight neg 4 div boxheight neg 4 div rlineto + closepath + eofill + stroke +} def + +/arrow +{ newpath + moveto + 3 -8 rlineto + -6 0 rlineto + 3 8 rlineto + closepath + eofill + stroke +} def + +/out % draws an output connector for the block at (arg1,arg2) +{ + newpath + exch xspacing mul xoffset add boxwidth 2 div add + exch yspacing mul boxheight add + /y exch def + /x exch def + x y moveto + 0 disty 2 div rlineto + stroke + 1 eq { x y disty 2 div add arrow } if +} def + +/in % draws an input connector for the block at (arg1,arg2) +{ + newpath + exch xspacing mul xoffset add boxwidth 2 div add + exch yspacing mul disty 2 div sub + /y exch def + /x exch def + x y moveto + 0 disty 2 div rlineto + stroke + 1 eq { x y disty 2 div add arrow } if +} def + +/hedge +{ + exch xspacing mul xoffset add boxwidth 2 div add + exch yspacing mul boxheight 2 div sub + /y exch def + /x exch def + newpath + x y moveto + boxwidth 2 div distx add 0 rlineto + stroke + 1 eq + { newpath x boxwidth 2 div distx add add y moveto + -8 3 rlineto + 0 -6 rlineto + 8 3 rlineto + closepath + eofill + stroke + } if +} def + +/vedge +{ + /ye exch def + /ys exch def + /xs exch def + newpath + xs xspacing mul xoffset add boxwidth 2 div add dup + ys yspacing mul boxheight 2 div sub + moveto + ye yspacing mul boxheight 2 div sub + lineto + stroke +} def + +/conn % connections the blocks from col `arg1' to `arg2' of row `arg3' +{ + /ys exch def + /xe exch def + /xs exch def + newpath + xs xspacing mul xoffset add boxwidth 2 div add + ys yspacing mul disty 2 div sub + moveto + xspacing xe xs sub mul 0 + rlineto + stroke +} def + +% ----- main ------ + +boxfont setfont +1 boundaspect scale +(peoSyncMultiStart< EOT >) cw +(Service) cw +(eoUpdater) cw +(Communicable) cw +(eoF< void >) cw +(eoFunctorBase) cw +/boxwidth boxwidth marginwidth 2 mul add def +/xspacing boxwidth distx add def +/yspacing boxheight disty add def +/scalefactor + boxwidth cols mul distx cols 1 sub mul add + boxheight rows mul disty rows 1 sub mul add boundaspect mul + max def +boundx scalefactor div boundy scalefactor div scale + +% ----- classes ----- + + (peoSyncMultiStart< EOT >) 0.5 0 box + (Service) 0 1 box + (eoUpdater) 1 1 box + (Communicable) 0 2 box + (eoF< void >) 1 2 box + (eoFunctorBase) 1 3 box + +% ----- relations ----- + +solid +0 0.5 0 out +solid +0 1 1 conn +solid +1 0 1 in +solid +0 0 1 out +solid +1 1 1 in +solid +0 1 1 out +solid +1 0 2 in +solid +1 1 2 in +solid +0 1 2 out +solid +1 1 3 in diff --git a/branches/paradiseo-peo-meta-model/doc/latex/classpeoSyncMultiStart.tex b/branches/paradiseo-peo-meta-model/doc/latex/classpeoSyncMultiStart.tex new file mode 100644 index 000000000..0d9edadaa --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/latex/classpeoSyncMultiStart.tex @@ -0,0 +1,245 @@ +\hypertarget{classpeoSyncMultiStart}{ +\section{peo\-Sync\-Multi\-Start$<$ EOT $>$ Class Template Reference} +\label{classpeoSyncMultiStart}\index{peoSyncMultiStart@{peoSyncMultiStart}} +} +The \hyperlink{classpeoSyncMultiStart}{peo\-Sync\-Multi\-Start} class provides the basis for implementing the synchronous multi-start model, for launching several solution-based algorithms in parallel on a specified initial population. + + +{\tt \#include $<$peo\-Sync\-Multi\-Start.h$>$} + +Inheritance diagram for peo\-Sync\-Multi\-Start$<$ EOT $>$::\begin{figure}[H] +\begin{center} +\leavevmode +\includegraphics[height=4cm]{classpeoSyncMultiStart} +\end{center} +\end{figure} +\subsection*{Public Member Functions} +\begin{CompactItemize} +\item +\hyperlink{classpeoSyncMultiStart_d29f94aad3c1f443bfffc8b6aee0704c}{peo\-Sync\-Multi\-Start} (\bf{eo\-Continue}$<$ EOT $>$ \&\_\-\_\-cont, \bf{eo\-Select}$<$ EOT $>$ \&\_\-\_\-select, \bf{eo\-Replacement}$<$ EOT $>$ \&\_\-\_\-replace, \bf{mo\-Algo}$<$ EOT $>$ \&\_\-\_\-ls, \bf{eo\-Pop}$<$ EOT $>$ \&\_\-\_\-pop) +\begin{CompactList}\small\item\em Constructor function - several simple parameters are required for defining the characteristics of the multi-start model. \item\end{CompactList}\item +void \hyperlink{classpeoSyncMultiStart_76385b33fe514f91cb83f0fbecbeb3c2}{operator()} () +\begin{CompactList}\small\item\em Operator which synchronously executes the specified algorithm on the individuals selected from the initial population. \item\end{CompactList}\item +void \hyperlink{classpeoSyncMultiStart_8becfab1922b64708dca5a53e2932a5a}{pack\-Data} () +\begin{CompactList}\small\item\em Auxiliary function for transferring data between the process requesting the synchronous execution of the specified algorithm and the process which actually executes the algorithm. \item\end{CompactList}\item +void \hyperlink{classpeoSyncMultiStart_2903a441b77cded266b5fb651e17a5b5}{unpack\-Data} () +\begin{CompactList}\small\item\em Auxiliary function for transferring data between the process requesting the synchronous execution of the specified algorithm and the process which actually executes the algorithm. \item\end{CompactList}\item +void \hyperlink{classpeoSyncMultiStart_a4d1c2943c290de540800087b54dc49b}{execute} () +\begin{CompactList}\small\item\em Auxiliary function for actually executing the specified algorithm on one assigned individual. \item\end{CompactList}\item +void \hyperlink{classpeoSyncMultiStart_6c48eb0dae741cff7203b65e226f9616}{pack\-Result} () +\begin{CompactList}\small\item\em Auxiliary function for transferring data between the process requesting the synchronous execution of the specified algorithm and the process which actually executes the algorithm. \item\end{CompactList}\item +void \hyperlink{classpeoSyncMultiStart_c3cbd1f10a89d1915c5ccf82a2c34a1d}{unpack\-Result} () +\begin{CompactList}\small\item\em Auxiliary function for transferring data between the process requesting the synchronous execution of the specified algorithm and the process which actually executes the algorithm. \item\end{CompactList}\item +void \hyperlink{classpeoSyncMultiStart_32ec0d01d3fd8a9932abd68f4781fc94}{notify\-Sending\-Data} () +\begin{CompactList}\small\item\em Auxiliary function for notifications between the process requesting the synchronous multi-start execution and the processes that performs the actual execution phase. \item\end{CompactList}\item +void \hyperlink{classpeoSyncMultiStart_fc90282cc4e93cdea8f82fd52dd78fb0}{notify\-Sending\-All\-Resource\-Requests} () +\begin{CompactList}\small\item\em Auxiliary function for notifications between the process requesting the synchronous multi-start execution and the processes that performs the actual execution phase. \item\end{CompactList}\end{CompactItemize} +\subsection*{Private Attributes} +\begin{CompactItemize} +\item +\hypertarget{classpeoSyncMultiStart_43f4fa9b125baef6fc8b968dfd16f437}{ +\bf{eo\-Continue}$<$ EOT $>$ \& \hyperlink{classpeoSyncMultiStart_43f4fa9b125baef6fc8b968dfd16f437}{cont}} +\label{classpeoSyncMultiStart_43f4fa9b125baef6fc8b968dfd16f437} + +\item +\hypertarget{classpeoSyncMultiStart_8fc9a3d046023ddd077defec3c23ab3b}{ +\bf{eo\-Select}$<$ EOT $>$ \& \hyperlink{classpeoSyncMultiStart_8fc9a3d046023ddd077defec3c23ab3b}{select}} +\label{classpeoSyncMultiStart_8fc9a3d046023ddd077defec3c23ab3b} + +\item +\hypertarget{classpeoSyncMultiStart_a375ccea98e9bf2a0854dac27df4522f}{ +\bf{eo\-Replacement}$<$ EOT $>$ \& \hyperlink{classpeoSyncMultiStart_a375ccea98e9bf2a0854dac27df4522f}{replace}} +\label{classpeoSyncMultiStart_a375ccea98e9bf2a0854dac27df4522f} + +\item +\hypertarget{classpeoSyncMultiStart_4d317966de767dcc87eee0286ea7f95d}{ +\bf{mo\-Algo}$<$ EOT $>$ \& \hyperlink{classpeoSyncMultiStart_4d317966de767dcc87eee0286ea7f95d}{ls}} +\label{classpeoSyncMultiStart_4d317966de767dcc87eee0286ea7f95d} + +\item +\hypertarget{classpeoSyncMultiStart_391178bd6b8a97a08ab4e345f070e967}{ +\bf{eo\-Pop}$<$ EOT $>$ \& \hyperlink{classpeoSyncMultiStart_391178bd6b8a97a08ab4e345f070e967}{pop}} +\label{classpeoSyncMultiStart_391178bd6b8a97a08ab4e345f070e967} + +\item +\hypertarget{classpeoSyncMultiStart_dbcc1a069ec72ecd8d40c392640d84b3}{ +\bf{eo\-Pop}$<$ EOT $>$ \hyperlink{classpeoSyncMultiStart_dbcc1a069ec72ecd8d40c392640d84b3}{sel}} +\label{classpeoSyncMultiStart_dbcc1a069ec72ecd8d40c392640d84b3} + +\item +\hypertarget{classpeoSyncMultiStart_ca10f6d258105e3c4f0d1660db5b7679}{ +\bf{eo\-Pop}$<$ EOT $>$ \hyperlink{classpeoSyncMultiStart_ca10f6d258105e3c4f0d1660db5b7679}{impr\_\-sel}} +\label{classpeoSyncMultiStart_ca10f6d258105e3c4f0d1660db5b7679} + +\item +\hypertarget{classpeoSyncMultiStart_2c2ebe46470d1425f0409897deab435b}{ +EOT \hyperlink{classpeoSyncMultiStart_2c2ebe46470d1425f0409897deab435b}{sol}} +\label{classpeoSyncMultiStart_2c2ebe46470d1425f0409897deab435b} + +\item +\hypertarget{classpeoSyncMultiStart_64191ef79b7b589964ac9c3e23ae6718}{ +unsigned \hyperlink{classpeoSyncMultiStart_64191ef79b7b589964ac9c3e23ae6718}{idx}} +\label{classpeoSyncMultiStart_64191ef79b7b589964ac9c3e23ae6718} + +\item +\hypertarget{classpeoSyncMultiStart_773eb9097550d9444f25ca8f48997a30}{ +unsigned \hyperlink{classpeoSyncMultiStart_773eb9097550d9444f25ca8f48997a30}{num\_\-term}} +\label{classpeoSyncMultiStart_773eb9097550d9444f25ca8f48997a30} + +\end{CompactItemize} + + +\subsection{Detailed Description} +\subsubsection*{template$<$class EOT$>$ class peo\-Sync\-Multi\-Start$<$ EOT $>$} + +The \hyperlink{classpeoSyncMultiStart}{peo\-Sync\-Multi\-Start} class provides the basis for implementing the synchronous multi-start model, for launching several solution-based algorithms in parallel on a specified initial population. + +As a simple example, several hill climbing algorithms may be synchronously launched on the specified population, each algorithm acting upon one individual only, the final result being integrated back in the population. A \hyperlink{classpeoSyncMultiStart}{peo\-Sync\-Multi\-Start} object can be specified as checkpoint object for a classic Paradis\-EO evolutionary algorithm thus allowing for simple hybridization schemes which combine the evolutionary approach with a local search approach, for example, executed at the end of each generation. + + + +Definition at line 36 of file peo\-Sync\-Multi\-Start.h. + +\subsection{Constructor \& Destructor Documentation} +\hypertarget{classpeoSyncMultiStart_d29f94aad3c1f443bfffc8b6aee0704c}{ +\index{peoSyncMultiStart@{peo\-Sync\-Multi\-Start}!peoSyncMultiStart@{peoSyncMultiStart}} +\index{peoSyncMultiStart@{peoSyncMultiStart}!peoSyncMultiStart@{peo\-Sync\-Multi\-Start}} +\subsubsection[peoSyncMultiStart]{\setlength{\rightskip}{0pt plus 5cm}template$<$class EOT$>$ \hyperlink{classpeoSyncMultiStart}{peo\-Sync\-Multi\-Start}$<$ EOT $>$::\hyperlink{classpeoSyncMultiStart}{peo\-Sync\-Multi\-Start} (\bf{eo\-Continue}$<$ EOT $>$ \& {\em \_\-\_\-cont}, \bf{eo\-Select}$<$ EOT $>$ \& {\em \_\-\_\-select}, \bf{eo\-Replacement}$<$ EOT $>$ \& {\em \_\-\_\-replace}, \bf{mo\-Algo}$<$ EOT $>$ \& {\em \_\-\_\-ls}, \bf{eo\-Pop}$<$ EOT $>$ \& {\em \_\-\_\-pop})}} +\label{classpeoSyncMultiStart_d29f94aad3c1f443bfffc8b6aee0704c} + + +Constructor function - several simple parameters are required for defining the characteristics of the multi-start model. + +\begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em eo\-Continue$<$}]EOT $>$\& \_\-\_\-cont - defined for including further functionality - no semantics associated at this time; \item[{\em eo\-Select$<$}]EOT $>$\& \_\-\_\-select - selection strategy for obtaining a subset of the initial population on which to apply the specified algorithm; \item[{\em eo\-Replacement$<$}]EOT $>$\& \_\-\_\-replace - replacement strategy for integrating the resulting individuals in the initial population; \item[{\em mo\-Algo$<$}]EOT $>$\& \_\-\_\-ls - algorithm to be applied on each of the selected individuals - a {\bf mo\-Algo$<$ EOT $>$}-derived object must be specified; \item[{\em eo\-Pop$<$}]EOT $>$\& \_\-\_\-pop - the initial population from which the individuals are selected for applying the specified algorithm. \end{description} +\end{Desc} + + +Definition at line 106 of file peo\-Sync\-Multi\-Start.h. + +\subsection{Member Function Documentation} +\hypertarget{classpeoSyncMultiStart_76385b33fe514f91cb83f0fbecbeb3c2}{ +\index{peoSyncMultiStart@{peo\-Sync\-Multi\-Start}!operator()@{operator()}} +\index{operator()@{operator()}!peoSyncMultiStart@{peo\-Sync\-Multi\-Start}} +\subsubsection[operator()]{\setlength{\rightskip}{0pt plus 5cm}template$<$class EOT$>$ void \hyperlink{classpeoSyncMultiStart}{peo\-Sync\-Multi\-Start}$<$ EOT $>$::operator() ()\hspace{0.3cm}{\tt \mbox{[}virtual\mbox{]}}}} +\label{classpeoSyncMultiStart_76385b33fe514f91cb83f0fbecbeb3c2} + + +Operator which synchronously executes the specified algorithm on the individuals selected from the initial population. + +There is no need to explicitly call the operator - automatically called as checkpoint operator. + +Implements \bf{eo\-F$<$ void $>$}. + +Definition at line 161 of file peo\-Sync\-Multi\-Start.h. + +References peo\-Sync\-Multi\-Start$<$ EOT $>$::idx, peo\-Sync\-Multi\-Start$<$ EOT $>$::impr\_\-sel, peo\-Sync\-Multi\-Start$<$ EOT $>$::num\_\-term, peo\-Sync\-Multi\-Start$<$ EOT $>$::pop, Service::request\-Resource\-Request(), peo\-Sync\-Multi\-Start$<$ EOT $>$::sel, peo\-Sync\-Multi\-Start$<$ EOT $>$::select, and Communicable::stop().\hypertarget{classpeoSyncMultiStart_8becfab1922b64708dca5a53e2932a5a}{ +\index{peoSyncMultiStart@{peo\-Sync\-Multi\-Start}!packData@{packData}} +\index{packData@{packData}!peoSyncMultiStart@{peo\-Sync\-Multi\-Start}} +\subsubsection[packData]{\setlength{\rightskip}{0pt plus 5cm}template$<$class EOT$>$ void \hyperlink{classpeoSyncMultiStart}{peo\-Sync\-Multi\-Start}$<$ EOT $>$::pack\-Data ()\hspace{0.3cm}{\tt \mbox{[}virtual\mbox{]}}}} +\label{classpeoSyncMultiStart_8becfab1922b64708dca5a53e2932a5a} + + +Auxiliary function for transferring data between the process requesting the synchronous execution of the specified algorithm and the process which actually executes the algorithm. + +There is no need to explicitly call the function. + +Reimplemented from \hyperlink{classService_aea4b8f7f8fb88e83862ee4bfd9ab207}{Service}. + +Definition at line 120 of file peo\-Sync\-Multi\-Start.h. + +References peo\-Sync\-Multi\-Start$<$ EOT $>$::idx, and peo\-Sync\-Multi\-Start$<$ EOT $>$::sel.\hypertarget{classpeoSyncMultiStart_2903a441b77cded266b5fb651e17a5b5}{ +\index{peoSyncMultiStart@{peo\-Sync\-Multi\-Start}!unpackData@{unpackData}} +\index{unpackData@{unpackData}!peoSyncMultiStart@{peo\-Sync\-Multi\-Start}} +\subsubsection[unpackData]{\setlength{\rightskip}{0pt plus 5cm}template$<$class EOT$>$ void \hyperlink{classpeoSyncMultiStart}{peo\-Sync\-Multi\-Start}$<$ EOT $>$::unpack\-Data ()\hspace{0.3cm}{\tt \mbox{[}virtual\mbox{]}}}} +\label{classpeoSyncMultiStart_2903a441b77cded266b5fb651e17a5b5} + + +Auxiliary function for transferring data between the process requesting the synchronous execution of the specified algorithm and the process which actually executes the algorithm. + +There is no need to explicitly call the function. + +Reimplemented from \hyperlink{classService_3bd87b444710813d30fd754d4d0b4df3}{Service}. + +Definition at line 126 of file peo\-Sync\-Multi\-Start.h. + +References peo\-Sync\-Multi\-Start$<$ EOT $>$::sol.\hypertarget{classpeoSyncMultiStart_a4d1c2943c290de540800087b54dc49b}{ +\index{peoSyncMultiStart@{peo\-Sync\-Multi\-Start}!execute@{execute}} +\index{execute@{execute}!peoSyncMultiStart@{peo\-Sync\-Multi\-Start}} +\subsubsection[execute]{\setlength{\rightskip}{0pt plus 5cm}template$<$class EOT$>$ void \hyperlink{classpeoSyncMultiStart}{peo\-Sync\-Multi\-Start}$<$ EOT $>$::execute ()\hspace{0.3cm}{\tt \mbox{[}virtual\mbox{]}}}} +\label{classpeoSyncMultiStart_a4d1c2943c290de540800087b54dc49b} + + +Auxiliary function for actually executing the specified algorithm on one assigned individual. + +There is no need to explicitly call the function. + +Reimplemented from \hyperlink{classService_e4f2894e6121e60f38d41cfbd7447ae4}{Service}. + +Definition at line 132 of file peo\-Sync\-Multi\-Start.h. + +References peo\-Sync\-Multi\-Start$<$ EOT $>$::ls, and peo\-Sync\-Multi\-Start$<$ EOT $>$::sol.\hypertarget{classpeoSyncMultiStart_6c48eb0dae741cff7203b65e226f9616}{ +\index{peoSyncMultiStart@{peo\-Sync\-Multi\-Start}!packResult@{packResult}} +\index{packResult@{packResult}!peoSyncMultiStart@{peo\-Sync\-Multi\-Start}} +\subsubsection[packResult]{\setlength{\rightskip}{0pt plus 5cm}template$<$class EOT$>$ void \hyperlink{classpeoSyncMultiStart}{peo\-Sync\-Multi\-Start}$<$ EOT $>$::pack\-Result ()\hspace{0.3cm}{\tt \mbox{[}virtual\mbox{]}}}} +\label{classpeoSyncMultiStart_6c48eb0dae741cff7203b65e226f9616} + + +Auxiliary function for transferring data between the process requesting the synchronous execution of the specified algorithm and the process which actually executes the algorithm. + +There is no need to explicitly call the function. + +Reimplemented from \hyperlink{classService_e5e4f90b2315e15c2a2913bd370f4cf5}{Service}. + +Definition at line 138 of file peo\-Sync\-Multi\-Start.h. + +References peo\-Sync\-Multi\-Start$<$ EOT $>$::sol.\hypertarget{classpeoSyncMultiStart_c3cbd1f10a89d1915c5ccf82a2c34a1d}{ +\index{peoSyncMultiStart@{peo\-Sync\-Multi\-Start}!unpackResult@{unpackResult}} +\index{unpackResult@{unpackResult}!peoSyncMultiStart@{peo\-Sync\-Multi\-Start}} +\subsubsection[unpackResult]{\setlength{\rightskip}{0pt plus 5cm}template$<$class EOT$>$ void \hyperlink{classpeoSyncMultiStart}{peo\-Sync\-Multi\-Start}$<$ EOT $>$::unpack\-Result ()\hspace{0.3cm}{\tt \mbox{[}virtual\mbox{]}}}} +\label{classpeoSyncMultiStart_c3cbd1f10a89d1915c5ccf82a2c34a1d} + + +Auxiliary function for transferring data between the process requesting the synchronous execution of the specified algorithm and the process which actually executes the algorithm. + +There is no need to explicitly call the function. + +Reimplemented from \hyperlink{classService_45c06344edbfa482b91f68e2035a6099}{Service}. + +Definition at line 144 of file peo\-Sync\-Multi\-Start.h. + +References Service::get\-Owner(), peo\-Sync\-Multi\-Start$<$ EOT $>$::impr\_\-sel, peo\-Sync\-Multi\-Start$<$ EOT $>$::num\_\-term, peo\-Sync\-Multi\-Start$<$ EOT $>$::pop, peo\-Sync\-Multi\-Start$<$ EOT $>$::replace, Communicable::resume(), peo\-Sync\-Multi\-Start$<$ EOT $>$::sel, Thread::set\-Active(), and peo\-Sync\-Multi\-Start$<$ EOT $>$::sol.\hypertarget{classpeoSyncMultiStart_32ec0d01d3fd8a9932abd68f4781fc94}{ +\index{peoSyncMultiStart@{peo\-Sync\-Multi\-Start}!notifySendingData@{notifySendingData}} +\index{notifySendingData@{notifySendingData}!peoSyncMultiStart@{peo\-Sync\-Multi\-Start}} +\subsubsection[notifySendingData]{\setlength{\rightskip}{0pt plus 5cm}template$<$class EOT$>$ void \hyperlink{classpeoSyncMultiStart}{peo\-Sync\-Multi\-Start}$<$ EOT $>$::notify\-Sending\-Data ()\hspace{0.3cm}{\tt \mbox{[}virtual\mbox{]}}}} +\label{classpeoSyncMultiStart_32ec0d01d3fd8a9932abd68f4781fc94} + + +Auxiliary function for notifications between the process requesting the synchronous multi-start execution and the processes that performs the actual execution phase. + +There is no need to explicitly call the function. + +Reimplemented from \hyperlink{classService_81ad4d6ebb50045b8977e2ab74826f30}{Service}. + +Definition at line 172 of file peo\-Sync\-Multi\-Start.h.\hypertarget{classpeoSyncMultiStart_fc90282cc4e93cdea8f82fd52dd78fb0}{ +\index{peoSyncMultiStart@{peo\-Sync\-Multi\-Start}!notifySendingAllResourceRequests@{notifySendingAllResourceRequests}} +\index{notifySendingAllResourceRequests@{notifySendingAllResourceRequests}!peoSyncMultiStart@{peo\-Sync\-Multi\-Start}} +\subsubsection[notifySendingAllResourceRequests]{\setlength{\rightskip}{0pt plus 5cm}template$<$class EOT$>$ void \hyperlink{classpeoSyncMultiStart}{peo\-Sync\-Multi\-Start}$<$ EOT $>$::notify\-Sending\-All\-Resource\-Requests ()\hspace{0.3cm}{\tt \mbox{[}virtual\mbox{]}}}} +\label{classpeoSyncMultiStart_fc90282cc4e93cdea8f82fd52dd78fb0} + + +Auxiliary function for notifications between the process requesting the synchronous multi-start execution and the processes that performs the actual execution phase. + +There is no need to explicitly call the function. + +Reimplemented from \hyperlink{classService_f94cc8a5c2665d4574041737e61e9ffc}{Service}. + +Definition at line 177 of file peo\-Sync\-Multi\-Start.h. + +References Service::get\-Owner(), and Thread::set\-Passive(). + +The documentation for this class was generated from the following file:\begin{CompactItemize} +\item +peo\-Sync\-Multi\-Start.h\end{CompactItemize} diff --git a/branches/paradiseo-peo-meta-model/doc/latex/classpeoTransform.eps b/branches/paradiseo-peo-meta-model/doc/latex/classpeoTransform.eps new file mode 100644 index 000000000..685b4bc71 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/latex/classpeoTransform.eps @@ -0,0 +1,233 @@ +%!PS-Adobe-2.0 EPSF-2.0 +%%Title: ClassName +%%Creator: Doxygen +%%CreationDate: Time +%%For: +%Magnification: 1.00 +%%Orientation: Portrait +%%BoundingBox: 0 0 500 250 +%%Pages: 0 +%%BeginSetup +%%EndSetup +%%EndComments + +% ----- variables ----- + +/boxwidth 0 def +/boxheight 40 def +/fontheight 24 def +/marginwidth 10 def +/distx 20 def +/disty 40 def +/boundaspect 2 def % aspect ratio of the BoundingBox (width/height) +/boundx 500 def +/boundy boundx boundaspect div def +/xspacing 0 def +/yspacing 0 def +/rows 5 def +/cols 2 def +/scalefactor 0 def +/boxfont /Times-Roman findfont fontheight scalefont def + +% ----- procedures ----- + +/dotted { [1 4] 0 setdash } def +/dashed { [5] 0 setdash } def +/solid { [] 0 setdash } def + +/max % result = MAX(arg1,arg2) +{ + /a exch def + /b exch def + a b gt {a} {b} ifelse +} def + +/xoffset % result = MAX(0,(scalefactor-(boxwidth*cols+distx*(cols-1)))/2) +{ + 0 scalefactor boxwidth cols mul distx cols 1 sub mul add sub 2 div max +} def + +/cw % boxwidth = MAX(boxwidth, stringwidth(arg1)) +{ + /str exch def + /boxwidth boxwidth str stringwidth pop max def +} def + +/box % draws a box with text `arg1' at grid pos (arg2,arg3) +{ gsave + 2 setlinewidth + newpath + exch xspacing mul xoffset add + exch yspacing mul + moveto + boxwidth 0 rlineto + 0 boxheight rlineto + boxwidth neg 0 rlineto + 0 boxheight neg rlineto + closepath + dup stringwidth pop neg boxwidth add 2 div + boxheight fontheight 2 div sub 2 div + rmoveto show stroke + grestore +} def + +/mark +{ newpath + exch xspacing mul xoffset add boxwidth add + exch yspacing mul + moveto + 0 boxheight 4 div rlineto + boxheight neg 4 div boxheight neg 4 div rlineto + closepath + eofill + stroke +} def + +/arrow +{ newpath + moveto + 3 -8 rlineto + -6 0 rlineto + 3 8 rlineto + closepath + eofill + stroke +} def + +/out % draws an output connector for the block at (arg1,arg2) +{ + newpath + exch xspacing mul xoffset add boxwidth 2 div add + exch yspacing mul boxheight add + /y exch def + /x exch def + x y moveto + 0 disty 2 div rlineto + stroke + 1 eq { x y disty 2 div add arrow } if +} def + +/in % draws an input connector for the block at (arg1,arg2) +{ + newpath + exch xspacing mul xoffset add boxwidth 2 div add + exch yspacing mul disty 2 div sub + /y exch def + /x exch def + x y moveto + 0 disty 2 div rlineto + stroke + 1 eq { x y disty 2 div add arrow } if +} def + +/hedge +{ + exch xspacing mul xoffset add boxwidth 2 div add + exch yspacing mul boxheight 2 div sub + /y exch def + /x exch def + newpath + x y moveto + boxwidth 2 div distx add 0 rlineto + stroke + 1 eq + { newpath x boxwidth 2 div distx add add y moveto + -8 3 rlineto + 0 -6 rlineto + 8 3 rlineto + closepath + eofill + stroke + } if +} def + +/vedge +{ + /ye exch def + /ys exch def + /xs exch def + newpath + xs xspacing mul xoffset add boxwidth 2 div add dup + ys yspacing mul boxheight 2 div sub + moveto + ye yspacing mul boxheight 2 div sub + lineto + stroke +} def + +/conn % connections the blocks from col `arg1' to `arg2' of row `arg3' +{ + /ys exch def + /xe exch def + /xs exch def + newpath + xs xspacing mul xoffset add boxwidth 2 div add + ys yspacing mul disty 2 div sub + moveto + xspacing xe xs sub mul 0 + rlineto + stroke +} def + +% ----- main ------ + +boxfont setfont +1 boundaspect scale +(peoTransform< EOT >) cw +(Service) cw +(eoTransform< EOT >) cw +(Communicable) cw +(eoUF< A1, R >) cw +(eoFunctorBase) cw +(peoParaSGATransform< EOT >) cw +(peoSeqTransform< EOT >) cw +/boxwidth boxwidth marginwidth 2 mul add def +/xspacing boxwidth distx add def +/yspacing boxheight disty add def +/scalefactor + boxwidth cols mul distx cols 1 sub mul add + boxheight rows mul disty rows 1 sub mul add boundaspect mul + max def +boundx scalefactor div boundy scalefactor div scale + +% ----- classes ----- + + (peoTransform< EOT >) 0.5 1 box + (Service) 0 2 box + (eoTransform< EOT >) 1 2 box + (Communicable) 0 3 box + (eoUF< A1, R >) 1 3 box + (eoFunctorBase) 1 4 box + (peoParaSGATransform< EOT >) 0 0 box + (peoSeqTransform< EOT >) 1 0 box + +% ----- relations ----- + +solid +0 0.5 1 out +solid +0 1 2 conn +solid +1 0 2 in +solid +0 0 2 out +solid +1 1 2 in +solid +0 1 2 out +solid +1 0 3 in +solid +1 1 3 in +solid +0 1 3 out +solid +1 1 4 in +solid +1 0.5 0.25 out +solid +0 1 1 conn +solid +0 0 0.75 in +solid +0 1 0.75 in diff --git a/branches/paradiseo-peo-meta-model/doc/latex/classpeoTransform.tex b/branches/paradiseo-peo-meta-model/doc/latex/classpeoTransform.tex new file mode 100644 index 000000000..218909383 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/latex/classpeoTransform.tex @@ -0,0 +1,29 @@ +\hypertarget{classpeoTransform}{ +\section{peo\-Transform$<$ EOT $>$ Class Template Reference} +\label{classpeoTransform}\index{peoTransform@{peoTransform}} +} +The \hyperlink{classpeoTransform}{peo\-Transform} class acts only as an interface for creating transform operators - for an example please refer to the {\bf \hyperlink{classpeoSeqTransform}{peo\-Seq\-Transform}} and the {\bf \hyperlink{classpeoParaSGATransform}{peo\-Para\-SGATransform}} classes. + + +{\tt \#include $<$peo\-Transform.h$>$} + +Inheritance diagram for peo\-Transform$<$ EOT $>$::\begin{figure}[H] +\begin{center} +\leavevmode +\includegraphics[height=5cm]{classpeoTransform} +\end{center} +\end{figure} + + +\subsection{Detailed Description} +\subsubsection*{template$<$class EOT$>$ class peo\-Transform$<$ EOT $>$} + +The \hyperlink{classpeoTransform}{peo\-Transform} class acts only as an interface for creating transform operators - for an example please refer to the {\bf \hyperlink{classpeoSeqTransform}{peo\-Seq\-Transform}} and the {\bf \hyperlink{classpeoParaSGATransform}{peo\-Para\-SGATransform}} classes. + + + +Definition at line 20 of file peo\-Transform.h. + +The documentation for this class was generated from the following file:\begin{CompactItemize} +\item +peo\-Transform.h\end{CompactItemize} diff --git a/branches/paradiseo-peo-meta-model/doc/latex/doxygen.sty b/branches/paradiseo-peo-meta-model/doc/latex/doxygen.sty new file mode 100644 index 000000000..dc3bf5e7e --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/latex/doxygen.sty @@ -0,0 +1,78 @@ +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{doxygen} +\RequirePackage{calc} +\RequirePackage{array} +\pagestyle{fancyplain} +\newcommand{\clearemptydoublepage}{\newpage{\pagestyle{empty}\cleardoublepage}} +\renewcommand{\chaptermark}[1]{\markboth{#1}{}} +\renewcommand{\sectionmark}[1]{\markright{\thesection\ #1}} +\lhead[\fancyplain{}{\bfseries\thepage}] + {\fancyplain{}{\bfseries\rightmark}} +\rhead[\fancyplain{}{\bfseries\leftmark}] + {\fancyplain{}{\bfseries\thepage}} +\rfoot[\fancyplain{}{\bfseries\scriptsize Generated on Thu Jul 5 13:43:30 2007 for Paradis\-EO-PEO by Doxygen }]{} +\lfoot[]{\fancyplain{}{\bfseries\scriptsize Generated on Thu Jul 5 13:43:30 2007 for Paradis\-EO-PEO by Doxygen }} +\cfoot{} +\newenvironment{Code} +{\footnotesize} +{\normalsize} +\newcommand{\doxyref}[3]{\textbf{#1} (\textnormal{#2}\,\pageref{#3})} +\newenvironment{DocInclude} +{\footnotesize} +{\normalsize} +\newenvironment{VerbInclude} +{\footnotesize} +{\normalsize} +\newenvironment{Image} +{\begin{figure}[H]} +{\end{figure}} +\newenvironment{ImageNoCaption}{}{} +\newenvironment{CompactList} +{\begin{list}{}{ + \setlength{\leftmargin}{0.5cm} + \setlength{\itemsep}{0pt} + \setlength{\parsep}{0pt} + \setlength{\topsep}{0pt} + \renewcommand{\makelabel}{\hfill}}} +{\end{list}} +\newenvironment{CompactItemize} +{ + \begin{itemize} + \setlength{\itemsep}{-3pt} + \setlength{\parsep}{0pt} + \setlength{\topsep}{0pt} + \setlength{\partopsep}{0pt} +} +{\end{itemize}} +\newcommand{\PBS}[1]{\let\temp=\\#1\let\\=\temp} +\newlength{\tmplength} +\newenvironment{TabularC}[1] +{ +\setlength{\tmplength} + {\linewidth/(#1)-\tabcolsep*2-\arrayrulewidth*(#1+1)/(#1)} + \par\begin{tabular*}{\linewidth} + {*{#1}{|>{\PBS\raggedright\hspace{0pt}}p{\the\tmplength}}|} +} +{\end{tabular*}\par} +\newcommand{\entrylabel}[1]{ + {\parbox[b]{\labelwidth-4pt}{\makebox[0pt][l]{\textbf{#1}}\vspace{1.5\baselineskip}}}} +\newenvironment{Desc} +{\begin{list}{} + { + \settowidth{\labelwidth}{40pt} + \setlength{\leftmargin}{\labelwidth} + \setlength{\parsep}{0pt} + \setlength{\itemsep}{-4pt} + \renewcommand{\makelabel}{\entrylabel} + } +} +{\end{list}} +\newenvironment{Indent} + {\begin{list}{}{\setlength{\leftmargin}{0.5cm}} + \item[]\ignorespaces} + {\unskip\end{list}} +\setlength{\parindent}{0cm} +\setlength{\parskip}{0.2cm} +\addtocounter{secnumdepth}{1} +\sloppy +\usepackage[T1]{fontenc} diff --git a/branches/paradiseo-peo-meta-model/doc/latex/hierarchy.tex b/branches/paradiseo-peo-meta-model/doc/latex/hierarchy.tex new file mode 100644 index 000000000..9bc0e8623 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/latex/hierarchy.tex @@ -0,0 +1,64 @@ +\section{Paradis\-EO-PEO Class Hierarchy} +This inheritance list is sorted roughly, but not completely, alphabetically:\begin{CompactList} +\item \contentsline{section}{Communicable}{\pageref{classCommunicable}}{} +\begin{CompactList} +\item \contentsline{section}{Cooperative}{\pageref{classCooperative}}{} +\begin{CompactList} +\item \contentsline{section}{peo\-Async\-Island\-Mig$<$ EOT $>$}{\pageref{classpeoAsyncIslandMig}}{} +\item \contentsline{section}{peo\-Sync\-Island\-Mig$<$ EOT $>$}{\pageref{classpeoSyncIslandMig}}{} +\end{CompactList} +\item \contentsline{section}{Runner}{\pageref{classRunner}}{} +\begin{CompactList} +\item \contentsline{section}{peo\-EA$<$ EOT $>$}{\pageref{classpeoEA}}{} +\end{CompactList} +\item \contentsline{section}{Service}{\pageref{classService}}{} +\begin{CompactList} +\item \contentsline{section}{peo\-Pop\-Eval$<$ EOT $>$}{\pageref{classpeoPopEval}}{} +\begin{CompactList} +\item \contentsline{section}{peo\-Para\-Pop\-Eval$<$ EOT $>$}{\pageref{classpeoParaPopEval}}{} +\item \contentsline{section}{peo\-Seq\-Pop\-Eval$<$ EOT $>$}{\pageref{classpeoSeqPopEval}}{} +\end{CompactList} +\item \contentsline{section}{peo\-Sync\-Multi\-Start$<$ EOT $>$}{\pageref{classpeoSyncMultiStart}}{} +\item \contentsline{section}{peo\-Transform$<$ EOT $>$}{\pageref{classpeoTransform}}{} +\begin{CompactList} +\item \contentsline{section}{peo\-Para\-SGATransform$<$ EOT $>$}{\pageref{classpeoParaSGATransform}}{} +\item \contentsline{section}{peo\-Seq\-Transform$<$ EOT $>$}{\pageref{classpeoSeqTransform}}{} +\end{CompactList} +\end{CompactList} +\item \contentsline{section}{Worker}{\pageref{classWorker}}{} +\end{CompactList} +\item eo\-Functor\-Base{\tt \mbox{[}external\mbox{]}}\begin{CompactList} +\item eo\-BF$<$ A1, A2, R $>${\tt \mbox{[}external\mbox{]}}\begin{CompactList} +\item \contentsline{section}{peo\-Agg\-Eval\-Func$<$ EOT $>$}{\pageref{classpeoAggEvalFunc}}{} +\begin{CompactList} +\item \contentsline{section}{peo\-No\-Agg\-Eval\-Func$<$ EOT $>$}{\pageref{classpeoNoAggEvalFunc}}{} +\end{CompactList} +\end{CompactList} +\item eo\-F$<$ void $>${\tt \mbox{[}external\mbox{]}}\begin{CompactList} +\item eo\-Updater{\tt \mbox{[}external\mbox{]}}\begin{CompactList} +\item \contentsline{section}{peo\-Async\-Island\-Mig$<$ EOT $>$}{\pageref{classpeoAsyncIslandMig}}{} +\item \contentsline{section}{peo\-Sync\-Island\-Mig$<$ EOT $>$}{\pageref{classpeoSyncIslandMig}}{} +\item \contentsline{section}{peo\-Sync\-Multi\-Start$<$ EOT $>$}{\pageref{classpeoSyncMultiStart}}{} +\end{CompactList} +\end{CompactList} +\item eo\-UF$<$ A1, R $>${\tt \mbox{[}external\mbox{]}}\begin{CompactList} +\item eo\-Transform$<$ EOT $>${\tt \mbox{[}external\mbox{]}}\begin{CompactList} +\item \contentsline{section}{peo\-Transform$<$ EOT $>$}{\pageref{classpeoTransform}}{} +\end{CompactList} +\end{CompactList} +\end{CompactList} +\item \contentsline{section}{SEND\_\-REQUEST}{\pageref{structSEND__REQUEST}}{} +\item \contentsline{section}{Thread}{\pageref{classThread}}{} +\begin{CompactList} +\item \contentsline{section}{Reactive\-Thread}{\pageref{classReactiveThread}}{} +\begin{CompactList} +\item \contentsline{section}{Communicator}{\pageref{classCommunicator}}{} +\item \contentsline{section}{Worker}{\pageref{classWorker}}{} +\end{CompactList} +\item \contentsline{section}{Runner}{\pageref{classRunner}}{} +\end{CompactList} +\item \contentsline{section}{Topology}{\pageref{classTopology}}{} +\begin{CompactList} +\item \contentsline{section}{Ring\-Topology}{\pageref{classRingTopology}}{} +\end{CompactList} +\end{CompactList} diff --git a/branches/paradiseo-peo-meta-model/doc/latex/main.tex b/branches/paradiseo-peo-meta-model/doc/latex/main.tex new file mode 100644 index 000000000..dca7752e8 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/latex/main.tex @@ -0,0 +1,52 @@ +\hypertarget{main_intro}{}\section{intro}\label{main_intro} +Paradis\-EO is a white-box object-oriented framework dedicated to the reusable design of parallel and distributed metaheuristics (PDM). Paradis\-EO provides a broad range of features including evolutionary algorithms (EA), local searches (LS), the most common parallel and distributed models and hybridization mechanisms, etc. This high content and utility encourages its use at European level. Paradis\-EO is based on a clear conceptual separation of the solution methods from the problems they are intended to solve. This separation confers to the user a maximum code and design reuse. Furthermore, the fine-grained nature of the classes provided by the framework allow a higher flexibility compared to other frameworks. Paradis\-EO is one of the rare frameworks that provide the most common parallel and distributed models. Their implementation is portable on distributed-memory machines as well as on shared-memory multiprocessors, as it uses standard libraries such as MPI, PVM and PThreads. The models can be exploited in a transparent way, one has just to instantiate their associated provided classes. Their experimentation on the radio network design real-world application demonstrate their efficiency. + +In practice, combinatorial optimization problems are often NP-hard, CPU time-consuming, and evolve over time. Unlike exact methods, metaheuristics allow to tackle large-size problems instances by delivering satisfactory solutions in a reasonable time. Metaheuristics are general-purpose heuristics that split in two categories: evolutionary algorithms (EA) and local search methods (LS). These two families have complementary characteristics: EA allow a better exploration of the search space, while LS have the power to intensify the search in promising regions. Their hybridization allows to deliver robust and better solutions + +Although serial metaheuristics have a polynomial temporal complexity, they remain unsatisfactory for industrial problems. Parallel and distributed computing is a powerful way to deal with the performance issue of these problems. Numerous parallel and distributed metaheuristics (PDM) and their implementations have been proposed, and are available on the\-Web. They can be reused and adapted to his/her own problems. However, the user has to deeply examine the code and rewrite its problem-specific sections. The task is tedious, errorprone, takes along time and makes harder the produced code maintenance. A better way to reuse the code of existing PDM is the reuse through libraries. These are often more reliable as they are more tested and documented. They allow a better maintainability and efficiency. However, libraries do not allow the reuse of design.\hypertarget{main_parallel_metaheuristics}{}\section{Parallel and distributed metaheuristics}\label{main_parallel_metaheuristics} +\hypertarget{main_parallel_distributed}{}\subsection{Parallel distributed evolutionary algorithms}\label{main_parallel_distributed} +Evolutionary Algorithms (EA) are based on the iterative improvement of a population of solutions. At each step, individuals are selected, paired and recombined in order to generate new solutions that replace other ones, and so on. As the algorithm converges, the population is mainly composed of individuals well adapted to the \char`\"{}environment\char`\"{}, for instance the problem. The main features that characterize EA are the way the population is initialized, the selection strategy (deterministic/stochastic) by fostering \char`\"{}good\char`\"{} solutions, the replacement strategy that discards individuals, and the continuation/stopping criterion to decide whether the evolution should go on or not. + +Basically, three major parallel and distributed models for EA can been distinguished: the island (a)synchronous cooperative model, the parallel evaluation of the population, and the distributed evaluation of a single solution. \begin{itemize} +\item {\em Island (a)synchronous cooperative model\/}. Different EA are simultaneously deployed to cooperate for computing better and robust solutions. They exchange in an asynchronous way genetic stuff to diversify the search. The objective is to allow to delay the global convergence, especially when the\-EAare heterogeneous regarding the variation operators. The migration of individuals follows a policy defined by few parameters: the migration decision criterion, the exchange topology, the number of emigrants, the emigrants selection policy, and the replacement/integration policy. + +\item {\em Parallel evaluation of the population\/}. It is required as it is in general the most timeconsuming. The parallel evaluation follows the centralized model. The farmer applies the following operations: selection, transformation and replacement as they require a global management of the population. At each generation, it distributes the set of new solutions between differentworkers. These evaluate and return back the solutions and their quality values. An efficient execution is often obtained particularly when the evaluation of each solution is costly. The two main advantages of an asynchronous model over the synchronous model are: (1) the fault tolerance of the asynchronous model; (2) the robustness in case the fitness computation can take very different computation times (e.g. for nonlinear numerical optimization). Whereas some time-out detection can be used to address the former issue, the latter one can be partially overcome if the grain is set to very small values, as individuals will be sent out for evaluations upon request of the workers. + +\item {\em Distributed evaluation of a single solution\/}. The quality of each solution is evaluated in a parallel centralized way. That model is particularly interesting when the evaluation function can be itself parallelized as it is CPU time-consuming and/or IO intensive. In that case, the function can be viewed as an aggregation of a certain number of partial functions. The partial functions could also be identical if for example the problem to deal with is a data mining one. The evaluation is thus data parallel and the accesses to data base are performed in parallel. Furthermore, a reduction operation is performed on the results returned by the partial functions. As a summary, for this model the user has to indicate a set of partial functions and an aggregation operator of these. \end{itemize} +\hypertarget{main_parallel_ls}{}\subsection{Parallel distributed local searches}\label{main_parallel_ls} +\hypertarget{main_local_searches}{}\subsubsection{Local searches}\label{main_local_searches} +All metaheuristics dedicated to the improvement of a single solution are based on the concept of neighborhood. They start from a solution randomly generated or obtained from another optimization algorithm, and update it, step by step, by replacing the current solution by one of its neighboring candidates. Some criterion have been identified to differentiate such searches: the heuristic internal memory, the choice of the initial solution, the candidate solutions generator, and the selection strategy of candidate moves. Three main algorithms of local search stand out: Hill Climbing (HC), Simulated Annealing (SA) and Tabu Search (TS).\hypertarget{main_parallel_local_searches}{}\subsubsection{Parallel local searches}\label{main_parallel_local_searches} +Two parallel distributed models are commonly used in the literature: the parallel distributed exploration of neighboring candidate solutions model, and the multi-start model. \begin{itemize} +\item {\em Parallel exploration of neighboring candidates\/}. It is a low-level Farmer-Worker model that does not alter the behavior of the heuristic. A sequential search computes the same results slower.At the beginning of each iteration, the farmer duplicates the current solution between distributed nodes. Each one manages some candidates and the results are returned to the farmer. The model is efficient if the evaluation of a each solution is time-consuming and/or there are a great deal of candidate neighbors to evaluate. This is obviously not applicable to SA since only one candidate is evaluated at each iteration. Likewise, the efficiency of the model for HC is not always guaranteed as the number of neighboring solutions to process before finding one that improves the current objective function may be highly variable. + +\item {\em Multi-start model\/}. It consists in simultaneously launching several local searches. They may be heterogeneous, but no information is exchanged between them. The resultswould be identical as if the algorithms were sequentially run.Very often deterministic algorithms differ by the supplied initial solution and/or some other parameters. This trivial model is convenient for low-speed networks of workstations. \end{itemize} +\hypertarget{main_hybridization}{}\section{Hybridization}\label{main_hybridization} +Recently, hybrid metaheuristics have gained a considerable interest. For many practical or academic optimization problems, the best found solutions are obtained by hybrid algorithms. Combinations of different metaheuristics have provided very powerful search methods. Two levels and two modes of hybridization have been distinguished: Low and High levels, and Relay and \hyperlink{classCooperative}{Cooperative} modes. The low-level hybridization addresses the functional composition of a single optimization method. A function of a given metaheuristic is replaced by another metaheuristic. On the contrary, for high-level hybrid algorithms the different metaheuristics are self-containing, meaning no direct relationship to their internal working is considered. On the other hand, relay hybridization means a set of metaheuristics is applied in a pipeline way. The output of a metaheuristic (except the last) is the input of the following one (except the first). Conversely, co-evolutionist hybridization is a cooperative optimization model. Each metaheuristic performs a search in a solution space, and exchange solutions with others.\hypertarget{main_paradiseo_goals}{}\section{Paradiseo goals and architecture}\label{main_paradiseo_goals} +The \char`\"{}EO\char`\"{} part of Paradis\-EO means Evolving Objects. \doxyref{EO} is a C++ LGPL open source framework and includes a paradigm-free Evolutionary Computation library (EOlib) dedicated to the flexible design of EA through evolving objects superseding the most common dialects (Genetic Algorithms, Evolution Strategies, Evolutionary Programming and Genetic Programming). Furthermore, \doxyref{EO} integrates several services including visualization facilities, on-line definition of parameters, application check-pointing, etc. Paradis\-EO is an extended version of the \doxyref{EO} framework. The extensions include local search methods, hybridization mechanisms, parallelism and distribution mechanisms, and other features that are not addressed in this paper such as multi-objective optimization and grid computing. In the next sections, we present the motivations and goals of Paradis\-EO, its architecture and some of its main implementation details and issues.\hypertarget{main_motivation}{}\subsection{Motivations and goals}\label{main_motivation} +A framework is normally intended to be exploited by as many users as possible. Therefore, its exploitation could be successful only if some important user criteria are satisfied. The following criteria are the major of them and constitute the main objectives of the Paradis\-EO framework: + +\begin{itemize} +\item {\em Maximum design and code reuse\/}. The framework must provide for the user a whole architecture design of his/her solution method. Moreover, the programmer may redo as little code as possible. This objective requires a clear and maximal conceptual separation between the solution methods and the problems to be solved, and thus a deep domain analysis. The user might therefore develop only the minimal problem-specific code. + +\item {\em Flexibility and adaptability\/}. It must be possible for the user to easily add new features/ metaheuristics or change existing ones without implicating other components. Furthermore, as in practice existing problems evolve and new others arise these have to be tackled by specializing/adapting the framework components. + +\item {\em Utility\/}. The framework must allow the user to cover a broad range of metaheuristics, problems, parallel distributed models, hybridization mechanisms, etc. + +\item {\em Transparent and easy access to performance and robustness\/}. As the optimization applications are often time-consuming the performance issue is crucial. Parallelism and distribution are two important ways to achieve high performance execution. In order to facilitate its use it is implemented so that the user can deploy his/her parallel algorithms in a transparent manner. Moreover, the execution of the algorithms must be robust to guarantee the reliability and the quality of the results. The hybridization mechanism allows to obtain robust and better solutions. + +\item {\em Portability\/}. In order to satisfy a large number of users the framework must support different material architectures and their associated operating systems. \end{itemize} +\hypertarget{main_architecture}{}\subsection{Paradis\-EO architecture}\label{main_architecture} +The architecture of Paradis\-EO is multi-layer and modular allowing to achieve the objectives quoted above. This allows particularly a high flexibility and adaptability, an easier hybridization, and more code and design reuse. The architecture has three layers identifying three major categories of classes: {\em Solvers\/}, {\em Runners\/} and {\em Helpers\/}. \begin{itemize} +\item {\em Helpers\/}. Helpers are low-level classes that perform specific actions related to the evolution or search process. They are split in two categories: {\em Evolutionary helpers (EH)\/} and {\em Local search helpers (LSH)\/}. EH include mainly the transformation, selection and replacement operations, the evaluation function and the stopping criterion. LSH can be generic such as the neighborhood explorer class, or specific to the local search metaheuristic like the tabu list manager class in the Tabu Search solution method. On the other hand, there are some special helpers dedicated to the management of parallel and distributed models 2 and 3, such as the communicators that embody the communication services. + +Helpers cooperate between them and interact with the components of the upper layer i.e. the runners. The runners invoke the helpers through function parameters. Indeed, helpers have not their own data, but they work on the internal data of the runners. + +\item {\em Runners\/}. The Runners layer contains a set of classes that implement the metaheuristics themselves. They perform the run of the metaheuristics from the initial state or population to the final one. One can distinguish the {\em Evolutionary runners (ER)\/} such as genetic algorithms, evolution strategies, etc., and {\em Local search runners (LSR)\/} like tabu search, simulated annealing and hill climbing. Runners invoke the helpers to perform specific actions on their data. For instance, an ER may ask the fitness function evaluation helper to evaluate its population. An LSR asks the movement helper to perform a given movement on the current state. Furthermore, runners can be serial or parallel distributed. + +\item {\em Solvers\/}. Solvers are devoted to control the evolution process and/or the search. They generate the initial state (solution or population) and define the strategy for combining and sequencing different metaheuristics. Two types of solvers can be distinguished. {\em Single metaheuristic solvers (SMS)\/} and {\em Multiple metaheuristics solvers (MMS)\/}. SMSs are dedicated to the execution of only one metaheuristic.MMS are more complex as they control and sequence several metaheuristics that can be heterogeneous. Solvers interact with the user by getting the input data and delivering the output (best solution, statistics, etc). \end{itemize} + + +According to the generality of their embedded features, the classes of the architecture split in two major categories: {\em Provided classes\/} and {\em Required classes\/}. Provided classes embody the factored out part of the metaheuristics. They are generic, implemented in the framework, and ensure the control at run time. Required classes are those that must be supplied by the user. They encapsulate the problem-specific aspects of the application. These classes are fixed but not implemented in Paradis\-EO. The programmer has the burden to develop them using the OO specialization mechanism.\hypertarget{main_tutorials}{}\section{Paradis\-EO-PEO Tutorials}\label{main_tutorials} +The basisc of the Paradis\-EO framework philosophy are exposed in a few simple tutorials: \begin{itemize} +\item \href{lesson1/html/main.html}{\tt creating a simple Paradis\-EO evolutionary algorithm}; \end{itemize} +All the presented examples have as case study the traveling salesman problem (TSP). Different operators and auxiliary objects were designed, standing as a \href{lsnshared/html/index.html}{\tt common shared source code base}. While not being part of the Paradis\-EO-PEO framework, it may represent a startpoint for a better understanding of the presented tutorials. \ No newline at end of file diff --git a/branches/paradiseo-peo-meta-model/doc/latex/namespacepeo.tex b/branches/paradiseo-peo-meta-model/doc/latex/namespacepeo.tex new file mode 100644 index 000000000..ee1f78ba8 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/latex/namespacepeo.tex @@ -0,0 +1,52 @@ +\hypertarget{namespacepeo}{ +\section{peo Namespace Reference} +\label{namespacepeo}\index{peo@{peo}} +} + + +\subsection*{Functions} +\begin{CompactItemize} +\item +\hypertarget{namespacepeo_f90478489cc92d1e6abb222179163a30}{ +void \hyperlink{namespacepeo_f90478489cc92d1e6abb222179163a30}{finalize} ()} +\label{namespacepeo_f90478489cc92d1e6abb222179163a30} + +\item +\hypertarget{namespacepeo_8184c3b1f7eecc68f69bb8e8b872a7d3}{ +void \hyperlink{namespacepeo_8184c3b1f7eecc68f69bb8e8b872a7d3}{init} (int \&\_\-\_\-argc, char $\ast$$\ast$\&\_\-\_\-argv)} +\label{namespacepeo_8184c3b1f7eecc68f69bb8e8b872a7d3} + +\item +\hypertarget{namespacepeo_2b496ee9b81d9ae322ae6edb9a93dc71}{ +void \hyperlink{namespacepeo_2b496ee9b81d9ae322ae6edb9a93dc71}{load\-Parameters} (int \&\_\-\_\-argc, char $\ast$$\ast$\&\_\-\_\-argv)} +\label{namespacepeo_2b496ee9b81d9ae322ae6edb9a93dc71} + +\item +\hypertarget{namespacepeo_10819b2d60b37477c6a89b60c595c67c}{ +void \hyperlink{namespacepeo_10819b2d60b37477c6a89b60c595c67c}{run} ()} +\label{namespacepeo_10819b2d60b37477c6a89b60c595c67c} + +\end{CompactItemize} +\subsection*{Variables} +\begin{CompactItemize} +\item +\hypertarget{namespacepeo_18a3998ce8b39c4e1143914fdd07b3d2}{ +int $\ast$ \hyperlink{namespacepeo_18a3998ce8b39c4e1143914fdd07b3d2}{argc}} +\label{namespacepeo_18a3998ce8b39c4e1143914fdd07b3d2} + +\item +\hypertarget{namespacepeo_d07043237d4d923125e38860ba9bbe20}{ +char $\ast$$\ast$$\ast$ \hyperlink{namespacepeo_d07043237d4d923125e38860ba9bbe20}{argv}} +\label{namespacepeo_d07043237d4d923125e38860ba9bbe20} + +\item +\hypertarget{namespacepeo_18a3998ce8b39c4e1143914fdd07b3d2}{ +int $\ast$ \hyperlink{namespacepeo_18a3998ce8b39c4e1143914fdd07b3d2}{argc}} +\label{namespacepeo_18a3998ce8b39c4e1143914fdd07b3d2} + +\item +\hypertarget{namespacepeo_d07043237d4d923125e38860ba9bbe20}{ +char $\ast$$\ast$$\ast$ \hyperlink{namespacepeo_d07043237d4d923125e38860ba9bbe20}{argv}} +\label{namespacepeo_d07043237d4d923125e38860ba9bbe20} + +\end{CompactItemize} diff --git a/branches/paradiseo-peo-meta-model/doc/latex/namespaces.tex b/branches/paradiseo-peo-meta-model/doc/latex/namespaces.tex new file mode 100644 index 000000000..b05536ba2 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/latex/namespaces.tex @@ -0,0 +1,4 @@ +\section{Paradis\-EO-PEO Namespace List} +Here is a list of all documented namespaces with brief descriptions:\begin{CompactList} +\item\contentsline{section}{\hyperlink{namespacepeo}{peo} }{\pageref{namespacepeo}}{} +\end{CompactList} diff --git a/branches/paradiseo-peo-meta-model/doc/latex/refman.tex b/branches/paradiseo-peo-meta-model/doc/latex/refman.tex new file mode 100644 index 000000000..d5b5327a9 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/latex/refman.tex @@ -0,0 +1,81 @@ +\documentclass[a4paper]{book} +\usepackage{a4wide} +\usepackage{makeidx} +\usepackage{fancyhdr} +\usepackage{graphicx} +\usepackage{multicol} +\usepackage{float} +\usepackage{textcomp} +\usepackage{alltt} +\usepackage{times} +\usepackage{ifpdf} +\ifpdf +\usepackage[pdftex, + pagebackref=true, + colorlinks=true, + linkcolor=blue + ]{hyperref} +\else +\usepackage[ps2pdf, + pagebackref=true, + colorlinks=true, + linkcolor=blue + ]{hyperref} +\usepackage{pspicture} +\fi +\usepackage{doxygen} +\makeindex +\setcounter{tocdepth}{1} +\renewcommand{\footrulewidth}{0.4pt} +\begin{document} +\begin{titlepage} +\vspace*{7cm} +\begin{center} +{\Large Paradis\-EO-PEO Reference Manual\\[1ex]\large 0.1 }\\ +\vspace*{1cm} +{\large Generated by Doxygen 1.4.7}\\ +\vspace*{0.5cm} +{\small Thu Jul 5 13:43:30 2007}\\ +\end{center} +\end{titlepage} +\clearemptydoublepage +\pagenumbering{roman} +\tableofcontents +\clearemptydoublepage +\pagenumbering{arabic} +\chapter{The Paradis\-EO-PEO Framework } +\label{index}\hypertarget{index}{}\input{main} +\chapter{Paradis\-EO-PEO Namespace Index} +\input{namespaces} +\chapter{Paradis\-EO-PEO Hierarchical Index} +\input{hierarchy} +\chapter{Paradis\-EO-PEO Class Index} +\input{annotated} +\chapter{Paradis\-EO-PEO Namespace Documentation} +\input{namespacepeo} +\chapter{Paradis\-EO-PEO Class Documentation} +\input{classCommunicable} +\include{classCommunicator} +\include{classCooperative} +\include{classpeoAggEvalFunc} +\include{classpeoAsyncIslandMig} +\include{classpeoEA} +\include{classpeoNoAggEvalFunc} +\include{classpeoParaPopEval} +\include{classpeoParaSGATransform} +\include{classpeoPopEval} +\include{classpeoSeqPopEval} +\include{classpeoSeqTransform} +\include{classpeoSyncIslandMig} +\include{classpeoSyncMultiStart} +\include{classpeoTransform} +\include{classReactiveThread} +\include{classRingTopology} +\include{classRunner} +\include{structSEND__REQUEST} +\include{classService} +\include{classThread} +\include{classTopology} +\include{classWorker} +\printindex +\end{document} diff --git a/branches/paradiseo-peo-meta-model/doc/latex/structSEND__REQUEST.tex b/branches/paradiseo-peo-meta-model/doc/latex/structSEND__REQUEST.tex new file mode 100644 index 000000000..6678d8e30 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/latex/structSEND__REQUEST.tex @@ -0,0 +1,34 @@ +\hypertarget{structSEND__REQUEST}{ +\section{SEND\_\-REQUEST Struct Reference} +\label{structSEND__REQUEST}\index{SEND_REQUEST@{SEND\_\-REQUEST}} +} +\subsection*{Public Attributes} +\begin{CompactItemize} +\item +\hypertarget{structSEND__REQUEST_1ad8f7233fa3ff13262e783a9153920f}{ +\hyperlink{classCommunicable}{Communicable} $\ast$ \hyperlink{structSEND__REQUEST_1ad8f7233fa3ff13262e783a9153920f}{comm}} +\label{structSEND__REQUEST_1ad8f7233fa3ff13262e783a9153920f} + +\item +\hypertarget{structSEND__REQUEST_93e2a6a71d2a91aa2b7bdd050ee59b4d}{ +int \hyperlink{structSEND__REQUEST_93e2a6a71d2a91aa2b7bdd050ee59b4d}{to}} +\label{structSEND__REQUEST_93e2a6a71d2a91aa2b7bdd050ee59b4d} + +\item +\hypertarget{structSEND__REQUEST_3126b3ef9d6533d3086760e413a7f23f}{ +int \hyperlink{structSEND__REQUEST_3126b3ef9d6533d3086760e413a7f23f}{tag}} +\label{structSEND__REQUEST_3126b3ef9d6533d3086760e413a7f23f} + +\end{CompactItemize} + + +\subsection{Detailed Description} + + + + +Definition at line 24 of file send.cpp. + +The documentation for this struct was generated from the following file:\begin{CompactItemize} +\item +send.cpp\end{CompactItemize} diff --git a/branches/paradiseo-peo-meta-model/doc/man/man3/Communicable.3 b/branches/paradiseo-peo-meta-model/doc/man/man3/Communicable.3 new file mode 100644 index 000000000..b79685283 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/man/man3/Communicable.3 @@ -0,0 +1,62 @@ +.TH "Communicable" 3 "5 Jul 2007" "Version 0.1" "ParadisEO-PEO" \" -*- nroff -*- +.ad l +.nh +.SH NAME +Communicable \- +.SH SYNOPSIS +.br +.PP +Inherited by \fBCooperative\fP, \fBRunner\fP, \fBService\fP, and \fBWorker\fP. +.PP +.SS "Public Member Functions" + +.in +1c +.ti -1c +.RI "\fBCommunicable\fP ()" +.br +.ti -1c +.RI "virtual \fB~Communicable\fP ()" +.br +.ti -1c +.RI "COMM_ID \fBgetKey\fP ()" +.br +.ti -1c +.RI "void \fBlock\fP ()" +.br +.ti -1c +.RI "void \fBunlock\fP ()" +.br +.ti -1c +.RI "void \fBstop\fP ()" +.br +.ti -1c +.RI "void \fBresume\fP ()" +.br +.in -1c +.SS "Protected Attributes" + +.in +1c +.ti -1c +.RI "COMM_ID \fBkey\fP" +.br +.ti -1c +.RI "sem_t \fBsem_lock\fP" +.br +.ti -1c +.RI "sem_t \fBsem_stop\fP" +.br +.in -1c +.SS "Static Protected Attributes" + +.in +1c +.ti -1c +.RI "static unsigned \fBnum_comm\fP = 0" +.br +.in -1c +.SH "Detailed Description" +.PP +Definition at line 16 of file communicable.h. + +.SH "Author" +.PP +Generated automatically by Doxygen for ParadisEO-PEO from the source code. diff --git a/branches/paradiseo-peo-meta-model/doc/man/man3/Communicator.3 b/branches/paradiseo-peo-meta-model/doc/man/man3/Communicator.3 new file mode 100644 index 000000000..dd8a76269 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/man/man3/Communicator.3 @@ -0,0 +1,27 @@ +.TH "Communicator" 3 "5 Jul 2007" "Version 0.1" "ParadisEO-PEO" \" -*- nroff -*- +.ad l +.nh +.SH NAME +Communicator \- +.SH SYNOPSIS +.br +.PP +Inherits \fBReactiveThread\fP. +.PP +.SS "Public Member Functions" + +.in +1c +.ti -1c +.RI "\fBCommunicator\fP (int *__argc, char ***__argv)" +.br +.ti -1c +.RI "void \fBstart\fP ()" +.br +.in -1c +.SH "Detailed Description" +.PP +Definition at line 15 of file comm.h. + +.SH "Author" +.PP +Generated automatically by Doxygen for ParadisEO-PEO from the source code. diff --git a/branches/paradiseo-peo-meta-model/doc/man/man3/Cooperative.3 b/branches/paradiseo-peo-meta-model/doc/man/man3/Cooperative.3 new file mode 100644 index 000000000..07f0daf1b --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/man/man3/Cooperative.3 @@ -0,0 +1,42 @@ +.TH "Cooperative" 3 "5 Jul 2007" "Version 0.1" "ParadisEO-PEO" \" -*- nroff -*- +.ad l +.nh +.SH NAME +Cooperative \- +.SH SYNOPSIS +.br +.PP +Inherits \fBCommunicable\fP. +.PP +Inherited by \fBpeoAsyncIslandMig< EOT >\fP, and \fBpeoSyncIslandMig< EOT >\fP. +.PP +.SS "Public Member Functions" + +.in +1c +.ti -1c +.RI "\fBRunner\fP * \fBgetOwner\fP ()" +.br +.ti -1c +.RI "void \fBsetOwner\fP (\fBRunner\fP &__runner)" +.br +.ti -1c +.RI "void \fBsend\fP (\fBCooperative\fP *__coop)" +.br +.ti -1c +.RI "virtual void \fBnotifySending\fP ()" +.br +.in -1c +.SS "Private Attributes" + +.in +1c +.ti -1c +.RI "\fBRunner\fP * \fBowner\fP" +.br +.in -1c +.SH "Detailed Description" +.PP +Definition at line 17 of file cooperative.h. + +.SH "Author" +.PP +Generated automatically by Doxygen for ParadisEO-PEO from the source code. diff --git a/branches/paradiseo-peo-meta-model/doc/man/man3/ReactiveThread.3 b/branches/paradiseo-peo-meta-model/doc/man/man3/ReactiveThread.3 new file mode 100644 index 000000000..b7b6eebbd --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/man/man3/ReactiveThread.3 @@ -0,0 +1,39 @@ +.TH "ReactiveThread" 3 "5 Jul 2007" "Version 0.1" "ParadisEO-PEO" \" -*- nroff -*- +.ad l +.nh +.SH NAME +ReactiveThread \- +.SH SYNOPSIS +.br +.PP +Inherits \fBThread\fP. +.PP +Inherited by \fBCommunicator\fP, and \fBWorker\fP. +.PP +.SS "Public Member Functions" + +.in +1c +.ti -1c +.RI "\fBReactiveThread\fP ()" +.br +.ti -1c +.RI "void \fBsleep\fP ()" +.br +.ti -1c +.RI "void \fBwakeUp\fP ()" +.br +.in -1c +.SS "Private Attributes" + +.in +1c +.ti -1c +.RI "sem_t \fBsem\fP" +.br +.in -1c +.SH "Detailed Description" +.PP +Definition at line 16 of file reac_thread.h. + +.SH "Author" +.PP +Generated automatically by Doxygen for ParadisEO-PEO from the source code. diff --git a/branches/paradiseo-peo-meta-model/doc/man/man3/RingTopology.3 b/branches/paradiseo-peo-meta-model/doc/man/man3/RingTopology.3 new file mode 100644 index 000000000..943200c5f --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/man/man3/RingTopology.3 @@ -0,0 +1,24 @@ +.TH "RingTopology" 3 "5 Jul 2007" "Version 0.1" "ParadisEO-PEO" \" -*- nroff -*- +.ad l +.nh +.SH NAME +RingTopology \- +.SH SYNOPSIS +.br +.PP +Inherits \fBTopology\fP. +.PP +.SS "Public Member Functions" + +.in +1c +.ti -1c +.RI "void \fBsetNeighbors\fP (\fBCooperative\fP *__mig, std::vector< \fBCooperative\fP * > &__from, std::vector< \fBCooperative\fP * > &__to)" +.br +.in -1c +.SH "Detailed Description" +.PP +Definition at line 14 of file ring_topo.h. + +.SH "Author" +.PP +Generated automatically by Doxygen for ParadisEO-PEO from the source code. diff --git a/branches/paradiseo-peo-meta-model/doc/man/man3/Runner.3 b/branches/paradiseo-peo-meta-model/doc/man/man3/Runner.3 new file mode 100644 index 000000000..55d84fc33 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/man/man3/Runner.3 @@ -0,0 +1,57 @@ +.TH "Runner" 3 "5 Jul 2007" "Version 0.1" "ParadisEO-PEO" \" -*- nroff -*- +.ad l +.nh +.SH NAME +Runner \- +.SH SYNOPSIS +.br +.PP +Inherits \fBCommunicable\fP, and \fBThread\fP. +.PP +Inherited by \fBpeoEA< EOT >\fP. +.PP +.SS "Public Member Functions" + +.in +1c +.ti -1c +.RI "\fBRunner\fP ()" +.br +.ti -1c +.RI "void \fBstart\fP ()" +.br +.ti -1c +.RI "void \fBwaitStarting\fP ()" +.br +.ti -1c +.RI "bool \fBisLocal\fP ()" +.br +.ti -1c +.RI "void \fBterminate\fP ()" +.br +.ti -1c +.RI "RUNNER_ID \fBgetID\fP ()" +.br +.ti -1c +.RI "void \fBpackTermination\fP ()" +.br +.ti -1c +.RI "void \fBnotifySendingTermination\fP ()" +.br +.in -1c +.SS "Private Attributes" + +.in +1c +.ti -1c +.RI "sem_t \fBsem_start\fP" +.br +.ti -1c +.RI "unsigned \fBid\fP" +.br +.in -1c +.SH "Detailed Description" +.PP +Definition at line 19 of file runner.h. + +.SH "Author" +.PP +Generated automatically by Doxygen for ParadisEO-PEO from the source code. diff --git a/branches/paradiseo-peo-meta-model/doc/man/man3/SEND_REQUEST.3 b/branches/paradiseo-peo-meta-model/doc/man/man3/SEND_REQUEST.3 new file mode 100644 index 000000000..f0ec40d76 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/man/man3/SEND_REQUEST.3 @@ -0,0 +1,28 @@ +.TH "SEND_REQUEST" 3 "5 Jul 2007" "Version 0.1" "ParadisEO-PEO" \" -*- nroff -*- +.ad l +.nh +.SH NAME +SEND_REQUEST \- +.SH SYNOPSIS +.br +.PP +.SS "Public Attributes" + +.in +1c +.ti -1c +.RI "\fBCommunicable\fP * \fBcomm\fP" +.br +.ti -1c +.RI "int \fBto\fP" +.br +.ti -1c +.RI "int \fBtag\fP" +.br +.in -1c +.SH "Detailed Description" +.PP +Definition at line 24 of file send.cpp. + +.SH "Author" +.PP +Generated automatically by Doxygen for ParadisEO-PEO from the source code. diff --git a/branches/paradiseo-peo-meta-model/doc/man/man3/Service.3 b/branches/paradiseo-peo-meta-model/doc/man/man3/Service.3 new file mode 100644 index 000000000..d502272ac --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/man/man3/Service.3 @@ -0,0 +1,69 @@ +.TH "Service" 3 "5 Jul 2007" "Version 0.1" "ParadisEO-PEO" \" -*- nroff -*- +.ad l +.nh +.SH NAME +Service \- +.SH SYNOPSIS +.br +.PP +Inherits \fBCommunicable\fP. +.PP +Inherited by \fBpeoPopEval< EOT >\fP, \fBpeoSyncMultiStart< EOT >\fP, and \fBpeoTransform< EOT >\fP. +.PP +.SS "Public Member Functions" + +.in +1c +.ti -1c +.RI "void \fBsetOwner\fP (\fBThread\fP &__owner)" +.br +.ti -1c +.RI "\fBThread\fP * \fBgetOwner\fP ()" +.br +.ti -1c +.RI "void \fBrequestResourceRequest\fP (unsigned __how_many=1)" +.br +.ti -1c +.RI "void \fBpackResourceRequest\fP ()" +.br +.ti -1c +.RI "virtual void \fBpackData\fP ()" +.br +.ti -1c +.RI "virtual void \fBunpackData\fP ()" +.br +.ti -1c +.RI "virtual void \fBexecute\fP ()" +.br +.ti -1c +.RI "virtual void \fBpackResult\fP ()" +.br +.ti -1c +.RI "virtual void \fBunpackResult\fP ()" +.br +.ti -1c +.RI "virtual void \fBnotifySendingData\fP ()" +.br +.ti -1c +.RI "virtual void \fBnotifySendingResourceRequest\fP ()" +.br +.ti -1c +.RI "virtual void \fBnotifySendingAllResourceRequests\fP ()" +.br +.in -1c +.SS "Private Attributes" + +.in +1c +.ti -1c +.RI "\fBThread\fP * \fBowner\fP" +.br +.ti -1c +.RI "unsigned \fBnum_sent_rr\fP" +.br +.in -1c +.SH "Detailed Description" +.PP +Definition at line 17 of file service.h. + +.SH "Author" +.PP +Generated automatically by Doxygen for ParadisEO-PEO from the source code. diff --git a/branches/paradiseo-peo-meta-model/doc/man/man3/Thread.3 b/branches/paradiseo-peo-meta-model/doc/man/man3/Thread.3 new file mode 100644 index 000000000..002aa208f --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/man/man3/Thread.3 @@ -0,0 +1,40 @@ +.TH "Thread" 3 "5 Jul 2007" "Version 0.1" "ParadisEO-PEO" \" -*- nroff -*- +.ad l +.nh +.SH NAME +Thread \- +.SH SYNOPSIS +.br +.PP +Inherited by \fBReactiveThread\fP, and \fBRunner\fP. +.PP +.SS "Public Member Functions" + +.in +1c +.ti -1c +.RI "\fBThread\fP ()" +.br +.ti -1c +.RI "virtual \fB~Thread\fP ()" +.br +.ti -1c +.RI "void \fBsetActive\fP ()" +.br +.ti -1c +.RI "void \fBsetPassive\fP ()" +.br +.in -1c +.SS "Private Attributes" + +.in +1c +.ti -1c +.RI "bool \fBact\fP" +.br +.in -1c +.SH "Detailed Description" +.PP +Definition at line 16 of file thread.h. + +.SH "Author" +.PP +Generated automatically by Doxygen for ParadisEO-PEO from the source code. diff --git a/branches/paradiseo-peo-meta-model/doc/man/man3/Topology.3 b/branches/paradiseo-peo-meta-model/doc/man/man3/Topology.3 new file mode 100644 index 000000000..f5494be2f --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/man/man3/Topology.3 @@ -0,0 +1,34 @@ +.TH "Topology" 3 "5 Jul 2007" "Version 0.1" "ParadisEO-PEO" \" -*- nroff -*- +.ad l +.nh +.SH NAME +Topology \- +.SH SYNOPSIS +.br +.PP +Inherited by \fBRingTopology\fP. +.PP +.SS "Public Member Functions" + +.in +1c +.ti -1c +.RI "virtual \fB~Topology\fP ()" +.br +.ti -1c +.RI "void \fBadd\fP (\fBCooperative\fP &__mig)" +.br +.in -1c +.SS "Protected Attributes" + +.in +1c +.ti -1c +.RI "std::vector< \fBCooperative\fP * > \fBmig\fP" +.br +.in -1c +.SH "Detailed Description" +.PP +Definition at line 16 of file topology.h. + +.SH "Author" +.PP +Generated automatically by Doxygen for ParadisEO-PEO from the source code. diff --git a/branches/paradiseo-peo-meta-model/doc/man/man3/Worker.3 b/branches/paradiseo-peo-meta-model/doc/man/man3/Worker.3 new file mode 100644 index 000000000..3ebab6c09 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/man/man3/Worker.3 @@ -0,0 +1,64 @@ +.TH "Worker" 3 "5 Jul 2007" "Version 0.1" "ParadisEO-PEO" \" -*- nroff -*- +.ad l +.nh +.SH NAME +Worker \- +.SH SYNOPSIS +.br +.PP +Inherits \fBCommunicable\fP, and \fBReactiveThread\fP. +.PP +.SS "Public Member Functions" + +.in +1c +.ti -1c +.RI "\fBWorker\fP ()" +.br +.ti -1c +.RI "void \fBstart\fP ()" +.br +.ti -1c +.RI "void \fBpackResult\fP ()" +.br +.ti -1c +.RI "void \fBunpackData\fP ()" +.br +.ti -1c +.RI "void \fBpackTaskDone\fP ()" +.br +.ti -1c +.RI "void \fBnotifySendingResult\fP ()" +.br +.ti -1c +.RI "void \fBnotifySendingTaskDone\fP ()" +.br +.ti -1c +.RI "void \fBsetSource\fP (int __rank)" +.br +.in -1c +.SS "Private Attributes" + +.in +1c +.ti -1c +.RI "WORKER_ID \fBid\fP" +.br +.ti -1c +.RI "SERVICE_ID \fBserv_id\fP" +.br +.ti -1c +.RI "\fBService\fP * \fBserv\fP" +.br +.ti -1c +.RI "int \fBsrc\fP" +.br +.ti -1c +.RI "bool \fBtoto\fP" +.br +.in -1c +.SH "Detailed Description" +.PP +Definition at line 18 of file worker.h. + +.SH "Author" +.PP +Generated automatically by Doxygen for ParadisEO-PEO from the source code. diff --git a/branches/paradiseo-peo-meta-model/doc/man/man3/peo.3 b/branches/paradiseo-peo-meta-model/doc/man/man3/peo.3 new file mode 100644 index 000000000..a337a3b4b --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/man/man3/peo.3 @@ -0,0 +1,43 @@ +.TH "peo" 3 "5 Jul 2007" "Version 0.1" "ParadisEO-PEO" \" -*- nroff -*- +.ad l +.nh +.SH NAME +peo \- +.SH SYNOPSIS +.br +.PP +.SS "Functions" + +.in +1c +.ti -1c +.RI "void \fBfinalize\fP ()" +.br +.ti -1c +.RI "void \fBinit\fP (int &__argc, char **&__argv)" +.br +.ti -1c +.RI "void \fBloadParameters\fP (int &__argc, char **&__argv)" +.br +.ti -1c +.RI "void \fBrun\fP ()" +.br +.in -1c +.SS "Variables" + +.in +1c +.ti -1c +.RI "int * \fBargc\fP" +.br +.ti -1c +.RI "char *** \fBargv\fP" +.br +.ti -1c +.RI "int * \fBargc\fP" +.br +.ti -1c +.RI "char *** \fBargv\fP" +.br +.in -1c +.SH "Author" +.PP +Generated automatically by Doxygen for ParadisEO-PEO from the source code. diff --git a/branches/paradiseo-peo-meta-model/doc/man/man3/peoAggEvalFunc.3 b/branches/paradiseo-peo-meta-model/doc/man/man3/peoAggEvalFunc.3 new file mode 100644 index 000000000..66fb766eb --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/man/man3/peoAggEvalFunc.3 @@ -0,0 +1,33 @@ +.TH "peoAggEvalFunc" 3 "5 Jul 2007" "Version 0.1" "ParadisEO-PEO" \" -*- nroff -*- +.ad l +.nh +.SH NAME +peoAggEvalFunc \- The \fBpeoAggEvalFunc\fP class offers only the interface for creating aggregate evaluation functions - there are no direct internal functions provided. + +.PP +.SH SYNOPSIS +.br +.PP +\fC#include \fP +.PP +Inherits \fBeoBF< A1, A2, R >< const EOT &, EOT::Fitness &, void >\fP. +.PP +Inherited by \fBpeoNoAggEvalFunc< EOT >\fP. +.PP +.SH "Detailed Description" +.PP + +.SS "template class peoAggEvalFunc< EOT >" +The \fBpeoAggEvalFunc\fP class offers only the interface for creating aggregate evaluation functions - there are no direct internal functions provided. + +The class inherits \fBpublic eoBF< EOT&, const typename EOT :: Fitness&, void >\fP thus requiring, for the derived classes, the creation of a function having the following signature: +.PP +void operator()( EOT& __eot, const typename EOT :: Fitness& __partial_fittness ); +.PP +The aggregation object is called in an iterative manner for each of the results obtained by applying partial evaluation functions. +.PP +Definition at line 25 of file peoAggEvalFunc.h. + +.SH "Author" +.PP +Generated automatically by Doxygen for ParadisEO-PEO from the source code. diff --git a/branches/paradiseo-peo-meta-model/doc/man/man3/peoAsyncIslandMig.3 b/branches/paradiseo-peo-meta-model/doc/man/man3/peoAsyncIslandMig.3 new file mode 100644 index 000000000..bc54b3aef --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/man/man3/peoAsyncIslandMig.3 @@ -0,0 +1,176 @@ +.TH "peoAsyncIslandMig" 3 "5 Jul 2007" "Version 0.1" "ParadisEO-PEO" \" -*- nroff -*- +.ad l +.nh +.SH NAME +peoAsyncIslandMig \- The \fBpeoAsyncIslandMig\fP class offers the elementary basis for implementating an asynchronous island migration model - requires the specification of several basic parameters, i.e. + +.PP +.SH SYNOPSIS +.br +.PP +\fC#include \fP +.PP +Inherits \fBCooperative\fP, and \fBeoUpdater\fP. +.PP +.SS "Public Member Functions" + +.in +1c +.ti -1c +.RI "\fBpeoAsyncIslandMig\fP (\fBeoContinue\fP< EOT > &__cont, \fBeoSelect\fP< EOT > &__select, \fBeoReplacement\fP< EOT > &__replace, \fBTopology\fP &__topology, \fBeoPop\fP< EOT > &__source, \fBeoPop\fP< EOT > &__destination)" +.br +.RI "\fIConstructor for the \fBpeoAsyncIslandMig\fP class; the characteristics of the migration model are defined through the specified parameters - out of the box objects provided in \fBEO\fP, etc., or custom, derived objects may be passed as parameters. \fP" +.ti -1c +.RI "void \fBoperator()\fP ()" +.br +.RI "\fI\fBFunction\fP operator to be called as checkpoint for performing the migration step. \fP" +.ti -1c +.RI "void \fBpack\fP ()" +.br +.RI "\fIAuxiliary function dealing with sending the emigrant individuals. There is no need to explicitly call the function. \fP" +.ti -1c +.RI "void \fBunpack\fP ()" +.br +.RI "\fIAuxiliary function dealing with receiving immigrant individuals. There is no need to explicitly call the function. \fP" +.in -1c +.SS "Private Member Functions" + +.in +1c +.ti -1c +.RI "void \fBemigrate\fP ()" +.br +.ti -1c +.RI "void \fBimmigrate\fP ()" +.br +.in -1c +.SS "Private Attributes" + +.in +1c +.ti -1c +.RI "\fBeoContinue\fP< EOT > & \fBcont\fP" +.br +.ti -1c +.RI "\fBeoSelect\fP< EOT > & \fBselect\fP" +.br +.ti -1c +.RI "\fBeoReplacement\fP< EOT > & \fBreplace\fP" +.br +.ti -1c +.RI "\fBTopology\fP & \fBtopology\fP" +.br +.ti -1c +.RI "\fBeoPop\fP< EOT > & \fBsource\fP" +.br +.ti -1c +.RI "\fBeoPop\fP< EOT > & \fBdestination\fP" +.br +.ti -1c +.RI "std::queue< \fBeoPop\fP< EOT > > \fBimm\fP" +.br +.ti -1c +.RI "std::queue< \fBeoPop\fP< EOT > > \fBem\fP" +.br +.ti -1c +.RI "std::queue< \fBCooperative\fP * > \fBcoop_em\fP" +.br +.in -1c +.SH "Detailed Description" +.PP + +.SS "template class peoAsyncIslandMig< EOT >" +The \fBpeoAsyncIslandMig\fP class offers the elementary basis for implementating an asynchronous island migration model - requires the specification of several basic parameters, i.e. + +continuation criterion, selection and replacement strategies, a topological model and the source and destination population for the migrating individuals. As opposed to the synchronous migration model, in the asynchronous migration approach, there is no synchronization step between islands after performing the emigration phase. +.PP +The migration operator is called at the end of each generation of an evolutionary algorithms as a checkpoint object - the following code exposes the structure of a classic evolutionary algorithm: +.PP +\fBdo\fP { select( population, offsprings ); // select the offsprings from the current population transform( offsprings ); // crossover and mutation operators are applied on the selected offsprings evaluate( offsprings ); // evaluation step of the resulting offsprings replace( population, offsprings ); // replace the individuals in the current population whith individuals from the offspring population, according to a specified replacement strategy } \fBwhile\fP ( eaCheckpointContinue( population ) ); // checkpoint operators are applied on the current population, including the migration operator, if any specified +.PP +Constructing an asynchronous island migration model requires having defined (1) a topological migration model, (2) the control parameters of the migration process, (3) a checkpoint object associated with an evolutionary algorithm, and (4) an owner object must be set. The owner object must be derived from the \fB\fBRunner\fP\fP class (for example a \fBpeoEA\fP object represents a possible owner). A simple example is offered bellow: +.PP +.PD 0 +.IP "1." 4 +topological model to be followed when performing migrations: +.br + +.br + \fBRingTopology\fP migTopology; // a simple ring topological model - each island communicates with two other islands +.PP + +.IP "2." 4 +the continuation criterion, selection and replacement strategy etc. are defined: +.br + +.br + eoPop< EOT > population( POP_SIZE, popInitializer ); // population of individuals to be used for the evolutionary algorithm eoPeriodicContinue< EOT > migCont( MIG_FREQ ); // migrations occur periodically at MIG_FREQ iterations eoRandomSelect< EOT > migSelectStrategy; // selection strategy - in this case a random selection is applied eoSelectNumber< EOT > migSelect( migSelectStrategy, MIG_SIZE ); // number of individuals to be selected using the specified strategy eoPlusReplacement< EOT > migReplace; // immigration strategy - the worse individuals in the destination population are replaced by the immigrant individuals peoAsyncIslandMig< EOT > asyncMigration( +.br + migCont, migSelect, migReplace, migTopology, +.br + population, population +.br + ); // asynchronous migration object - the emigrant individuals are selected from the same from population in which the immigrant individuals are being integrated +.PP + +.IP "3." 4 +creation of a checkpoint object as part of the definition of an evolutionary algoritm (details of th EA not given as being out of scope): +.br + +.br + ... eoGenContinue< EOT > eaCont( NUM_GEN ); // the evolutionary algorithm will stop after NUM_GEN generations eoCheckPoint< EOT > eaCheckpointContinue( eaCont ); // number of individuals to be selected using the specified strategy ... eaCheckpointContinue.add( asyncMigration ); // adding the migration operator as checkpoint element ... +.PP + +.IP "4." 4 +definition of an owner evolutionary algorithm (an object inheriting the \fB\fBRunner\fP\fP class): +.br + +.br + peoEA< EOT > eaAlg( eaCheckpointContinue, eaPopEval, eaSelect, eaTransform, eaReplace); // evolutionary algorithm having as checkpoint the eaCheckpointContinue object defined above asyncMigration.setOwner( eaAlg ); // setting the evolutionary algorithm as owner of the migration object eaAlg( population ); // applying the evolutionary algorithm on a given population +.PP +.PP +The source and the destination population for the migration object were specified as being the same, in step no. 2, as we are usually interested in selecting the emigrants and integrating the immigrant individuals from and in, respectively, one unique population, iteratively evolved by an evolutionary algorithm. There is no restriction in having two distinct populations as source and destination for the emigrant and immigrant individuals respectively. +.PP +The above steps only create an asynchronous migration object associated to an evolutionary algorithm. The creation of several islands requires the reiteration of the steps 2 through 4 for creating distinct algorithms, with distinct populations and the associated distinctly parametrized migration objects. The interconnecting element is the underlying topology, defined at step 1 (the same C++ migTopology object has to be passed as parameter for all the migration objects, in order to interconnect them). +.PP +Definition at line 112 of file peoAsyncIslandMig.h. +.SH "Constructor & Destructor Documentation" +.PP +.SS "template \fBpeoAsyncIslandMig\fP< EOT >::\fBpeoAsyncIslandMig\fP (\fBeoContinue\fP< EOT > & __cont, \fBeoSelect\fP< EOT > & __select, \fBeoReplacement\fP< EOT > & __replace, \fBTopology\fP & __topology, \fBeoPop\fP< EOT > & __source, \fBeoPop\fP< EOT > & __destination)" +.PP +Constructor for the \fBpeoAsyncIslandMig\fP class; the characteristics of the migration model are defined through the specified parameters - out of the box objects provided in \fBEO\fP, etc., or custom, derived objects may be passed as parameters. +.PP +\fBParameters:\fP +.RS 4 +\fIeoContinue<\fP EOT >& __cont - continuation criterion specifying whether the migration is performed or not; +.br +\fIeoSelect<\fP EOT >& __select - selection strategy to be applied for constructing a list of emigrant individuals out of the source population; +.br +\fIeoReplacement<\fP EOT >& __replace - replacement strategy used for integrating the immigrant individuals in the destination population; +.br +\fITopology&\fP __topology - topological model to be followed when performing migrations; +.br +\fIeoPop<\fP EOT >& __source - source population from which the emigrant individuals are selected; +.br +\fIeoPop<\fP EOT >& __destination - destination population in which the immigrant population are integrated. +.RE +.PP + +.PP +Definition at line 171 of file peoAsyncIslandMig.h. +.PP +References Topology::add(). +.SH "Member Function Documentation" +.PP +.SS "template void \fBpeoAsyncIslandMig\fP< EOT >::operator() ()\fC [virtual]\fP" +.PP +\fBFunction\fP operator to be called as checkpoint for performing the migration step. +.PP +The emigrant individuals are selected from the source population and sent to the next island (defined by the topology object) while the immigrant individuals are integrated in the destination population. There is no need to explicitly call the function - the wrapper checkpoint object (please refer to the above example) will perform the call when required. +.PP +Implements \fBeoF< void >\fP. +.PP +Definition at line 248 of file peoAsyncIslandMig.h. +.PP +References peoAsyncIslandMig< EOT >::cont, peoAsyncIslandMig< EOT >::emigrate(), peoAsyncIslandMig< EOT >::immigrate(), and peoAsyncIslandMig< EOT >::source. + +.SH "Author" +.PP +Generated automatically by Doxygen for ParadisEO-PEO from the source code. diff --git a/branches/paradiseo-peo-meta-model/doc/man/man3/peoEA.3 b/branches/paradiseo-peo-meta-model/doc/man/man3/peoEA.3 new file mode 100644 index 000000000..4f6ae6da4 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/man/man3/peoEA.3 @@ -0,0 +1,109 @@ +.TH "peoEA" 3 "5 Jul 2007" "Version 0.1" "ParadisEO-PEO" \" -*- nroff -*- +.ad l +.nh +.SH NAME +peoEA \- The \fBpeoEA\fP class offers an elementary evolutionary algorithm implementation. + +.PP +.SH SYNOPSIS +.br +.PP +\fC#include \fP +.PP +Inherits \fBRunner\fP. +.PP +.SS "Public Member Functions" + +.in +1c +.ti -1c +.RI "\fBpeoEA\fP (\fBeoContinue\fP< EOT > &__cont, \fBpeoPopEval\fP< EOT > &__pop_eval, \fBeoSelect\fP< EOT > &__select, \fBpeoTransform\fP< EOT > &__trans, \fBeoReplacement\fP< EOT > &__replace)" +.br +.RI "\fIConstructor for the evolutionary algorithm object - several basic parameters have to be specified, allowing for different levels of parallelism. \fP" +.ti -1c +.RI "void \fBrun\fP ()" +.br +.RI "\fIEvolutionary algorithm function - a side effect of the fact that the class is derived from the \fB\fBRunner\fP\fP class, thus requiring the existence of a \fIrun\fP function, the algorithm being executed on a distinct thread. \fP" +.ti -1c +.RI "void \fBoperator()\fP (\fBeoPop\fP< EOT > &__pop)" +.br +.RI "\fI\fBFunction\fP operator for specifying the population to be associated with the algorithm. \fP" +.in -1c +.SS "Private Attributes" + +.in +1c +.ti -1c +.RI "\fBeoContinue\fP< EOT > & \fBcont\fP" +.br +.ti -1c +.RI "\fBpeoPopEval\fP< EOT > & \fBpop_eval\fP" +.br +.ti -1c +.RI "\fBeoSelect\fP< EOT > & \fBselect\fP" +.br +.ti -1c +.RI "\fBpeoTransform\fP< EOT > & \fBtrans\fP" +.br +.ti -1c +.RI "\fBeoReplacement\fP< EOT > & \fBreplace\fP" +.br +.ti -1c +.RI "\fBeoPop\fP< EOT > * \fBpop\fP" +.br +.in -1c +.SH "Detailed Description" +.PP + +.SS "template class peoEA< EOT >" +The \fBpeoEA\fP class offers an elementary evolutionary algorithm implementation. + +In addition, as compared with the algorithms provided by the \fBEO\fP framework, the \fBpeoEA\fP class has the underlying necessary structure for including, for example, parallel evaluation and parallel transformation operators, migration operators etc. Although there is no restriction on using the algorithms provided by the \fBEO\fP framework, the drawback resides in the fact that the \fBEO\fP implementation is exclusively sequential and, in consequence, no parallelism is provided. A simple example for constructing a \fBpeoEA\fP object: +.PP +... eoPop< EOT > population( POP_SIZE, popInitializer ); // creation of a population with POP_SIZE individuals - the popInitializer is a functor to be called for each individual eoGenContinue< EOT > eaCont( NUM_GEN ); // number of generations for the evolutionary algorithm eoCheckPoint< EOT > eaCheckpointContinue( eaCont ); // checkpoint incorporating the continuation criterion - startpoint for adding other checkpoint objects peoSeqPopEval< EOT > eaPopEval( evalFunction ); // sequential evaluation functor wrapper - evalFunction represents the actual evaluation functor eoRankingSelect< EOT > selectionStrategy; // selection strategy for creating the offspring population - a simple ranking selection in this case eoSelectNumber< EOT > eaSelect( selectionStrategy, POP_SIZE ); // the number of individuals to be selected for creating the offspring population eoRankingSelect< EOT > selectionStrategy; // selection strategy for creating the offspring population - a simple ranking selection in this case eoSGATransform< EOT > transform( crossover, CROSS_RATE, mutation, MUT_RATE ); // transformation operator - crossover and mutation operators with their associated probabilities peoSeqTransform< EOT > eaTransform( transform ); // ParadisEO specific sequential operator - a parallel version may be specified in the same manner eoPlusReplacement< EOT > eaReplace; // replacement strategy - for integrating the offspring resulting individuals in the initial population peoEA< EOT > eaAlg( eaCheckpointContinue, eaPopEval, eaSelect, eaTransform, eaReplace ); // ParadisEO evolutionary algorithm integrating the above defined objects eaAlg( population ); // specifying the initial population for the algorithm ... +.PP +Definition at line 54 of file peoEA.h. +.SH "Constructor & Destructor Documentation" +.PP +.SS "template \fBpeoEA\fP< EOT >::\fBpeoEA\fP (\fBeoContinue\fP< EOT > & __cont, \fBpeoPopEval\fP< EOT > & __pop_eval, \fBeoSelect\fP< EOT > & __select, \fBpeoTransform\fP< EOT > & __trans, \fBeoReplacement\fP< EOT > & __replace)" +.PP +Constructor for the evolutionary algorithm object - several basic parameters have to be specified, allowing for different levels of parallelism. +.PP +Depending on the requirements, a sequential or a parallel evaluation operator may be specified or, in the same manner, a sequential or a parallel transformation operator may be given as parameter. Out of the box objects may be provided, from the \fBEO\fP package, for example, or custom defined ones may be specified, provided that they are derived from the correct base classes. +.PP +\fBParameters:\fP +.RS 4 +\fIeoContinue<\fP EOT >& __cont - continuation criterion specifying whether the algorithm should continue or not; +.br +\fIpeoPopEval<\fP EOT >& __pop_eval - evaluation operator; it allows the specification of parallel evaluation operators, aggregate evaluation functions, etc.; +.br +\fIeoSelect<\fP EOT >& __select - selection strategy to be applied for constructing a list of offspring individuals; +.br +\fIpeoTransform<\fP EOT >& __trans - transformation operator, i.e. crossover and mutation; allows for sequential or parallel transform; +.br +\fIeoReplacement<\fP EOT >& __replace - replacement strategy for integrating the offspring individuals in the initial population; +.RE +.PP + +.PP +Definition at line 98 of file peoEA.h. +.PP +References peoEA< EOT >::pop_eval, and peoEA< EOT >::trans. +.SH "Member Function Documentation" +.PP +.SS "template void \fBpeoEA\fP< EOT >::operator() (\fBeoPop\fP< EOT > & __pop)" +.PP +\fBFunction\fP operator for specifying the population to be associated with the algorithm. +.PP +\fBParameters:\fP +.RS 4 +\fIeoPop<\fP EOT >& __pop - initial population of the algorithm, to be iteratively evolved; +.RE +.PP + +.PP +Definition at line 114 of file peoEA.h. +.PP +References peoEA< EOT >::pop. + +.SH "Author" +.PP +Generated automatically by Doxygen for ParadisEO-PEO from the source code. diff --git a/branches/paradiseo-peo-meta-model/doc/man/man3/peoNoAggEvalFunc.3 b/branches/paradiseo-peo-meta-model/doc/man/man3/peoNoAggEvalFunc.3 new file mode 100644 index 000000000..c2df6a16e --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/man/man3/peoNoAggEvalFunc.3 @@ -0,0 +1,35 @@ +.TH "peoNoAggEvalFunc" 3 "5 Jul 2007" "Version 0.1" "ParadisEO-PEO" \" -*- nroff -*- +.ad l +.nh +.SH NAME +peoNoAggEvalFunc \- The \fBpeoNoAggEvalFunc\fP class does nothing more than an association between a fitness value and a specified individual. + +.PP +.SH SYNOPSIS +.br +.PP +\fC#include \fP +.PP +Inherits \fBpeoAggEvalFunc< EOT >< EOT >\fP. +.PP +.SS "Public Member Functions" + +.in +1c +.ti -1c +.RI "void \fBoperator()\fP (EOT &__sol, const typename EOT::Fitness &__fit)" +.br +.RI "\fIOperator which sets as fitness the \fB__fit\fP value for the \fB__sol\fP individual. \fP" +.in -1c +.SH "Detailed Description" +.PP + +.SS "template class peoNoAggEvalFunc< EOT >" +The \fBpeoNoAggEvalFunc\fP class does nothing more than an association between a fitness value and a specified individual. + +The class is provided as a mean of declaring that no aggregation is required for the evaluation function - the fitness value is explicitly specified. +.PP +Definition at line 19 of file peoNoAggEvalFunc.h. + +.SH "Author" +.PP +Generated automatically by Doxygen for ParadisEO-PEO from the source code. diff --git a/branches/paradiseo-peo-meta-model/doc/man/man3/peoParaPopEval.3 b/branches/paradiseo-peo-meta-model/doc/man/man3/peoParaPopEval.3 new file mode 100644 index 000000000..b0f85ca26 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/man/man3/peoParaPopEval.3 @@ -0,0 +1,217 @@ +.TH "peoParaPopEval" 3 "5 Jul 2007" "Version 0.1" "ParadisEO-PEO" \" -*- nroff -*- +.ad l +.nh +.SH NAME +peoParaPopEval \- The \fBpeoParaPopEval\fP represents a wrapper for creating a functor capable of applying in parallel an EO-derived evaluation functor. + +.PP +.SH SYNOPSIS +.br +.PP +\fC#include \fP +.PP +Inherits \fBpeoPopEval< EOT >< EOT >\fP. +.PP +.SS "Public Member Functions" + +.in +1c +.ti -1c +.RI "\fBpeoParaPopEval\fP (\fBeoEvalFunc\fP< EOT > &__eval_func)" +.br +.RI "\fIConstructor function - an EO-derived evaluation functor has to be specified; an internal reference is set towards the specified evaluation functor. \fP" +.ti -1c +.RI "\fBpeoParaPopEval\fP (const std::vector< \fBeoEvalFunc\fP< EOT > * > &__funcs, \fBpeoAggEvalFunc\fP< EOT > &__merge_eval)" +.br +.RI "\fIConstructor function - a vector of EO-derived evaluation functors has to be specified as well as an aggregation function. \fP" +.ti -1c +.RI "void \fBoperator()\fP (\fBeoPop\fP< EOT > &__pop)" +.br +.RI "\fIOperator for applying the evaluation functor (direct or aggregate) for each individual of the specified population. \fP" +.ti -1c +.RI "void \fBpackData\fP ()" +.br +.RI "\fIAuxiliary function for transferring data between the process requesting an evaluation operation and the process that performs the actual evaluation phase. \fP" +.ti -1c +.RI "void \fBunpackData\fP ()" +.br +.RI "\fIAuxiliary function for transferring data between the process requesting an evaluation operation and the process that performs the actual evaluation phase. \fP" +.ti -1c +.RI "void \fBexecute\fP ()" +.br +.RI "\fIAuxiliary function - it calls the specified evaluation functor(s). There is no need to explicitly call the function. \fP" +.ti -1c +.RI "void \fBpackResult\fP ()" +.br +.RI "\fIAuxiliary function for transferring data between the process requesting an evaluation operation and the process that performs the actual evaluation phase. \fP" +.ti -1c +.RI "void \fBunpackResult\fP ()" +.br +.RI "\fIAuxiliary function for transferring data between the process requesting an evaluation operation and the process that performs the actual evaluation phase. \fP" +.ti -1c +.RI "void \fBnotifySendingData\fP ()" +.br +.RI "\fIAuxiliary function for notifications between the process requesting an evaluation operation and the processes that performs the actual evaluation phase. \fP" +.ti -1c +.RI "void \fBnotifySendingAllResourceRequests\fP ()" +.br +.RI "\fIAuxiliary function for notifications between the process requesting an evaluation operation and the processes that performs the actual evaluation phase. \fP" +.in -1c +.SS "Private Attributes" + +.in +1c +.ti -1c +.RI "const std::vector< \fBeoEvalFunc\fP< EOT > * > & \fBfuncs\fP" +.br +.ti -1c +.RI "std::vector< \fBeoEvalFunc\fP< EOT > * > \fBone_func\fP" +.br +.ti -1c +.RI "\fBpeoAggEvalFunc\fP< EOT > & \fBmerge_eval\fP" +.br +.ti -1c +.RI "\fBpeoNoAggEvalFunc\fP< EOT > \fBno_merge_eval\fP" +.br +.ti -1c +.RI "std::queue< EOT * > \fBtasks\fP" +.br +.ti -1c +.RI "std::map< EOT *, std::pair< unsigned, unsigned > > \fBprogression\fP" +.br +.ti -1c +.RI "unsigned \fBnum_func\fP" +.br +.ti -1c +.RI "EOT \fBsol\fP" +.br +.ti -1c +.RI "EOT * \fBad_sol\fP" +.br +.ti -1c +.RI "unsigned \fBtotal\fP" +.br +.in -1c +.SH "Detailed Description" +.PP + +.SS "template class peoParaPopEval< EOT >" +The \fBpeoParaPopEval\fP represents a wrapper for creating a functor capable of applying in parallel an EO-derived evaluation functor. + +The class offers the possibility of chosing between a single-function evaluation and an aggregate evaluation function, including several sub-evalution functions. +.PP +Definition at line 26 of file peoParaPopEval.h. +.SH "Constructor & Destructor Documentation" +.PP +.SS "template \fBpeoParaPopEval\fP< EOT >::\fBpeoParaPopEval\fP (\fBeoEvalFunc\fP< EOT > & __eval_func)" +.PP +Constructor function - an EO-derived evaluation functor has to be specified; an internal reference is set towards the specified evaluation functor. +.PP +\fBParameters:\fP +.RS 4 +\fIeoEvalFunc<\fP EOT >& __eval_func - EO-derived evaluation functor to be applied in parallel on each individual of a specified population +.RE +.PP + +.PP +Definition at line 102 of file peoParaPopEval.h. +.PP +References peoParaPopEval< EOT >::one_func. +.SS "template \fBpeoParaPopEval\fP< EOT >::\fBpeoParaPopEval\fP (const std::vector< \fBeoEvalFunc\fP< EOT > * > & __funcs, \fBpeoAggEvalFunc\fP< EOT > & __merge_eval)" +.PP +Constructor function - a vector of EO-derived evaluation functors has to be specified as well as an aggregation function. +.PP +\fBParameters:\fP +.RS 4 +\fIconst\fP std :: vector< \fBeoEvalFunc\fP < EOT >* >& __funcs - vector of EO-derived partial evaluation functors; +.br +\fIpeoAggEvalFunc<\fP EOT >& __merge_eval - aggregation functor for creating a fitness value out of the partial fitness values. +.RE +.PP + +.PP +Definition at line 111 of file peoParaPopEval.h. +.SH "Member Function Documentation" +.PP +.SS "template void \fBpeoParaPopEval\fP< EOT >::operator() (\fBeoPop\fP< EOT > & __pop)\fC [virtual]\fP" +.PP +Operator for applying the evaluation functor (direct or aggregate) for each individual of the specified population. +.PP +\fBParameters:\fP +.RS 4 +\fIeoPop<\fP EOT >& __pop - population to be evaluated by applying the evaluation functor specified in the constructor. +.RE +.PP + +.PP +Implements \fBpeoPopEval< EOT >\fP. +.PP +Definition at line 122 of file peoParaPopEval.h. +.PP +References peoParaPopEval< EOT >::funcs, peoParaPopEval< EOT >::progression, Service::requestResourceRequest(), Communicable::stop(), peoParaPopEval< EOT >::tasks, and peoParaPopEval< EOT >::total. +.SS "template void \fBpeoParaPopEval\fP< EOT >::packData ()\fC [virtual]\fP" +.PP +Auxiliary function for transferring data between the process requesting an evaluation operation and the process that performs the actual evaluation phase. +.PP +There is no need to explicitly call the function. +.PP +Reimplemented from \fBService\fP. +.PP +Definition at line 143 of file peoParaPopEval.h. +.PP +References peoParaPopEval< EOT >::progression, and peoParaPopEval< EOT >::tasks. +.SS "template void \fBpeoParaPopEval\fP< EOT >::unpackData ()\fC [virtual]\fP" +.PP +Auxiliary function for transferring data between the process requesting an evaluation operation and the process that performs the actual evaluation phase. +.PP +There is no need to explicitly call the function. +.PP +Reimplemented from \fBService\fP. +.PP +Definition at line 157 of file peoParaPopEval.h. +.PP +References peoParaPopEval< EOT >::ad_sol, peoParaPopEval< EOT >::num_func, and peoParaPopEval< EOT >::sol. +.SS "template void \fBpeoParaPopEval\fP< EOT >::packResult ()\fC [virtual]\fP" +.PP +Auxiliary function for transferring data between the process requesting an evaluation operation and the process that performs the actual evaluation phase. +.PP +There is no need to explicitly call the function. +.PP +Reimplemented from \fBService\fP. +.PP +Definition at line 174 of file peoParaPopEval.h. +.PP +References peoParaPopEval< EOT >::ad_sol, and peoParaPopEval< EOT >::sol. +.SS "template void \fBpeoParaPopEval\fP< EOT >::unpackResult ()\fC [virtual]\fP" +.PP +Auxiliary function for transferring data between the process requesting an evaluation operation and the process that performs the actual evaluation phase. +.PP +There is no need to explicitly call the function. +.PP +Reimplemented from \fBService\fP. +.PP +Definition at line 183 of file peoParaPopEval.h. +.PP +References peoParaPopEval< EOT >::ad_sol, Service::getOwner(), peoParaPopEval< EOT >::merge_eval, peoParaPopEval< EOT >::progression, Communicable::resume(), Thread::setActive(), and peoParaPopEval< EOT >::total. +.SS "template void \fBpeoParaPopEval\fP< EOT >::notifySendingData ()\fC [virtual]\fP" +.PP +Auxiliary function for notifications between the process requesting an evaluation operation and the processes that performs the actual evaluation phase. +.PP +There is no need to explicitly call the function. +.PP +Reimplemented from \fBService\fP. +.PP +Definition at line 214 of file peoParaPopEval.h. +.SS "template void \fBpeoParaPopEval\fP< EOT >::notifySendingAllResourceRequests ()\fC [virtual]\fP" +.PP +Auxiliary function for notifications between the process requesting an evaluation operation and the processes that performs the actual evaluation phase. +.PP +There is no need to explicitly call the function. +.PP +Reimplemented from \fBService\fP. +.PP +Definition at line 219 of file peoParaPopEval.h. +.PP +References Service::getOwner(), and Thread::setPassive(). + +.SH "Author" +.PP +Generated automatically by Doxygen for ParadisEO-PEO from the source code. diff --git a/branches/paradiseo-peo-meta-model/doc/man/man3/peoParaSGATransform.3 b/branches/paradiseo-peo-meta-model/doc/man/man3/peoParaSGATransform.3 new file mode 100644 index 000000000..749a44b21 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/man/man3/peoParaSGATransform.3 @@ -0,0 +1,83 @@ +.TH "peoParaSGATransform" 3 "5 Jul 2007" "Version 0.1" "ParadisEO-PEO" \" -*- nroff -*- +.ad l +.nh +.SH NAME +peoParaSGATransform \- +.SH SYNOPSIS +.br +.PP +Inherits \fBpeoTransform< EOT >< EOT >\fP. +.PP +.SS "Public Member Functions" + +.in +1c +.ti -1c +.RI "\fBpeoParaSGATransform\fP (\fBeoQuadOp\fP< EOT > &__cross, double __cross_rate, \fBeoMonOp\fP< EOT > &__mut, double __mut_rate)" +.br +.ti -1c +.RI "void \fBoperator()\fP (\fBeoPop\fP< EOT > &__pop)" +.br +.ti -1c +.RI "void \fBpackData\fP ()" +.br +.ti -1c +.RI "void \fBunpackData\fP ()" +.br +.ti -1c +.RI "void \fBexecute\fP ()" +.br +.ti -1c +.RI "void \fBpackResult\fP ()" +.br +.ti -1c +.RI "void \fBunpackResult\fP ()" +.br +.ti -1c +.RI "void \fBnotifySendingData\fP ()" +.br +.ti -1c +.RI "void \fBnotifySendingAllResourceRequests\fP ()" +.br +.in -1c +.SS "Private Attributes" + +.in +1c +.ti -1c +.RI "\fBeoQuadOp\fP< EOT > & \fBcross\fP" +.br +.ti -1c +.RI "double \fBcross_rate\fP" +.br +.ti -1c +.RI "\fBeoMonOp\fP< EOT > & \fBmut\fP" +.br +.ti -1c +.RI "double \fBmut_rate\fP" +.br +.ti -1c +.RI "unsigned \fBidx\fP" +.br +.ti -1c +.RI "\fBeoPop\fP< EOT > * \fBpop\fP" +.br +.ti -1c +.RI "EOT \fBfather\fP" +.br +.ti -1c +.RI "EOT \fBmother\fP" +.br +.ti -1c +.RI "unsigned \fBnum_term\fP" +.br +.in -1c +.SH "Detailed Description" +.PP + +.SS "template class peoParaSGATransform< EOT >" + +.PP +Definition at line 21 of file peoParaSGATransform.h. + +.SH "Author" +.PP +Generated automatically by Doxygen for ParadisEO-PEO from the source code. diff --git a/branches/paradiseo-peo-meta-model/doc/man/man3/peoPopEval.3 b/branches/paradiseo-peo-meta-model/doc/man/man3/peoPopEval.3 new file mode 100644 index 000000000..74da17ed3 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/man/man3/peoPopEval.3 @@ -0,0 +1,37 @@ +.TH "peoPopEval" 3 "5 Jul 2007" "Version 0.1" "ParadisEO-PEO" \" -*- nroff -*- +.ad l +.nh +.SH NAME +peoPopEval \- The \fB\fBpeoPopEval\fP\fP class provides the interface for constructing ParadisEO specific evaluation functors. + +.PP +.SH SYNOPSIS +.br +.PP +\fC#include \fP +.PP +Inherits \fBService\fP. +.PP +Inherited by \fBpeoParaPopEval< EOT >\fP, and \fBpeoSeqPopEval< EOT >\fP. +.PP +.SS "Public Member Functions" + +.in +1c +.ti -1c +.RI "virtual void \fBoperator()\fP (\fBeoPop\fP< EOT > &__pop)=0" +.br +.RI "\fIInterface function providing the signature for constructing an evaluation functor. \fP" +.in -1c +.SH "Detailed Description" +.PP + +.SS "template class peoPopEval< EOT >" +The \fB\fBpeoPopEval\fP\fP class provides the interface for constructing ParadisEO specific evaluation functors. + +The derived classes may be used as wrappers for \fB\fBEO\fP\fP-derived evaluation functors. In order to have an example, please refer to the implementation of the \fB\fBpeoSeqPopEval\fP\fP and \fB\fBpeoParaPopEval\fP\fP classes. +.PP +Definition at line 19 of file peoPopEval.h. + +.SH "Author" +.PP +Generated automatically by Doxygen for ParadisEO-PEO from the source code. diff --git a/branches/paradiseo-peo-meta-model/doc/man/man3/peoSeqPopEval.3 b/branches/paradiseo-peo-meta-model/doc/man/man3/peoSeqPopEval.3 new file mode 100644 index 000000000..dad8e7f30 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/man/man3/peoSeqPopEval.3 @@ -0,0 +1,78 @@ +.TH "peoSeqPopEval" 3 "5 Jul 2007" "Version 0.1" "ParadisEO-PEO" \" -*- nroff -*- +.ad l +.nh +.SH NAME +peoSeqPopEval \- The \fBpeoSeqPopEval\fP class acts only as a ParadisEO specific sequential evaluation functor - a wrapper for incorporating an \fBeoEvalFunc< EOT >\fP-derived class as evaluation functor. + +.PP +.SH SYNOPSIS +.br +.PP +\fC#include \fP +.PP +Inherits \fBpeoPopEval< EOT >< EOT >\fP. +.PP +.SS "Public Member Functions" + +.in +1c +.ti -1c +.RI "\fBpeoSeqPopEval\fP (\fBeoEvalFunc\fP< EOT > &__eval)" +.br +.RI "\fIConstructor function - it only sets an internal reference to point to the specified evaluation object. \fP" +.ti -1c +.RI "void \fBoperator()\fP (\fBeoPop\fP< EOT > &__pop)" +.br +.RI "\fIOperator for evaluating all the individuals of a given population - in a sequential iterative manner. \fP" +.in -1c +.SS "Private Attributes" + +.in +1c +.ti -1c +.RI "\fBeoEvalFunc\fP< EOT > & \fBeval\fP" +.br +.in -1c +.SH "Detailed Description" +.PP + +.SS "template class peoSeqPopEval< EOT >" +The \fBpeoSeqPopEval\fP class acts only as a ParadisEO specific sequential evaluation functor - a wrapper for incorporating an \fBeoEvalFunc< EOT >\fP-derived class as evaluation functor. + +The specified \fBEO\fP evaluation object is applyied in an iterative manner to each individual of a specified population. +.PP +Definition at line 21 of file peoSeqPopEval.h. +.SH "Constructor & Destructor Documentation" +.PP +.SS "template \fBpeoSeqPopEval\fP< EOT >::\fBpeoSeqPopEval\fP (\fBeoEvalFunc\fP< EOT > & __eval)" +.PP +Constructor function - it only sets an internal reference to point to the specified evaluation object. +.PP +\fBParameters:\fP +.RS 4 +\fIeoEvalFunc<\fP EOT >& __eval - evaluation object to be applied for each individual of a specified population +.RE +.PP + +.PP +Definition at line 41 of file peoSeqPopEval.h. +.SH "Member Function Documentation" +.PP +.SS "template void \fBpeoSeqPopEval\fP< EOT >::operator() (\fBeoPop\fP< EOT > & __pop)\fC [virtual]\fP" +.PP +Operator for evaluating all the individuals of a given population - in a sequential iterative manner. +.PP +\fBParameters:\fP +.RS 4 +\fIeoPop<\fP EOT >& __pop - population to be evaluated. +.RE +.PP + +.PP +Implements \fBpeoPopEval< EOT >\fP. +.PP +Definition at line 46 of file peoSeqPopEval.h. +.PP +References peoSeqPopEval< EOT >::eval. + +.SH "Author" +.PP +Generated automatically by Doxygen for ParadisEO-PEO from the source code. diff --git a/branches/paradiseo-peo-meta-model/doc/man/man3/peoSeqTransform.3 b/branches/paradiseo-peo-meta-model/doc/man/man3/peoSeqTransform.3 new file mode 100644 index 000000000..ab92b53cd --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/man/man3/peoSeqTransform.3 @@ -0,0 +1,96 @@ +.TH "peoSeqTransform" 3 "5 Jul 2007" "Version 0.1" "ParadisEO-PEO" \" -*- nroff -*- +.ad l +.nh +.SH NAME +peoSeqTransform \- The \fBpeoSeqTransform\fP represent a wrapper for offering the possibility of using \fBEO\fP derived transform operators along with the ParadisEO evolutionary algorithms. + +.PP +.SH SYNOPSIS +.br +.PP +\fC#include \fP +.PP +Inherits \fBpeoTransform< EOT >< EOT >\fP. +.PP +.SS "Public Member Functions" + +.in +1c +.ti -1c +.RI "\fBpeoSeqTransform\fP (\fBeoTransform\fP< EOT > &__trans)" +.br +.RI "\fIConstructor function - sets an internal reference towards the specified EO-derived transform object. \fP" +.ti -1c +.RI "void \fBoperator()\fP (\fBeoPop\fP< EOT > &__pop)" +.br +.RI "\fIOperator for applying the specified transform operators on each individual of the given population. \fP" +.ti -1c +.RI "virtual void \fBpackData\fP ()" +.br +.RI "\fIInterface function for providing a link with the parallel architecture of the ParadisEO framework. \fP" +.ti -1c +.RI "virtual void \fBunpackData\fP ()" +.br +.RI "\fIInterface function for providing a link with the parallel architecture of the ParadisEO framework. \fP" +.ti -1c +.RI "virtual void \fBexecute\fP ()" +.br +.RI "\fIInterface function for providing a link with the parallel architecture of the ParadisEO framework. \fP" +.ti -1c +.RI "virtual void \fBpackResult\fP ()" +.br +.RI "\fIInterface function for providing a link with the parallel architecture of the ParadisEO framework. \fP" +.ti -1c +.RI "virtual void \fBunpackResult\fP ()" +.br +.RI "\fIInterface function for providing a link with the parallel architecture of the ParadisEO framework. \fP" +.in -1c +.SS "Private Attributes" + +.in +1c +.ti -1c +.RI "\fBeoTransform\fP< EOT > & \fBtrans\fP" +.br +.in -1c +.SH "Detailed Description" +.PP + +.SS "template class peoSeqTransform< EOT >" +The \fBpeoSeqTransform\fP represent a wrapper for offering the possibility of using \fBEO\fP derived transform operators along with the ParadisEO evolutionary algorithms. + +A minimal set of interface functions is also provided for creating the link with the parallel architecture of the ParadisEO framework. +.PP +Definition at line 20 of file peoSeqTransform.h. +.SH "Constructor & Destructor Documentation" +.PP +.SS "template \fBpeoSeqTransform\fP< EOT >::\fBpeoSeqTransform\fP (\fBeoTransform\fP< EOT > & __trans)" +.PP +Constructor function - sets an internal reference towards the specified EO-derived transform object. +.PP +\fBParameters:\fP +.RS 4 +\fIeoTransform<\fP EOT >& __trans - EO-derived transform object including crossover and mutation operators. +.RE +.PP + +.PP +Definition at line 55 of file peoSeqTransform.h. +.SH "Member Function Documentation" +.PP +.SS "template void \fBpeoSeqTransform\fP< EOT >::operator() (\fBeoPop\fP< EOT > & __pop)" +.PP +Operator for applying the specified transform operators on each individual of the given population. +.PP +\fBParameters:\fP +.RS 4 +\fIeoPop<\fP EOT >& __pop - population to be transformed by applying the crossover and mutation operators. +.RE +.PP + +.PP +Definition at line 60 of file peoSeqTransform.h. +.PP +References peoSeqTransform< EOT >::trans. + +.SH "Author" +.PP +Generated automatically by Doxygen for ParadisEO-PEO from the source code. diff --git a/branches/paradiseo-peo-meta-model/doc/man/man3/peoSyncIslandMig.3 b/branches/paradiseo-peo-meta-model/doc/man/man3/peoSyncIslandMig.3 new file mode 100644 index 000000000..57918dbbd --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/man/man3/peoSyncIslandMig.3 @@ -0,0 +1,183 @@ +.TH "peoSyncIslandMig" 3 "5 Jul 2007" "Version 0.1" "ParadisEO-PEO" \" -*- nroff -*- +.ad l +.nh +.SH NAME +peoSyncIslandMig \- The \fBpeoSyncIslandMig\fP class offers the elementary basis for implementating a synchronous island migration model - requires the specification of several basic parameters, i.e. + +.PP +.SH SYNOPSIS +.br +.PP +\fC#include \fP +.PP +Inherits \fBCooperative\fP, and \fBeoUpdater\fP. +.PP +.SS "Public Member Functions" + +.in +1c +.ti -1c +.RI "\fBpeoSyncIslandMig\fP (unsigned __frequency, \fBeoSelect\fP< EOT > &__select, \fBeoReplacement\fP< EOT > &__replace, \fBTopology\fP &__topology, \fBeoPop\fP< EOT > &__source, \fBeoPop\fP< EOT > &__destination)" +.br +.RI "\fIConstructor for the \fBpeoSyncIslandMig\fP class; the characteristics of the migration model are defined through the specified parameters - out of the box objects provided in \fBEO\fP, etc., or custom, derived objects may be passed as parameters. \fP" +.ti -1c +.RI "void \fBoperator()\fP ()" +.br +.RI "\fI\fBFunction\fP operator to be called as checkpoint for performing the migration step. \fP" +.ti -1c +.RI "void \fBpack\fP ()" +.br +.RI "\fIAuxiliary function dealing with sending the emigrant individuals. There is no need to explicitly call the function. \fP" +.ti -1c +.RI "void \fBunpack\fP ()" +.br +.RI "\fIAuxiliary function dealing with receiving immigrant individuals. There is no need to explicitly call the function. \fP" +.ti -1c +.RI "void \fBnotifySending\fP ()" +.br +.RI "\fIAuxiliary function dealing with migration notifications. There is no need to explicitly call the function. \fP" +.in -1c +.SS "Private Member Functions" + +.in +1c +.ti -1c +.RI "void \fBemigrate\fP ()" +.br +.ti -1c +.RI "void \fBimmigrate\fP ()" +.br +.in -1c +.SS "Private Attributes" + +.in +1c +.ti -1c +.RI "\fBeoPeriodicContinue\fP< EOT > \fBcont\fP" +.br +.ti -1c +.RI "\fBeoSelect\fP< EOT > & \fBselect\fP" +.br +.ti -1c +.RI "\fBeoReplacement\fP< EOT > & \fBreplace\fP" +.br +.ti -1c +.RI "\fBTopology\fP & \fBtopology\fP" +.br +.ti -1c +.RI "\fBeoPop\fP< EOT > & \fBsource\fP" +.br +.ti -1c +.RI "\fBeoPop\fP< EOT > & \fBdestination\fP" +.br +.ti -1c +.RI "std::queue< \fBeoPop\fP< EOT > > \fBimm\fP" +.br +.ti -1c +.RI "std::queue< \fBeoPop\fP< EOT > > \fBem\fP" +.br +.ti -1c +.RI "std::queue< \fBCooperative\fP * > \fBcoop_em\fP" +.br +.ti -1c +.RI "sem_t \fBsync\fP" +.br +.in -1c +.SH "Detailed Description" +.PP + +.SS "template class peoSyncIslandMig< EOT >" +The \fBpeoSyncIslandMig\fP class offers the elementary basis for implementating a synchronous island migration model - requires the specification of several basic parameters, i.e. + +frequency of the migrations, selection and replacement strategies, a topological model and the source and destination population for the migrating individuals. The main difference as opposed to the asynchronous migration model is the synchronization step performed after selecting and sending the emigrant individuals. +.PP +The migration operator is called at the end of each generation of an evolutionary algorithms as a checkpoint object - the following code exposes the structure of a classic evolutionary algorithm: +.PP +\fBdo\fP { select( population, offsprings ); // select the offsprings from the current population transform( offsprings ); // crossover and mutation operators are applied on the selected offsprings evaluate( offsprings ); // evaluation step of the resulting offspring replace( population, offsprings ); // replace the individuals in the current population whith individuals from the offspring population, according to a specified replacement strategy } \fBwhile\fP ( eaCheckpointContinue( population ) ); // checkpoint operators are applied on the current population, including the migration operator, if any specified +.PP +Constructing a synchronous island migration model requires having defined (1) a topological migration model, (2) the control parameters of the migration process, (3) a checkpoint object associated with an evolutionary algorithm, and (4) an owner object must be set. The owner object must be derived from the \fB\fBRunner\fP\fP class (for example a \fBpeoEA\fP object represents a possible owner). A simple example is offered bellow: +.PP +.PD 0 +.IP "1." 4 +topological model to be followed when performing migrations: +.br + +.br + \fBRingTopology\fP migTopology; // a simple ring topological model - each island communicates with two other islands +.PP + +.IP "2." 4 +the continuation criterion, selection and replacement strategy etc. are defined: +.br + +.br + eoPop< EOT > population( POP_SIZE, popInitializer ); // population of individuals to be used for the evolutionary algorithm eoRandomSelect< EOT > migSelectStrategy; // selection strategy - in this case a random selection is applied eoSelectNumber< EOT > migSelect( migSelectStrategy, MIG_SIZE ); // number of individuals to be selected using the specified strategy eoPlusReplacement< EOT > migReplace; // immigration strategy - the worse individuals in the destination population are replaced by the immigrant individuals peoSyncIslandMig< EOT > syncMigration( +.br + MIG_FREQ, migSelect, migReplace, migTopology, +.br + population, population +.br + ); // synchronous migration object - the emigrant individuals are selected from the same from population in which the immigrant individuals are being integrated +.PP + +.IP "3." 4 +creation of a checkpoint object as part of the definition of an evolutionary algoritm (details of th EA not given as being out of scope): +.br + +.br + ... eoGenContinue< EOT > eaCont( NUM_GEN ); // the evolutionary algorithm will stop after NUM_GEN generations eoCheckPoint< EOT > eaCheckpointContinue( eaCont ); // number of individuals to be selected using the specified strategy ... eaCheckpointContinue.add( syncMigration ); // adding the migration operator as checkpoint element ... +.PP + +.IP "4." 4 +definition of an owner evolutionary algorithm (an object inheriting the \fB\fBRunner\fP\fP class): +.br + +.br + peoEA< EOT > eaAlg( eaCheckpointContinue, eaPopEval, eaSelect, eaTransform, eaReplace); // evolutionary algorithm having as checkpoint the eaCheckpointContinue object defined above syncMigration.setOwner( eaAlg ); // setting the evolutionary algorithm as owner of the migration object eaAlg( population ); // applying the evolutionary algorithm on a given population +.PP +.PP +The source and the destination population for the migration object were specified as being the same, in step no. 2, as we are usually interested in selecting the emigrants and integrating the immigrant individuals from and in, respectively, one unique population, iteratively evolved by an evolutionary algorithm. There is no restriction in having two distinct populations as source and destination for the emigrant and immigrant individuals respectively. +.PP +The above steps only create a synchronous migration object associated to an evolutionary algorithm. The creation of several islands requires the reiteration of the steps 2 through 4 for creating distinct algorithms, with distinct populations and the associated distinctly parametrized migration objects. The interconnecting element is the underlying topology, defined at step 1 (the same C++ migTopology object has to be passed as parameter for all the migration objects, in order to interconnect them). +.PP +Definition at line 114 of file peoSyncIslandMig.h. +.SH "Constructor & Destructor Documentation" +.PP +.SS "template \fBpeoSyncIslandMig\fP< EOT >::\fBpeoSyncIslandMig\fP (unsigned __frequency, \fBeoSelect\fP< EOT > & __select, \fBeoReplacement\fP< EOT > & __replace, \fBTopology\fP & __topology, \fBeoPop\fP< EOT > & __source, \fBeoPop\fP< EOT > & __destination)" +.PP +Constructor for the \fBpeoSyncIslandMig\fP class; the characteristics of the migration model are defined through the specified parameters - out of the box objects provided in \fBEO\fP, etc., or custom, derived objects may be passed as parameters. +.PP +\fBParameters:\fP +.RS 4 +\fIunsigned\fP __frequency - frequency of the migrations - the migrations occur periodically; +.br +\fIeoSelect<\fP EOT >& __select - selection strategy to be applied for constructing a list of emigrant individuals out of the source population; +.br +\fIeoReplacement<\fP EOT >& __replace - replacement strategy used for integrating the immigrant individuals in the destination population; +.br +\fITopology&\fP __topology - topological model to be followed when performing migrations; +.br +\fIeoPop<\fP EOT >& __source - source population from which the emigrant individuals are selected; +.br +\fIeoPop<\fP EOT >& __destination - destination population in which the immigrant population are integrated. +.RE +.PP + +.PP +Definition at line 178 of file peoSyncIslandMig.h. +.PP +References Topology::add(), and peoSyncIslandMig< EOT >::sync. +.SH "Member Function Documentation" +.PP +.SS "template void \fBpeoSyncIslandMig\fP< EOT >::operator() ()\fC [virtual]\fP" +.PP +\fBFunction\fP operator to be called as checkpoint for performing the migration step. +.PP +The emigrant individuals are selected from the source population and sent to the next island (defined by the topology object) while the immigrant individuals are integrated in the destination population. There is no need to explicitly call the function - the wrapper checkpoint object (please refer to the above example) will perform the call when required. +.PP +Implements \fBeoF< void >\fP. +.PP +Definition at line 252 of file peoSyncIslandMig.h. +.PP +References peoSyncIslandMig< EOT >::cont, peoSyncIslandMig< EOT >::emigrate(), Cooperative::getOwner(), peoSyncIslandMig< EOT >::immigrate(), Thread::setActive(), peoSyncIslandMig< EOT >::source, Communicable::stop(), and peoSyncIslandMig< EOT >::sync. + +.SH "Author" +.PP +Generated automatically by Doxygen for ParadisEO-PEO from the source code. diff --git a/branches/paradiseo-peo-meta-model/doc/man/man3/peoSyncMultiStart.3 b/branches/paradiseo-peo-meta-model/doc/man/man3/peoSyncMultiStart.3 new file mode 100644 index 000000000..4bca1683b --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/man/man3/peoSyncMultiStart.3 @@ -0,0 +1,211 @@ +.TH "peoSyncMultiStart" 3 "5 Jul 2007" "Version 0.1" "ParadisEO-PEO" \" -*- nroff -*- +.ad l +.nh +.SH NAME +peoSyncMultiStart \- The \fBpeoSyncMultiStart\fP class provides the basis for implementing the synchronous multi-start model, for launching several solution-based algorithms in parallel on a specified initial population. + +.PP +.SH SYNOPSIS +.br +.PP +\fC#include \fP +.PP +Inherits \fBService\fP, and \fBeoUpdater\fP. +.PP +.SS "Public Member Functions" + +.in +1c +.ti -1c +.RI "\fBpeoSyncMultiStart\fP (\fBeoContinue\fP< EOT > &__cont, \fBeoSelect\fP< EOT > &__select, \fBeoReplacement\fP< EOT > &__replace, \fBmoAlgo\fP< EOT > &__ls, \fBeoPop\fP< EOT > &__pop)" +.br +.RI "\fIConstructor function - several simple parameters are required for defining the characteristics of the multi-start model. \fP" +.ti -1c +.RI "void \fBoperator()\fP ()" +.br +.RI "\fIOperator which synchronously executes the specified algorithm on the individuals selected from the initial population. \fP" +.ti -1c +.RI "void \fBpackData\fP ()" +.br +.RI "\fIAuxiliary function for transferring data between the process requesting the synchronous execution of the specified algorithm and the process which actually executes the algorithm. \fP" +.ti -1c +.RI "void \fBunpackData\fP ()" +.br +.RI "\fIAuxiliary function for transferring data between the process requesting the synchronous execution of the specified algorithm and the process which actually executes the algorithm. \fP" +.ti -1c +.RI "void \fBexecute\fP ()" +.br +.RI "\fIAuxiliary function for actually executing the specified algorithm on one assigned individual. \fP" +.ti -1c +.RI "void \fBpackResult\fP ()" +.br +.RI "\fIAuxiliary function for transferring data between the process requesting the synchronous execution of the specified algorithm and the process which actually executes the algorithm. \fP" +.ti -1c +.RI "void \fBunpackResult\fP ()" +.br +.RI "\fIAuxiliary function for transferring data between the process requesting the synchronous execution of the specified algorithm and the process which actually executes the algorithm. \fP" +.ti -1c +.RI "void \fBnotifySendingData\fP ()" +.br +.RI "\fIAuxiliary function for notifications between the process requesting the synchronous multi-start execution and the processes that performs the actual execution phase. \fP" +.ti -1c +.RI "void \fBnotifySendingAllResourceRequests\fP ()" +.br +.RI "\fIAuxiliary function for notifications between the process requesting the synchronous multi-start execution and the processes that performs the actual execution phase. \fP" +.in -1c +.SS "Private Attributes" + +.in +1c +.ti -1c +.RI "\fBeoContinue\fP< EOT > & \fBcont\fP" +.br +.ti -1c +.RI "\fBeoSelect\fP< EOT > & \fBselect\fP" +.br +.ti -1c +.RI "\fBeoReplacement\fP< EOT > & \fBreplace\fP" +.br +.ti -1c +.RI "\fBmoAlgo\fP< EOT > & \fBls\fP" +.br +.ti -1c +.RI "\fBeoPop\fP< EOT > & \fBpop\fP" +.br +.ti -1c +.RI "\fBeoPop\fP< EOT > \fBsel\fP" +.br +.ti -1c +.RI "\fBeoPop\fP< EOT > \fBimpr_sel\fP" +.br +.ti -1c +.RI "EOT \fBsol\fP" +.br +.ti -1c +.RI "unsigned \fBidx\fP" +.br +.ti -1c +.RI "unsigned \fBnum_term\fP" +.br +.in -1c +.SH "Detailed Description" +.PP + +.SS "template class peoSyncMultiStart< EOT >" +The \fBpeoSyncMultiStart\fP class provides the basis for implementing the synchronous multi-start model, for launching several solution-based algorithms in parallel on a specified initial population. + +As a simple example, several hill climbing algorithms may be synchronously launched on the specified population, each algorithm acting upon one individual only, the final result being integrated back in the population. A \fBpeoSyncMultiStart\fP object can be specified as checkpoint object for a classic ParadisEO evolutionary algorithm thus allowing for simple hybridization schemes which combine the evolutionary approach with a local search approach, for example, executed at the end of each generation. +.PP +Definition at line 36 of file peoSyncMultiStart.h. +.SH "Constructor & Destructor Documentation" +.PP +.SS "template \fBpeoSyncMultiStart\fP< EOT >::\fBpeoSyncMultiStart\fP (\fBeoContinue\fP< EOT > & __cont, \fBeoSelect\fP< EOT > & __select, \fBeoReplacement\fP< EOT > & __replace, \fBmoAlgo\fP< EOT > & __ls, \fBeoPop\fP< EOT > & __pop)" +.PP +Constructor function - several simple parameters are required for defining the characteristics of the multi-start model. +.PP +\fBParameters:\fP +.RS 4 +\fIeoContinue<\fP EOT >& __cont - defined for including further functionality - no semantics associated at this time; +.br +\fIeoSelect<\fP EOT >& __select - selection strategy for obtaining a subset of the initial population on which to apply the specified algorithm; +.br +\fIeoReplacement<\fP EOT >& __replace - replacement strategy for integrating the resulting individuals in the initial population; +.br +\fImoAlgo<\fP EOT >& __ls - algorithm to be applied on each of the selected individuals - a \fBmoAlgo< EOT >\fP-derived object must be specified; +.br +\fIeoPop<\fP EOT >& __pop - the initial population from which the individuals are selected for applying the specified algorithm. +.RE +.PP + +.PP +Definition at line 106 of file peoSyncMultiStart.h. +.SH "Member Function Documentation" +.PP +.SS "template void \fBpeoSyncMultiStart\fP< EOT >::operator() ()\fC [virtual]\fP" +.PP +Operator which synchronously executes the specified algorithm on the individuals selected from the initial population. +.PP +There is no need to explicitly call the operator - automatically called as checkpoint operator. +.PP +Implements \fBeoF< void >\fP. +.PP +Definition at line 161 of file peoSyncMultiStart.h. +.PP +References peoSyncMultiStart< EOT >::idx, peoSyncMultiStart< EOT >::impr_sel, peoSyncMultiStart< EOT >::num_term, peoSyncMultiStart< EOT >::pop, Service::requestResourceRequest(), peoSyncMultiStart< EOT >::sel, peoSyncMultiStart< EOT >::select, and Communicable::stop(). +.SS "template void \fBpeoSyncMultiStart\fP< EOT >::packData ()\fC [virtual]\fP" +.PP +Auxiliary function for transferring data between the process requesting the synchronous execution of the specified algorithm and the process which actually executes the algorithm. +.PP +There is no need to explicitly call the function. +.PP +Reimplemented from \fBService\fP. +.PP +Definition at line 120 of file peoSyncMultiStart.h. +.PP +References peoSyncMultiStart< EOT >::idx, and peoSyncMultiStart< EOT >::sel. +.SS "template void \fBpeoSyncMultiStart\fP< EOT >::unpackData ()\fC [virtual]\fP" +.PP +Auxiliary function for transferring data between the process requesting the synchronous execution of the specified algorithm and the process which actually executes the algorithm. +.PP +There is no need to explicitly call the function. +.PP +Reimplemented from \fBService\fP. +.PP +Definition at line 126 of file peoSyncMultiStart.h. +.PP +References peoSyncMultiStart< EOT >::sol. +.SS "template void \fBpeoSyncMultiStart\fP< EOT >::execute ()\fC [virtual]\fP" +.PP +Auxiliary function for actually executing the specified algorithm on one assigned individual. +.PP +There is no need to explicitly call the function. +.PP +Reimplemented from \fBService\fP. +.PP +Definition at line 132 of file peoSyncMultiStart.h. +.PP +References peoSyncMultiStart< EOT >::ls, and peoSyncMultiStart< EOT >::sol. +.SS "template void \fBpeoSyncMultiStart\fP< EOT >::packResult ()\fC [virtual]\fP" +.PP +Auxiliary function for transferring data between the process requesting the synchronous execution of the specified algorithm and the process which actually executes the algorithm. +.PP +There is no need to explicitly call the function. +.PP +Reimplemented from \fBService\fP. +.PP +Definition at line 138 of file peoSyncMultiStart.h. +.PP +References peoSyncMultiStart< EOT >::sol. +.SS "template void \fBpeoSyncMultiStart\fP< EOT >::unpackResult ()\fC [virtual]\fP" +.PP +Auxiliary function for transferring data between the process requesting the synchronous execution of the specified algorithm and the process which actually executes the algorithm. +.PP +There is no need to explicitly call the function. +.PP +Reimplemented from \fBService\fP. +.PP +Definition at line 144 of file peoSyncMultiStart.h. +.PP +References Service::getOwner(), peoSyncMultiStart< EOT >::impr_sel, peoSyncMultiStart< EOT >::num_term, peoSyncMultiStart< EOT >::pop, peoSyncMultiStart< EOT >::replace, Communicable::resume(), peoSyncMultiStart< EOT >::sel, Thread::setActive(), and peoSyncMultiStart< EOT >::sol. +.SS "template void \fBpeoSyncMultiStart\fP< EOT >::notifySendingData ()\fC [virtual]\fP" +.PP +Auxiliary function for notifications between the process requesting the synchronous multi-start execution and the processes that performs the actual execution phase. +.PP +There is no need to explicitly call the function. +.PP +Reimplemented from \fBService\fP. +.PP +Definition at line 172 of file peoSyncMultiStart.h. +.SS "template void \fBpeoSyncMultiStart\fP< EOT >::notifySendingAllResourceRequests ()\fC [virtual]\fP" +.PP +Auxiliary function for notifications between the process requesting the synchronous multi-start execution and the processes that performs the actual execution phase. +.PP +There is no need to explicitly call the function. +.PP +Reimplemented from \fBService\fP. +.PP +Definition at line 177 of file peoSyncMultiStart.h. +.PP +References Service::getOwner(), and Thread::setPassive(). + +.SH "Author" +.PP +Generated automatically by Doxygen for ParadisEO-PEO from the source code. diff --git a/branches/paradiseo-peo-meta-model/doc/man/man3/peoTransform.3 b/branches/paradiseo-peo-meta-model/doc/man/man3/peoTransform.3 new file mode 100644 index 000000000..488597bae --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/man/man3/peoTransform.3 @@ -0,0 +1,27 @@ +.TH "peoTransform" 3 "5 Jul 2007" "Version 0.1" "ParadisEO-PEO" \" -*- nroff -*- +.ad l +.nh +.SH NAME +peoTransform \- The \fBpeoTransform\fP class acts only as an interface for creating transform operators - for an example please refer to the \fB\fBpeoSeqTransform\fP\fP and the \fB\fBpeoParaSGATransform\fP\fP classes. + +.PP +.SH SYNOPSIS +.br +.PP +\fC#include \fP +.PP +Inherits \fBService\fP, and \fBeoTransform< EOT >< EOT >\fP. +.PP +Inherited by \fBpeoParaSGATransform< EOT >\fP, and \fBpeoSeqTransform< EOT >\fP. +.PP +.SH "Detailed Description" +.PP + +.SS "template class peoTransform< EOT >" +The \fBpeoTransform\fP class acts only as an interface for creating transform operators - for an example please refer to the \fB\fBpeoSeqTransform\fP\fP and the \fB\fBpeoParaSGATransform\fP\fP classes. +.PP +Definition at line 20 of file peoTransform.h. + +.SH "Author" +.PP +Generated automatically by Doxygen for ParadisEO-PEO from the source code. diff --git a/branches/paradiseo-peo-meta-model/doc/paradiseo-peo.doxyfile b/branches/paradiseo-peo-meta-model/doc/paradiseo-peo.doxyfile new file mode 100644 index 000000000..03407d91a --- /dev/null +++ b/branches/paradiseo-peo-meta-model/doc/paradiseo-peo.doxyfile @@ -0,0 +1,239 @@ +# Doxyfile 1.4.7 + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = ParadisEO-PEO +PROJECT_NUMBER = 0.1 +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 = peo +#--------------------------------------------------------------------------- +# 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 = YES +USE_PDFLATEX = YES +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=http://eodev.sourceforge.net/eo/doc/html \ + ../../paradiseo-mo/doc/mo.doxytag=../../../paradiseo-mo/doc/html +GENERATE_TAGFILE = paradiseo-peo.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/branches/paradiseo-peo-meta-model/peo-conf.cmake b/branches/paradiseo-peo-meta-model/peo-conf.cmake new file mode 100644 index 000000000..8fa260baa --- /dev/null +++ b/branches/paradiseo-peo-meta-model/peo-conf.cmake @@ -0,0 +1,33 @@ + +###################################################################################### +###################################################################################### +### In this file, you can specify many CMake variables used to build paradisEO-PEO. +### For example, if you don't want ot give the EO path each time on the command line, +### uncomment the line the "SET(EO_DIR...)" and set your path. +### The section numbers are the same as those used in the CMakeLists.txt file. +###################################################################################### +###################################################################################### + + +###################################################################################### +### 3) OPTIONNAL - Overwrite default paths +###################################################################################### + +# SET(MO_DIR "" CACHE PATH "ParadisEO-PEO main directory") +# SET(EO_DIR "" CACHE PATH "ParadisEO-EO main directory") + +# SET(EO_SRC_DIR "") +# SET(MO_SRC_DIR "") +# SET(MO_DOC_DIR "") + +###################################################################################### + + +##################################################################################### +### 5) OPTIONNAL - Overwrite subdirs +###################################################################################### + +# SUBDIRS(doc src tutorial) + +###################################################################################### + diff --git a/branches/paradiseo-peo-meta-model/src/CMakeLists.txt b/branches/paradiseo-peo-meta-model/src/CMakeLists.txt new file mode 100644 index 000000000..67c2c2478 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/src/CMakeLists.txt @@ -0,0 +1,8 @@ + +###################################################################################### +### 1) Where must cmake go now ? +###################################################################################### + +SUBDIRS(core rmc) + +###################################################################################### diff --git a/branches/paradiseo-peo-meta-model/src/core/CMakeLists.txt b/branches/paradiseo-peo-meta-model/src/core/CMakeLists.txt new file mode 100644 index 000000000..61adba4f6 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/src/core/CMakeLists.txt @@ -0,0 +1,49 @@ + + +###################################################################################### +### 1) Include the sources +###################################################################################### + +INCLUDE_DIRECTORIES(${EO_SRC_DIR}) + +###################################################################################### + + +###################################################################################### +### 2) Define your target(s): just the peo library here +###################################################################################### + +SET(CORE_LIB_OUTPUT_PATH ${ParadisEO-PEO_BINARY_DIR}/lib) +SET(LIBRARY_OUTPUT_PATH ${CORE_LIB_OUTPUT_PATH}) + +SET (CORE_SOURCES peo_init.cpp + peo_fin.cpp + peo_run.cpp + peo_param.cpp + peo_debug.cpp + thread.cpp + reac_thread.cpp + service.cpp + runner.cpp + communicable.cpp + topology.cpp + ring_topo.cpp) + + + +ADD_LIBRARY(peo STATIC ${CORE_SOURCES}) + +###################################################################################### + + + +###################################################################################### +### 3) Optionnal: define your target(s)'s version: no effect for windows +###################################################################################### + +SET(CORE_VERSION "1.0.beta") +SET_TARGET_PROPERTIES(peo PROPERTIES VERSION "${CORE_VERSION}") +###################################################################################### + + + diff --git a/branches/paradiseo-peo-meta-model/src/core/communicable.cpp b/branches/paradiseo-peo-meta-model/src/core/communicable.cpp new file mode 100644 index 000000000..36f04eaa0 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/src/core/communicable.cpp @@ -0,0 +1,70 @@ +// "comm.cpp" + +// (c) OPAC Team, LIFL, August 2005 + +/* + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#include +#include +#include + +#include "communicable.h" + +static std :: vector key_to_comm (1); /* Vector of registered cooperators */ + +static std :: map comm_to_key; /* Map of registered cooperators */ + +unsigned Communicable :: num_comm = 0; + +Communicable :: Communicable () { + + comm_to_key [this] = key = ++ num_comm; + key_to_comm.push_back (this); + sem_init (& sem_lock, 0, 1); + sem_init (& sem_stop, 0, 0); +} + +Communicable :: ~ Communicable () { + +} + +COMM_ID Communicable :: getKey () { + + return key; +} + +Communicable * getCommunicable (COMM_ID __key) { + + assert (__key < key_to_comm.size ()); + return key_to_comm [__key]; +} + +COMM_ID getKey (const Communicable * __comm) { + + return comm_to_key [__comm]; +} + +void Communicable :: lock () { + + sem_wait (& sem_lock); +} + +void Communicable :: unlock () { + + sem_post (& sem_lock); +} + +void Communicable :: stop () { + + sem_wait (& sem_stop); +} + +void Communicable :: resume () { + + sem_post (& sem_stop); +} + + + diff --git a/branches/paradiseo-peo-meta-model/src/core/communicable.h b/branches/paradiseo-peo-meta-model/src/core/communicable.h new file mode 100644 index 000000000..cdd5c0c1d --- /dev/null +++ b/branches/paradiseo-peo-meta-model/src/core/communicable.h @@ -0,0 +1,47 @@ +// "communicable.h" + +// (c) OPAC Team, LIFL, August 2005 + +/* + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#ifndef __communicable_h +#define __communicable_h + +#include + +typedef unsigned COMM_ID; + +class Communicable { + +public : + + Communicable (); + + virtual ~ Communicable (); + + COMM_ID getKey (); + + void lock (); /* It suspends the current process if the semaphore is locked */ + void unlock (); /* It unlocks the shared semaphore */ + + void stop (); /* It suspends the current process */ + void resume (); /* It resumes ___________ */ + +protected : + + COMM_ID key; + + sem_t sem_lock; + + sem_t sem_stop; + + static unsigned num_comm; +}; + +extern Communicable * getCommunicable (COMM_ID __key); + +//extern COMM_ID getKey (const Communicable * __comm); + +#endif diff --git a/branches/paradiseo-peo-meta-model/src/core/cooperative.h b/branches/paradiseo-peo-meta-model/src/core/cooperative.h new file mode 100644 index 000000000..e05997b9c --- /dev/null +++ b/branches/paradiseo-peo-meta-model/src/core/cooperative.h @@ -0,0 +1,41 @@ +// "cooperative.h" + +// (c) OPAC Team, LIFL, August 2005 + +/* + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#ifndef __cooperative_h +#define __cooperative_h + +#include "communicable.h" +#include "runner.h" + +typedef unsigned COOP_ID; + +class Cooperative : public Communicable { + +public : + + Runner * getOwner (); + + void setOwner (Runner & __runner); + + virtual void pack () = 0; + + virtual void unpack () = 0; + + void send (Cooperative * __coop); + + virtual void notifySending (); + +private : + + Runner * owner; + +}; + +extern Cooperative * getCooperative (COOP_ID __key); + +#endif diff --git a/branches/paradiseo-peo-meta-model/src/core/eoPop_comm.h b/branches/paradiseo-peo-meta-model/src/core/eoPop_comm.h new file mode 100644 index 000000000..c9366c22e --- /dev/null +++ b/branches/paradiseo-peo-meta-model/src/core/eoPop_comm.h @@ -0,0 +1,32 @@ +// "eoPop_comm.h" + +// (c) OPAC Team, LIFL, August 2005 + +/* + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#ifndef __eoPop_comm_h +#define __eoPop_comm_h + +#include + +#include "messaging.h" + +template void pack (const eoPop & __pop) { + + pack ((unsigned) __pop.size ()); + for (unsigned i = 0; i < __pop.size (); i ++) + pack (__pop [i]); +} + +template void unpack (eoPop & __pop) { + + unsigned n; + + unpack (n); + __pop.resize (n); + for (unsigned i = 0; i < n; i ++) + unpack (__pop [i]); +} +#endif diff --git a/branches/paradiseo-peo-meta-model/src/core/eoVector_comm.h b/branches/paradiseo-peo-meta-model/src/core/eoVector_comm.h new file mode 100644 index 000000000..27cb3fbee --- /dev/null +++ b/branches/paradiseo-peo-meta-model/src/core/eoVector_comm.h @@ -0,0 +1,38 @@ +// "eoVector_comm.h" + +// (c) OPAC Team, LIFL, August 2005 + +/* + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#ifndef __eoVector_comm_h +#define __eoVector_comm_h + +#include + +#include "messaging.h" + +template void pack (const eoVector & __v) { + + pack (__v.fitness ()) ; + unsigned len = __v.size (); + pack (len); + for (unsigned i = 0 ; i < len; i ++) + pack (__v [i]); +} + +template void unpack (eoVector & __v) { + + F fit; + unpack (fit); + __v.fitness (fit); + + unsigned len; + unpack (len); + __v.resize (len); + for (unsigned i = 0 ; i < len; i ++) + unpack (__v [i]); +} + +#endif diff --git a/branches/paradiseo-peo-meta-model/src/core/messaging.h b/branches/paradiseo-peo-meta-model/src/core/messaging.h new file mode 100644 index 000000000..573375020 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/src/core/messaging.h @@ -0,0 +1,104 @@ +// "messaging.h" + +// (c) OPAC Team, LIFL, August 2005 + +/* + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#ifndef __mess_h +#define __mess_h + +#include + +/* Char */ +extern void pack (const char & __c); + +/* Float */ +extern void pack (const float & __f, int __nitem = 1); + +/* Double */ +extern void pack (const double & __d, int __nitem = 1); + +/* Integer */ +extern void pack (const int & __i, int __nitem = 1); + +/* Unsigned int. */ +extern void pack (const unsigned int & __ui, int __nitem = 1); + +/* Short int. */ +extern void pack (const short & __sh, int __nitem = 1); + +/* Unsigned short */ +extern void pack (const unsigned short & __ush, int __nitem = 1); + +/* Long */ +extern void pack (const long & __l, int __nitem = 1); + +/* Unsigned long */ +extern void pack (const unsigned long & __ul, int __nitem = 1); + +/* String */ +extern void pack (const char * __str); + +/* Pointer */ +template void pack (const T * __ptr) { + + pack ((unsigned long) __ptr); +} + +/* Pair */ +template void pack (const std :: pair & __pair) { + + pack (__pair.first); + pack (__pair.second); +} + +// + +/* Float */ +extern void unpack (char & __c); + +/* Float */ +extern void unpack (float & __f, int __nitem = 1); + +/* Double */ +extern void unpack (double & __d, int __nitem = 1); + +/* Integer */ +extern void unpack (int & __i, int __nitem = 1); + +/* Unsigned int. */ +extern void unpack (unsigned int & __ui, int __nitem = 1); + +/* Short int. */ +extern void unpack (short & __sh, int __nitem = 1); + +/* Unsigned short */ +extern void unpack (unsigned short & __ush, int __nitem = 1); + +/* Long */ +extern void unpack (long & __l, int __nitem = 1); + +/* Unsigned long */ +extern void unpack (unsigned long & __ul, int __nitem = 1); + +/* String */ +extern void unpack (char * __str); + +/* Pointer */ +template void unpack (T * & __ptr) { + + unsigned long p; + unpack (p); + __ptr = (T *) p; +} + +/* Pair */ +template void unpack (std :: pair & __pair) { + + unpack (__pair.first); + unpack (__pair.second); +} + +#endif diff --git a/branches/paradiseo-peo-meta-model/src/core/peo_debug.cpp b/branches/paradiseo-peo-meta-model/src/core/peo_debug.cpp new file mode 100644 index 000000000..998a5fb25 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/src/core/peo_debug.cpp @@ -0,0 +1,77 @@ +// "peo_debug.cpp" + +// (c) OPAC Team, LIFL, August 2005 + +/* + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#include "peo_debug.h" + +#include +#include +#include +#include +#include +#include +#include + +#include "peo_debug.h" + +#define MAX_BUFF_SIZE 1000 + +#define DEBUG_PATH "./log/" + +static bool debug = true; + +static char host [MAX_BUFF_SIZE]; + +std :: vector files; + +void setDebugMode (bool __dbg) { + + debug = __dbg; + gethostname (host, MAX_BUFF_SIZE); +} + +extern int getNodeRank (); + +void initDebugging () { + + mkdir (DEBUG_PATH, S_IRWXU); + // files.push_back (stdout); + char buff [MAX_BUFF_SIZE]; + sprintf (buff, "%s/%d", DEBUG_PATH, getNodeRank ()); + files.push_back (fopen (buff, "w")); +} + +void endDebugging () { + + for (unsigned i = 0; i < files.size (); i ++) + if (files [i] != stdout) + fclose (files [i]); +} + +void printDebugMessage (const char * __mess) { + + if (debug) { + + char buff [MAX_BUFF_SIZE]; + time_t t = time (0); + + /* Date */ + sprintf (buff, "[%s][%s: ", host, ctime (& t)); + * strchr (buff, '\n') = ']'; + for (unsigned i = 0; i < files.size (); i ++) + fprintf (files [i], buff); + + /* Message */ + sprintf (buff, "%s", __mess); + + for (unsigned i = 0; i < files.size (); i ++) { + fputs (buff, files [i]); + fputs ("\n", files [i]); + fflush (files [i]); + } + } +} diff --git a/branches/paradiseo-peo-meta-model/src/core/peo_debug.h b/branches/paradiseo-peo-meta-model/src/core/peo_debug.h new file mode 100644 index 000000000..90e830717 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/src/core/peo_debug.h @@ -0,0 +1,22 @@ +// "peo_debug.h" + +// (c) OPAC Team, LIFL, August 2005 + +/* + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#ifndef __peo_debug_h +#define __peo_debug_h + +extern void initDebugging (); + +extern void endDebugging (); + +extern void setDebugMode (bool __dbg = true); /* (Des)activating the Debugging mode */ + +extern void printDebugMessage (const char * __mess); /* Print a new message both on the + standard output and a target + text-file in a subdirectory) */ + +#endif diff --git a/branches/paradiseo-peo-meta-model/src/core/peo_fin.cpp b/branches/paradiseo-peo-meta-model/src/core/peo_fin.cpp new file mode 100644 index 000000000..c5d0971ec --- /dev/null +++ b/branches/paradiseo-peo-meta-model/src/core/peo_fin.cpp @@ -0,0 +1,24 @@ +// "peo_finalize.cpp" + +// (c) OPAC Team, LIFL, August 2005 + +/* + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#include "peo_fin.h" +#include "peo_debug.h" +#include "runner.h" +#include "rmc.h" + +void peo :: finalize () { + + printDebugMessage ("waiting for the termination of all threads"); + + joinRunners (); + + finalizeRMC (); + + printDebugMessage ("this is the end"); + endDebugging (); +} diff --git a/branches/paradiseo-peo-meta-model/src/core/peo_fin.h b/branches/paradiseo-peo-meta-model/src/core/peo_fin.h new file mode 100644 index 000000000..22521fa90 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/src/core/peo_fin.h @@ -0,0 +1,17 @@ +// "peo_finalize.h" + +// (c) OPAC Team, LIFL, August 2005 + +/* + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#ifndef __peo_finalize_h +#define __peo_finalize_h + +namespace peo { + + extern void finalize (); +} + +#endif diff --git a/branches/paradiseo-peo-meta-model/src/core/peo_init.cpp b/branches/paradiseo-peo-meta-model/src/core/peo_init.cpp new file mode 100644 index 000000000..f182bfe4f --- /dev/null +++ b/branches/paradiseo-peo-meta-model/src/core/peo_init.cpp @@ -0,0 +1,37 @@ +// "peo_init.cpp" + +// (c) OPAC Team, LIFL, August 2005 + +/* + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#include + +#include "peo_init.h" +#include "peo_param.h" +#include "peo_debug.h" +#include "rmc.h" + +namespace peo { + + int * argc; + + char * * * argv; + + void init (int & __argc, char * * & __argv) { + + argc = & __argc; + + argv = & __argv; + + /* Initializing the the Resource Management and Communication */ + initRMC (__argc, __argv); + + /* Loading the common parameters */ + loadParameters (__argc, __argv); + + /* */ + initDebugging (); + } +} diff --git a/branches/paradiseo-peo-meta-model/src/core/peo_init.h b/branches/paradiseo-peo-meta-model/src/core/peo_init.h new file mode 100644 index 000000000..f4d8527d1 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/src/core/peo_init.h @@ -0,0 +1,21 @@ +// "peo_init.h" + +// (c) OPAC Team, LIFL, August 2005 + +/* + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#ifndef __peo_init_h +#define __peo_init_h + +namespace peo { + + extern int * argc; + + extern char * * * argv; + + extern void init (int & __argc, char * * & __argv); +} + +#endif diff --git a/branches/paradiseo-peo-meta-model/src/core/peo_param.cpp b/branches/paradiseo-peo-meta-model/src/core/peo_param.cpp new file mode 100644 index 000000000..235f89701 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/src/core/peo_param.cpp @@ -0,0 +1,25 @@ +// "peo_param.cpp" + +// (c) OPAC Team, LIFL, August 2005 + +/* + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#include + +#include "peo_param.h" +#include "peo_debug.h" + + + +void peo :: loadParameters (int & __argc, char * * & __argv) { + + eoParser parser (__argc, __argv); + + /* Debug */ + eoValueParam debug_param ("false", "debug", "?"); + parser.processParam (debug_param); + if (debug_param.value () == "true") + setDebugMode (); +} diff --git a/branches/paradiseo-peo-meta-model/src/core/peo_param.h b/branches/paradiseo-peo-meta-model/src/core/peo_param.h new file mode 100644 index 000000000..1f3c55c59 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/src/core/peo_param.h @@ -0,0 +1,17 @@ +// "peo_param.h" + +// (c) OPAC Team, LIFL, August 2005 + +/* + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#ifndef __peo_param_h +#define __peo_param_h + +namespace peo { + + extern void loadParameters (int & __argc, char * * & __argv); +} + +#endif diff --git a/branches/paradiseo-peo-meta-model/src/core/peo_run.cpp b/branches/paradiseo-peo-meta-model/src/core/peo_run.cpp new file mode 100644 index 000000000..7dc523b55 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/src/core/peo_run.cpp @@ -0,0 +1,19 @@ +// "peo_run.cpp" + +// (c) OPAC Team, LIFL, August 2005 + +/* + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#include "peo_init.h" +#include "peo_run.h" +#include "rmc.h" +#include "runner.h" + +void peo :: run () { + + startRunners (); + + runRMC (); +} diff --git a/branches/paradiseo-peo-meta-model/src/core/peo_run.h b/branches/paradiseo-peo-meta-model/src/core/peo_run.h new file mode 100644 index 000000000..0c4734078 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/src/core/peo_run.h @@ -0,0 +1,17 @@ +// "peo_run.h" + +// (c) OPAC Team, LIFL, August 2005 + +/* + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#ifndef __peo_run_h +#define __peo_run_h + +namespace peo { + + extern void run (); +} + +#endif diff --git a/branches/paradiseo-peo-meta-model/src/core/reac_thread.cpp b/branches/paradiseo-peo-meta-model/src/core/reac_thread.cpp new file mode 100644 index 000000000..e6f02e9cb --- /dev/null +++ b/branches/paradiseo-peo-meta-model/src/core/reac_thread.cpp @@ -0,0 +1,36 @@ +// "reac_thread.cpp" + +// (c) OPAC Team, LIFL, August 2005 + +/* + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#include "reac_thread.h" + +static bool the_end = false; + +static std :: vector reac_threads; + +ReactiveThread :: ReactiveThread () { + + reac_threads.push_back (this); + sem_init (& sem, 0, 0); +} + +void ReactiveThread :: sleep () { + + sem_wait (& sem); +} + +void ReactiveThread :: wakeUp () { + + sem_post (& sem); +} + +void stopReactiveThreads () { + + the_end = true; + for (unsigned i = 0; i < reac_threads.size (); i ++) + reac_threads [i] -> wakeUp (); +} diff --git a/branches/paradiseo-peo-meta-model/src/core/reac_thread.h b/branches/paradiseo-peo-meta-model/src/core/reac_thread.h new file mode 100644 index 000000000..ac9fc79d0 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/src/core/reac_thread.h @@ -0,0 +1,35 @@ +// "reac_thread.h" + +// (c) OPAC Team, LIFL, August 2005 + +/* + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#ifndef REAC_THREAD_H_ +#define REAC_THREAD_H_ + +#include + +#include "thread.h" + +class ReactiveThread : public Thread { + +public: + + /* Ctor */ + ReactiveThread (); + + void sleep (); + + void wakeUp (); + +private: + + sem_t sem; + +}; + +extern void stopReactiveThreads (); + +#endif /*THREAD_H_*/ diff --git a/branches/paradiseo-peo-meta-model/src/core/ring_topo.cpp b/branches/paradiseo-peo-meta-model/src/core/ring_topo.cpp new file mode 100644 index 000000000..1fa1351d4 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/src/core/ring_topo.cpp @@ -0,0 +1,25 @@ +// "ring_topo.cpp" + +// (c) OPAC Team, LIFL, September 2005 + +/* + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#include "ring_topo.h" + +void RingTopology :: setNeighbors (Cooperative * __mig, + std :: vector & __from, + std :: vector & __to) { + __from.clear () ; + __to.clear () ; + + int len = mig.size () ; + + for (int i = 0 ; i < len ; i ++) + if (mig [i] == __mig) { + __from.push_back (mig [(i - 1 + len) % len]) ; + __to.push_back (mig [(i + 1) % len]) ; + break; + } +} diff --git a/branches/paradiseo-peo-meta-model/src/core/ring_topo.h b/branches/paradiseo-peo-meta-model/src/core/ring_topo.h new file mode 100644 index 000000000..d473d300a --- /dev/null +++ b/branches/paradiseo-peo-meta-model/src/core/ring_topo.h @@ -0,0 +1,24 @@ +// "ring_topo.h" + +// (c) OPAC Team, LIFL, September 2005 + +/* + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#ifndef __ring_topo_h +#define __ring_topo_h + +#include "topology.h" + +class RingTopology : public Topology { + +public : + + void setNeighbors (Cooperative * __mig, + std :: vector & __from, + std :: vector & __to); + +}; + +#endif diff --git a/branches/paradiseo-peo-meta-model/src/core/rmc.h b/branches/paradiseo-peo-meta-model/src/core/rmc.h new file mode 100644 index 000000000..cf32292e7 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/src/core/rmc.h @@ -0,0 +1,18 @@ +// "rmc.h" + +// (c) OPAC Team, LIFL, August 2005 + +/* + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#ifndef __rmc_h +#define __rmc_h + +extern void initRMC (int & __argc, char * * & __argv); + +extern void runRMC (); /* Resource Management and Communication */ + +extern void finalizeRMC (); + +#endif diff --git a/branches/paradiseo-peo-meta-model/src/core/runner.cpp b/branches/paradiseo-peo-meta-model/src/core/runner.cpp new file mode 100644 index 000000000..6f8fee9de --- /dev/null +++ b/branches/paradiseo-peo-meta-model/src/core/runner.cpp @@ -0,0 +1,104 @@ +// "runner.cpp" + +// (c) OPAC Team, LIFL, August 2005 + +/* + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#include + +#include "runner.h" +#include "reac_thread.h" +#include "peo_debug.h" +#include "messaging.h" + +static unsigned num_act = 0; /* Number of active runners */ + +static std :: vector ll_threads; /* Low-level runner threads */ + +static std :: vector the_runners; + +static unsigned num_runners = 0; + +Runner :: Runner () { + + id = ++ num_runners; + the_runners.push_back (this); + sem_init (& sem_start, 0, 0); + num_act ++; +} + +extern int getNodeRank (); + +extern int getNumberOfNodes (); + +void unpackTerminationOfRunner () { + + RUNNER_ID id; + unpack (id); + num_act --; + printDebugMessage ("I'm noticed of the termination of a runner"); + if (! num_act) { + printDebugMessage ("all the runners have terminated. Now stopping the reactive threads."); + stopReactiveThreads (); + } +} + +bool atLeastOneActiveRunner () { + + return num_act; +} + +RUNNER_ID Runner :: getID () { + + return id; +} + +void Runner :: start () { + + setActive (); + sem_post (& sem_start); + run (); + terminate (); +} + +void Runner :: notifySendingTermination () { + + /* + char b [1000]; + sprintf (b, "Il reste encore %d !!!!!!!!!!!!", n); + printDebugMessage (b); + */ + printDebugMessage ("je suis informe que tout le monde a recu ma terminaison"); + setPassive (); + +} + +void Runner :: waitStarting () { + + sem_wait (& sem_start); +} + +Runner * getRunner (RUNNER_ID __key) { + + return dynamic_cast (getCommunicable (__key)); +} + +void startRunners () { + + /* Runners */ + for (unsigned i = 0; i < the_runners.size (); i ++) + if (the_runners [i] -> isLocal ()) { + addThread (the_runners [i], ll_threads); + the_runners [i] -> waitStarting (); + } + printDebugMessage ("launched the parallel runners"); +} + + +void joinRunners () { + + + joinThreads (ll_threads); +} diff --git a/branches/paradiseo-peo-meta-model/src/core/runner.h b/branches/paradiseo-peo-meta-model/src/core/runner.h new file mode 100644 index 000000000..3c7864449 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/src/core/runner.h @@ -0,0 +1,58 @@ +// "runner.h" + +// (c) OPAC Team, LIFL, August 2005 + +/* + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#ifndef __runner_h +#define __runner_h + +#include + +#include "communicable.h" +#include "thread.h" + +typedef unsigned RUNNER_ID; + +class Runner : public Communicable, public Thread { + +public : + + Runner (); + + void start (); + + void waitStarting (); + + bool isLocal (); + + void terminate (); + + virtual void run () = 0; + + RUNNER_ID getID (); + + void packTermination (); + + void notifySendingTermination (); + +private : + + sem_t sem_start; + + unsigned id; +}; + +extern bool atLeastOneActiveRunner (); + +extern void unpackTerminationOfRunner (); + +extern Runner * getRunner (RUNNER_ID __key); + +extern void startRunners (); + +extern void joinRunners (); + +#endif diff --git a/branches/paradiseo-peo-meta-model/src/core/service.cpp b/branches/paradiseo-peo-meta-model/src/core/service.cpp new file mode 100644 index 000000000..4496e0274 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/src/core/service.cpp @@ -0,0 +1,58 @@ +// "service.cpp" + +// (c) OPAC Team, LIFL, August 2005 + +/* + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#include "service.h" + +void Service :: setOwner (Thread & __owner) { + + owner = & __owner; +} + +Thread * Service :: getOwner () { + + return owner; +} + +Service * getService (SERVICE_ID __key) { + + return dynamic_cast (getCommunicable (__key)); +} + +void Service :: notifySendingData () { + +} +void Service :: notifySendingResourceRequest () { + + num_sent_rr --; + if (! num_sent_rr) + notifySendingAllResourceRequests (); +} + +void Service :: notifySendingAllResourceRequests () { + +} + +void Service :: packData () { + +} + +void Service :: unpackData () { + +} + +void Service :: execute () { + +} + +void Service :: packResult () { + +} + +void Service :: unpackResult () { + +} diff --git a/branches/paradiseo-peo-meta-model/src/core/service.h b/branches/paradiseo-peo-meta-model/src/core/service.h new file mode 100644 index 000000000..16f75d830 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/src/core/service.h @@ -0,0 +1,50 @@ +// "service.h" + +// (c) OPAC Team, LIFL, August 2005 + +/* + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#ifndef __service_h +#define __service_h + +#include "communicable.h" +#include "thread.h" + +typedef unsigned SERVICE_ID; + +class Service : public Communicable { + +public : + + void setOwner (Thread & __owner); + + Thread * getOwner (); + + void requestResourceRequest (unsigned __how_many = 1); + void packResourceRequest (); + + virtual void packData (); + virtual void unpackData (); + + virtual void execute (); + + virtual void packResult (); + virtual void unpackResult (); + + virtual void notifySendingData (); + virtual void notifySendingResourceRequest (); + virtual void notifySendingAllResourceRequests (); + +private : + + Thread * owner; /* Owner thread (i.e. 'uses' that service) */ + + unsigned num_sent_rr; /* Number of RR not really sent (i.e. still in the sending queue)*/ + +}; + +extern Service * getService (SERVICE_ID __key); + +#endif diff --git a/branches/paradiseo-peo-meta-model/src/core/thread.cpp b/branches/paradiseo-peo-meta-model/src/core/thread.cpp new file mode 100644 index 000000000..5445fe58e --- /dev/null +++ b/branches/paradiseo-peo-meta-model/src/core/thread.cpp @@ -0,0 +1,81 @@ +// "thread.cpp" + +// (c) OPAC Team, LIFL, August 2005 + +/* + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#include + +#include "thread.h" + +static std :: vector threads; + +unsigned num_act = 0; + +Thread :: Thread () { + + threads.push_back (this); + act = false; +} + +Thread :: ~ Thread () { + + /* Nothing ! */ +} + +extern int getNodeRank (); + +void Thread :: setActive () { + + if (! act ) { + + act = true; + num_act ++; + // if (getNodeRank () == 1) + // printf ("On passe a %d\n", num_act); + } +} + +void Thread :: setPassive () { + + if (act) { + + act = false; + num_act --; + // if (getNodeRank () == 1) + // printf ("On passe a %d\n", num_act); + + } +} + +bool atLeastOneActiveThread () { + + return num_act; +} + +unsigned numberOfActiveThreads () { + + return num_act; +} + +static void * launch (void * __arg) { + + Thread * thr = (Thread *) __arg; + thr -> start (); + return 0; +} + +void addThread (Thread * __hl_thread, std :: vector & __ll_threads) { + + pthread_t * ll_thr = new pthread_t; + __ll_threads.push_back (ll_thr); + pthread_create (ll_thr, 0, launch, __hl_thread); +} + +void joinThreads (std :: vector & __threads) { + + for (unsigned i = 0; i < __threads.size (); i ++) + pthread_join (* __threads [i], 0); +} diff --git a/branches/paradiseo-peo-meta-model/src/core/thread.h b/branches/paradiseo-peo-meta-model/src/core/thread.h new file mode 100644 index 000000000..db6caa26a --- /dev/null +++ b/branches/paradiseo-peo-meta-model/src/core/thread.h @@ -0,0 +1,48 @@ +// "thread.h" + +// (c) OPAC Team, LIFL, August 2005 + +/* + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#ifndef THREAD_H_ +#define THREAD_H_ + +#include + +/* A high-level thread */ + +class Thread { + +public: + + /* Ctor */ + Thread (); + + /* Dtor */ + virtual ~ Thread (); + + /* Go ! */ + virtual void start () = 0; + + void setActive ();/* It means the current process is going to send messages soon */ + void setPassive ();/* The current process is not going to perform send operations + (but it may receive messages) */ + +private : + + bool act; +}; + +extern void addThread (Thread * __hl_thread, std :: vector & __ll_threads); + +extern void joinThreads (std :: vector & __ll_threads); + +extern bool atLeastOneActiveThread (); /* It returns 'true' iff at least one process is going + to send messages */ + +extern unsigned numberOfActiveThreads (); + + +#endif /*THREAD_H_*/ diff --git a/branches/paradiseo-peo-meta-model/src/core/topology.cpp b/branches/paradiseo-peo-meta-model/src/core/topology.cpp new file mode 100644 index 000000000..46df4c3bc --- /dev/null +++ b/branches/paradiseo-peo-meta-model/src/core/topology.cpp @@ -0,0 +1,20 @@ +// "topo.cpp" + +// (c) OPAC Team, LIFL, September 2005 + +/* + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#include "topology.h" + +Topology :: ~ Topology () { + + /* Nothing ! */ +} + +void Topology :: add (Cooperative & __mig) { + + mig.push_back (& __mig) ; +} + diff --git a/branches/paradiseo-peo-meta-model/src/core/topology.h b/branches/paradiseo-peo-meta-model/src/core/topology.h new file mode 100644 index 000000000..602e899dd --- /dev/null +++ b/branches/paradiseo-peo-meta-model/src/core/topology.h @@ -0,0 +1,33 @@ +// "topology.h" + +// (c) OPAC Team, LIFL, September 2005 + +/* + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#ifndef __topology_h +#define __topology_h + +#include + +#include "cooperative.h" + +class Topology { + +public: + + virtual ~Topology (); + + void add (Cooperative & __mig); + + virtual void setNeighbors (Cooperative * __mig, + std :: vector & __from, + std :: vector & __to) = 0; + +protected: + + std :: vector mig ; +}; + +#endif diff --git a/branches/paradiseo-peo-meta-model/src/paradiseo b/branches/paradiseo-peo-meta-model/src/paradiseo new file mode 100644 index 000000000..960f721a1 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/src/paradiseo @@ -0,0 +1,14 @@ +// "paradiseo" + +// (c) OPAC Team, LIFL, August 2005 + +/* + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#ifndef __paradiseo_ +#define __paradiseo_ + +#include "paradiseo.h" + +#endif diff --git a/branches/paradiseo-peo-meta-model/src/paradiseo.h b/branches/paradiseo-peo-meta-model/src/paradiseo.h new file mode 100644 index 000000000..17f28765a --- /dev/null +++ b/branches/paradiseo-peo-meta-model/src/paradiseo.h @@ -0,0 +1,285 @@ +// "paradiseo.h" + +// (c) OPAC Team, LIFL, August 2005 + +/* + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#ifndef __paradiseo_h_ +#define __paradiseo_h_ + +#include +#include + + +//! \mainpage The ParadisEO-PEO Framework +//! +//! \section intro Introduction +//! +//! ParadisEO is a white-box object-oriented framework dedicated to the reusable design +//! of parallel and distributed metaheuristics (PDM). ParadisEO provides a broad range of features including evolutionary +//! algorithms (EA), local searches (LS), the most common parallel and distributed models and hybridization +//! mechanisms, etc. This high content and utility encourages its use at European level. ParadisEO is based on a +//! clear conceptual separation of the solution methods from the problems they are intended to solve. This separation +//! confers to the user a maximum code and design reuse. Furthermore, the fine-grained nature of the classes +//! provided by the framework allow a higher flexibility compared to other frameworks. ParadisEO is one of the rare +//! frameworks that provide the most common parallel and distributed models. Their implementation is portable on +//! distributed-memory machines as well as on shared-memory multiprocessors, as it uses standard libraries such as +//! MPI, PVM and PThreads. The models can be exploited in a transparent way, one has just to instantiate their associated +//! provided classes. Their experimentation on the radio network design real-world application demonstrate their +//! efficiency. +//! +//! In practice, combinatorial optimization problems are often NP-hard, CPU time-consuming, +//! and evolve over time. Unlike exact methods, metaheuristics allow to tackle large-size problems +//! instances by delivering satisfactory solutions in a reasonable time. Metaheuristics are +//! general-purpose heuristics that split in two categories: evolutionary algorithms (EA) and local +//! search methods (LS). These two families have complementary characteristics: EA allow +//! a better exploration of the search space, while LS have the power to intensify the search in +//! promising regions. Their hybridization allows to deliver robust and better solutions +//! +//! Although serial metaheuristics have a polynomial temporal complexity, they remain +//! unsatisfactory for industrial problems. Parallel and distributed computing is a powerful way +//! to deal with the performance issue of these problems. Numerous parallel and distributed +//! metaheuristics (PDM) and their implementations have been proposed, and are available on +//! theWeb. They can be reused and adapted to his/her own problems. However, the user has to +//! deeply examine the code and rewrite its problem-specific sections. The task is tedious, errorprone, +//! takes along time and makes harder the produced code maintenance. A better way to +//! reuse the code of existing PDM is the reuse through libraries. These are often +//! more reliable as they are more tested and documented. They allow a better maintainability +//! and efficiency. However, libraries do not allow the reuse of design. +//! +//! \section parallel_metaheuristics Parallel and distributed metaheuristics +//! +//! \subsection parallel_distributed Parallel distributed evolutionary algorithms +//! +//! Evolutionary Algorithms (EA) are based on the iterative improvement of a +//! population of solutions. At each step, individuals are selected, paired and recombined in order +//! to generate new solutions that replace other ones, and so on. As the algorithm converges, +//! the population is mainly composed of individuals well adapted to the "environment", for +//! instance the problem. The main features that characterize EA are the way the population is +//! initialized, the selection strategy (deterministic/stochastic) by fostering "good" solutions, +//! the replacement strategy that discards individuals, and the continuation/stopping criterion +//! to decide whether the evolution should go on or not. +//! +//! Basically, three major parallel and distributed models for EA can been distinguished: +//! the island (a)synchronous cooperative model, the parallel evaluation of the +//! population, and the distributed evaluation of a single solution. +//!
    +//!
  • Island (a)synchronous cooperative model. Different EA are simultaneously deployed to +//! cooperate for computing better and robust solutions. They exchange in an asynchronous +//! way genetic stuff to diversify the search. The objective is to allow to delay the global +//! convergence, especially when theEAare heterogeneous regarding the variation operators. +//! The migration of individuals follows a policy defined by few parameters: the migration +//! decision criterion, the exchange topology, the number of emigrants, the emigrants selection +//! policy, and the replacement/integration policy.
  • +//! +//!
  • Parallel evaluation of the population. It is required as it is in general the most timeconsuming. +//! The parallel evaluation follows the centralized model. The farmer applies +//! the following operations: selection, transformation and replacement as they require a +//! global management of the population. At each generation, it distributes the set of new +//! solutions between differentworkers. These evaluate and return back the solutions and their +//! quality values. An efficient execution is often obtained particularly when the evaluation +//! of each solution is costly. The two main advantages of an asynchronous model over +//! the synchronous model are: (1) the fault tolerance of the asynchronous model; (2) the +//! robustness in case the fitness computation can take very different computation times (e.g. +//! for nonlinear numerical optimization). Whereas some time-out detection can be used to +//! address the former issue, the latter one can be partially overcome if the grain is set to very +//! small values, as individuals will be sent out for evaluations upon request of the workers.
  • +//! +//!
  • Distributed evaluation of a single solution. The quality of each solution is evaluated in +//! a parallel centralized way. That model is particularly interesting when the evaluation +//! function can be itself parallelized as it is CPU time-consuming and/or IO intensive. In +//! that case, the function can be viewed as an aggregation of a certain number of partial +//! functions. The partial functions could also be identical if for example the problem to deal +//! with is a data mining one. The evaluation is thus data parallel and the accesses to data +//! base are performed in parallel. Furthermore, a reduction operation is performed on the +//! results returned by the partial functions. As a summary, for this model the user has to +//! indicate a set of partial functions and an aggregation operator of these.
  • +//!
+//! +//! \subsection parallel_ls Parallel distributed local searches +//! +//! \subsubsection local_searches Local searches +//! +//! All metaheuristics dedicated to the improvement of a single solution +//! are based on the concept of neighborhood. They start from a solution randomly generated or +//! obtained from another optimization algorithm, and update it, step by step, by replacing the +//! current solution by one of its neighboring candidates. Some criterion have been identified to +//! differentiate such searches: the heuristic internal memory, the choice of the initial solution, +//! the candidate solutions generator, and the selection strategy of candidate moves. Three main +//! algorithms of local search stand out: Hill Climbing (HC), Simulated +//! Annealing (SA) and Tabu Search (TS). +//! +//! \subsubsection parallel_local_searches Parallel local searches +//! +//! Two parallel distributed models are commonly used in the literature: the parallel distributed +//! exploration of neighboring candidate solutions model, and the multi-start model. +//!
    +//!
  • Parallel exploration of neighboring candidates. It is a low-level Farmer-Worker model +//! that does not alter the behavior of the heuristic. A sequential search computes the same +//! results slower.At the beginning of each iteration, the farmer duplicates the current solution +//! between distributed nodes. Each one manages some candidates and the results are returned to the farmer. +//! The model is efficient if the evaluation of a each solution is time-consuming and/or there are a great +//! deal of candidate neighbors to evaluate. This is obviously not applicable to SA since only one candidate +//! is evaluated at each iteration. Likewise, the efficiency of the model for HC is not always guaranteed as +//! the number of neighboring solutions to process before finding one that improves the current objective function may +//! be highly variable.
  • +//! +//!
  • Multi-start model. It consists in simultaneously launching several local searches. They +//! may be heterogeneous, but no information is exchanged between them. The resultswould +//! be identical as if the algorithms were sequentially run.Very often deterministic algorithms +//! differ by the supplied initial solution and/or some other parameters. This trivial model is +//! convenient for low-speed networks of workstations.
  • +//!
+//! +//! \section hybridization Hybridization +//! +//! Recently, hybrid metaheuristics have gained a considerable interest. For many +//! practical or academic optimization problems, the best found solutions are obtained by +//! hybrid algorithms. Combinations of different metaheuristics have provided very powerful +//! search methods. Two levels and two modes +//! of hybridization have been distinguished: Low and High levels, and Relay and Cooperative modes. +//! The low-level hybridization addresses the functional composition of a single optimization +//! method. A function of a given metaheuristic is replaced by another metaheuristic. On the +//! contrary, for high-level hybrid algorithms the different metaheuristics are self-containing, +//! meaning no direct relationship to their internal working is considered. On the other hand, +//! relay hybridization means a set of metaheuristics is applied in a pipeline way. The output +//! of a metaheuristic (except the last) is the input of the following one (except the first). +//! Conversely, co-evolutionist hybridization is a cooperative optimization model. Each metaheuristic +//! performs a search in a solution space, and exchange solutions with others. +//! +//! \section paradiseo_goals Paradiseo goals and architecture +//! +//! The "EO" part of ParadisEO means Evolving Objects. EO is a C++ LGPL open source +//! framework and includes a paradigm-free Evolutionary Computation library (EOlib) +//! dedicated to the flexible design of EA through evolving objects superseding the most common +//! dialects (Genetic Algorithms, Evolution Strategies, Evolutionary Programming and +//! Genetic Programming). Furthermore, EO integrates several services including visualization +//! facilities, on-line definition of parameters, application check-pointing, etc. ParadisEO is an +//! extended version of the EO framework. The extensions include local search methods, hybridization +//! mechanisms, parallelism and distribution mechanisms, and other features that +//! are not addressed in this paper such as multi-objective optimization and grid computing. In +//! the next sections, we present the motivations and goals of ParadisEO, its architecture and +//! some of its main implementation details and issues. +//! +//! \subsection motivation Motivations and goals +//! +//! A framework is normally intended to be exploited by as many users as possible. Therefore, +//! its exploitation could be successful only if some important user criteria are satisfied. The +//! following criteria are the major of them and constitute the main objectives of the ParadisEO +//! framework: +//! +//!
    +//!
  • Maximum design and code reuse. The framework must provide for the user a whole +//! architecture design of his/her solution method. Moreover, the programmer may redo as +//! little code as possible. This objective requires a clear and maximal conceptual separation +//! between the solution methods and the problems to be solved, and thus a deep domain +//! analysis. The user might therefore develop only the minimal problem-specific code.
  • +//! +//!
  • Flexibility and adaptability. It must be possible for the user to easily add new features/ +//! metaheuristics or change existing ones without implicating other components. Furthermore, +//! as in practice existing problems evolve and new others arise these have to be +//! tackled by specializing/adapting the framework components.
  • +//! +//!
  • Utility. The framework must allow the user to cover a broad range of metaheuristics, +//! problems, parallel distributed models, hybridization mechanisms, etc.
  • +//! +//!
  • Transparent and easy access to performance and robustness. As the optimization applications +//! are often time-consuming the performance issue is crucial. Parallelism and +//! distribution are two important ways to achieve high performance execution. In order to +//! facilitate its use it is implemented so that the user can deploy his/her parallel algorithms in +//! a transparent manner. Moreover, the execution of the algorithms must be robust to guarantee +//! the reliability and the quality of the results. The hybridization mechanism allows +//! to obtain robust and better solutions.
  • +//! +//!
  • Portability. In order to satisfy a large number of users the framework must support +//! different material architectures and their associated operating systems.
  • +//!
+//! +//! \subsection architecture ParadisEO architecture +//! +//! The architecture of ParadisEO is multi-layer and modular allowing to achieve the objectives +//! quoted above. This allows particularly a high flexibility and adaptability, an +//! easier hybridization, and more code and design reuse. The architecture has three layers +//! identifying three major categories of classes: Solvers, Runners and Helpers. +//!
    +//!
  • Helpers. Helpers are low-level classes that perform specific actions related to the evolution +//! or search process. They are split in two categories: Evolutionary helpers (EH) +//! and Local search helpers (LSH). EH include mainly the transformation, selection and +//! replacement operations, the evaluation function and the stopping criterion. LSH can be +//! generic such as the neighborhood explorer class, or specific to the local search metaheuristic +//! like the tabu list manager class in the Tabu Search solution method. On the +//! other hand, there are some special helpers dedicated to the management of parallel and +//! distributed models 2 and 3, such as the communicators that embody the communication +//! services. +//! +//! Helpers cooperate between them and interact with the components of the upper layer +//! i.e. the runners. The runners invoke the helpers through function parameters. Indeed, +//! helpers have not their own data, but they work on the internal data of the runners.
  • +//! +//!
  • Runners. The Runners layer contains a set of classes that implement the metaheuristics +//! themselves. They perform the run of the metaheuristics from the initial state or +//! population to the final one. One can distinguish the Evolutionary runners (ER) such as +//! genetic algorithms, evolution strategies, etc., and Local search runners (LSR) like tabu +//! search, simulated annealing and hill climbing. Runners invoke the helpers to perform +//! specific actions on their data. For instance, an ER may ask the fitness function evaluation +//! helper to evaluate its population. An LSR asks the movement helper to perform +//! a given movement on the current state. Furthermore, runners can be serial or parallel +//! distributed.
  • +//! +//!
  • Solvers. Solvers are devoted to control the evolution process and/or the search. They +//! generate the initial state (solution or population) and define the strategy for combining +//! and sequencing different metaheuristics. Two types of solvers can be distinguished. +//! Single metaheuristic solvers (SMS) and Multiple metaheuristics solvers (MMS). SMSs +//! are dedicated to the execution of only one metaheuristic.MMS are more complex as they +//! control and sequence several metaheuristics that can be heterogeneous. Solvers interact with +//! the user by getting the input data and delivering the output (best solution, statistics, +//! etc).
  • +//!
+//! +//! According to the generality of their embedded features, the classes of the architecture split +//! in two major categories: Provided classes and Required classes. Provided classes embody +//! the factored out part of the metaheuristics. They are generic, implemented in the framework, +//! and ensure the control at run time. Required classes are those that must be supplied by the +//! user. They encapsulate the problem-specific aspects of the application. These classes are +//! fixed but not implemented in ParadisEO. The programmer has the burden to develop them +//! using the OO specialization mechanism. +//! +//! \section tutorials ParadisEO-PEO Tutorials +//! +//! The basisc of the ParadisEO framework philosophy are exposed in a few simple tutorials: +//! +//! All the presented examples have as case study the traveling salesman problem (TSP). Different operators and auxiliary objects were designed, +//! standing as a common shared source code base. While not being +//! part of the ParadisEO-PEO framework, it may represent a startpoint for a better understanding of the presented tutorials. + + + +#include "core/peo_init.h" +#include "core/peo_run.h" +#include "core/peo_fin.h" + +#include "core/eoVector_comm.h" + +#include "peoEA.h" + +/* Parallel steps of the E.A. */ +#include "peoSeqTransform.h" +#include "peoParaSGATransform.h" +#include "peoSeqPopEval.h" +#include "peoParaPopEval.h" + +/* Cooperative island model */ +#include "core/ring_topo.h" +#include "peoAsyncIslandMig.h" +#include "peoSyncIslandMig.h" + +/* Synchronous multi-start model */ +#include "peoSyncMultiStart.h" + +#endif diff --git a/branches/paradiseo-peo-meta-model/src/peoAggEvalFunc.h b/branches/paradiseo-peo-meta-model/src/peoAggEvalFunc.h new file mode 100644 index 000000000..c7f492305 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/src/peoAggEvalFunc.h @@ -0,0 +1,30 @@ +// "peoAggEvalFunc.h" + +// (c) OPAC Team, LIFL, August 2005 + +/* + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#ifndef __peoAggEvalFunc_h +#define __peoAggEvalFunc_h + +#include + +//! Interface class for creating an aggregate evaluation function. + +//! The peoAggEvalFunc class offers only the interface for creating aggregate evaluation functions - there +//! are no direct internal functions provided. The class inherits public eoBF< EOT&, const typename EOT :: Fitness&, void > +//! thus requiring, for the derived classes, the creation of a function having the following signature: +//! +//! +//! +//!
void operator()( EOT& __eot, const typename EOT :: Fitness& __partial_fittness );    
+//! +//! The aggregation object is called in an iterative manner for each of the results obtained by applying partial evaluation functions. +template< class EOT > class peoAggEvalFunc : public eoBF< EOT&, const typename EOT :: Fitness&, void > { + +}; + + +#endif diff --git a/branches/paradiseo-peo-meta-model/src/peoAsyncIslandMig.h b/branches/paradiseo-peo-meta-model/src/peoAsyncIslandMig.h new file mode 100644 index 000000000..8c82e2f5f --- /dev/null +++ b/branches/paradiseo-peo-meta-model/src/peoAsyncIslandMig.h @@ -0,0 +1,258 @@ +// "peoAsyncIslandMig.h" + +// (c) OPAC Team, LIFL, August 2005 + +/* + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#ifndef __peoAsyncIslandMig_h +#define __peoAsyncIslandMig_h + + +#include + +#include + +#include +#include +#include +#include + +#include "core/topology.h" +#include "core/cooperative.h" +#include "core/eoPop_comm.h" +#include "core/peo_debug.h" + + +//! Class providing the basis for the asynchronous island migration model. + +//! The peoAsyncIslandMig class offers the elementary basis for implementating an +//! asynchronous island migration model - requires the specification of several basic +//! parameters, i.e. continuation criterion, selection and replacement strategies, +//! a topological model and the source and destination population for the migrating individuals. +//! As opposed to the synchronous migration model, in the asynchronous migration approach, there is +//! no synchronization step between islands after performing the emigration phase. +//! +//! The migration operator is called at the end of each generation of an evolutionary algorithms +//! as a checkpoint object - the following code exposes the structure of a classic evolutionary algorithm: +//! +//! +//! +//! +//! +//! +//! +//! +//!
do {    
         select( population, offsprings );   // select the offsprings from the current population
         transform( offsprings );   // crossover and mutation operators are applied on the selected offsprings
         evaluate( offsprings );   // evaluation step of the resulting offsprings
         replace( population, offsprings );   // replace the individuals in the current population whith individuals from the offspring population, according to a specified replacement strategy
} while ( eaCheckpointContinue( population ) );   // checkpoint operators are applied on the current population, including the migration operator, if any specified
+//! +//! Constructing an asynchronous island migration model requires having defined (1) a topological migration model, +//! (2) the control parameters of the migration process, (3) a checkpoint object associated with an evolutionary algorithm, +//! and (4) an owner object must be set. The owner object must be derived from the Runner class (for example +//! a peoEA object represents a possible owner). +//! A simple example is offered bellow: +//! +//!
    +//!
  1. topological model to be followed when performing migrations:
    +//!
    +//! +//! +//!
    RingTopology migTopology;   // a simple ring topological model - each island communicates with two other islands
    +//!
  2. +//! +//!
  3. the continuation criterion, selection and replacement strategy etc. are defined:
    +//!
    +//! +//! +//! +//! +//! +//! +//! +//! +//! +//! +//!
    eoPop< EOT > population( POP_SIZE, popInitializer );   // population of individuals to be used for the evolutionary algorithm
       
    eoPeriodicContinue< EOT > migCont( MIG_FREQ );   // migrations occur periodically at MIG_FREQ iterations
    eoRandomSelect< EOT > migSelectStrategy;   // selection strategy - in this case a random selection is applied
    eoSelectNumber< EOT > migSelect( migSelectStrategy, MIG_SIZE );   // number of individuals to be selected using the specified strategy
    eoPlusReplacement< EOT > migReplace;   // immigration strategy - the worse individuals in the destination population are replaced by the immigrant individuals
       
    peoAsyncIslandMig< EOT > asyncMigration( +//!
             migCont, migSelect, migReplace, migTopology, +//!
             population, population +//!
    );  
    // asynchronous migration object - the emigrant individuals are selected from the same from population in which the immigrant individuals are being integrated
    +//!
  4. +//! +//!
  5. creation of a checkpoint object as part of the definition of an evolutionary algoritm (details of th EA not given as being out of scope):
    +//!
    +//! +//! +//! +//! +//! +//! +//! +//!
    ...    
    eoGenContinue< EOT > eaCont( NUM_GEN );   // the evolutionary algorithm will stop after NUM_GEN generations
    eoCheckPoint< EOT > eaCheckpointContinue( eaCont );   // number of individuals to be selected using the specified strategy
    ...    
    eaCheckpointContinue.add( asyncMigration );   // adding the migration operator as checkpoint element
    ...    
    +//!
  6. +//! +//!
  7. definition of an owner evolutionary algorithm (an object inheriting the Runner class):
    +//!
    +//! +//! +//! +//! +//!
    peoEA< EOT > eaAlg( eaCheckpointContinue, eaPopEval, eaSelect, eaTransform, eaReplace);   // evolutionary algorithm having as checkpoint the eaCheckpointContinue object defined above
    asyncMigration.setOwner( eaAlg );   // setting the evolutionary algorithm as owner of the migration object
    eaAlg( population );   // applying the evolutionary algorithm on a given population
    +//!
  8. +//!
+//! +//! The source and the destination population for the migration object were specified as being the same, in step no. 2, +//! as we are usually interested in selecting the emigrants and integrating the immigrant individuals from and in, respectively, one unique +//! population, iteratively evolved by an evolutionary algorithm. There is no restriction in having two distinct populations +//! as source and destination for the emigrant and immigrant individuals respectively. +//! +//! The above steps only create an asynchronous migration object associated to an evolutionary algorithm. The creation of several +//! islands requires the reiteration of the steps 2 through 4 for creating distinct algorithms, with distinct populations and +//! the associated distinctly parametrized migration objects. The interconnecting element is the underlying topology, defined at step 1 +//! (the same C++ migTopology object has to be passed as parameter for all the migration objects, in order to interconnect them). +template< class EOT > class peoAsyncIslandMig : public Cooperative, public eoUpdater { + +public: + + //! Constructor for the peoAsyncIslandMig class; the characteristics of the migration model are defined + //! through the specified parameters - out of the box objects provided in EO, etc., or custom, derived objects may be passed as parameters. + //! + //! @param eoContinue< EOT >& __cont - continuation criterion specifying whether the migration is performed or not; + //! @param eoSelect< EOT >& __select - selection strategy to be applied for constructing a list of emigrant individuals out of the source population; + //! @param eoReplacement< EOT >& __replace - replacement strategy used for integrating the immigrant individuals in the destination population; + //! @param Topology& __topology - topological model to be followed when performing migrations; + //! @param eoPop< EOT >& __source - source population from which the emigrant individuals are selected; + //! @param eoPop< EOT >& __destination - destination population in which the immigrant population are integrated. + peoAsyncIslandMig( + eoContinue< EOT >& __cont, + eoSelect< EOT >& __select, + eoReplacement< EOT >& __replace, + Topology& __topology, + eoPop< EOT >& __source, + eoPop< EOT >& __destination + ); + + //! Function operator to be called as checkpoint for performing the migration step. The emigrant individuals are selected + //! from the source population and sent to the next island (defined by the topology object) while the immigrant + //! individuals are integrated in the destination population. There is no need to explicitly call the function - the + //! wrapper checkpoint object (please refer to the above example) will perform the call when required. + void operator()(); + + //! Auxiliary function dealing with sending the emigrant individuals. There is no need to explicitly call the function. + void pack(); + //! Auxiliary function dealing with receiving immigrant individuals. There is no need to explicitly call the function. + void unpack(); + + +private: + + void emigrate(); + void immigrate(); + + +private: + + eoContinue< EOT >& cont; // continuator + eoSelect< EOT >& select; // the selection strategy + eoReplacement< EOT >& replace; // the replacement strategy + Topology& topology; // the neighboring topology + + // source and destination populations + eoPop< EOT >& source; + eoPop< EOT >& destination; + + // immigrants & emigrants in the queue + std :: queue< eoPop< EOT > > imm; + std :: queue< eoPop< EOT > > em; + + std :: queue< Cooperative* > coop_em; +}; + + +template< class EOT > peoAsyncIslandMig< EOT > :: peoAsyncIslandMig( + + eoContinue< EOT >& __cont, + eoSelect< EOT >& __select, + eoReplacement< EOT >& __replace, + Topology& __topology, + eoPop< EOT >& __source, + eoPop< EOT >& __destination + + ) : cont( __cont ), select( __select ), replace( __replace ), topology( __topology ), source( __source ), destination( __destination ) +{ + + __topology.add( *this ); +} + + +template< class EOT > void peoAsyncIslandMig< EOT > :: pack() +{ + + lock(); { + + :: pack( coop_em.front()->getKey() ); + :: pack( em.front() ); + coop_em.pop(); + em.pop(); + } + unlock(); +} + + +template< class EOT > void peoAsyncIslandMig< EOT > :: unpack() +{ + + lock(); { + + eoPop< EOT > mig; + :: unpack( mig ); + imm.push( mig ); + } + unlock(); +} + + +template< class EOT > void peoAsyncIslandMig< EOT > :: emigrate() +{ + + std :: vector< Cooperative* >in, out; + topology.setNeighbors( this, in, out ); + + for ( unsigned i = 0; i < out.size(); i++ ) { + + eoPop< EOT > mig; + select( source, mig ); + em.push( mig ); + coop_em.push( out[i] ); + send( out[i] ); + printDebugMessage( "sending some emigrants." ); + } +} + + +template< class EOT > void peoAsyncIslandMig< EOT > :: immigrate() +{ + + lock(); { + + while ( !imm.empty() ) { + + replace( destination, imm.front() ); + imm.pop(); + printDebugMessage( "receiving some immigrants." ); + } + } + unlock(); +} + + +template< class EOT > void peoAsyncIslandMig< EOT > :: operator()() { + + if ( !cont( source ) ) { + + emigrate(); // sending emigrants + immigrate(); // receiving immigrants + } +} + + +#endif diff --git a/branches/paradiseo-peo-meta-model/src/peoEA.h b/branches/paradiseo-peo-meta-model/src/peoEA.h new file mode 100644 index 000000000..516b70af9 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/src/peoEA.h @@ -0,0 +1,145 @@ +// "peoEA.h" + +// (c) OPAC Team, LIFL, August 2005 + +/* + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#ifndef __peoEA_h +#define __peoEA_h + +#include +#include +#include +#include +#include + +#include "peoPopEval.h" +#include "peoTransform.h" +#include "core/runner.h" +#include "core/peo_debug.h" + +//! Class providing an elementary ParadisEO evolutionary algorithm. + +//! The peoEA class offers an elementary evolutionary algorithm implementation. In addition, as compared +//! with the algorithms provided by the EO framework, the peoEA class has the underlying necessary structure +//! for including, for example, parallel evaluation and parallel transformation operators, migration operators +//! etc. Although there is no restriction on using the algorithms provided by the EO framework, the drawback resides +//! in the fact that the EO implementation is exclusively sequential and, in consequence, no parallelism is provided. +//! A simple example for constructing a peoEA object: +//! +//! +//! +//! +//! +//! +//! +//! +//! +//! +//! +//! +//! +//! +//! +//! +//! +//! +//! +//! +//! +//! +//!
...    
eoPop< EOT > population( POP_SIZE, popInitializer );   // creation of a population with POP_SIZE individuals - the popInitializer is a functor to be called for each individual
   
eoGenContinue< EOT > eaCont( NUM_GEN );   // number of generations for the evolutionary algorithm
eoCheckPoint< EOT > eaCheckpointContinue( eaCont );   // checkpoint incorporating the continuation criterion - startpoint for adding other checkpoint objects
   
peoSeqPopEval< EOT > eaPopEval( evalFunction );   // sequential evaluation functor wrapper - evalFunction represents the actual evaluation functor
   
eoRankingSelect< EOT > selectionStrategy;   // selection strategy for creating the offspring population - a simple ranking selection in this case
eoSelectNumber< EOT > eaSelect( selectionStrategy, POP_SIZE );   // the number of individuals to be selected for creating the offspring population
eoRankingSelect< EOT > selectionStrategy;   // selection strategy for creating the offspring population - a simple ranking selection in this case
   
eoSGATransform< EOT > transform( crossover, CROSS_RATE, mutation, MUT_RATE );   // transformation operator - crossover and mutation operators with their associated probabilities
peoSeqTransform< EOT > eaTransform( transform );   // ParadisEO specific sequential operator - a parallel version may be specified in the same manner
   
eoPlusReplacement< EOT > eaReplace;   // replacement strategy - for integrating the offspring resulting individuals in the initial population
   
peoEA< EOT > eaAlg( eaCheckpointContinue, eaPopEval, eaSelect, eaTransform, eaReplace );   // ParadisEO evolutionary algorithm integrating the above defined objects
eaAlg( population );   // specifying the initial population for the algorithm
...    
+template < class EOT > class peoEA : public Runner { + +public: + + //! Constructor for the evolutionary algorithm object - several basic parameters have to be specified, + //! allowing for different levels of parallelism. Depending on the requirements, a sequential or a parallel + //! evaluation operator may be specified or, in the same manner, a sequential or a parallel transformation + //! operator may be given as parameter. Out of the box objects may be provided, from the EO package, for example, + //! or custom defined ones may be specified, provided that they are derived from the correct base classes. + //! + //! @param eoContinue< EOT >& __cont - continuation criterion specifying whether the algorithm should continue or not; + //! @param peoPopEval< EOT >& __pop_eval - evaluation operator; it allows the specification of parallel evaluation operators, aggregate evaluation functions, etc.; + //! @param eoSelect< EOT >& __select - selection strategy to be applied for constructing a list of offspring individuals; + //! @param peoTransform< EOT >& __trans - transformation operator, i.e. crossover and mutation; allows for sequential or parallel transform; + //! @param eoReplacement< EOT >& __replace - replacement strategy for integrating the offspring individuals in the initial population; + peoEA( + eoContinue< EOT >& __cont, + peoPopEval< EOT >& __pop_eval, + eoSelect< EOT >& __select, + peoTransform< EOT >& __trans, + eoReplacement< EOT >& __replace + ); + + //! Evolutionary algorithm function - a side effect of the fact that the class is derived from the Runner class, + //! thus requiring the existence of a run function, the algorithm being executed on a distinct thread. + void run(); + + //! Function operator for specifying the population to be associated with the algorithm. + //! + //! @param eoPop< EOT >& __pop - initial population of the algorithm, to be iteratively evolved; + void operator()( eoPop< EOT >& __pop ); + +private: + + + eoContinue< EOT >& cont; + peoPopEval< EOT >& pop_eval; + eoSelect< EOT >& select; + peoTransform< EOT >& trans; + eoReplacement< EOT >& replace; + eoPop< EOT >* pop; +}; + + +template < class EOT > peoEA< EOT > :: peoEA( + + eoContinue< EOT >& __cont, + peoPopEval< EOT >& __pop_eval, + eoSelect< EOT >& __select, + peoTransform< EOT >& __trans, + eoReplacement< EOT >& __replace + + ) : cont( __cont ), pop_eval( __pop_eval ), select( __select ), trans( __trans ), replace( __replace ) +{ + + trans.setOwner( *this ); + pop_eval.setOwner( *this ); +} + + +template< class EOT > void peoEA< EOT > :: operator ()( eoPop< EOT >& __pop ) { + + pop = &__pop; +} + + +template< class EOT > void peoEA< EOT > :: run() { + + printDebugMessage( "performing the first evaluation of the population." ); + pop_eval( *pop ); + + do { + + eoPop< EOT > off; + + printDebugMessage( "performing the selection step." ); + select( *pop, off ); + trans( off ); + + printDebugMessage( "performing the evaluation of the population." ); + pop_eval( off ); + + printDebugMessage( "performing the replacement of the population." ); + replace( *pop, off ); + + printDebugMessage( "deciding of the continuation." ); + + } while ( cont( *pop ) ); +} + + +#endif diff --git a/branches/paradiseo-peo-meta-model/src/peoNoAggEvalFunc.h b/branches/paradiseo-peo-meta-model/src/peoNoAggEvalFunc.h new file mode 100644 index 000000000..d3a701123 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/src/peoNoAggEvalFunc.h @@ -0,0 +1,34 @@ +// "peoNoAggEvalFunc.h" + +// (c) OPAC Team, LIFL, August 2005 + +/* + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#ifndef __peoNoAggEvalFunc_h +#define __peoNoAggEvalFunc_h + +#include "peoAggEvalFunc.h" + +//! Class providing a simple interface for associating a fitness value to a specified individual. + +//! The peoNoAggEvalFunc class does nothing more than an association between a fitness value and a specified individual. +//! The class is provided as a mean of declaring that no aggregation is required for the evaluation function - the fitness +//! value is explicitly specified. +template< class EOT > class peoNoAggEvalFunc : public peoAggEvalFunc< EOT > { + +public : + + //! Operator which sets as fitness the __fit value for the __sol individual + void operator()( EOT& __sol, const typename EOT :: Fitness& __fit ); +}; + + +template< class EOT > void peoNoAggEvalFunc< EOT > :: operator()( EOT& __sol, const typename EOT :: Fitness& __fit ) { + + __sol.fitness( __fit ); +} + + +#endif diff --git a/branches/paradiseo-peo-meta-model/src/peoParaPopEval.h b/branches/paradiseo-peo-meta-model/src/peoParaPopEval.h new file mode 100644 index 000000000..8e9760d89 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/src/peoParaPopEval.h @@ -0,0 +1,225 @@ +// "peoParaPopEval.h" + +// (c) OPAC Team, LIFL, August 2005 + +/* + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#ifndef __peoParaPopEval_h +#define __peoParaPopEval_h + +#include +#include + +#include "core/messaging.h" +#include "core/peo_debug.h" +#include "peoAggEvalFunc.h" +#include "peoNoAggEvalFunc.h" + + +//! Parallel evaluation functor wrapper. + +//! The peoParaPopEval represents a wrapper for creating a functor capable of applying in parallel +//! an EO-derived evaluation functor. The class offers the possibility of chosing between a single-function evaluation +//! and an aggregate evaluation function, including several sub-evalution functions. +template< class EOT > class peoParaPopEval : public peoPopEval< EOT > { + +public: + + using peoPopEval< EOT > :: requestResourceRequest; + using peoPopEval< EOT > :: resume; + using peoPopEval< EOT > :: stop; + using peoPopEval< EOT > :: getOwner; + + //! Constructor function - an EO-derived evaluation functor has to be specified; an internal reference + //! is set towards the specified evaluation functor. + //! + //! @param eoEvalFunc< EOT >& __eval_func - EO-derived evaluation functor to be applied in parallel on each individual of a specified population + peoParaPopEval( eoEvalFunc< EOT >& __eval_func ); + + //! Constructor function - a vector of EO-derived evaluation functors has to be specified as well as an aggregation function. + //! + //! @param const std :: vector< eoEvalFunc < EOT >* >& __funcs - vector of EO-derived partial evaluation functors; + //! @param peoAggEvalFunc< EOT >& __merge_eval - aggregation functor for creating a fitness value out of the partial fitness values. + peoParaPopEval( const std :: vector< eoEvalFunc < EOT >* >& __funcs, peoAggEvalFunc< EOT >& __merge_eval ); + + //! Operator for applying the evaluation functor (direct or aggregate) for each individual of the specified population. + //! + //! @param eoPop< EOT >& __pop - population to be evaluated by applying the evaluation functor specified in the constructor. + void operator()( eoPop< EOT >& __pop ); + + //! Auxiliary function for transferring data between the process requesting an evaluation operation and the process that + //! performs the actual evaluation phase. There is no need to explicitly call the function. + void packData(); + + //! Auxiliary function for transferring data between the process requesting an evaluation operation and the process that + //! performs the actual evaluation phase. There is no need to explicitly call the function. + void unpackData(); + + //! Auxiliary function - it calls the specified evaluation functor(s). There is no need to explicitly call the function. + void execute(); + + //! Auxiliary function for transferring data between the process requesting an evaluation operation and the process that + //! performs the actual evaluation phase. There is no need to explicitly call the function. + void packResult(); + + //! Auxiliary function for transferring data between the process requesting an evaluation operation and the process that + //! performs the actual evaluation phase. There is no need to explicitly call the function. + void unpackResult(); + + //! Auxiliary function for notifications between the process requesting an evaluation operation and the processes that + //! performs the actual evaluation phase. There is no need to explicitly call the function. + void notifySendingData(); + + //! Auxiliary function for notifications between the process requesting an evaluation operation and the processes that + //! performs the actual evaluation phase. There is no need to explicitly call the function. + void notifySendingAllResourceRequests(); + +private: + + + const std :: vector< eoEvalFunc < EOT >* >& funcs; + std :: vector< eoEvalFunc < EOT >* > one_func; + + peoAggEvalFunc< EOT >& merge_eval; + peoNoAggEvalFunc< EOT > no_merge_eval; + + std :: queue< EOT* >tasks; + + std :: map< EOT*, std :: pair< unsigned, unsigned > > progression; + + unsigned num_func; + + EOT sol; + + EOT *ad_sol; + + unsigned total; +}; + + +template< class EOT > peoParaPopEval< EOT > :: peoParaPopEval( eoEvalFunc< EOT >& __eval_func ) : + + funcs( one_func ), merge_eval( no_merge_eval ) +{ + + one_func.push_back( &__eval_func ); +} + + +template< class EOT > peoParaPopEval< EOT > :: peoParaPopEval( + + const std :: vector< eoEvalFunc< EOT >* >& __funcs, + peoAggEvalFunc< EOT >& __merge_eval + + ) : funcs( __funcs ), merge_eval( __merge_eval ) +{ + +} + + +template< class EOT > void peoParaPopEval< EOT >::operator()( eoPop< EOT >& __pop ) { + + for ( unsigned i = 0; i < __pop.size(); i++ ) { + + __pop[ i ].fitness( typename EOT :: Fitness() ); + + progression[ &__pop[ i ] ].first = funcs.size() - 1; + progression[ &__pop[ i ] ].second = funcs.size(); + + for ( unsigned j = 0; j < funcs.size(); j++ ) { + /* Queuing the 'invalid' solution and its associated owner */ + tasks.push( &__pop[ i ] ); + } + } + + total = funcs.size() * __pop.size(); + requestResourceRequest( funcs.size() * __pop.size() ); + stop(); +} + + +template< class EOT > void peoParaPopEval< EOT > :: packData() { + + // printDebugMessage ("debut pakc data"); + pack( progression[ tasks.front() ].first-- ); + + /* Packing the contents :-) of the solution */ + pack( *tasks.front() ); + + /* Packing the addresses of both the solution and the owner */ + pack( tasks.front() ); + tasks.pop( ); +} + + +template< class EOT > void peoParaPopEval< EOT > :: unpackData() { + + unpack( num_func ); + /* Unpacking the solution */ + unpack( sol ); + /* Unpacking the @ of that one */ + unpack( ad_sol ); +} + + +template< class EOT > void peoParaPopEval< EOT > :: execute() { + + /* Computing the fitness of the solution */ + funcs[ num_func ]->operator()( sol ); +} + + +template< class EOT > void peoParaPopEval< EOT > :: packResult() { + + /* Packing the fitness of the solution */ + pack( sol.fitness() ); + /* Packing the @ of the individual */ + pack( ad_sol ); +} + + +template< class EOT > void peoParaPopEval< EOT > :: unpackResult() { + + typename EOT :: Fitness fit; + + /* Unpacking the computed fitness */ + unpack( fit ); + + /* Unpacking the @ of the associated individual */ + unpack( ad_sol ); + + + /* Associating the fitness the local solution */ + merge_eval( *ad_sol, fit ); + + progression[ ad_sol ].second--; + + /* Notifying the container of the termination of the evaluation */ + if ( !progression[ ad_sol ].second ) { + + progression.erase( ad_sol ); + } + + total--; + if ( !total ) { + + getOwner()->setActive(); + resume(); + } +} + + +template< class EOT > void peoParaPopEval< EOT > :: notifySendingData() { + +} + + +template< class EOT > void peoParaPopEval< EOT > :: notifySendingAllResourceRequests() { + + getOwner()->setPassive(); +} + + +#endif diff --git a/branches/paradiseo-peo-meta-model/src/peoParaSGATransform.h b/branches/paradiseo-peo-meta-model/src/peoParaSGATransform.h new file mode 100644 index 000000000..6e64a25b2 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/src/peoParaSGATransform.h @@ -0,0 +1,155 @@ +// "peoParaSGATransform.h" + +//(c) OPAC Team, LIFL, August 2005 + +/* + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#ifndef __peoParaSGATransform_h +#define __peoParaSGATransform_h + +#include "peoTransform.h" +#include "core/thread.h" +#include "core/messaging.h" +#include "core/peo_debug.h" + + +extern int getNodeRank(); + + +template< class EOT > class peoParaSGATransform : public peoTransform< EOT > { + +public: + + using peoTransform< EOT > :: requestResourceRequest; + using peoTransform< EOT > :: resume; + using peoTransform< EOT > :: stop; + using peoTransform< EOT > :: getOwner; + + peoParaSGATransform( + + eoQuadOp< EOT >& __cross, + double __cross_rate, + eoMonOp< EOT >& __mut, + double __mut_rate + ); + + void operator()( eoPop< EOT >& __pop ); + + void packData(); + + void unpackData(); + + void execute(); + + void packResult(); + + void unpackResult(); + + void notifySendingData(); + void notifySendingAllResourceRequests(); + +private: + + eoQuadOp< EOT >& cross; + double cross_rate; + + eoMonOp< EOT >& mut; + double mut_rate; + + unsigned idx; + + eoPop< EOT >* pop; + + EOT father, mother; + + unsigned num_term; +}; + +template< class EOT > peoParaSGATransform< EOT > :: peoParaSGATransform( + + eoQuadOp< EOT >& __cross, + double __cross_rate, + eoMonOp < EOT >& __mut, + double __mut_rate + + ) : cross( __cross ), cross_rate( __cross_rate ), mut( __mut ), mut_rate( __mut_rate ) +{ + +} + + +template< class EOT > void peoParaSGATransform< EOT > :: packData() { + + pack( idx ); + :: pack( pop->operator[]( idx++ ) ); + :: pack( pop->operator[]( idx++ ) ); +} + + +template< class EOT > void peoParaSGATransform< EOT > :: unpackData() { + + unpack( idx ); + :: unpack( father ); + :: unpack( mother ); +} + + +template< class EOT > void peoParaSGATransform< EOT > :: execute() { + + if( rng.uniform() < cross_rate ) cross( mother, father ); + + if( rng.uniform() < mut_rate ) mut( mother ); + if( rng.uniform() < mut_rate ) mut( father ); +} + + +template< class EOT > void peoParaSGATransform< EOT > :: packResult() { + + pack( idx ); + :: pack( father ); + :: pack( mother ); +} + + +template< class EOT > void peoParaSGATransform< EOT > :: unpackResult() { + + unsigned sidx; + + unpack( sidx ); + :: unpack( pop->operator[]( sidx++ ) ); + :: unpack( pop->operator[]( sidx ) ); + num_term += 2; + + if( num_term == pop->size() ) { + + getOwner()->setActive(); + resume(); + } +} + + +template< class EOT > void peoParaSGATransform< EOT > :: operator()( eoPop < EOT >& __pop ) { + + printDebugMessage( "performing the parallel transformation step." ); + pop = &__pop; + idx = 0; + num_term = 0; + requestResourceRequest( __pop.size() / 2 ); + stop(); +} + + +template< class EOT > void peoParaSGATransform< EOT > :: notifySendingData() { + +} + + +template< class EOT > void peoParaSGATransform< EOT > :: notifySendingAllResourceRequests() { + + getOwner()->setPassive(); +} + + +#endif diff --git a/branches/paradiseo-peo-meta-model/src/peoPopEval.h b/branches/paradiseo-peo-meta-model/src/peoPopEval.h new file mode 100644 index 000000000..440d638ae --- /dev/null +++ b/branches/paradiseo-peo-meta-model/src/peoPopEval.h @@ -0,0 +1,28 @@ +// "peoPopEval.h" + +// (c) OPAC Team, LIFL, August 2005 + +/* + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#ifndef __peoPopEval_h +#define __peoPopEval_h + +#include "core/service.h" + +//! Interface for ParadisEO specific evaluation functors. + +//! The peoPopEval class provides the interface for constructing ParadisEO specific evaluation functors. +//! The derived classes may be used as wrappers for EO-derived evaluation functors. In order to have an example, +//! please refer to the implementation of the peoSeqPopEval and peoParaPopEval classes. +template< class EOT > class peoPopEval : public Service { + +public: + + //! Interface function providing the signature for constructing an evaluation functor. + virtual void operator()( eoPop< EOT >& __pop ) = 0; +}; + + +#endif diff --git a/branches/paradiseo-peo-meta-model/src/peoSeqPopEval.h b/branches/paradiseo-peo-meta-model/src/peoSeqPopEval.h new file mode 100644 index 000000000..769c4f891 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/src/peoSeqPopEval.h @@ -0,0 +1,53 @@ +// "peoSeqPopEval.h" + +// (c) OPAC Team, LIFL, August 2005 + +/* + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#ifndef __peoSeqPopEval_h +#define __peoSeqPopEval_h + +#include + +#include "peoPopEval.h" + +//! Sequential evaluation functor wrapper. + +//! The peoSeqPopEval class acts only as a ParadisEO specific sequential evaluation functor - a wrapper for incorporating +//! an eoEvalFunc< EOT >-derived class as evaluation functor. The specified EO evaluation object is applyied in an +//! iterative manner to each individual of a specified population. +template< class EOT > class peoSeqPopEval : public peoPopEval< EOT > { + +public: + + //! Constructor function - it only sets an internal reference to point to the specified evaluation object. + //! + //! @param eoEvalFunc< EOT >& __eval - evaluation object to be applied for each individual of a specified population + peoSeqPopEval( eoEvalFunc< EOT >& __eval ); + + //! Operator for evaluating all the individuals of a given population - in a sequential iterative manner. + //! + //! @param eoPop< EOT >& __pop - population to be evaluated. + void operator()( eoPop< EOT >& __pop ); + +private: + + eoEvalFunc< EOT >& eval; +}; + + +template< class EOT > peoSeqPopEval< EOT > :: peoSeqPopEval( eoEvalFunc< EOT >& __eval ) : eval( __eval ) { + +} + + +template< class EOT > void peoSeqPopEval< EOT > :: operator()( eoPop< EOT >& __pop ) { + + for ( unsigned i = 0; i < __pop.size(); i++ ) + eval( __pop[i] ); +} + + +#endif diff --git a/branches/paradiseo-peo-meta-model/src/peoSeqTransform.h b/branches/paradiseo-peo-meta-model/src/peoSeqTransform.h new file mode 100644 index 000000000..6834f550d --- /dev/null +++ b/branches/paradiseo-peo-meta-model/src/peoSeqTransform.h @@ -0,0 +1,66 @@ +// "peoSeqTransform.h" + +// (c) OPAC Team, LIFL, August 2005 + +/* + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#ifndef __peoSeqTransform_h +#define __peoSeqTransform_h + +#include "peoTransform.h" + + +//! ParadisEO specific wrapper class offering the possibility of using EO derived transform operators. + +//! The peoSeqTransform represent a wrapper for offering the possibility of using EO derived transform operators +//! along with the ParadisEO evolutionary algorithms. A minimal set of interface functions is also provided for creating the +//! link with the parallel architecture of the ParadisEO framework. +template< class EOT > class peoSeqTransform : public peoTransform< EOT > { + +public: + + //! Constructor function - sets an internal reference towards the specified EO-derived transform object. + //! + //! @param eoTransform< EOT >& __trans - EO-derived transform object including crossover and mutation operators. + peoSeqTransform( eoTransform< EOT >& __trans ); + + //! Operator for applying the specified transform operators on each individual of the given population. + //! + //! @param eoPop< EOT >& __pop - population to be transformed by applying the crossover and mutation operators. + void operator()( eoPop< EOT >& __pop ); + + //! Interface function for providing a link with the parallel architecture of the ParadisEO framework. + virtual void packData() { } + + //! Interface function for providing a link with the parallel architecture of the ParadisEO framework. + virtual void unpackData() { } + + //! Interface function for providing a link with the parallel architecture of the ParadisEO framework. + virtual void execute() { } + + //! Interface function for providing a link with the parallel architecture of the ParadisEO framework. + virtual void packResult() { } + + //! Interface function for providing a link with the parallel architecture of the ParadisEO framework. + virtual void unpackResult() { } + +private: + + eoTransform< EOT >& trans; +}; + + +template< class EOT > peoSeqTransform< EOT > :: peoSeqTransform( eoTransform< EOT >& __trans ) : trans( __trans ) { + +} + + +template< class EOT > void peoSeqTransform< EOT > :: operator()( eoPop< EOT >& __pop ) { + + trans( __pop ); +} + + +#endif diff --git a/branches/paradiseo-peo-meta-model/src/peoSyncIslandMig.h b/branches/paradiseo-peo-meta-model/src/peoSyncIslandMig.h new file mode 100644 index 000000000..a6b0b13b1 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/src/peoSyncIslandMig.h @@ -0,0 +1,286 @@ +// "peoSyncIslandMig.h" + +// (c) OPAC Team, LIFL, August 2005 + +/* + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#ifndef __peoSyncIslandMig_h +#define __peoSyncIslandMig_h + + +#include +#include + +#include + +#include + +#include +#include +#include +#include + +#include "core/topology.h" +#include "core/thread.h" +#include "core/eoPop_comm.h" +#include "core/peo_debug.h" + + +//! Class providing the basis for the synchronous island migration model. + +//! The peoSyncIslandMig class offers the elementary basis for implementating a +//! synchronous island migration model - requires the specification of several basic +//! parameters, i.e. frequency of the migrations, selection and replacement strategies, +//! a topological model and the source and destination population for the migrating individuals. +//! The main difference as opposed to the asynchronous migration model is the synchronization step +//! performed after selecting and sending the emigrant individuals. +//! +//! The migration operator is called at the end of each generation of an evolutionary algorithms +//! as a checkpoint object - the following code exposes the structure of a classic evolutionary algorithm: +//! +//! +//! +//! +//! +//! +//! +//! +//!
do {    
         select( population, offsprings );   // select the offsprings from the current population
         transform( offsprings );   // crossover and mutation operators are applied on the selected offsprings
         evaluate( offsprings );   // evaluation step of the resulting offspring
         replace( population, offsprings );   // replace the individuals in the current population whith individuals from the offspring population, according to a specified replacement strategy
} while ( eaCheckpointContinue( population ) );   // checkpoint operators are applied on the current population, including the migration operator, if any specified
+//! +//! Constructing a synchronous island migration model requires having defined (1) a topological migration model, +//! (2) the control parameters of the migration process, (3) a checkpoint object associated with an evolutionary algorithm, +//! and (4) an owner object must be set. The owner object must be derived from the Runner class (for example +//! a peoEA object represents a possible owner). +//! A simple example is offered bellow: +//! +//!
    +//!
  1. topological model to be followed when performing migrations:
    +//!
    +//! +//! +//!
    RingTopology migTopology;   // a simple ring topological model - each island communicates with two other islands
    +//!
  2. +//! +//!
  3. the continuation criterion, selection and replacement strategy etc. are defined:
    +//!
    +//! +//! +//! +//! +//! +//! +//! +//! +//! +//!
    eoPop< EOT > population( POP_SIZE, popInitializer );   // population of individuals to be used for the evolutionary algorithm
       
    eoRandomSelect< EOT > migSelectStrategy;   // selection strategy - in this case a random selection is applied
    eoSelectNumber< EOT > migSelect( migSelectStrategy, MIG_SIZE );   // number of individuals to be selected using the specified strategy
    eoPlusReplacement< EOT > migReplace;   // immigration strategy - the worse individuals in the destination population are replaced by the immigrant individuals
       
    peoSyncIslandMig< EOT > syncMigration( +//!
             MIG_FREQ, migSelect, migReplace, migTopology, +//!
             population, population +//!
    );  
    // synchronous migration object - the emigrant individuals are selected from the same from population in which the immigrant individuals are being integrated
    +//!
  4. +//! +//!
  5. creation of a checkpoint object as part of the definition of an evolutionary algoritm (details of th EA not given as being out of scope):
    +//!
    +//! +//! +//! +//! +//! +//! +//! +//!
    ...    
    eoGenContinue< EOT > eaCont( NUM_GEN );   // the evolutionary algorithm will stop after NUM_GEN generations
    eoCheckPoint< EOT > eaCheckpointContinue( eaCont );   // number of individuals to be selected using the specified strategy
    ...    
    eaCheckpointContinue.add( syncMigration );   // adding the migration operator as checkpoint element
    ...    
    +//!
  6. +//! +//!
  7. definition of an owner evolutionary algorithm (an object inheriting the Runner class):
    +//!
    +//! +//! +//! +//! +//!
    peoEA< EOT > eaAlg( eaCheckpointContinue, eaPopEval, eaSelect, eaTransform, eaReplace);   // evolutionary algorithm having as checkpoint the eaCheckpointContinue object defined above
    syncMigration.setOwner( eaAlg );   // setting the evolutionary algorithm as owner of the migration object
    eaAlg( population );   // applying the evolutionary algorithm on a given population
    +//!
  8. +//!
+//! +//! The source and the destination population for the migration object were specified as being the same, in step no. 2, +//! as we are usually interested in selecting the emigrants and integrating the immigrant individuals from and in, respectively, one unique +//! population, iteratively evolved by an evolutionary algorithm. There is no restriction in having two distinct populations +//! as source and destination for the emigrant and immigrant individuals respectively. +//! +//! The above steps only create a synchronous migration object associated to an evolutionary algorithm. The creation of several +//! islands requires the reiteration of the steps 2 through 4 for creating distinct algorithms, with distinct populations and +//! the associated distinctly parametrized migration objects. The interconnecting element is the underlying topology, defined at step 1 +//! (the same C++ migTopology object has to be passed as parameter for all the migration objects, in order to interconnect them). +template< class EOT > class peoSyncIslandMig : public Cooperative, public eoUpdater { + +public: + + //! Constructor for the peoSyncIslandMig class; the characteristics of the migration model are defined + //! through the specified parameters - out of the box objects provided in EO, etc., or custom, derived objects may be passed as parameters. + //! + //! @param unsigned __frequency - frequency of the migrations - the migrations occur periodically; + //! @param eoSelect< EOT >& __select - selection strategy to be applied for constructing a list of emigrant individuals out of the source population; + //! @param eoReplacement< EOT >& __replace - replacement strategy used for integrating the immigrant individuals in the destination population; + //! @param Topology& __topology - topological model to be followed when performing migrations; + //! @param eoPop< EOT >& __source - source population from which the emigrant individuals are selected; + //! @param eoPop< EOT >& __destination - destination population in which the immigrant population are integrated. + peoSyncIslandMig( + unsigned __frequency, + eoSelect< EOT >& __select, + eoReplacement< EOT >& __replace, + Topology& __topology, + eoPop< EOT >& __source, + eoPop< EOT >& __destination + ); + + //! Function operator to be called as checkpoint for performing the migration step. The emigrant individuals are selected + //! from the source population and sent to the next island (defined by the topology object) while the immigrant + //! individuals are integrated in the destination population. There is no need to explicitly call the function - the + //! wrapper checkpoint object (please refer to the above example) will perform the call when required. + void operator()(); + + //! Auxiliary function dealing with sending the emigrant individuals. There is no need to explicitly call the function. + void pack(); + //! Auxiliary function dealing with receiving immigrant individuals. There is no need to explicitly call the function. + void unpack(); + + //! Auxiliary function dealing with migration notifications. There is no need to explicitly call the function. + void notifySending(); + + +private: + + void emigrate(); + void immigrate(); + + +private: + + eoPeriodicContinue< EOT > cont; + eoSelect< EOT >& select; // selection strategy + eoReplacement< EOT >& replace; // replacement strategy + Topology& topology; // neighboring topology + + // source and target populations + eoPop< EOT >& source; + eoPop< EOT >& destination; + + // immigrants & emigrants in the queue + std :: queue< eoPop< EOT > > imm; + std :: queue< eoPop< EOT > > em; + + std :: queue< Cooperative* > coop_em; + + sem_t sync; +}; + + +template< class EOT > peoSyncIslandMig< EOT > :: peoSyncIslandMig( + + unsigned __frequency, + eoSelect< EOT >& __select, + eoReplacement< EOT >& __replace, + Topology& __topology, + eoPop< EOT >& __source, + eoPop< EOT >& __destination + + ) : cont( __frequency ), select( __select ), replace( __replace ), topology( __topology ), source( __source ), destination( __destination ) +{ + + __topology.add( *this ); + sem_init( &sync, 0, 0 ); +} + + +template< class EOT > void peoSyncIslandMig< EOT > :: pack() { + + lock(); { + + :: pack( coop_em.front()->getKey() ); + :: pack( em.front() ); + coop_em.pop(); + em.pop(); + } + unlock(); +} + + +template< class EOT > void peoSyncIslandMig< EOT > :: unpack() { + + lock(); { + + eoPop< EOT > mig; + :: unpack( mig ); + imm.push( mig ); + } + unlock(); + + sem_post( &sync ); +} + + +template< class EOT > void peoSyncIslandMig< EOT > :: emigrate() { + + std :: vector< Cooperative* > in, out; + topology.setNeighbors( this, in, out ); + + for ( unsigned i = 0; i < out.size(); i ++ ) { + + eoPop< EOT > mig; + select( source, mig ); + em.push( mig ); + coop_em.push( out[ i ] ); + send( out[ i ] ); + printDebugMessage( "sending some emigrants." ); + } +} + + +template< class EOT > void peoSyncIslandMig< EOT > :: immigrate() { + + lock(); { + + assert( imm.size() ); + replace( destination, imm.front() ) ; + imm.pop(); + printDebugMessage( "receiving some immigrants." ); + } + unlock(); +} + + +template< class EOT > void peoSyncIslandMig< EOT > :: operator()() { + + if ( !cont( source ) ) { + + // sending emigrants + emigrate(); + stop(); + + // synchronizing + sem_wait( &sync ); + getOwner()->setActive(); + + // receiving immigrants + immigrate(); + } +} + + +template< class EOT > void peoSyncIslandMig< EOT > :: notifySending() { + + lock(); { + + if ( imm.empty() ) { + + printDebugMessage( "entering pasive mode\n" ); + getOwner()->setPassive(); + } + } + unlock(); + + resume(); +} + + +#endif diff --git a/branches/paradiseo-peo-meta-model/src/peoSyncMultiStart.h b/branches/paradiseo-peo-meta-model/src/peoSyncMultiStart.h new file mode 100644 index 000000000..bfeb5aa6e --- /dev/null +++ b/branches/paradiseo-peo-meta-model/src/peoSyncMultiStart.h @@ -0,0 +1,183 @@ +// "peoSyncMultiStart.h" + +// (c) OPAC Team, LIFL, August 2005 + +/* + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#ifndef __peoSyncMultiStart_h +#define __peoSyncMultiStart_h + +#include +#include + +#include +#include +#include + +#include "core/service.h" +#include "core/messaging.h" +#include "core/peo_debug.h" + + +extern int getNodeRank(); + + +//! Class providing the basis for the synchronous multi-start model. + +//! The peoSyncMultiStart class provides the basis for implementing the synchronous multi-start model, +//! for launching several solution-based algorithms in parallel on a specified initial population. As a simple +//! example, several hill climbing algorithms may be synchronously launched on the specified population, each +//! algorithm acting upon one individual only, the final result being integrated back in the population. A +//! peoSyncMultiStart object can be specified as checkpoint object for a classic ParadisEO evolutionary algorithm +//! thus allowing for simple hybridization schemes which combine the evolutionary approach with a local search approach, +//! for example, executed at the end of each generation. +template< class EOT > class peoSyncMultiStart : public Service, public eoUpdater { + +public: + + //! Constructor function - several simple parameters are required for defining the characteristics of the multi-start model. + //! + //! @param eoContinue< EOT >& __cont - defined for including further functionality - no semantics associated at this time; + //! @param eoSelect< EOT >& __select - selection strategy for obtaining a subset of the initial population on which to apply the specified algorithm; + //! @param eoReplacement< EOT >& __replace - replacement strategy for integrating the resulting individuals in the initial population; + //! @param moAlgo< EOT >& __ls - algorithm to be applied on each of the selected individuals - a moAlgo< EOT >-derived object must be specified; + //! @param eoPop< EOT >& __pop - the initial population from which the individuals are selected for applying the specified algorithm. + peoSyncMultiStart( + + eoContinue< EOT >& __cont, + eoSelect< EOT >& __select, + eoReplacement< EOT >& __replace, + moAlgo< EOT >& __ls, + eoPop< EOT >& __pop + ); + + //! Operator which synchronously executes the specified algorithm on the individuals selected from the initial population. + //! There is no need to explicitly call the operator - automatically called as checkpoint operator. + void operator()(); + + //! Auxiliary function for transferring data between the process requesting the synchronous execution of the specified + //! algorithm and the process which actually executes the algorithm. There is no need to explicitly call the function. + void packData(); + + //! Auxiliary function for transferring data between the process requesting the synchronous execution of the specified + //! algorithm and the process which actually executes the algorithm. There is no need to explicitly call the function. + void unpackData(); + + //! Auxiliary function for actually executing the specified algorithm on one assigned individual. There is no need to + //! explicitly call the function. + void execute(); + + //! Auxiliary function for transferring data between the process requesting the synchronous execution of the specified + //! algorithm and the process which actually executes the algorithm. There is no need to explicitly call the function. + void packResult(); + + //! Auxiliary function for transferring data between the process requesting the synchronous execution of the specified + //! algorithm and the process which actually executes the algorithm. There is no need to explicitly call the function. + void unpackResult(); + + //! Auxiliary function for notifications between the process requesting the synchronous multi-start execution + //! and the processes that performs the actual execution phase. There is no need to explicitly call the function. + void notifySendingData(); + + //! Auxiliary function for notifications between the process requesting the synchronous multi-start execution + //! and the processes that performs the actual execution phase. There is no need to explicitly call the function. + void notifySendingAllResourceRequests(); + +private: + + eoContinue< EOT >& cont; + eoSelect< EOT >& select; + eoReplacement< EOT >& replace; + + moAlgo< EOT >& ls; + + eoPop< EOT >& pop; + eoPop< EOT > sel; + eoPop< EOT > impr_sel; + + EOT sol; + unsigned idx; + unsigned num_term; +}; + + +template< class EOT > peoSyncMultiStart< EOT > :: peoSyncMultiStart( + + eoContinue < EOT >& __cont, + eoSelect< EOT >& __select, + eoReplacement< EOT >& __replace, + moAlgo < EOT >& __ls, + eoPop< EOT >& __pop + + ) : cont( __cont ), select( __select ), replace( __replace ), ls( __ls ), pop( __pop ) +{ + +} + + +template< class EOT > void peoSyncMultiStart< EOT > :: packData() { + + :: pack( sel[ idx++ ] ); +} + + +template< class EOT > void peoSyncMultiStart< EOT > :: unpackData() { + + unpack( sol ); +} + + +template< class EOT > void peoSyncMultiStart< EOT > :: execute() { + + ls( sol ); +} + + +template< class EOT > void peoSyncMultiStart< EOT > :: packResult() { + + pack( sol ); +} + + +template< class EOT > void peoSyncMultiStart< EOT > :: unpackResult() { + + unpack( sol ); + impr_sel.push_back( sol ); + num_term++; + + if ( num_term == sel.size() ) { + + getOwner()->setActive(); + replace( pop, impr_sel ); + + printDebugMessage( "replacing the improved individuals in the population." ); + resume(); + } +} + + +template< class EOT > void peoSyncMultiStart< EOT > :: operator()() { + + printDebugMessage( "performing the parallel multi-start hybridization." ); + select( pop, sel ); + impr_sel.clear(); + idx = num_term = 0; + requestResourceRequest( sel.size() ); + stop(); +} + + +template< class EOT > void peoSyncMultiStart< EOT > :: notifySendingData() { + +} + + +template< class EOT > void peoSyncMultiStart< EOT > :: notifySendingAllResourceRequests() { + + getOwner()->setPassive(); +} + + +#endif diff --git a/branches/paradiseo-peo-meta-model/src/peoTransform.h b/branches/paradiseo-peo-meta-model/src/peoTransform.h new file mode 100644 index 000000000..fd07f9d3a --- /dev/null +++ b/branches/paradiseo-peo-meta-model/src/peoTransform.h @@ -0,0 +1,25 @@ +// "peoTransform.h" + +// (c) OPAC Team, LIFL, August 2005 + +/* + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#ifndef __peoTransform_h +#define __peoTransform_h + +#include + +#include "core/service.h" + +//! Interface class for constructing more complex transformation operators. + +//! The peoTransform class acts only as an interface for creating transform operators - for an example +//! please refer to the peoSeqTransform and the peoParaSGATransform classes. +template< class EOT > class peoTransform : public Service, public eoTransform< EOT > { + +}; + + +#endif diff --git a/branches/paradiseo-peo-meta-model/src/rmc/CMakeLists.txt b/branches/paradiseo-peo-meta-model/src/rmc/CMakeLists.txt new file mode 100644 index 000000000..cff45bfa7 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/src/rmc/CMakeLists.txt @@ -0,0 +1,9 @@ + + +###################################################################################### +### 1) Where must cmake go now ? +###################################################################################### + +SUBDIRS(mpi) + +###################################################################################### \ No newline at end of file diff --git a/branches/paradiseo-peo-meta-model/src/rmc/mpi/CMakeLists.txt b/branches/paradiseo-peo-meta-model/src/rmc/mpi/CMakeLists.txt new file mode 100644 index 000000000..b275baef1 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/src/rmc/mpi/CMakeLists.txt @@ -0,0 +1,60 @@ + +###################################################################################### +### 0) Set the compiler +###################################################################################### + +SET (CMAKE_CXX_COMPILER mpicxx) + +###################################################################################### + + + +###################################################################################### +### 1) Include the sources +###################################################################################### + +INCLUDE_DIRECTORIES(${EO_SRC_DIR}) +INCLUDE_DIRECTORIES(${XML2_CFLAGS_WITH_WHITESPACE}) + +###################################################################################### + + + +###################################################################################### +### 2) Define your target(s): just the core library here +###################################################################################### + +SET(RMC_MPI_LIB_OUTPUT_PATH ${ParadisEO-PEO_BINARY_DIR}/lib) +SET(LIBRARY_OUTPUT_PATH ${RMC_MPI_LIB_OUTPUT_PATH}) + +SET (RMC_MPI_SOURCES node.cpp + param.cpp + comm.cpp + coop.cpp + mess.cpp + rmc.cpp + scheduler.cpp + worker.cpp + send.cpp + recv.cpp + xml_parser.cpp + schema.cpp + runner.cpp + service.cpp) + +ADD_LIBRARY(rmc_mpi STATIC ${RMC_MPI_SOURCES}) +ADD_DEPENDENCIES(rmc_mpi peo) +###################################################################################### + + + +###################################################################################### +### 3) Optionnal: define your lib version: +###################################################################################### + +SET(RMC_MPI_VERSION "1.0.beta") +SET_TARGET_PROPERTIES(rmc_mpi PROPERTIES VERSION "${RMC_MPI_VERSION}") +###################################################################################### + + + diff --git a/branches/paradiseo-peo-meta-model/src/rmc/mpi/comm.cpp b/branches/paradiseo-peo-meta-model/src/rmc/mpi/comm.cpp new file mode 100644 index 000000000..1352c66fb --- /dev/null +++ b/branches/paradiseo-peo-meta-model/src/rmc/mpi/comm.cpp @@ -0,0 +1,67 @@ +// "comm.cpp" + +// (c) OPAC Team, LIFL, August 2005 + +/* + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + + +#include + +#include "comm.h" +#include "mess.h" +#include "node.h" +#include "param.h" +#include "../../core/peo_debug.h" +#include "../../core/runner.h" +#include "send.h" +#include "recv.h" +#include "scheduler.h" + +static sem_t sem_comm_init; + +static Communicator * the_thread; + +Communicator :: Communicator (int * __argc, char * * * __argv) { + + the_thread = this; + initNode (__argc, __argv); + loadRMCParameters (* __argc, * __argv); + sem_post (& sem_comm_init); +} + +void Communicator :: start () { + + while (true) { + + /* Zzz Zzz Zzz :-))) */ + sleep (); + sendMessages (); + + if (! atLeastOneActiveRunner ()) + break; + receiveMessages (); + } + waitBuffers (); + printDebugMessage ("finalizing"); + MPI_Finalize (); +} + +void initCommunication () { + + sem_init (& sem_comm_init, 0, 0); +} + +void waitNodeInitialization () { + + sem_wait (& sem_comm_init); +} + +void wakeUpCommunicator () { + + the_thread -> wakeUp (); +} + + + diff --git a/branches/paradiseo-peo-meta-model/src/rmc/mpi/comm.h b/branches/paradiseo-peo-meta-model/src/rmc/mpi/comm.h new file mode 100644 index 000000000..1ecf4b89a --- /dev/null +++ b/branches/paradiseo-peo-meta-model/src/rmc/mpi/comm.h @@ -0,0 +1,31 @@ +// "comm.h" + +// (c) OPAC Team, LIFL, August 2005 + +/* + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#ifndef __comm_mpi_h +#define __comm_mpi_h + +#include "../../core/communicable.h" +#include "../../core/reac_thread.h" + +class Communicator : public ReactiveThread { + +public : + + /* Ctor */ + Communicator (int * __argc, char * * * __argv); + + void start (); +}; + +extern void initCommunication (); + +extern void waitNodeInitialization (); + +extern void wakeUpCommunicator (); + +#endif diff --git a/branches/paradiseo-peo-meta-model/src/rmc/mpi/coop.cpp b/branches/paradiseo-peo-meta-model/src/rmc/mpi/coop.cpp new file mode 100644 index 000000000..f24ffea1c --- /dev/null +++ b/branches/paradiseo-peo-meta-model/src/rmc/mpi/coop.cpp @@ -0,0 +1,42 @@ +// "coop.cpp" + +// (c) OPAC Team, LIFL, August 2005 + +/* + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#include "../../core/cooperative.h" +#include "send.h" +#include "tags.h" +#include "schema.h" +#include "mess.h" +#include "../../core/peo_debug.h" + +Runner * Cooperative :: getOwner () { + + return owner; +} + +void Cooperative :: setOwner (Runner & __runner) { + + owner = & __runner; +} + +void Cooperative :: send (Cooperative * __coop) { + + :: send (this, getRankOfRunner (__coop -> getOwner () -> getID ()), COOP_TAG); + // stop (); +} + +Cooperative * getCooperative (COOP_ID __key) { + + return dynamic_cast (getCommunicable (__key)); +} + +void Cooperative :: notifySending () { + + //getOwner -> setPassive (); + // resume (); + // printDebugMessage (b); +} diff --git a/branches/paradiseo-peo-meta-model/src/rmc/mpi/mess.cpp b/branches/paradiseo-peo-meta-model/src/rmc/mpi/mess.cpp new file mode 100644 index 000000000..1ccedb51e --- /dev/null +++ b/branches/paradiseo-peo-meta-model/src/rmc/mpi/mess.cpp @@ -0,0 +1,237 @@ +// "mess.cpp" + +// (c) OPAC Team, LIFL, August 2005 + +/* + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#include +#include + +#include "mess.h" +#include "../../core/peo_debug.h" +#include "node.h" + +#define MPI_BUF_SIZE 1024*64 + +static char mpi_buf [MPI_BUF_SIZE]; + +static int pos_buf ; + +static std :: vector act_buf; /* Active buffers */ + +static std :: vector act_req; /* Active requests */ + +void cleanBuffers () { + + for (unsigned i = 0; i < act_req.size ();) { + + MPI_Status stat ; + int flag ; + MPI_Test (act_req [i], & flag, & stat) ; + if (flag) { + + delete act_buf [i] ; + delete act_req [i] ; + + act_buf [i] = act_buf.back () ; + act_buf.pop_back () ; + + act_req [i] = act_req.back () ; + act_req.pop_back () ; + } + else + i ++; + } +} + +void waitBuffers () { + + printDebugMessage ("waiting the termination of the asynchronous operations to complete"); + + for (unsigned i = 0; i < act_req.size (); i ++) { + + MPI_Status stat ; + + MPI_Wait (act_req [i], & stat) ; + + delete act_buf [i] ; + delete act_req [i] ; + } +} + +bool probeMessage (int & __src, int & __tag) { + + int flag; + + MPI_Status stat; + + MPI_Iprobe (MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD, & flag, & stat); + + __src = stat.MPI_SOURCE; + __tag = stat.MPI_TAG; + + return flag; +} + +void waitMessage () { + + MPI_Status stat; + + MPI_Probe (MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD, & stat); +} + +void initMessage () { + + pos_buf = 0; +} + +void sendMessage (int __to, int __tag) { + + cleanBuffers (); + act_buf.push_back (new char [pos_buf]); + act_req.push_back (new MPI_Request); + memcpy (act_buf.back (), mpi_buf, pos_buf); + MPI_Isend (act_buf.back (), pos_buf, MPI_PACKED, __to, __tag, MPI_COMM_WORLD, act_req.back ()); +} + +void sendMessageToAll (int __tag) { + + for (int i = 0; i < getNumberOfNodes (); i ++) + sendMessage (i, __tag); +} + +void receiveMessage (int __from, int __tag) { + + MPI_Status stat; + MPI_Request req; + + MPI_Irecv (mpi_buf, MPI_BUF_SIZE, MPI_PACKED, __from, __tag, MPI_COMM_WORLD, & req) ; + MPI_Wait (& req, & stat) ; +} + +/* Char */ +void pack (const char & __c) { + + MPI_Pack ((void *) & __c, 1, MPI_CHAR, mpi_buf, MPI_BUF_SIZE, & pos_buf, MPI_COMM_WORLD); +} + +/* Float */ +void pack (const float & __f, int __nitem) { + + MPI_Pack ((void *) & __f, __nitem, MPI_FLOAT, mpi_buf, MPI_BUF_SIZE, & pos_buf, MPI_COMM_WORLD); +} + +/* Double */ +void pack (const double & __d, int __nitem) { + + MPI_Pack ((void *) & __d, __nitem, MPI_DOUBLE, mpi_buf, MPI_BUF_SIZE, & pos_buf, MPI_COMM_WORLD); +} + +/* Integer */ +void pack (const int & __i, int __nitem) { + + MPI_Pack ((void *) & __i, __nitem, MPI_INT, mpi_buf, MPI_BUF_SIZE, & pos_buf, MPI_COMM_WORLD); +} + +/* Unsigned int. */ +void pack (const unsigned int & __ui, int __nitem) { + + MPI_Pack ((void *) & __ui, __nitem, MPI_UNSIGNED, mpi_buf, MPI_BUF_SIZE, & pos_buf, MPI_COMM_WORLD); +} + +/* Short int. */ +void pack (const short & __sh, int __nitem) { + + MPI_Pack ((void *) & __sh, __nitem, MPI_SHORT, mpi_buf, MPI_BUF_SIZE, & pos_buf, MPI_COMM_WORLD); +} + +/* Unsigned short */ +void pack (const unsigned short & __ush, int __nitem) { + + MPI_Pack ((void *) & __ush, __nitem, MPI_UNSIGNED_SHORT, mpi_buf, MPI_BUF_SIZE, & pos_buf, MPI_COMM_WORLD); +} + +/* Long */ +void pack (const long & __l, int __nitem) { + + MPI_Pack ((void *) & __l, __nitem, MPI_LONG, mpi_buf, MPI_BUF_SIZE, & pos_buf, MPI_COMM_WORLD); +} + +/* Unsigned long */ +void pack (const unsigned long & __ul, int __nitem) { + + MPI_Pack ((void *) & __ul, __nitem, MPI_UNSIGNED_LONG, mpi_buf, MPI_BUF_SIZE, & pos_buf, MPI_COMM_WORLD); +} + +/* String */ +void pack (const char * __str) { + + int len = strlen (__str) + 1; + MPI_Pack (& len, 1, MPI_INT, mpi_buf, MPI_BUF_SIZE, & pos_buf, MPI_COMM_WORLD); + MPI_Pack ((void *) __str, len, MPI_CHAR, mpi_buf, MPI_BUF_SIZE, & pos_buf, MPI_COMM_WORLD); +} + +/* Char */ +void unpack (char & __c) { + + MPI_Unpack (mpi_buf, MPI_BUF_SIZE, & pos_buf, & __c, 1, MPI_CHAR, MPI_COMM_WORLD); +} + +/* Float */ +void unpack (float & __f, int __nitem) { + + MPI_Unpack (mpi_buf, MPI_BUF_SIZE, & pos_buf, & __f, __nitem, MPI_FLOAT, MPI_COMM_WORLD); +} + +/* Double */ +void unpack (double & __d, int __nitem) { + + MPI_Unpack (mpi_buf, MPI_BUF_SIZE, & pos_buf, & __d, __nitem, MPI_DOUBLE, MPI_COMM_WORLD); +} + +/* Integer */ +void unpack (int & __i, int __nitem) { + + MPI_Unpack (mpi_buf, MPI_BUF_SIZE, & pos_buf, & __i, __nitem, MPI_INT, MPI_COMM_WORLD); +} + +/* Unsigned int. */ +void unpack (unsigned int & __ui, int __nitem) { + + MPI_Unpack (mpi_buf, MPI_BUF_SIZE, & pos_buf, & __ui, __nitem, MPI_UNSIGNED, MPI_COMM_WORLD); +} + +/* Short int. */ +void unpack (short & __sh, int __nitem) { + + MPI_Unpack (mpi_buf, MPI_BUF_SIZE, & pos_buf, & __sh, __nitem, MPI_SHORT, MPI_COMM_WORLD); +} + +/* Unsigned short */ +void unpack (unsigned short & __ush, int __nitem) { + + MPI_Unpack (mpi_buf, MPI_BUF_SIZE, & pos_buf, & __ush, __nitem, MPI_UNSIGNED_SHORT, MPI_COMM_WORLD); +} + +/* Long */ +void unpack (long & __l, int __nitem) { + + MPI_Unpack (mpi_buf, MPI_BUF_SIZE, & pos_buf, & __l, __nitem, MPI_LONG, MPI_COMM_WORLD); +} + +/* Unsigned long */ +void unpack (unsigned long & __ul, int __nitem) { + + MPI_Unpack (mpi_buf, MPI_BUF_SIZE, & pos_buf, & __ul, __nitem, MPI_UNSIGNED_LONG, MPI_COMM_WORLD); +} + +/* String */ +void unpack (char * __str) { + + int len; + MPI_Unpack (mpi_buf, MPI_BUF_SIZE, & pos_buf, & len, 1, MPI_INT, MPI_COMM_WORLD); + MPI_Unpack (mpi_buf, MPI_BUF_SIZE, & pos_buf, __str, len, MPI_CHAR, MPI_COMM_WORLD); +} + diff --git a/branches/paradiseo-peo-meta-model/src/rmc/mpi/mess.h b/branches/paradiseo-peo-meta-model/src/rmc/mpi/mess.h new file mode 100644 index 000000000..6e40a154a --- /dev/null +++ b/branches/paradiseo-peo-meta-model/src/rmc/mpi/mess.h @@ -0,0 +1,31 @@ +// "mess.h" + +// (c) OPAC Team, LIFL, August 2005 + +/* + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#ifndef __mess_rmc_h +#define __mess_rmc_h + +#include "../../core/messaging.h" + +extern void initMessage (); + +extern void sendMessage (int __to, int __tag); + +extern void sendMessageToAll (int __tag); + +extern void receiveMessage (int __from, int __tag); + +extern void cleanBuffers (); + +extern void waitBuffers (); + +extern bool probeMessage (int & __src, int & __tag); + +extern void waitMessage (); + +#endif + diff --git a/branches/paradiseo-peo-meta-model/src/rmc/mpi/node.cpp b/branches/paradiseo-peo-meta-model/src/rmc/mpi/node.cpp new file mode 100644 index 000000000..b17b032bf --- /dev/null +++ b/branches/paradiseo-peo-meta-model/src/rmc/mpi/node.cpp @@ -0,0 +1,58 @@ +// "node.cpp" + +// (c) OPAC Team, LIFL, August 2005 + +/* + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#include +#include +#include +#include +#include + +static int rk, sz; /* Rank & size */ + +static std :: map name_to_rk; + +static std :: vector rk_to_name; + +int getNodeRank () { + + return rk; +} + +int getNumberOfNodes () { + + return sz; +} + +int getRankFromName (const std :: string & __name) { + + return atoi (__name.c_str ()); +} + +void initNode (int * __argc, char * * * __argv) { + + int provided; + MPI_Init_thread (__argc, __argv, MPI_THREAD_FUNNELED, & provided); + assert (provided == MPI_THREAD_FUNNELED); /* The MPI implementation must be multi-threaded. + Yet, only one thread performs the comm. + operations */ + MPI_Comm_rank (MPI_COMM_WORLD, & rk); /* Who ? */ + MPI_Comm_size (MPI_COMM_WORLD, & sz); /* How many ? */ + + char names [sz] [MPI_MAX_PROCESSOR_NAME]; + int len; + + /* Processor names */ + MPI_Get_processor_name (names [0], & len); /* Me */ + MPI_Allgather (names, MPI_MAX_PROCESSOR_NAME, MPI_CHAR, names, MPI_MAX_PROCESSOR_NAME, MPI_CHAR, MPI_COMM_WORLD); /* Broadcast */ + + for (int i = 0; i < sz; i ++) { + rk_to_name.push_back (names [i]); + name_to_rk [names [i]] = i; + } +} + diff --git a/branches/paradiseo-peo-meta-model/src/rmc/mpi/node.h b/branches/paradiseo-peo-meta-model/src/rmc/mpi/node.h new file mode 100644 index 000000000..3fc345c8d --- /dev/null +++ b/branches/paradiseo-peo-meta-model/src/rmc/mpi/node.h @@ -0,0 +1,24 @@ +// "node.h" + +// (c) OPAC Team, LIFL, August 2005 + +/* + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#ifndef __node_h +#define __node_h + +#include +#include + +extern int getNodeRank (); /* It gives the rank of the calling process */ + +extern int getNumberOfNodes (); /* It gives the size of the environment (Total number of nodes) */ + +extern int getRankFromName (const std :: string & __name); /* It gives the rank of the process + expressed by its name */ + +extern void initNode (int * __argc, char * * * __argv); + +#endif diff --git a/branches/paradiseo-peo-meta-model/src/rmc/mpi/param.cpp b/branches/paradiseo-peo-meta-model/src/rmc/mpi/param.cpp new file mode 100644 index 000000000..22d387ad0 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/src/rmc/mpi/param.cpp @@ -0,0 +1,21 @@ +// "param.cpp" + +// (c) OPAC Team, LIFL, August 2005 + +/* + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#include + +#include "schema.h" + +void loadRMCParameters (int & __argc, char * * & __argv) { + + eoParser parser (__argc, __argv); + + /* Schema */ + eoValueParam schema_param ("schema.xml", "schema", "?"); + parser.processParam (schema_param); + loadSchema (schema_param.value ().c_str ()); +} diff --git a/branches/paradiseo-peo-meta-model/src/rmc/mpi/param.h b/branches/paradiseo-peo-meta-model/src/rmc/mpi/param.h new file mode 100644 index 000000000..9fdc99e59 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/src/rmc/mpi/param.h @@ -0,0 +1,14 @@ +// "param.h" + +// (c) OPAC Team, LIFL, August 2005 + +/* + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#ifndef __rmc_param_h +#define __rmc_param_h + +extern void loadRMCParameters (int & __argc, char * * & __argv); + +#endif diff --git a/branches/paradiseo-peo-meta-model/src/rmc/mpi/recv.cpp b/branches/paradiseo-peo-meta-model/src/rmc/mpi/recv.cpp new file mode 100644 index 000000000..a2d12795c --- /dev/null +++ b/branches/paradiseo-peo-meta-model/src/rmc/mpi/recv.cpp @@ -0,0 +1,112 @@ +// "recv.cpp" + +// (c) OPAC Team, LIFL, August 2005 + +/* + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#include "comm.h" +#include "tags.h" +#include "worker.h" +#include "scheduler.h" +#include "mess.h" +#include "node.h" +#include "../../core/runner.h" +#include "../../core/cooperative.h" +#include "../../core/peo_debug.h" + +void receiveMessages () { + + cleanBuffers (); + + do { + + if (! atLeastOneActiveThread ()) { + // printDebugMessage ("debut wait"); + waitMessage (); + //printDebugMessage ("fin wait"); + } + + int src, tag; + + while (probeMessage (src, tag)) { + + receiveMessage (src, tag); + initMessage (); + /* + char b [1000]; + sprintf (b, "traitement recv %d\n", tag); + printDebugMessage (b); + */ + + switch (tag) { + + case RUNNER_STOP_TAG: + unpackTerminationOfRunner (); + wakeUpCommunicator (); + break; + + case COOP_TAG: + // printDebugMessage ("reception de message de cooperation"); + COOP_ID coop_id; + unpack (coop_id); + getCooperative (coop_id) -> unpack (); + break; + + case SCHED_REQUEST_TAG: + unpackResourceRequest (); + break; + + case SCHED_RESULT_TAG: + { + /* Unpacking the resource */ + SERVICE_ID serv_id; + unpack (serv_id); + Service * serv = getService (serv_id); + int dest; + unpack (dest); + WORKER_ID worker_id; + unpack (worker_id); + + /* Going back ... */ + initMessage (); + pack (worker_id); + pack (serv_id); + serv -> packData (); + serv -> notifySendingData (); + sendMessage (dest, TASK_DATA_TAG); + break; + } + + case TASK_DATA_TAG: + { + WORKER_ID worker_id; + unpack (worker_id); + Worker * worker = getWorker (worker_id); + worker -> setSource (src); + worker -> unpackData (); + worker -> wakeUp (); + break; + } + + case TASK_RESULT_TAG: + { + SERVICE_ID serv_id; + unpack (serv_id); + Service * serv = getService (serv_id); + serv -> unpackResult (); + break; + } + + case TASK_DONE_TAG: + unpackTaskDone (); + break; + + default: + ; + }; + } + + } while (! atLeastOneActiveThread () && atLeastOneActiveRunner () /*&& ! allResourcesFree ()*/); +} diff --git a/branches/paradiseo-peo-meta-model/src/rmc/mpi/recv.h b/branches/paradiseo-peo-meta-model/src/rmc/mpi/recv.h new file mode 100644 index 000000000..5832a7584 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/src/rmc/mpi/recv.h @@ -0,0 +1,14 @@ +// "recv.h" + +// (c) OPAC Team, LIFL, August 2005 + +/* + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#ifndef __recv_h +#define __recv_h + +extern void receiveMessages (); + +#endif diff --git a/branches/paradiseo-peo-meta-model/src/rmc/mpi/rmc.cpp b/branches/paradiseo-peo-meta-model/src/rmc/mpi/rmc.cpp new file mode 100644 index 000000000..5730f837f --- /dev/null +++ b/branches/paradiseo-peo-meta-model/src/rmc/mpi/rmc.cpp @@ -0,0 +1,47 @@ +// "rmc.cpp" + +// (c) OPAC Team, LIFL, August 2005 + +/* + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#include "send.h" +#include "worker.h" +#include "schema.h" +#include "comm.h" +#include "scheduler.h" +#include "../../core/peo_debug.h" + +static std :: vector ll_threads; /* Low level threads */ + +void runRMC () { + + /* Worker(s) ? */ + for (unsigned i = 0; i < my_node -> num_workers; i ++) + addThread (new Worker, ll_threads); + + wakeUpCommunicator (); +} + +void initRMC (int & __argc, char * * & __argv) { + + /* Communication */ + initCommunication (); + addThread (new Communicator (& __argc, & __argv), ll_threads); + waitNodeInitialization (); + initSending (); + + /* Scheduler */ + if (isScheduleNode ()) + initScheduler (); + + /// +} + +void finalizeRMC () { + + printDebugMessage ("before join threads RMC"); + joinThreads (ll_threads); + printDebugMessage ("after join threads RMC"); +} diff --git a/branches/paradiseo-peo-meta-model/src/rmc/mpi/runner.cpp b/branches/paradiseo-peo-meta-model/src/rmc/mpi/runner.cpp new file mode 100644 index 000000000..7fe7673e0 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/src/rmc/mpi/runner.cpp @@ -0,0 +1,33 @@ +// "runner.cpp" + +// (c) OPAC Team, LIFL, August 2005 + +/* + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#include "../../core/messaging.h" +#include "../../core/runner.h" +#include "node.h" +#include "send.h" +#include "tags.h" +#include "schema.h" + +bool Runner :: isLocal () { + + for (unsigned i = 0; i < my_node -> id_run.size (); i ++) + if (my_node -> id_run [i] == id) + return true; + return false; +} + +void Runner :: packTermination () { + + pack (id); +} + +void Runner :: terminate () { + + sendToAll (this, RUNNER_STOP_TAG); +} + diff --git a/branches/paradiseo-peo-meta-model/src/rmc/mpi/scheduler.cpp b/branches/paradiseo-peo-meta-model/src/rmc/mpi/scheduler.cpp new file mode 100644 index 000000000..40de0e3f7 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/src/rmc/mpi/scheduler.cpp @@ -0,0 +1,78 @@ +// "sched_thread.cpp" + +// (c) OPAC Team, LIFL, August 2005 + +/* + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#include + +#include "scheduler.h" +#include "tags.h" +#include "mess.h" +#include "../../core/peo_debug.h" + +static std :: queue resources; /* Free resources */ + +static std :: queue requests; /* Requests */ + +static unsigned initNumberOfRes = 0; + +void initScheduler () { + + for (unsigned i = 0; i < the_schema.size (); i ++) { + + const Node & node = the_schema [i]; + + if (node.rk_sched == my_node -> rk) + for (unsigned j = 0; j < node.num_workers; j ++) + resources.push (std :: pair (i, j + 1)); + } + initNumberOfRes = resources.size (); +} + +bool allResourcesFree () { + + return resources.size () == initNumberOfRes; +} + +static void update () { + + unsigned num_alloc = std :: min (resources.size (), requests.size ()); + + for (unsigned i = 0; i < num_alloc; i ++) { + + SCHED_REQUEST req = requests.front (); + requests.pop (); + + SCHED_RESOURCE res = resources.front (); + resources.pop (); + + printDebugMessage ("allocating a resource."); + initMessage (); + pack (req.second); + pack (res); + sendMessage (req.first, SCHED_RESULT_TAG); + } +} + +void unpackResourceRequest () { + + printDebugMessage ("queuing a resource request."); + SCHED_REQUEST req; + unpack (req); + requests.push (req); + update (); +} + +void unpackTaskDone () { + + printDebugMessage ("I'm notified a worker is now idle."); + SCHED_RESOURCE res; + unpack (res); + resources.push (res); + if (resources.size () == initNumberOfRes) + printDebugMessage ("all the resources are now free."); + update (); +} diff --git a/branches/paradiseo-peo-meta-model/src/rmc/mpi/scheduler.h b/branches/paradiseo-peo-meta-model/src/rmc/mpi/scheduler.h new file mode 100644 index 000000000..2bae123ff --- /dev/null +++ b/branches/paradiseo-peo-meta-model/src/rmc/mpi/scheduler.h @@ -0,0 +1,32 @@ +// "scheduler.h" + +// (c) OPAC Team, LIFL, August 2005 + +/* + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#ifndef __scheduler_h +#define __scheduler_h + +#include + +#include "schema.h" +#include "worker.h" + +typedef std :: pair SCHED_RESOURCE; + +typedef std :: pair SCHED_REQUEST; + +/* Initializing the list of available workers */ +extern void initScheduler (); + +/* Processing a resource request from a service */ +extern void unpackResourceRequest (); + +/* Being known a worker is now idle :-) */ +extern void unpackTaskDone (); + +extern bool allResourcesFree (); + +#endif diff --git a/branches/paradiseo-peo-meta-model/src/rmc/mpi/schema.cpp b/branches/paradiseo-peo-meta-model/src/rmc/mpi/schema.cpp new file mode 100644 index 000000000..fa202b462 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/src/rmc/mpi/schema.cpp @@ -0,0 +1,135 @@ +// "schema.cpp" + +// (c) OPAC Team, LIFL, August 2005 + +/* + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#include +#include + +#include "schema.h" +#include "xml_parser.h" +#include "comm.h" +#include "node.h" +#include "../../core/peo_debug.h" + +std :: vector the_schema; + +Node * my_node; + +RANK_ID getRankOfRunner (RUNNER_ID __key) { + + for (unsigned i = 0; i < the_schema.size (); i ++) + for (unsigned j = 0; j < the_schema [i].id_run.size (); j ++) + if (the_schema [i].id_run [j] == __key) + return the_schema [i].rk; + assert (false); + return 0; +} + +static void loadNode (int __rk_sched) { + + Node node; + + node.rk_sched = __rk_sched; + + /* ATT: name*/ + node.rk = getRankFromName (getAttributeValue ("name")); + /* ATT: num_workers */ + node.num_workers = atoi (getAttributeValue ("num_workers").c_str ()); + + while (true) { + + /* TAG: | */ + std :: string name = getNextNode (); + assert (name == "runner" || name == "node"); + if (name == "runner") { + /* TAG: */ + node.id_run.push_back (atoi (getNextNode ().c_str ())); + /* TAG:
*/ + assert (getNextNode () == "runner"); + } + else { + /* TAG: */ + the_schema.push_back (node); + break; + } + } +} + +static void loadGroup () { + + std :: string name; + + /* ATT: scheduler*/ + int rk_sched = getRankFromName (getAttributeValue ("scheduler")); + + while (true) { + + /* TAG: | */ + name = getNextNode (); + assert (name == "node" || name == "group"); + if (name == "node") + /* TAG: */ + loadNode (rk_sched); + else + /* TAG: */ + break; + } +} + +bool isScheduleNode () { + + return my_node -> rk == my_node -> rk_sched; +} + +void loadSchema (const char * __filename) { + + openXMLDocument (__filename); + + std :: string name; + + /* TAG: */ + name = getNextNode (); + assert (name == "schema"); + + while (true) { + + /* TAG: | */ + name = getNextNode (); + assert (name == "group" || name == "schema"); + if (name == "group") + /* TAG: */ + loadGroup (); + else + /* TAG: */ + break; + } + + /* Looking for my node */ + for (unsigned i = 0; i < the_schema.size (); i ++) + if (the_schema [i].rk == getNodeRank ()) + my_node = & (the_schema [i]); + + /* About me */ + char mess [1000]; + + sprintf (mess, "my rank is %d", my_node -> rk); + printDebugMessage (mess); + if (isScheduleNode ()) + printDebugMessage ("I'am a scheduler"); + for (unsigned i = 0; i < my_node -> id_run.size (); i ++) { + sprintf (mess, "I manage the runner %d", my_node -> id_run [i]); + printDebugMessage (mess); + } + if (my_node -> num_workers) { + + sprintf (mess, "I manage %d worker(s)", my_node -> num_workers); + printDebugMessage (mess); + } + + closeXMLDocument (); +} + diff --git a/branches/paradiseo-peo-meta-model/src/rmc/mpi/schema.h b/branches/paradiseo-peo-meta-model/src/rmc/mpi/schema.h new file mode 100644 index 000000000..4a16ce15e --- /dev/null +++ b/branches/paradiseo-peo-meta-model/src/rmc/mpi/schema.h @@ -0,0 +1,39 @@ +// "schema.h" + +// (c) OPAC Team, LIFL, August 2005 + +/* + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#ifndef __schema_h +#define __schema_h + +#include +#include +#include + +#include "../../core/runner.h" + +typedef int RANK_ID; + +struct Node { + + RANK_ID rk; /* Rank */ + std :: string name; /* Host name */ + unsigned num_workers; /* Number of parallel workers */ + int rk_sched; /* rank of the scheduler */ + std :: vector id_run; /* List of runners */ +}; + +extern std :: vector the_schema; + +extern Node * my_node; + +extern void loadSchema (const char * __filename); + +extern RANK_ID getRankOfRunner (RUNNER_ID __key); + +extern bool isScheduleNode (); + +#endif diff --git a/branches/paradiseo-peo-meta-model/src/rmc/mpi/send.cpp b/branches/paradiseo-peo-meta-model/src/rmc/mpi/send.cpp new file mode 100644 index 000000000..a6c7288af --- /dev/null +++ b/branches/paradiseo-peo-meta-model/src/rmc/mpi/send.cpp @@ -0,0 +1,116 @@ +// "send.cpp" + +// (c) OPAC Team, LIFL, August 2005 + +/* + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#include +#include +#include + +#include "tags.h" +#include "comm.h" +#include "worker.h" +#include "scheduler.h" +#include "mess.h" +#include "node.h" +#include "../../core/cooperative.h" +#include "../../core/peo_debug.h" + +#define TO_ALL -1 + +typedef struct { + + Communicable * comm; + int to; + int tag; + +} SEND_REQUEST; + +static std :: queue mess; + +static sem_t sem_send; + +void initSending () { + + sem_init (& sem_send, 0, 1); +} + +void send (Communicable * __comm, int __to, int __tag) { + + SEND_REQUEST req; + req.comm = __comm; + req.to = __to; + req.tag = __tag; + + sem_wait (& sem_send); + mess.push (req); + sem_post (& sem_send); + wakeUpCommunicator (); +} + +void sendToAll (Communicable * __comm, int __tag) { + + send (__comm, TO_ALL, __tag); +} + +void sendMessages () { + + sem_wait (& sem_send); + + while (! mess.empty ()) { + + SEND_REQUEST req = mess.front (); + /* + char b [1000]; + sprintf (b, "traitement send %d\n", req.tag); + printDebugMessage (b); + */ + + Communicable * comm = req.comm; + + initMessage (); + + switch (req.tag) { + + case RUNNER_STOP_TAG: + dynamic_cast (comm) -> packTermination (); + dynamic_cast (comm) -> notifySendingTermination (); + break; + + case COOP_TAG: + dynamic_cast (comm) -> pack (); + dynamic_cast (comm) -> notifySending (); + break; + + case SCHED_REQUEST_TAG: + dynamic_cast (comm) -> packResourceRequest (); + dynamic_cast (comm) -> notifySendingResourceRequest (); + break; + + case TASK_RESULT_TAG: + dynamic_cast (comm) -> packResult (); + dynamic_cast (comm) -> notifySendingResult (); + break; + + case TASK_DONE_TAG: + dynamic_cast (comm) -> packTaskDone (); + dynamic_cast (comm) -> notifySendingTaskDone (); + break; + + default : + break; + + }; + + if (req.to == TO_ALL) + sendMessageToAll (req.tag); + else + sendMessage (req.to, req.tag); + mess.pop (); + } + + sem_post (& sem_send); +} diff --git a/branches/paradiseo-peo-meta-model/src/rmc/mpi/send.h b/branches/paradiseo-peo-meta-model/src/rmc/mpi/send.h new file mode 100644 index 000000000..ddf264440 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/src/rmc/mpi/send.h @@ -0,0 +1,22 @@ +// "send.h" + +// (c) OPAC Team, LIFL, August 2005 + +/* + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#ifndef __send_h +#define __send_h + +#include "../../core/communicable.h" + +extern void initSending (); + +extern void send (Communicable * __comm, int __to, int __tag); + +extern void sendToAll (Communicable * __comm, int __tag); + +extern void sendMessages (); + +#endif diff --git a/branches/paradiseo-peo-meta-model/src/rmc/mpi/service.cpp b/branches/paradiseo-peo-meta-model/src/rmc/mpi/service.cpp new file mode 100644 index 000000000..93647f035 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/src/rmc/mpi/service.cpp @@ -0,0 +1,30 @@ +// "service.h" + +// (c) OPAC Team, LIFL, August 2005 + +/* + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#include "../../core/service.h" +#include "../../core/messaging.h" +#include "node.h" +#include "tags.h" +#include "send.h" +#include "scheduler.h" + +void Service :: requestResourceRequest (unsigned __how_many) { + + num_sent_rr = __how_many; + for (unsigned i = 0; i < __how_many; i ++) + send (this, my_node -> rk_sched, SCHED_REQUEST_TAG); +} + +void Service :: packResourceRequest () { + + SCHED_REQUEST req; + req.first = getNodeRank (); + req.second = getKey (); + // printf ("demande de ressource pour %d\n", req.second); + :: pack (req); +} diff --git a/branches/paradiseo-peo-meta-model/src/rmc/mpi/tags.h b/branches/paradiseo-peo-meta-model/src/rmc/mpi/tags.h new file mode 100644 index 000000000..ce29a7b80 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/src/rmc/mpi/tags.h @@ -0,0 +1,24 @@ +// "tags.h" + +// (c) OPAC Team, LIFL, August 2005 + +/* + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#ifndef __tags_h +#define __tags_h + +#define RUNNER_STOP_TAG 13 + +#define COOP_TAG 14 + +#define SCHED_REQUEST_TAG 16 + +#define SCHED_RESULT_TAG 17 +#define TASK_DATA_TAG 18 + +#define TASK_RESULT_TAG 19 +#define TASK_DONE_TAG 20 + +#endif diff --git a/branches/paradiseo-peo-meta-model/src/rmc/mpi/worker.cpp b/branches/paradiseo-peo-meta-model/src/rmc/mpi/worker.cpp new file mode 100644 index 000000000..3fc4218e1 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/src/rmc/mpi/worker.cpp @@ -0,0 +1,93 @@ +// "worker.cpp" + +// (c) OPAC Team, LIFL, August 2005 + +/* + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#include + +#include "tags.h" +#include "send.h" +#include "node.h" +#include "schema.h" +#include "worker.h" +#include "mess.h" +#include "../../core/peo_debug.h" + +static std :: vector key_to_worker (1); /* Vector of registered workers */ + +Worker * getWorker (WORKER_ID __key) { + + return key_to_worker [__key]; +} + +Worker :: Worker () { + + toto = false; + id = key_to_worker.size (); + key_to_worker.push_back (this); +} + +void Worker :: packResult () { + + pack (serv_id); + serv -> packResult (); +} + +void Worker :: unpackData () { + + printDebugMessage ("unpacking the ID. of the service."); + unpack (serv_id); + serv = getService (serv_id); + printDebugMessage ("found the service."); + serv -> unpackData (); + printDebugMessage ("unpacking the data."); + setActive (); +} + +void Worker :: packTaskDone () { + + pack (getNodeRank ()); + pack (id); +} + +void Worker :: notifySendingResult () { + + /* Notifying the scheduler of the termination */ + toto = true; + wakeUp (); +} + +void Worker :: notifySendingTaskDone () { + + setPassive (); +} + +void Worker :: setSource (int __rank) { + + src = __rank; +} + +void Worker :: start () { + + while (true) { + + sleep (); + + if (! atLeastOneActiveRunner ()) + break; + + if (toto) { + send (this, my_node -> rk_sched, TASK_DONE_TAG); + toto = false; + } + else { + + printDebugMessage ("executing the task."); + serv -> execute (); + send (this, src, TASK_RESULT_TAG); + } + } +} diff --git a/branches/paradiseo-peo-meta-model/src/rmc/mpi/worker.h b/branches/paradiseo-peo-meta-model/src/rmc/mpi/worker.h new file mode 100644 index 000000000..e47d5cc35 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/src/rmc/mpi/worker.h @@ -0,0 +1,50 @@ +// "worker.h" + +// (c) OPAC Team, LIFL, August 2005 + +/* + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#ifndef __worker_h +#define __worker_h + +#include "../../core/communicable.h" +#include "../../core/reac_thread.h" +#include "../../core/service.h" + +typedef unsigned WORKER_ID; + +class Worker : public Communicable, public ReactiveThread { + +public : + + Worker (); + + void start (); + + void packResult (); + + void unpackData (); + + void packTaskDone (); + + void notifySendingResult (); + + void notifySendingTaskDone (); + + void setSource (int __rank); + +private : + + WORKER_ID id; + SERVICE_ID serv_id; + Service * serv; + int src; + + bool toto; +}; + +extern Worker * getWorker (WORKER_ID __key); + +#endif diff --git a/branches/paradiseo-peo-meta-model/src/rmc/mpi/xml_parser.cpp b/branches/paradiseo-peo-meta-model/src/rmc/mpi/xml_parser.cpp new file mode 100644 index 000000000..75436c477 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/src/rmc/mpi/xml_parser.cpp @@ -0,0 +1,75 @@ +// "xml_parser.h" + +// (c) OPAC Team, LIFL, August 2005 + +/* + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#include + +#include "xml_parser.h" + +static xmlTextReaderPtr reader; + +void openXMLDocument (const char * __filename) { + + reader = xmlNewTextReaderFilename (__filename); + + if (! reader) { + + fprintf (stderr, "unable to open '%s'.\n", __filename); + exit (1); + } +} + +void closeXMLDocument () { + + xmlFreeTextReader (reader); +} + +std :: string getAttributeValue (const std :: string & __attr) { + + xmlChar * value = xmlTextReaderGetAttribute (reader, (const xmlChar *) __attr.c_str ()); + + std :: string str ((const char *) value); + + xmlFree (value); + + return str; +} + +static bool isSep (const xmlChar * __text) { + + for (unsigned i = 0; i < strlen ((char *) __text); i ++) + if (__text [i] != ' ' && __text [i] != '\t' && __text [i] != '\n') + return false; + return true; +} + +std :: string getNextNode () { + + xmlChar * name, * value; + + do { + xmlTextReaderRead (reader); + name = xmlTextReaderName (reader); + value = xmlTextReaderValue (reader); + // printf ("value = %s\n", value); + } while (! strcmp ((char *) name, "#text") && isSep (value)); + + std :: string str; + + if (strcmp ((char *) name, "#text")) + str.assign ((char *) name); + else + str.assign ((char *) value); + + if (name) + xmlFree (name); + if (value) + xmlFree (value); + + return str; +} + diff --git a/branches/paradiseo-peo-meta-model/src/rmc/mpi/xml_parser.h b/branches/paradiseo-peo-meta-model/src/rmc/mpi/xml_parser.h new file mode 100644 index 000000000..169bb0288 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/src/rmc/mpi/xml_parser.h @@ -0,0 +1,22 @@ +// "xml_parser.h" + +// (c) OPAC Team, LIFL, August 2005 + +/* + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#ifndef __xml_parser_h +#define __xml_parser_h + +#include + +extern void openXMLDocument (const char * __filename); + +extern void closeXMLDocument (); + +extern std :: string getAttributeValue (const std :: string & __attr); + +extern std :: string getNextNode (); + +#endif diff --git a/branches/paradiseo-peo-meta-model/tutorial/CMakeLists.txt b/branches/paradiseo-peo-meta-model/tutorial/CMakeLists.txt new file mode 100644 index 000000000..00c6290e5 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/tutorial/CMakeLists.txt @@ -0,0 +1,16 @@ +# +##################################################################################### +### 1) Definitions (required for tsp target) +###################################################################################### + +SET(TSP_SRC_DIR ${ParadisEO-PEO_SOURCE_DIR}/tutorial/examples/tsp) +SET(TSP_BINARY_DIR ${ParadisEO-PEO_BINARY_DIR}/tutorial/examples/tsp) +###################################################################################### + +###################################################################################### +### 2) Where must cmake go now ? +###################################################################################### + +SUBDIRS(examples Lesson1 Lesson2 Lesson3 Walkthrough) + +###################################################################################### diff --git a/branches/paradiseo-peo-meta-model/tutorial/Lesson1/CMakeLists.txt b/branches/paradiseo-peo-meta-model/tutorial/Lesson1/CMakeLists.txt new file mode 100644 index 000000000..120a82625 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/tutorial/Lesson1/CMakeLists.txt @@ -0,0 +1,89 @@ + +###################################################################################### +### 0) Set the compiler and define targets to easily run the lessons +###################################################################################### + +SET (CMAKE_CXX_COMPILER mpicxx) + +ADD_CUSTOM_TARGET(install DEPENDS ${ParadisEO-PEO_SOURCE_DIR}/tutorial/Lesson1/lesson.param ${ParadisEO-PEO_SOURCE_DIR}/tutorial/Lesson1/schema.xml) + +ADD_CUSTOM_COMMAND( + TARGET install + POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different + ${ParadisEO-PEO_SOURCE_DIR}/tutorial/Lesson1/lesson.param + ${ParadisEO-PEO_BINARY_DIR}/tutorial/Lesson1) +ADD_CUSTOM_COMMAND( + TARGET install + POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different + ${ParadisEO-PEO_SOURCE_DIR}/tutorial/Lesson1/schema.xml + ${ParadisEO-PEO_BINARY_DIR}/tutorial/Lesson1) +###################################################################################### + + +###################################################################################### +### 1) Include the sources +###################################################################################### + +INCLUDE_DIRECTORIES(${EO_SRC_DIR}) +INCLUDE_DIRECTORIES(${MO_SRC_DIR}) +INCLUDE_DIRECTORIES(${PEO_SRC_DIR}) +INCLUDE_DIRECTORIES(${TSP_SRC_DIR}) + +###################################################################################### + + +###################################################################################### +### 2) Specify where CMake can find the libraries (mandatory: before 3) ) +###################################################################################### + +LINK_DIRECTORIES( ${EO_SRC_DIR} + ${EO_SRC_DIR}/utils + ${ParadisEO-PEO_BINARY_DIR}/lib + ${TSP_BINARY_DIR}/lib) + +###################################################################################### + + +###################################################################################### +### 3) Define your target(s): just an executable here +###################################################################################### + +# no matter what is the OS, hopefully +ADD_EXECUTABLE(tspExample main.cpp) + +ADD_DEPENDENCIES(tspExample tsp) +ADD_DEPENDENCIES(tspExample peo) +ADD_DEPENDENCIES(tspExample rmc_mpi) +###################################################################################### + + +###################################################################################### +### 4) Optionnal: define your target(s)'s version: no effect for windows +###################################################################################### + +SET(LESSON1_VERSION "1.0.beta") +SET_TARGET_PROPERTIES(tspExample PROPERTIES VERSION "${LESSON1_VERSION}") +###################################################################################### + + +###################################################################################### +### 5) Link the librairies +###################################################################################### + +TARGET_LINK_LIBRARIES(tspExample ${XML2_LIBS}) # define in CMakeLists.txt at PEO root dir +TARGET_LINK_LIBRARIES(tspExample tsp) +TARGET_LINK_LIBRARIES(tspExample peo) +TARGET_LINK_LIBRARIES(tspExample rmc_mpi) +TARGET_LINK_LIBRARIES(tspExample eo) +TARGET_LINK_LIBRARIES(tspExample eoutils) + +###################################################################################### + + + + + diff --git a/branches/paradiseo-peo-meta-model/tutorial/Lesson1/ParadisEO-PEO_Lesson1.pdf b/branches/paradiseo-peo-meta-model/tutorial/Lesson1/ParadisEO-PEO_Lesson1.pdf new file mode 100755 index 000000000..04f8e0174 Binary files /dev/null and b/branches/paradiseo-peo-meta-model/tutorial/Lesson1/ParadisEO-PEO_Lesson1.pdf differ diff --git a/branches/paradiseo-peo-meta-model/tutorial/Lesson1/doclsn.h b/branches/paradiseo-peo-meta-model/tutorial/Lesson1/doclsn.h new file mode 100644 index 000000000..544edc583 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/tutorial/Lesson1/doclsn.h @@ -0,0 +1,498 @@ +//! \mainpage Creating a simple ParadisEO-PEO Evolutionary Algorithm +//! +//! \section structure Introduction +//! +//! One of the first steps in designing an evolutionary algorithm using the ParadisEO-PEO framework +//! consists in having a clear overview of the implemented algorithm. A brief pseudo-code description is offered +//! bellow - the entire source code for the ParadisEO-PEO evolutionary algorithm is defined in the peoEA.h +//! header file. The main elements to be considered when building an evolutionary algorithm are the transformation +//! operators, i.e. crossover and mutation, the evaluation function, the continuation criterion and the selection +//! and replacement strategy. +//! +//! +//! +//! +//! +//! +//! +//! +//!
do {    
         select( population, offsprings );   // select the offsprings from the current population
         transform( offsprings );   // crossover and mutation operators are applied on the selected offsprings
         evaluate( offsprings );   // evaluation step of the resulting offsprings
         replace( population, offsprings );   // replace the individuals in the current population whith individuals from the offspring population, according to a specified replacement strategy
} while ( eaCheckpointContinue( population ) );   // checkpoint operators are applied on the current population
+//! +//! The peoEA class offers an elementary evolutionary algorithm implementation. The peoEA class has the underlying structure +//! for including parallel evaluation and parallel transformation operators, migration operators etc. Although there is +//! no restriction on using the algorithms provided by the EO framework, no parallelism is provided - the EO implementation is exclusively sequential. +//!
+//! +//! \section requirements Requirements +//! +//! You should have already installed the ParadisEO-PEO package - this requires several additional packages which should be already +//! included in the provided archive. The installation script has to be launched in order to configure and compile all the required +//! components. At the end of the installation phase you should end up having a directory tree resembling the following: +//! +//!
     ... +//!
     paradiseo-mo +//!
     paradiseo-moeo +//!
     paradiseo-peo +//!
            docs +//!
            examples +//!
                   lesson1 +//!
                   lesson2 +//!
                   ... +//!
                   shared +//!
                   ... +//!
            src +//!
            ... +//!
     ... +//!
+//!
+//! +//! The source-code for this tutorial may be found in the paradiseo-peo/examples/lesson1 directory, in the main.cpp file. +//! We strongly encourage creating a backup copy of the file if you consider modifying the source code. For a complete reference on the +//! TSP-related classes and definitions please refer to the files under the paradiseo-peo/examples/shared. After the installation +//! phase you should end up having an tspExample executable file in the paradiseo-peo/examples/lesson1 directory. +//! We will discuss testing and launching aspects later in the tutorial. +//! +//! You are supposed to be familiar with working in C/C++ (with an extensive use of templates) and you should have at least an introductory +//! background in working with the EO framework. +//! +//!
+//! NOTE: All the presented examples have as case study the Traveling Salesman Problem (TSP). All the presented tutorials rely +//! on a common shared source code defining transformation operators, +//! evaluation functions, etc. for the TSP problem. For a complete understanding of the presented tutorials please take your time for +//! consulting and for studying the additional underlying defined classes. +//!

+//! +//! \section problemDef Problem Definition and Representation +//! +//! As we are not directly concerned with the Traveling Salesman Problem, and to some extent out of scope, no in depth details are offered +//! for the TSP. The problem requires finding the shortest path connecting a given set of cities, while visiting each of +//! the specified cities only once and returning to the startpoint city. The problem is known to be NP-complete, i.e. no polynomial +//! time algorithm exists for solving the problem in exact manner. +//! +//! The construction of a ParadisEO-PEO evolutionary algorithm requires following a few simple steps - please take your time to study the signature +//! of the peoEA constructor: +//! +//! +//! +//! +//!
+//!      peoEA( +//!
            eoContinue< EOT >& __cont, +//!
            peoPopEval< EOT >& __pop_eval, +//!
            eoSelect< EOT >& __select, +//!
            peoTransform< EOT >& __trans, +//!
            eoReplacement< EOT >& __replace +//!
     ); +//!
+//! \image html peoEA.png +//!
+//! +//! A few remarks have to be made: while most of the parameters are passed as EO-specific types, the evaluation and the transformation objects have to be +//! derived from the ParadisEO-PEO peoPopEval and peoTransform classes. Derived classes like the peoParaPopEval and peoParaSGATransform classes allow +//! for parallel evaluation of the population and parallel transformation operators, respectively. Wrappers are provided thus allowing to make use +//! of the EO classes. +//! +//! In the followings, the main required elements for building an evolutionary algorithm are enumerated. For complete details regarding the +//! implementation aspects of each of the components, please refer to the common shared source code. +//! Each of the bellow referred header files may be found in the pardiseo-peo/examples/shared directory. +//! +//!
    +//!
  1. representation - the first decision to be taken concerns the representation of the individuals. You may create your +//! own representation or you may use/derive one of the predefined classes of the EO framework.
    +//! +//! For our case study, the TSP, each city is defined as a Node in the node.h header file - in fact an unsigned value defined +//! as typedef unsigned Node. Moreover, each individual (of the evolutionary algorithm) is represented as a Route object, a vector of Node objects, in +//! the route.h header file - typedef eoVector< int, Node > Route. The definition of the Route object implies two +//! elements: (1) a route is a vector of nodes, and (2) the fitness is an integer value (please refer to the eoVector +//! definition in the EO framework). +//! +//! In addition you should also take a look in the route_init.h header file which includes the RouteInit class, defined for +//! initializing in random manner Route objects. +//!
  2. +//!
  3. evaluation function - having a representation model, an evaluation object has to be defined, implementing a specific +//! fitness function. The designed class has to be derived (directly or indirectly) from the peoPopEval class - you have the choice of +//! using peoSeqPopEval or peoParaPopEval for sequential and parallel evaluation, respectively. These classes act as wrappers requiring +//! the specification of an EO evaluation object derived from the eoEvalFunc class - please refer to their respective documentation.
    +//! +//! The fitness function for our TSP case study is implemented in the route_eval.h header file. The class is derived from the eoEvalFunc +//! EO class, being defined as class RouteEval : public eoEvalFunc< Route >. +//!
  4. +//!
  5. transformation operators - in order to assure the evolution of the initial population, transformation operators have to be defined. +//! Depending on your problem, you may specify quadruple operators (two input individuals, two output resulting individuals), i.e. crossover operators, +//! binary operators (one input individual and one output resulting individual), i.e. mutation operators, or combination of both types. As for the +//! evaluation function, the signature of the peoEA constructor requires specifying a peoTransform derived object as transformation operator. +//! +//! The transform operators, crossover and mutation, for the herein presented example are defined in the order_xover.h and the city_swap.h +//! header files, respectively. +//!
  6. +//!
  7. continuation criterion - the evolutionary algorithm evolves in an iterative manner; a continuation criterion has to be specified. +//! One of the most common and simplest options considers a maximum number of generations. It is your choice whether to use +//! a predefined EO class for specifying the continuation criterion or using a custom defined class. In the later case you have to +//! make sure that your class derives the eoContinue class.
    +//!
  8. +//!
  9. selection strategy - at each iteration a set of individuals are selected for applying the transform operators, in order +//! to obtain the offspring population. As the specified parameter has to be derived from the eoSelect it is your option of whether using +//! the EO provided selection strategies or implementing your own, as long as it inherits the eoSelect class. +//! +//! For our example we chose to use the eoRankingSelect strategy, provided in the EO framework. +//!
  10. +//!
  11. replacement strategy - once the offspring population is obtained, the offsprings have to be integrated back into the initial +//! population, according to a given strategy. For custom defined strategies you have to inherit the eoReplacement EO class. We chose to +//! use an eoPlusReplacement as strategy (please review the EO documentation for details on the different strategies available). +//!
  12. +//!
+//!
+//! +//! \section example A simple example for constructing a peoEA object +//! +//! The source code for this example may be found in the main.cpp file, under the paradiseo-peo/examples/lesson1 directory. Please make sure you +//! At this point you have two options: (a) you can just follow the example without touching the main.cpp or, (b) you can start from scratch, +//! following the presented steps, in which case you are required make a backup copy of the main.cpp file and replace the original file with an +//! empty one. +//! +//!
    +//!
  1. include the necessary header files - as we will be using Route objects, we have to include the files +//! which define the Route type, the initializing functor and the evaluation functions. Furthermore, in order to make use of +//! transform operators, we require having the headers which define the crossover and the mutation operators. +//! All these files may be found in the shared directory that we mentioned in the beginning. At this point you +//! should have something like the following:
    +//! +//!
    +//!		##include "route.h"
    +//!		##include "route_init.h"
    +//!		##include "route_eval.h"
    +//!		
    +//!		##include "order_xover.h"
    +//!		##include "city_swap.h"
    +//!		
    +//! In addition we require having the paradiseo header file, in order to use the ParadisEO-PEO features, and a header specific +//! for our problem, dealing with processing command-line parameters - the param.h header file. The complete picture at this point +//! with all the required header files is as follows:
    +//! +//!
    +//!		##include "route.h"
    +//!		##include "route_init.h"
    +//!		##include "route_eval.h"
    +//!		
    +//!		##include "order_xover.h"
    +//!		##include "city_swap.h"
    +//!
    +//!		##include "param.h"
    +//!
    +//!		##include <paradiseo>
    +//!		
    +//! NOTE: the paradiseo header file is in fact a "super-header" - it includes all the esential ParadisEO-PEO header files. +//! It is at at your choice if you want use the paradiseo header file or to explicitly include different header files, +//! like the peoEA.h header file, for example. +//! +//!
  2. +//!
  3. define problem specific parameters - in our case we have to specify how many individuals we want to have in our population, the number +//! of generations for the evolutionary algorithm to iterate and the probabilities associated with the crossover and mutation operators.
    +//! +//!
    +//!		##include "route.h"
    +//!		##include "route_init.h"
    +//!		##include "route_eval.h"
    +//!		
    +//!		##include "order_xover.h"
    +//!		##include "city_swap.h"
    +//!
    +//!		##include "param.h"
    +//!
    +//!		##include <paradiseo>
    +//!
    +//!
    +//!		##define POP_SIZE 10
    +//!		##define NUM_GEN 100
    +//!		##define CROSS_RATE 1.0
    +//!		##define MUT_RATE 0.01
    +//!		
    +//!
  4. +//!
  5. construct the skeleton of a simple ParadisEO-PEO program - the main function including the code for initializing the ParadisEO-PEO +//! environment, for loading problem data and for shutting down the ParadisEO-PEO environment. From this point on we will make +//! abstraction of the previous part referring only to the main function.
    +//! +//!
    +//!		...
    +//!		
    +//!		int main( int __argc, char** __argv ) {
    +//!		
    +//!			// initializing the ParadisEO-PEO environment
    +//!			peo :: init( __argc, __argv );
    +//!		
    +//!			// processing the command line specified parameters
    +//!			loadParameters( __argc, __argv );
    +//!		
    +//!
    +//!			// EVOLUTIONARY ALGORITHM TO BE DEFINED
    +//!
    +//!		
    +//!			peo :: run( );
    +//!			peo :: finalize( );
    +//!			// shutting down the ParadisEO-PEO environment
    +//!		
    +//!			return 0;
    +//!		}
    +//!		
    +//!
  6. +//!
  7. initialization functors, evaluation function and transform operators - basically we only need to create instances for each of the +//! enumerated objects, to be passed later as parameters for higher-level components of the evolutionary algorithm.
    +//! +//!
    +//!		RouteInit route_init;	// random init object - creates random Route objects
    +//!		RouteEval full_eval;	// evaluator object - offers a fitness value for a specified Route object
    +//!
    +//!		OrderXover crossover;	// crossover operator - creates two offsprings out of two specified parents
    +//!		CitySwap mutation;	// mutation operator - randomly mutates one gene for a specified individual
    +//!		
    +//!
  8. +//!
  9. construct the components of the evolutionary algorithm - each of the components that has to be passed as parameter to the +//! peoEA constructor has to be defined along with the associated parameters. Except for the requirement to provide the +//! appropriate objects (for example, a peoPopEval derived object must be specified for the evaluation functor), there is no strict +//! path to follow. It is your option what elements to mix, depending on your problem - we aimed for simplicity in our example. +//! +//!
      +//!
    • an initial population has to be specified; the constructor accepts the specification of an initializing object. Further, +//! an evaluation object is required - the peoEA constructor requires a peoPopEval derived class. +//!
    • +//!
    +//!
    +//!		eoPop< Route > population( POP_SIZE, route_init );	// initial population for the algorithm having POP_SIZE individuals
    +//!		peoSeqPopEval< Route > eaPopEval( full_eval );		// evaluator object - to be applied at each iteration on the entire population
    +//!		
    +//!
      +//!
    • the evolutionary algorithm continues to iterate till a continuation criterion is not met. For our case we consider +//! a fixed number of generations. The continuation criterion has to be specified as a checkpoint object, thus requiring +//! the creation of an eoCheckPoint object in addition. +//!
    • +//!
    +//!
    +//!		eoGenContinue< Route > eaCont( NUM_GEN );		// continuation criterion - the algorithm will iterate for NUM_GEN generations
    +//!		eoCheckPoint< Route > eaCheckpointContinue( eaCont );	// checkpoint object - verify at each iteration if the continuation criterion is met
    +//!		
    +//!
      +//!
    • selection strategy - we are required to specify a selection strategy for extracting individuals out of the parent +//! population; in addition the number of individuals to be selected has to be specified. +//!
    • +//!
    +//!
    +//!		eoRankingSelect< Route > selectionStrategy;		// selection strategy - applied at each iteration for selecting parent individuals
    +//!		eoSelectNumber< Route > eaSelect( selectionStrategy, POP_SIZE ); // selection object - POP_SIZE individuals are selected at each iteration
    +//!		
    +//!
      +//!
    • transformation operators - we have to integrate the crossover and the mutation functors into an object which may be passed +//! as a parameter when creating the peoEA object. The constructor of peoEA requires a peoTransform derived +//! object. Associated probabilities have to be specified also. +//!
    • +//!
    +//!
    +//!		// transform operator - includes the crossover and the mutation operators with a specified associated rate
    +//!		eoSGATransform< Route > transform( crossover, CROSS_RATE, mutation, MUT_RATE );
    +//!		peoSeqTransform< Route > eaTransform( transform );	// ParadisEO transform operator (please remark the peo prefix) - wraps an e EO transform object
    +//!		
    +//!
      +//!
    • replacement strategy - required for defining the way for integrating the resulting offsprings into the initial population. +//! At your option whether you would like to chose one of the predefined replacement strategies that come with the EO framework +//! or if you want to define your own. +//!
    • +//!
    +//!
    +//!		eoPlusReplacement< Route > eaReplace;			// replacement strategy - for replacing the initial population with offspring individuals
    +//!		
    +//!
  10. +//!
  11. evolutionary algorithm - having defined all the previous components, we are ready for instanciating an evolutionary algorithm. +//! In the end we have to associate a population with the algorithm, which will serve as the initial population, to be iteratively evolved. +//! +//!
    +//!		peoEA< Route > eaAlg( eaCheckpointContinue, eaPopEval, eaSelect, eaTransform, eaReplace );
    +//!
    +//!		eaAlg( population );	// specifying the initial population for the algorithm, to be iteratively evolved
    +//!		
    +//!
  12. +//!
+//! +//! If you have not missed any of the enumerated points, your program should be like the following: +//! +//!
+//! ##include "route.h"
+//! ##include "route_init.h"
+//! ##include "route_eval.h"
+//! 
+//! ##include "order_xover.h"
+//! ##include "city_swap.h"
+//! 
+//! ##include "param.h"
+//! 
+//! ##include 
+//! 
+//! 
+//! ##define POP_SIZE 10
+//! ##define NUM_GEN 100
+//! ##define CROSS_RATE 1.0
+//! ##define MUT_RATE 0.01
+//! 
+//! 
+//! int main( int __argc, char** __argv ) {
+//! 
+//! 	// initializing the ParadisEO-PEO environment
+//! 	peo :: init( __argc, __argv );
+//! 
+//! 
+//! 	// processing the command line specified parameters
+//! 	loadParameters( __argc, __argv );
+//! 
+//! 
+//! 	// init, eval operators, EA operators -------------------------------------------------------------------------------------------------------------
+//! 
+//! 	RouteInit route_init;	// random init object - creates random Route objects
+//! 	RouteEval full_eval;	// evaluator object - offers a fitness value for a specified Route object
+//! 
+//! 	OrderXover crossover;	// crossover operator - creates two offsprings out of two specified parents
+//! 	CitySwap mutation;	// mutation operator - randomly mutates one gene for a specified individual
+//! 	// ------------------------------------------------------------------------------------------------------------------------------------------------
+//! 
+//! 
+//! 	// evolutionary algorithm components --------------------------------------------------------------------------------------------------------------
+//! 
+//! 	eoPop< Route > population( POP_SIZE, route_init );	// initial population for the algorithm having POP_SIZE individuals
+//! 	peoSeqPopEval< Route > eaPopEval( full_eval );		// evaluator object - to be applied at each iteration on the entire population
+//! 
+//! 	eoGenContinue< Route > eaCont( NUM_GEN );		// continuation criterion - the algorithm will iterate for NUM_GEN generations
+//! 	eoCheckPoint< Route > eaCheckpointContinue( eaCont );	// checkpoint object - verify at each iteration if the continuation criterion is met
+//! 
+//! 	eoRankingSelect< Route > selectionStrategy;		// selection strategy - applied at each iteration for selecting parent individuals
+//! 	eoSelectNumber< Route > eaSelect( selectionStrategy, POP_SIZE ); // selection object - POP_SIZE individuals are selected at each iteration
+//! 
+//! 	// transform operator - includes the crossover and the mutation operators with a specified associated rate
+//! 	eoSGATransform< Route > transform( crossover, CROSS_RATE, mutation, MUT_RATE );
+//! 	peoSeqTransform< Route > eaTransform( transform );	// ParadisEO transform operator (please remark the peo prefix) - wraps an e EO transform object
+//! 
+//! 	eoPlusReplacement< Route > eaReplace;			// replacement strategy - for replacing the initial population with offspring individuals
+//! 	// ------------------------------------------------------------------------------------------------------------------------------------------------
+//! 
+//! 
+//! 	// ParadisEO-PEO evolutionary algorithm -----------------------------------------------------------------------------------------------------------
+//! 
+//! 	peoEA< Route > eaAlg( eaCheckpointContinue, eaPopEval, eaSelect, eaTransform, eaReplace );
+//! 	
+//! 	eaAlg( population );	// specifying the initial population for the algorithm, to be iteratively evolved
+//! 	// ------------------------------------------------------------------------------------------------------------------------------------------------
+//! 
+//! 
+//! 	peo :: run( );
+//! 	peo :: finalize( );
+//! 	// shutting down the ParadisEO-PEO environment
+//! 
+//! 	return 0;
+//! }
+//! 
+//! +//! +//! \section testing Compilation and Execution +//! +//! First, please make sure that you followed all the previous steps in defining the evolutionary algorithm. Your file should be called main.cpp - please +//! make sure you do not rename the file (we will be using a pre-built makefile, thus you are required not to change the file names). Please make sure you +//! are in the paradiseo-peo/examples/lesson1 directory - you should open a console and you should change your current directory to the one of Lesson1. +//! +//! Compilation: being in the paradiseo-peo/examples/lesson1 directory, you have to type make. As a result the main.cpp file +//! will be compiled and you should obtain an executable file called tspExample. If you have errors, please verify any of the followings: +//! +//!
    +//!
  • you are under the right directory - you can verify by typing the pwd command - you should have something like .../paradiseo-peo/examples/lesson1
  • +//!
  • you saved your modifications in a file called main.cpp, in the paradiseo-peo/examples/lesson1 directory
  • +//!
  • there are no differences between the example presented above and your file
  • +//!
+//! +//! NOTE: in order to successfully compile your program you should already have installed an MPI distribution in your system. +//! +//! Execution: the execution of a ParadisEO-PEO program requires having already created an environment for launching MPI programs. For MPICH-2, +//! for example, this requires starting a ring of daemons. The implementation that we provided as an example is sequential and includes no parallelism - we +//! will see in the end how to include also parallelism. Executing a parallel program requires specifying a mapping of resources, in order to assing different +//! algorithms to different machines, define worker machines etc. This mapping is defined by an XML file called schema.xml, which, for our case, has +//! the following structure: +//! +//!
+//!	
+//!	
+//!	
+//!		
+//!			
+//!			
+//!			
+//!			
+//!			1
+//!			
+//!			
+//!			
+//!			
+//!			
+//!			
+//!		
+//!	
+//! 
+//! +//! Not going into details, the XML file presented above describes a mapping which includes four nodes, the first one having the role of scheduler, +//! the second one being the node on which the evolutionary algorithm is actually executed and the third and the fourth ones being slave nodes. Overall +//! the mapping says that we will be launching four processes, out of which only one will be executing the evolutionary algorithm. The other node entries +//! in the XML file have no real functionality as we have no parallelism in our program - the entries were created for you convenience, in order to provide +//! a smooth transition to creating a parallel program. +//! +//! Launching the program may be different, depending on your MPI distribution - for MPICH-2, in a console, in the paradiseo-peo/examples/lesson1 +//! directory you have to type the following command: +//! +//! mpiexec -n 4 ./tspExample @lesson.param +//! +//! NOTE: the "-n 4" indicates the number of processes to be launched. The last argument, "@lesson.param", indicates a file which specifies different +//! application specific parameters (the mapping file to be used, for example, whether to use logging or not, etc). +//! +//! The result of your execution should be similar to the following: +//!
+//! 	Loading '../data/eil101.tsp'.
+//! 	NAME: eil101.
+//! 	COMMENT: 101-city problem (Christofides/Eilon).
+//! 	TYPE: TSP.
+//! 	DIMENSION: 101.
+//! 	EDGE_WEIGHT_TYPE: EUC_2D.
+//! 	Loading '../data/eil101.tsp'.
+//! 	NAME: eil101.
+//! 	COMMENT: 101-city problem (Christofides/Eilon).
+//! 	EOF.
+//! 	TYPE: TSP.
+//! 	DIMENSION: 101.
+//! 	EDGE_WEIGHT_TYPE: EUC_2D.
+//! 	EOF.
+//! 	Loading '../data/eil101.tsp'.
+//! 	NAME: eil101.
+//! 	COMMENT: 101-city problem (Christofides/Eilon).
+//! 	TYPE: TSP.
+//! 	DIMENSION: 101.
+//! 	EDGE_WEIGHT_TYPE: EUC_2D.
+//! 	EOF.
+//! 	Loading '../data/eil101.tsp'.
+//! 	NAME: eil101.
+//! 	COMMENT: 101-city problem (Christofides/Eilon).
+//! 	TYPE: TSP.
+//! 	DIMENSION: 101.
+//! 	EDGE_WEIGHT_TYPE: EUC_2D.
+//! 	EOF.
+//! 	STOP in eoGenContinue: Reached maximum number of generations [100/100]
+//!	
+//! +//! +//! \section paraIntro Introducing parallelism +//! +//! Creating parallel programs with ParadisEO-PEO represents an easy task once you have the basic structure for your program. For experimentation, +//! in the main.cpp file, replace the line +//!
+//!	peoSeqPopEval< Route > eaPopEval( full_eval );
+//! 
+//! with +//!
+//!	peoParaPopEval< Route > eaPopEval( full_eval );
+//! 
+//! The second line only tells that we would like to evaluate individuals in parallel - this is very interesting if you have a time consuming fitness +//! evaluation function. If you take another look on the schema.xml XML file you will see the last two nodes being marked as slaves (the "num_workers" +//! attribute - these nodes will be used for computing the fitness of the individuals. +//! +//! At this point you only have to recompile your program and to launch it again - as we are not using a time consuming fitness fitness function, the +//! effects might not be visible - you may increase the number of individuals to experiment. diff --git a/branches/paradiseo-peo-meta-model/tutorial/Lesson1/lesson.param b/branches/paradiseo-peo-meta-model/tutorial/Lesson1/lesson.param new file mode 100644 index 000000000..eb843c65f --- /dev/null +++ b/branches/paradiseo-peo-meta-model/tutorial/Lesson1/lesson.param @@ -0,0 +1,12 @@ +## miscallenous parameters + +--debug=false + +## deployment schema + +--schema=schema.xml + +## parameters + +--inst=../examples/tsp/benchs/eil101.tsp + diff --git a/branches/paradiseo-peo-meta-model/tutorial/Lesson1/main.cpp b/branches/paradiseo-peo-meta-model/tutorial/Lesson1/main.cpp new file mode 100644 index 000000000..0658fa813 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/tutorial/Lesson1/main.cpp @@ -0,0 +1,79 @@ +// "main.cpp" + +// (c) OPAC Team, LIFL, January 2006 + +/* + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#include "route.h" +#include "route_init.h" +#include "route_eval.h" + +#include "order_xover.h" +#include "city_swap.h" + +#include "param.h" + +#include + + +#define POP_SIZE 10 +#define NUM_GEN 100 +#define CROSS_RATE 1.0 +#define MUT_RATE 0.01 + + +int main( int __argc, char** __argv ) { + + // initializing the ParadisEO-PEO environment + peo :: init( __argc, __argv ); + + + // processing the command line specified parameters + loadParameters( __argc, __argv ); + + + // init, eval operators, EA operators ------------------------------------------------------------------------------------------------------------- + + RouteInit route_init; // random init object - creates random Route objects + RouteEval full_eval; // evaluator object - offers a fitness value for a specified Route object + + OrderXover crossover; // crossover operator - creates two offsprings out of two specified parents + CitySwap mutation; // mutation operator - randomly mutates one gene for a specified individual + // ------------------------------------------------------------------------------------------------------------------------------------------------ + + + // evolutionary algorithm components -------------------------------------------------------------------------------------------------------------- + + eoPop< Route > population( POP_SIZE, route_init ); // initial population for the algorithm having POP_SIZE individuals + peoSeqPopEval< Route > eaPopEval( full_eval ); // evaluator object - to be applied at each iteration on the entire population + + eoGenContinue< Route > eaCont( NUM_GEN ); // continuation criterion - the algorithm will iterate for NUM_GEN generations + eoCheckPoint< Route > eaCheckpointContinue( eaCont ); // checkpoint object - verify at each iteration if the continuation criterion is met + + eoRankingSelect< Route > selectionStrategy; // selection strategy - applied at each iteration for selecting parent individuals + eoSelectNumber< Route > eaSelect( selectionStrategy, POP_SIZE ); // selection object - POP_SIZE individuals are selected at each iteration + + // transform operator - includes the crossover and the mutation operators with a specified associated rate + eoSGATransform< Route > transform( crossover, CROSS_RATE, mutation, MUT_RATE ); + peoSeqTransform< Route > eaTransform( transform ); // ParadisEO transform operator (please remark the peo prefix) - wraps an e EO transform object + + eoPlusReplacement< Route > eaReplace; // replacement strategy - for replacing the initial population with offspring individuals + // ------------------------------------------------------------------------------------------------------------------------------------------------ + + + // ParadisEO-PEO evolutionary algorithm ----------------------------------------------------------------------------------------------------------- + + peoEA< Route > eaAlg( eaCheckpointContinue, eaPopEval, eaSelect, eaTransform, eaReplace ); + + eaAlg( population ); // specifying the initial population for the algorithm, to be iteratively evolved + // ------------------------------------------------------------------------------------------------------------------------------------------------ + + + peo :: run( ); + peo :: finalize( ); + // shutting down the ParadisEO-PEO environment + + return 0; +} diff --git a/branches/paradiseo-peo-meta-model/tutorial/Lesson1/paradiseo-peo-lsn.doxyfile b/branches/paradiseo-peo-meta-model/tutorial/Lesson1/paradiseo-peo-lsn.doxyfile new file mode 100644 index 000000000..b7ecda59e --- /dev/null +++ b/branches/paradiseo-peo-meta-model/tutorial/Lesson1/paradiseo-peo-lsn.doxyfile @@ -0,0 +1,241 @@ +# Doxyfile 1.4.7 + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "ParadisEO-PEO Lesson1" +PROJECT_NUMBER = 0.1 +OUTPUT_DIRECTORY = ../../../doc/html/lesson1 +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 = . +FILE_PATTERNS = *.cpp \ + *.h \ + NEWS \ + README +RECURSIVE = YES +EXCLUDE = +EXCLUDE_SYMLINKS = NO +EXCLUDE_PATTERNS = +EXAMPLE_PATH = +EXAMPLE_PATTERNS = * +EXAMPLE_RECURSIVE = NO +IMAGE_PATH = ../../docs/images +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 = peo +#--------------------------------------------------------------------------- +# 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 = YES +USE_PDFLATEX = YES +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-mo/docs/eo.doxytag=../../../../../paradiseo-mo/docs/html \ + ../../../paradiseo-mo/docs/mo.doxytag=../../../../../paradiseo-mo/docs/html \ + ../../docs/paradiseo-peo.doxytag=../../ \ + ../shared/paradiseo-peo-lsn-shared.doxytag=../../lsnshared/html +GENERATE_TAGFILE = ../../docs/paradiseo-peo-lsn.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/branches/paradiseo-peo-meta-model/tutorial/Lesson1/schema.xml b/branches/paradiseo-peo-meta-model/tutorial/Lesson1/schema.xml new file mode 100644 index 000000000..3edea1488 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/tutorial/Lesson1/schema.xml @@ -0,0 +1,18 @@ + + + + + + + + + 1 + + + + + + + + + diff --git a/branches/paradiseo-peo-meta-model/tutorial/Lesson2/CMakeLists.txt b/branches/paradiseo-peo-meta-model/tutorial/Lesson2/CMakeLists.txt new file mode 100644 index 000000000..dacb594ce --- /dev/null +++ b/branches/paradiseo-peo-meta-model/tutorial/Lesson2/CMakeLists.txt @@ -0,0 +1,90 @@ + +###################################################################################### +### 0) Set the compiler and define targets to easily run the lessons +###################################################################################### + +SET (CMAKE_CXX_COMPILER mpicxx) + +ADD_CUSTOM_TARGET(install DEPENDS ${ParadisEO-PEO_SOURCE_DIR}/tutorial/Lesson2/lesson.param ${ParadisEO-PEO_SOURCE_DIR}/tutorial/Lesson2/schema.xml) + +ADD_CUSTOM_COMMAND( + TARGET install + POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different + ${ParadisEO-PEO_SOURCE_DIR}/tutorial/Lesson2/lesson.param + ${ParadisEO-PEO_BINARY_DIR}/tutorial/Lesson2) +ADD_CUSTOM_COMMAND( + TARGET install + POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different + ${ParadisEO-PEO_SOURCE_DIR}/tutorial/Lesson2/schema.xml + ${ParadisEO-PEO_BINARY_DIR}/tutorial/Lesson2) +###################################################################################### + + +###################################################################################### +### 1) Include the sources +###################################################################################### + +INCLUDE_DIRECTORIES(${EO_SRC_DIR}) +INCLUDE_DIRECTORIES(${MO_SRC_DIR}) +INCLUDE_DIRECTORIES(${PEO_SRC_DIR}) +INCLUDE_DIRECTORIES(${TSP_SRC_DIR}) + +###################################################################################### + + +###################################################################################### +### 2) Specify where CMake can find the libraries (mandatory: before 3) ) +###################################################################################### + +LINK_DIRECTORIES( ${EO_SRC_DIR} + ${EO_SRC_DIR}/utils + ${ParadisEO-PEO_BINARY_DIR}/lib + ${TSP_BINARY_DIR}/lib) + +###################################################################################### + + +###################################################################################### +### 3) Define your target(s): just an executable here +###################################################################################### + +# no matter what is the OS, hopefully +ADD_EXECUTABLE(tspExample main.cpp) + +ADD_DEPENDENCIES(tspExample tsp) +ADD_DEPENDENCIES(tspExample peo) +ADD_DEPENDENCIES(tspExample rmc_mpi) + +###################################################################################### + + +###################################################################################### +### 4) Optionnal: define your target(s)'s version: no effect for windows +###################################################################################### + +SET(LESSON2_VERSION "1.0.beta") +SET_TARGET_PROPERTIES(tspExample PROPERTIES VERSION "${LESSON2_VERSION}") +###################################################################################### + + +###################################################################################### +### 5) Link the librairies +###################################################################################### + +TARGET_LINK_LIBRARIES(tspExample ${XML2_LIBS}) # define in CMakeLists.txt at PEO root dir +TARGET_LINK_LIBRARIES(tspExample tsp) +TARGET_LINK_LIBRARIES(tspExample peo) +TARGET_LINK_LIBRARIES(tspExample rmc_mpi) +TARGET_LINK_LIBRARIES(tspExample eo) +TARGET_LINK_LIBRARIES(tspExample eoutils) + +###################################################################################### + + + + + diff --git a/branches/paradiseo-peo-meta-model/tutorial/Lesson2/ParadisEO-PEO_Lesson2.pdf b/branches/paradiseo-peo-meta-model/tutorial/Lesson2/ParadisEO-PEO_Lesson2.pdf new file mode 100755 index 000000000..d99d43f1a Binary files /dev/null and b/branches/paradiseo-peo-meta-model/tutorial/Lesson2/ParadisEO-PEO_Lesson2.pdf differ diff --git a/branches/paradiseo-peo-meta-model/tutorial/Lesson2/lesson.param b/branches/paradiseo-peo-meta-model/tutorial/Lesson2/lesson.param new file mode 100644 index 000000000..eb843c65f --- /dev/null +++ b/branches/paradiseo-peo-meta-model/tutorial/Lesson2/lesson.param @@ -0,0 +1,12 @@ +## miscallenous parameters + +--debug=false + +## deployment schema + +--schema=schema.xml + +## parameters + +--inst=../examples/tsp/benchs/eil101.tsp + diff --git a/branches/paradiseo-peo-meta-model/tutorial/Lesson2/main.cpp b/branches/paradiseo-peo-meta-model/tutorial/Lesson2/main.cpp new file mode 100644 index 000000000..d1a07f019 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/tutorial/Lesson2/main.cpp @@ -0,0 +1,111 @@ +// "main.cpp" + +// (c) OPAC Team, LIFL, January 2006 + +/* + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#include "route.h" +#include "route_init.h" +#include "route_eval.h" + +#include "order_xover.h" +#include "city_swap.h" + +#include "param.h" + +#include "merge_route_eval.h" +#include "part_route_eval.h" + + +#include + + +#define POP_SIZE 10 +#define NUM_GEN 100 +#define CROSS_RATE 1.0 +#define MUT_RATE 0.01 + +#define NUM_PART_EVALS 2 + + +// by default, parallel evaluation of the population is performed; +// for parallel fitness evaluation, uncomment the following line + +// #define PARALLEL_FIT_EVALUATION + + +int main( int __argc, char** __argv ) { + + // initializing the ParadisEO-PEO environment + peo :: init( __argc, __argv ); + + + // processing the command line specified parameters + loadParameters( __argc, __argv ); + + + // init, eval operators, EA operators ------------------------------------------------------------------------------------------------------------- + + RouteInit route_init; // random init object - creates random Route objects + RouteEval full_eval; // evaluator object - offers a fitness value for a specified Route object + + OrderXover crossover; // crossover operator - creates two offsprings out of two specified parents + CitySwap mutation; // mutation operator - randomly mutates one gene for a specified individual + // ------------------------------------------------------------------------------------------------------------------------------------------------ + + + // evolutionary algorithm components -------------------------------------------------------------------------------------------------------------- + + eoPop< Route > population( POP_SIZE, route_init ); // initial population for the algorithm having POP_SIZE individuals + + + #ifdef PARALLEL_FIT_EVALUATION + + MergeRouteEval merge_eval; + + std :: vector< eoEvalFunc< Route >* > part_eval; + for ( unsigned index = 1; index <= NUM_PART_EVALS; index++ ) + part_eval.push_back( new PartRouteEval( ( float )( index - 1 ) / NUM_PART_EVALS, ( float )index / NUM_PART_EVALS ) ); + + peoParaPopEval< Route > ox_pop_eval( part_eval, merge_eval ); + + #else + + peoParaPopEval< Route > ox_pop_eval( full_eval ); + + #endif + + + + peoParaPopEval< Route > eaPopEval( full_eval ); // evaluator object - to be applied at each iteration on the entire population + + eoGenContinue< Route > eaCont( NUM_GEN ); // continuation criterion - the algorithm will iterate for NUM_GEN generations + eoCheckPoint< Route > eaCheckpointContinue( eaCont ); // checkpoint object - verify at each iteration if the continuation criterion is met + + eoRankingSelect< Route > selectionStrategy; // selection strategy - applied at each iteration for selecting parent individuals + eoSelectNumber< Route > eaSelect( selectionStrategy, POP_SIZE ); // selection object - POP_SIZE individuals are selected at each iteration + + // transform operator - includes the crossover and the mutation operators with a specified associated rate + eoSGATransform< Route > transform( crossover, CROSS_RATE, mutation, MUT_RATE ); + peoSeqTransform< Route > eaTransform( transform ); // ParadisEO transform operator (please remark the peo prefix) - wraps an e EO transform object + + eoPlusReplacement< Route > eaReplace; // replacement strategy - for replacing the initial population with offspring individuals + // ------------------------------------------------------------------------------------------------------------------------------------------------ + + + // ParadisEO-PEO evolutionary algorithm ----------------------------------------------------------------------------------------------------------- + + peoEA< Route > eaAlg( eaCheckpointContinue, eaPopEval, eaSelect, eaTransform, eaReplace ); + + eaAlg( population ); // specifying the initial population for the algorithm, to be iteratively evolved + // ------------------------------------------------------------------------------------------------------------------------------------------------ + + + peo :: run( ); + peo :: finalize( ); + // shutting down the ParadisEO-PEO environment + + return 0; +} diff --git a/branches/paradiseo-peo-meta-model/tutorial/Lesson2/paradiseo-peo-lsn.doxyfile b/branches/paradiseo-peo-meta-model/tutorial/Lesson2/paradiseo-peo-lsn.doxyfile new file mode 100644 index 000000000..318d06ba0 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/tutorial/Lesson2/paradiseo-peo-lsn.doxyfile @@ -0,0 +1,241 @@ +# Doxyfile 1.4.7 + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "ParadisEO-PEO Lesson2" +PROJECT_NUMBER = 0.1 +OUTPUT_DIRECTORY = ../../../doc/html/lesson2 +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 = . +FILE_PATTERNS = *.cpp \ + *.h \ + NEWS \ + README +RECURSIVE = YES +EXCLUDE = +EXCLUDE_SYMLINKS = NO +EXCLUDE_PATTERNS = +EXAMPLE_PATH = +EXAMPLE_PATTERNS = * +EXAMPLE_RECURSIVE = NO +IMAGE_PATH = ../../docs/images +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 = peo +#--------------------------------------------------------------------------- +# 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 = YES +USE_PDFLATEX = YES +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-mo/docs/eo.doxytag=../../../../../paradiseo-mo/docs/html \ + ../../../paradiseo-mo/docs/mo.doxytag=../../../../../paradiseo-mo/docs/html \ + ../../docs/paradiseo-peo.doxytag=../../ \ + ../shared/paradiseo-peo-lsn-shared.doxytag=../../lsnshared/html +GENERATE_TAGFILE = ../../docs/paradiseo-peo-lsn.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/branches/paradiseo-peo-meta-model/tutorial/Lesson2/schema.xml b/branches/paradiseo-peo-meta-model/tutorial/Lesson2/schema.xml new file mode 100644 index 000000000..3edea1488 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/tutorial/Lesson2/schema.xml @@ -0,0 +1,18 @@ + + + + + + + + + 1 + + + + + + + + + diff --git a/branches/paradiseo-peo-meta-model/tutorial/Lesson3/CMakeLists.txt b/branches/paradiseo-peo-meta-model/tutorial/Lesson3/CMakeLists.txt new file mode 100644 index 000000000..2a9da8df5 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/tutorial/Lesson3/CMakeLists.txt @@ -0,0 +1,90 @@ + +###################################################################################### +### 0) Set the compiler and define targets to easily run the lessons +###################################################################################### +SET (CMAKE_CXX_COMPILER mpicxx) + +ADD_CUSTOM_TARGET(install DEPENDS ${ParadisEO-PEO_SOURCE_DIR}/tutorial/Lesson3/lesson.param ${ParadisEO-PEO_SOURCE_DIR}/tutorial/Lesson3/schema.xml) + +ADD_CUSTOM_COMMAND( + TARGET install + POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different + ${ParadisEO-PEO_SOURCE_DIR}/tutorial/Lesson3/lesson.param + ${ParadisEO-PEO_BINARY_DIR}/tutorial/Lesson3) +ADD_CUSTOM_COMMAND( + TARGET install + POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different + ${ParadisEO-PEO_SOURCE_DIR}/tutorial/Lesson3/schema.xml + ${ParadisEO-PEO_BINARY_DIR}/tutorial/Lesson3) +###################################################################################### + + + +###################################################################################### +### 1) Include the sources +###################################################################################### + +INCLUDE_DIRECTORIES(${EO_SRC_DIR}) +INCLUDE_DIRECTORIES(${MO_SRC_DIR}) +INCLUDE_DIRECTORIES(${PEO_SRC_DIR}) +INCLUDE_DIRECTORIES(${TSP_SRC_DIR}) + +###################################################################################### + + +###################################################################################### +### 2) Specify where CMake can find the libraries (mandatory: before 3) ) +###################################################################################### + +LINK_DIRECTORIES( ${EO_SRC_DIR} + ${EO_SRC_DIR}/utils + ${ParadisEO-PEO_BINARY_DIR}/lib + ${TSP_BINARY_DIR}/lib) + +###################################################################################### + + +###################################################################################### +### 3) Define your target(s): just an executable here +###################################################################################### + +# no matter what is the OS, hopefully +ADD_EXECUTABLE(tspExample main.cpp) + +ADD_DEPENDENCIES(tspExample tsp) +ADD_DEPENDENCIES(tspExample peo) +ADD_DEPENDENCIES(tspExample rmc_mpi) + +###################################################################################### + + +###################################################################################### +### 4) Optionnal: define your target(s)'s version: no effect for windows +###################################################################################### + +SET(LESSON3_VERSION "1.0.beta") +SET_TARGET_PROPERTIES(tspExample PROPERTIES VERSION "${LESSON3_VERSION}") +###################################################################################### + + +###################################################################################### +### 5) Link the librairies +###################################################################################### + +TARGET_LINK_LIBRARIES(tspExample ${XML2_LIBS}) # define in CMakeLists.txt at PEO root dir +TARGET_LINK_LIBRARIES(tspExample tsp) +TARGET_LINK_LIBRARIES(tspExample peo) +TARGET_LINK_LIBRARIES(tspExample rmc_mpi) +TARGET_LINK_LIBRARIES(tspExample eo) +TARGET_LINK_LIBRARIES(tspExample eoutils) + +###################################################################################### + + + + + diff --git a/branches/paradiseo-peo-meta-model/tutorial/Lesson3/ParadisEO-PEO_Lesson3.pdf b/branches/paradiseo-peo-meta-model/tutorial/Lesson3/ParadisEO-PEO_Lesson3.pdf new file mode 100755 index 000000000..dda6ad44f Binary files /dev/null and b/branches/paradiseo-peo-meta-model/tutorial/Lesson3/ParadisEO-PEO_Lesson3.pdf differ diff --git a/branches/paradiseo-peo-meta-model/tutorial/Lesson3/lesson.param b/branches/paradiseo-peo-meta-model/tutorial/Lesson3/lesson.param new file mode 100644 index 000000000..eb843c65f --- /dev/null +++ b/branches/paradiseo-peo-meta-model/tutorial/Lesson3/lesson.param @@ -0,0 +1,12 @@ +## miscallenous parameters + +--debug=false + +## deployment schema + +--schema=schema.xml + +## parameters + +--inst=../examples/tsp/benchs/eil101.tsp + diff --git a/branches/paradiseo-peo-meta-model/tutorial/Lesson3/main.cpp b/branches/paradiseo-peo-meta-model/tutorial/Lesson3/main.cpp new file mode 100644 index 000000000..559d83f80 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/tutorial/Lesson3/main.cpp @@ -0,0 +1,160 @@ +// "main.cpp" + +// (c) OPAC Team, LIFL, January 2006 + +/* + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#include "route.h" +#include "route_init.h" +#include "route_eval.h" + +#include "order_xover.h" +#include "city_swap.h" + +#include "param.h" + + +#include + + +#define POP_SIZE 10 +#define NUM_GEN 100 +#define CROSS_RATE 1.0 +#define MUT_RATE 0.01 + +#define MIG_FREQ 10 +#define MIG_SIZE 5 + + +int main( int __argc, char** __argv ) { + + // initializing the ParadisEO-PEO environment + peo :: init( __argc, __argv ); + + + // processing the command line specified parameters + loadParameters( __argc, __argv ); + + + // init, eval operators, EA operators ------------------------------------------------------------------------------------------------------------- + + RouteInit route_init; // random init object - creates random Route objects + RouteEval full_eval; // evaluator object - offers a fitness value for a specified Route object + + OrderXover crossover; // crossover operator - creates two offsprings out of two specified parents + CitySwap mutation; // mutation operator - randomly mutates one gene for a specified individual + // ------------------------------------------------------------------------------------------------------------------------------------------------ + + + // evolutionary algorithm components -------------------------------------------------------------------------------------------------------------- + + eoPop< Route > population( POP_SIZE, route_init ); // initial population for the algorithm having POP_SIZE individuals + peoParaPopEval< Route > eaPopEval( full_eval ); // evaluator object - to be applied at each iteration on the entire population + + eoGenContinue< Route > eaCont( NUM_GEN ); // continuation criterion - the algorithm will iterate for NUM_GEN generations + eoCheckPoint< Route > eaCheckpointContinue( eaCont ); // checkpoint object - verify at each iteration if the continuation criterion is met + + eoRankingSelect< Route > selectionStrategy; // selection strategy - applied at each iteration for selecting parent individuals + eoSelectNumber< Route > eaSelect( selectionStrategy, POP_SIZE ); // selection object - POP_SIZE individuals are selected at each iteration + + // transform operator - includes the crossover and the mutation operators with a specified associated rate + eoSGATransform< Route > transform( crossover, CROSS_RATE, mutation, MUT_RATE ); + peoSeqTransform< Route > eaTransform( transform ); // ParadisEO transform operator (please remark the peo prefix) - wraps an e EO transform object + + eoPlusReplacement< Route > eaReplace; // replacement strategy - for replacing the initial population with offspring individuals + // ------------------------------------------------------------------------------------------------------------------------------------------------ + + + + RingTopology topology; + + // migration policy and components ---------------------------------------------------------------------------------------------------------------- + + eoPeriodicContinue< Route > mig_cont( MIG_FREQ ); // migration occurs periodically + + eoRandomSelect< Route > mig_select_one; // emigrants are randomly selected + eoSelectNumber< Route > mig_select( mig_select_one, MIG_SIZE ); + + eoPlusReplacement< Route > mig_replace; // immigrants replace the worse individuals + + peoSyncIslandMig< Route > mig( MIG_FREQ, mig_select, mig_replace, topology, population, population ); + //peoAsyncIslandMig< Route > mig( mig_cont, mig_select, mig_replace, topology, population, population ); + + eaCheckpointContinue.add( mig ); + // ------------------------------------------------------------------------------------------------------------------------------------------------ + + + + + + // ParadisEO-PEO evolutionary algorithm ----------------------------------------------------------------------------------------------------------- + + peoEA< Route > eaAlg( eaCheckpointContinue, eaPopEval, eaSelect, eaTransform, eaReplace ); + + mig.setOwner( eaAlg ); + + eaAlg( population ); // specifying the initial population for the algorithm, to be iteratively evolved + // ------------------------------------------------------------------------------------------------------------------------------------------------ + + + + + // evolutionary algorithm components -------------------------------------------------------------------------------------------------------------- + + eoPop< Route > population2( POP_SIZE, route_init ); // initial population for the algorithm having POP_SIZE individuals + peoParaPopEval< Route > eaPopEval2( full_eval ); // evaluator object - to be applied at each iteration on the entire population + + eoGenContinue< Route > eaCont2( NUM_GEN ); // continuation criterion - the algorithm will iterate for NUM_GEN generations + eoCheckPoint< Route > eaCheckpointContinue2( eaCont2 ); // checkpoint object - verify at each iteration if the continuation criterion is met + + eoRankingSelect< Route > selectionStrategy2; // selection strategy - applied at each iteration for selecting parent individuals + eoSelectNumber< Route > eaSelect2( selectionStrategy2, POP_SIZE ); // selection object - POP_SIZE individuals are selected at each iteration + + // transform operator - includes the crossover and the mutation operators with a specified associated rate + eoSGATransform< Route > transform2( crossover, CROSS_RATE, mutation, MUT_RATE ); + peoSeqTransform< Route > eaTransform2( transform2 ); // ParadisEO transform operator (please remark the peo prefix) - wraps an e EO transform object + + eoPlusReplacement< Route > eaReplace2; // replacement strategy - for replacing the initial population with offspring individuals + // ------------------------------------------------------------------------------------------------------------------------------------------------ + + + + + // migration policy and components ---------------------------------------------------------------------------------------------------------------- + + eoPeriodicContinue< Route > mig_cont2( MIG_FREQ ); // migration occurs periodically + + eoRandomSelect< Route > mig_select_one2; // emigrants are randomly selected + eoSelectNumber< Route > mig_select2( mig_select_one2, MIG_SIZE ); + + eoPlusReplacement< Route > mig_replace2; // immigrants replace the worse individuals + + peoSyncIslandMig< Route > mig2( MIG_FREQ, mig_select2, mig_replace2, topology, population2, population2 ); + //peoAsyncIslandMig< Route > mig2( mig_cont2, mig_select2, mig_replace2, topology, population2, population2 ); + + eaCheckpointContinue2.add( mig2 ); + // ------------------------------------------------------------------------------------------------------------------------------------------------ + + + + + + // ParadisEO-PEO evolutionary algorithm ----------------------------------------------------------------------------------------------------------- + + peoEA< Route > eaAlg2( eaCheckpointContinue2, eaPopEval2, eaSelect2, eaTransform2, eaReplace2 ); + + mig2.setOwner( eaAlg2 ); + + eaAlg2( population2 ); // specifying the initial population for the algorithm, to be iteratively evolved + // ------------------------------------------------------------------------------------------------------------------------------------------------ + + + + peo :: run( ); + peo :: finalize( ); + // shutting down the ParadisEO-PEO environment + + return 0; +} diff --git a/branches/paradiseo-peo-meta-model/tutorial/Lesson3/paradiseo-peo-lsn.doxyfile b/branches/paradiseo-peo-meta-model/tutorial/Lesson3/paradiseo-peo-lsn.doxyfile new file mode 100644 index 000000000..1d97a8596 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/tutorial/Lesson3/paradiseo-peo-lsn.doxyfile @@ -0,0 +1,241 @@ +# Doxyfile 1.4.7 + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "ParadisEO-PEO Lesson3" +PROJECT_NUMBER = 0.1 +OUTPUT_DIRECTORY = ../../../doc/html/lesson3 +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 = . +FILE_PATTERNS = *.cpp \ + *.h \ + NEWS \ + README +RECURSIVE = YES +EXCLUDE = +EXCLUDE_SYMLINKS = NO +EXCLUDE_PATTERNS = +EXAMPLE_PATH = +EXAMPLE_PATTERNS = * +EXAMPLE_RECURSIVE = NO +IMAGE_PATH = ../../docs/images +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 = peo +#--------------------------------------------------------------------------- +# 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 = YES +USE_PDFLATEX = YES +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-mo/docs/eo.doxytag=../../../../../paradiseo-mo/docs/html \ + ../../../paradiseo-mo/docs/mo.doxytag=../../../../../paradiseo-mo/docs/html \ + ../../docs/paradiseo-peo.doxytag=../../ \ + ../shared/paradiseo-peo-lsn-shared.doxytag=../../lsnshared/html +GENERATE_TAGFILE = ../../docs/paradiseo-peo-lsn.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/branches/paradiseo-peo-meta-model/tutorial/Lesson3/schema.xml b/branches/paradiseo-peo-meta-model/tutorial/Lesson3/schema.xml new file mode 100644 index 000000000..9b8bf316c --- /dev/null +++ b/branches/paradiseo-peo-meta-model/tutorial/Lesson3/schema.xml @@ -0,0 +1,19 @@ + + + + + + + + + 1 + 2 + + + + + + + + + diff --git a/branches/paradiseo-peo-meta-model/tutorial/Walkthrough/CMakeLists.txt b/branches/paradiseo-peo-meta-model/tutorial/Walkthrough/CMakeLists.txt new file mode 100644 index 000000000..0b8409eb1 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/tutorial/Walkthrough/CMakeLists.txt @@ -0,0 +1,129 @@ + +###################################################################################### +### 0) Pre-config +###################################################################################### + +SET (CMAKE_CXX_COMPILER mpicxx) + +ADD_CUSTOM_TARGET(install DEPENDS ${ParadisEO-PEO_SOURCE_DIR}/tutorial/Walkthrough/config) + +ADD_CUSTOM_COMMAND( + TARGET install + POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_directory + ${ParadisEO-PEO_SOURCE_DIR}/tutorial/Walkthrough/config + ${ParadisEO-PEO_BINARY_DIR}/tutorial/Walkthrough/config) +###################################################################################### + + +###################################################################################### +### 1) Include the sources +###################################################################################### + +INCLUDE_DIRECTORIES(${EO_SRC_DIR}) +INCLUDE_DIRECTORIES(${MO_SRC_DIR}) +INCLUDE_DIRECTORIES(${PEO_SRC_DIR}) +INCLUDE_DIRECTORIES(${TSP_SRC_DIR}) + +###################################################################################### + + +###################################################################################### +### 2) Specify where CMake can find the libraries (mandatory: before 3) ) +###################################################################################### + +LINK_DIRECTORIES( ${EO_SRC_DIR} + ${EO_SRC_DIR}/utils + ${PEO_DIR}/build + ${TSP_BINARY_DIR}/lib) + +###################################################################################### + + +###################################################################################### +### 3) Define your target(s): just an executable here +###################################################################################### + +# no matter what is the OS, hopefully +ADD_EXECUTABLE(exampleA exampleA.cpp) +ADD_EXECUTABLE(exampleB exampleB.cpp) +ADD_EXECUTABLE(exampleC exampleC.cpp) +ADD_EXECUTABLE(exampleD exampleD.cpp) +ADD_EXECUTABLE(exampleE exampleE.cpp) + +ADD_DEPENDENCIES(exampleA tsp) +ADD_DEPENDENCIES(exampleB tsp) +ADD_DEPENDENCIES(exampleC tsp) +ADD_DEPENDENCIES(exampleD tsp) +ADD_DEPENDENCIES(exampleE tsp) + +ADD_DEPENDENCIES(exampleA peo) +ADD_DEPENDENCIES(exampleB peo) +ADD_DEPENDENCIES(exampleC peo) +ADD_DEPENDENCIES(exampleD peo) +ADD_DEPENDENCIES(exampleE peo) + +ADD_DEPENDENCIES(exampleA rmc_mpi) +ADD_DEPENDENCIES(exampleB rmc_mpi) +ADD_DEPENDENCIES(exampleC rmc_mpi) +ADD_DEPENDENCIES(exampleD rmc_mpi) +ADD_DEPENDENCIES(exampleE rmc_mpi) + +###################################################################################### + + +###################################################################################### +### 4) Optionnal: define your target(s)'s version: no effect for windows +###################################################################################### + +SET(WALKTHROUGH_VERSION "1.0.beta") +SET_TARGET_PROPERTIES(exampleA PROPERTIES VERSION "${WALKTHROUGH_VERSION}") +SET_TARGET_PROPERTIES(exampleB PROPERTIES VERSION "${WALKTHROUGH_VERSION}") +SET_TARGET_PROPERTIES(exampleC PROPERTIES VERSION "${WALKTHROUGH_VERSION}") +SET_TARGET_PROPERTIES(exampleD PROPERTIES VERSION "${WALKTHROUGH_VERSION}") +SET_TARGET_PROPERTIES(exampleE PROPERTIES VERSION "${WALKTHROUGH_VERSION}") +###################################################################################### + + +###################################################################################### +### 5) Link the librairies +###################################################################################### + +TARGET_LINK_LIBRARIES(exampleA ${XML2_LIBS}) # define in CMakeLists.txt at PEO root dir +TARGET_LINK_LIBRARIES(exampleB ${XML2_LIBS}) # define in CMakeLists.txt at PEO root dir +TARGET_LINK_LIBRARIES(exampleC ${XML2_LIBS}) # define in CMakeLists.txt at PEO root dir +TARGET_LINK_LIBRARIES(exampleD ${XML2_LIBS}) # define in CMakeLists.txt at PEO root dir +TARGET_LINK_LIBRARIES(exampleE ${XML2_LIBS}) # define in CMakeLists.txt at PEO root dir + +TARGET_LINK_LIBRARIES(exampleA tsp) +TARGET_LINK_LIBRARIES(exampleB tsp) +TARGET_LINK_LIBRARIES(exampleC tsp) +TARGET_LINK_LIBRARIES(exampleD tsp) +TARGET_LINK_LIBRARIES(exampleE tsp) + +TARGET_LINK_LIBRARIES(exampleA peo) +TARGET_LINK_LIBRARIES(exampleB peo) +TARGET_LINK_LIBRARIES(exampleC peo) +TARGET_LINK_LIBRARIES(exampleD peo) +TARGET_LINK_LIBRARIES(exampleE peo) + +TARGET_LINK_LIBRARIES(exampleA rmc_mpi) +TARGET_LINK_LIBRARIES(exampleB rmc_mpi) +TARGET_LINK_LIBRARIES(exampleC rmc_mpi) +TARGET_LINK_LIBRARIES(exampleD rmc_mpi) +TARGET_LINK_LIBRARIES(exampleE rmc_mpi) + +TARGET_LINK_LIBRARIES(exampleA eo) +TARGET_LINK_LIBRARIES(exampleB eo) +TARGET_LINK_LIBRARIES(exampleC eo) +TARGET_LINK_LIBRARIES(exampleD eo) +TARGET_LINK_LIBRARIES(exampleE eo) + +TARGET_LINK_LIBRARIES(exampleA eoutils) +TARGET_LINK_LIBRARIES(exampleB eoutils) +TARGET_LINK_LIBRARIES(exampleC eoutils) +TARGET_LINK_LIBRARIES(exampleD eoutils) +TARGET_LINK_LIBRARIES(exampleE eoutils) + +###################################################################################### diff --git a/branches/paradiseo-peo-meta-model/tutorial/Walkthrough/ParadisEO-PEO_Walkthrough.pdf b/branches/paradiseo-peo-meta-model/tutorial/Walkthrough/ParadisEO-PEO_Walkthrough.pdf new file mode 100755 index 000000000..5c4fe7841 Binary files /dev/null and b/branches/paradiseo-peo-meta-model/tutorial/Walkthrough/ParadisEO-PEO_Walkthrough.pdf differ diff --git a/branches/paradiseo-peo-meta-model/tutorial/Walkthrough/config/lessonA.param b/branches/paradiseo-peo-meta-model/tutorial/Walkthrough/config/lessonA.param new file mode 100644 index 000000000..5719b59f3 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/tutorial/Walkthrough/config/lessonA.param @@ -0,0 +1,11 @@ +## miscallenous parameters + +--debug=false + +## deployment schema + +--schema=config/schemaA.xml + +## parameters + +--inst=../examples/tsp/benchs/eil101.tsp diff --git a/branches/paradiseo-peo-meta-model/tutorial/Walkthrough/config/lessonB.param b/branches/paradiseo-peo-meta-model/tutorial/Walkthrough/config/lessonB.param new file mode 100644 index 000000000..873dffa40 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/tutorial/Walkthrough/config/lessonB.param @@ -0,0 +1,11 @@ +## miscallenous parameters + +--debug=false + +## deployment schema + +--schema=config/schemaB.xml + +## parameters + +--inst=../examples/tsp/benchs/eil101.tsp diff --git a/branches/paradiseo-peo-meta-model/tutorial/Walkthrough/config/lessonC.param b/branches/paradiseo-peo-meta-model/tutorial/Walkthrough/config/lessonC.param new file mode 100644 index 000000000..cb47c9bf3 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/tutorial/Walkthrough/config/lessonC.param @@ -0,0 +1,11 @@ +## miscallenous parameters + +--debug=false + +## deployment schema + +--schema=config/schemaC.xml + +## parameters + +--inst=../examples/tsp/benchs/eil101.tsp diff --git a/branches/paradiseo-peo-meta-model/tutorial/Walkthrough/config/lessonD.param b/branches/paradiseo-peo-meta-model/tutorial/Walkthrough/config/lessonD.param new file mode 100644 index 000000000..8c177206b --- /dev/null +++ b/branches/paradiseo-peo-meta-model/tutorial/Walkthrough/config/lessonD.param @@ -0,0 +1,11 @@ +## miscallenous parameters + +--debug=false + +## deployment schema + +--schema=config/schemaD.xml + +## parameters + +--inst=../examples/tsp/benchs/eil101.tsp diff --git a/branches/paradiseo-peo-meta-model/tutorial/Walkthrough/config/lessonE.param b/branches/paradiseo-peo-meta-model/tutorial/Walkthrough/config/lessonE.param new file mode 100644 index 000000000..336c8fdea --- /dev/null +++ b/branches/paradiseo-peo-meta-model/tutorial/Walkthrough/config/lessonE.param @@ -0,0 +1,11 @@ +## miscallenous parameters + +--debug=false + +## deployment schema + +--schema=config/schemaE.xml + +## parameters + +--inst=../examples/tsp/benchs/eil101.tsp diff --git a/branches/paradiseo-peo-meta-model/tutorial/Walkthrough/config/schemaA.xml b/branches/paradiseo-peo-meta-model/tutorial/Walkthrough/config/schemaA.xml new file mode 100644 index 000000000..47b198b4c --- /dev/null +++ b/branches/paradiseo-peo-meta-model/tutorial/Walkthrough/config/schemaA.xml @@ -0,0 +1,10 @@ + + + + + + 1 + + + + diff --git a/branches/paradiseo-peo-meta-model/tutorial/Walkthrough/config/schemaB.xml b/branches/paradiseo-peo-meta-model/tutorial/Walkthrough/config/schemaB.xml new file mode 100644 index 000000000..47b198b4c --- /dev/null +++ b/branches/paradiseo-peo-meta-model/tutorial/Walkthrough/config/schemaB.xml @@ -0,0 +1,10 @@ + + + + + + 1 + + + + diff --git a/branches/paradiseo-peo-meta-model/tutorial/Walkthrough/config/schemaC.xml b/branches/paradiseo-peo-meta-model/tutorial/Walkthrough/config/schemaC.xml new file mode 100644 index 000000000..51754a346 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/tutorial/Walkthrough/config/schemaC.xml @@ -0,0 +1,13 @@ + + + + + + + + 1 + 2 + + + + diff --git a/branches/paradiseo-peo-meta-model/tutorial/Walkthrough/config/schemaD.xml b/branches/paradiseo-peo-meta-model/tutorial/Walkthrough/config/schemaD.xml new file mode 100644 index 000000000..b352f8b19 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/tutorial/Walkthrough/config/schemaD.xml @@ -0,0 +1,16 @@ + + + + + + + + 1 + + + + + + + + diff --git a/branches/paradiseo-peo-meta-model/tutorial/Walkthrough/config/schemaE.xml b/branches/paradiseo-peo-meta-model/tutorial/Walkthrough/config/schemaE.xml new file mode 100644 index 000000000..b352f8b19 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/tutorial/Walkthrough/config/schemaE.xml @@ -0,0 +1,16 @@ + + + + + + + + 1 + + + + + + + + diff --git a/branches/paradiseo-peo-meta-model/tutorial/Walkthrough/exampleA.cpp b/branches/paradiseo-peo-meta-model/tutorial/Walkthrough/exampleA.cpp new file mode 100644 index 000000000..fa86c5ae6 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/tutorial/Walkthrough/exampleA.cpp @@ -0,0 +1,73 @@ +// (c) OPAC Team, LIFL, July 2007 +// +// Contact: paradiseo-help@lists.gforge.inria.fr + +#include "param.h" +#include "route_init.h" +#include "route_eval.h" + +#include "order_xover.h" +#include "edge_xover.h" +#include "partial_mapped_xover.h" +#include "city_swap.h" +#include "part_route_eval.h" +#include "merge_route_eval.h" +#include "two_opt_init.h" +#include "two_opt_next.h" +#include "two_opt_incr_eval.h" + +#include + +#define POP_SIZE 10 +#define NUM_GEN 10 +#define CROSS_RATE 1.0 +#define MUT_RATE 0.01 + + +int main (int __argc, char * * __argv) { + + peo :: init (__argc, __argv); + + + loadParameters (__argc, __argv); /* Processing some parameters relative to the tackled + problem (TSP) */ + + RouteInit route_init; /* It builds random routes */ + RouteEval full_eval; /* Full route evaluator */ + + + OrderXover order_cross; /* Recombination */ + PartialMappedXover pm_cross; + EdgeXover edge_cross; + CitySwap city_swap_mut; /* Mutation */ + + + /** Local Search */ + TwoOptInit pmx_two_opt_init; + TwoOptNext pmx_two_opt_next; + TwoOptIncrEval pmx_two_opt_incr_eval; + moBestImprSelect pmx_two_opt_move_select; + moHC hc (pmx_two_opt_init, pmx_two_opt_next, pmx_two_opt_incr_eval, pmx_two_opt_move_select, full_eval); + + /** The EA */ + eoPop ox_pop (POP_SIZE, route_init); /* Population */ + + eoGenContinue ox_cont (NUM_GEN); /* A fixed number of iterations */ + eoCheckPoint ox_checkpoint (ox_cont); /* Checkpoint */ + peoSeqPopEval ox_pop_eval (full_eval); + eoStochTournamentSelect ox_select_one; + eoSelectNumber ox_select (ox_select_one, POP_SIZE); + eoSGATransform ox_transform (order_cross, CROSS_RATE, city_swap_mut, MUT_RATE); + peoSeqTransform ox_para_transform (ox_transform); + eoEPReplacement ox_replace (2); + + peoEA ox_ea (ox_checkpoint, ox_pop_eval, ox_select, ox_para_transform, ox_replace); + + ox_ea (ox_pop); /* Application to the given population */ + + peo :: run (); + peo :: finalize (); /* Termination */ + + + return 0; +} diff --git a/branches/paradiseo-peo-meta-model/tutorial/Walkthrough/exampleB.cpp b/branches/paradiseo-peo-meta-model/tutorial/Walkthrough/exampleB.cpp new file mode 100644 index 000000000..0de63ab2f --- /dev/null +++ b/branches/paradiseo-peo-meta-model/tutorial/Walkthrough/exampleB.cpp @@ -0,0 +1,79 @@ +// (c) OPAC Team, LIFL, July 2007 +// +// Contact: paradiseo-help@lists.gforge.inria.fr + +#include "param.h" +#include "route_init.h" +#include "route_eval.h" + +#include "order_xover.h" +#include "edge_xover.h" +#include "partial_mapped_xover.h" +#include "city_swap.h" +#include "part_route_eval.h" +#include "merge_route_eval.h" +#include "two_opt_init.h" +#include "two_opt_next.h" +#include "two_opt_incr_eval.h" + +#include + +#define POP_SIZE 10 +#define NUM_GEN 10 +#define CROSS_RATE 1.0 +#define MUT_RATE 0.01 + + +int main (int __argc, char * * __argv) { + + peo :: init (__argc, __argv); + + + loadParameters (__argc, __argv); /* Processing some parameters relative to the tackled + problem (TSP) */ + + RouteInit route_init; /* Its builds random routes */ + RouteEval full_eval; /* Full route evaluator */ + + + OrderXover order_cross; /* Recombination */ + PartialMappedXover pm_cross; + EdgeXover edge_cross; + CitySwap city_swap_mut; /* Mutation */ + + + /** Local Search */ + TwoOptInit pmx_two_opt_init; + TwoOptNext pmx_two_opt_next; + TwoOptIncrEval pmx_two_opt_incr_eval; + moBestImprSelect pmx_two_opt_move_select; + moHC hc (pmx_two_opt_init, pmx_two_opt_next, pmx_two_opt_incr_eval, pmx_two_opt_move_select, full_eval); + + /** The EA */ + eoPop ox_pop (POP_SIZE, route_init); /* Population */ + + eoGenContinue ox_cont (NUM_GEN); /* A fixed number of iterations */ + eoCheckPoint ox_checkpoint (ox_cont); /* Checkpoint */ + peoSeqPopEval ox_pop_eval (full_eval); + eoStochTournamentSelect ox_select_one; + eoSelectNumber ox_select (ox_select_one, POP_SIZE); + eoSGATransform ox_transform (order_cross, CROSS_RATE, city_swap_mut, MUT_RATE); + peoSeqTransform ox_para_transform (ox_transform); + eoEPReplacement ox_replace (2); + + peoEA ox_ea (ox_checkpoint, ox_pop_eval, ox_select, ox_para_transform, ox_replace); + + ox_ea (ox_pop); /* Application to the given population */ + + + peo :: run (); + peo :: finalize (); /* Termination */ + + + std :: cout << ox_pop[ 0 ].fitness(); + hc( ox_pop[ 0 ] ); + std :: cout << " -> " << ox_pop[ 0 ].fitness() << std :: endl; + + + return 0; +} diff --git a/branches/paradiseo-peo-meta-model/tutorial/Walkthrough/exampleC.cpp b/branches/paradiseo-peo-meta-model/tutorial/Walkthrough/exampleC.cpp new file mode 100644 index 000000000..4944fcaa9 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/tutorial/Walkthrough/exampleC.cpp @@ -0,0 +1,131 @@ +// (c) OPAC Team, LIFL, July 2007 +// +// Contact: paradiseo-help@lists.gforge.inria.fr + +#include "param.h" +#include "route_init.h" +#include "route_eval.h" + +#include "order_xover.h" +#include "edge_xover.h" +#include "partial_mapped_xover.h" +#include "city_swap.h" +#include "part_route_eval.h" +#include "merge_route_eval.h" +#include "two_opt_init.h" +#include "two_opt_next.h" +#include "two_opt_incr_eval.h" + +#include + +#define POP_SIZE 10 +#define NUM_GEN 10 +#define CROSS_RATE 1.0 +#define MUT_RATE 0.01 + +#define MIG_FREQ 1 +#define MIG_SIZE 5 + + +int main (int __argc, char * * __argv) { + + peo :: init (__argc, __argv); + + + loadParameters (__argc, __argv); /* Processing some parameters relative to the tackled + problem (TSP) */ + + /* Migration topology */ + RingTopology topo; + + + + // The First EA ------------------------------------------------------------------------------------- + + RouteInit route_init; /* Its builds random routes */ + RouteEval full_eval; /* Full route evaluator */ + + OrderXover order_cross; /* Recombination */ + CitySwap city_swap_mut; /* Mutation */ + + eoPop ox_pop (POP_SIZE, route_init); /* Population */ + + eoGenContinue ox_cont (NUM_GEN); /* A fixed number of iterations */ + eoCheckPoint ox_checkpoint (ox_cont); /* Checkpoint */ + peoSeqPopEval ox_pop_eval (full_eval); + eoStochTournamentSelect ox_select_one; + eoSelectNumber ox_select (ox_select_one, POP_SIZE); + eoSGATransform ox_transform (order_cross, CROSS_RATE, city_swap_mut, MUT_RATE); + peoSeqTransform ox_seq_transform (ox_transform); + eoEPReplacement ox_replace (2); + + + /* The migration policy */ + eoPeriodicContinue ox_mig_cont (MIG_FREQ); /* Migration occurs periodically */ + eoStochTournamentSelect ox_mig_select_one; /* Emigrants are randomly selected */ + eoSelectNumber ox_mig_select (ox_mig_select_one, MIG_SIZE); + eoPlusReplacement ox_mig_replace; /* Immigrants replace the worse individuals */ + + peoAsyncIslandMig ox_mig (ox_mig_cont, ox_mig_select, ox_mig_replace, topo, ox_pop, ox_pop); + ox_checkpoint.add (ox_mig); + + peoEA ox_ea (ox_checkpoint, ox_pop_eval, ox_select, ox_seq_transform, ox_replace); + ox_mig.setOwner (ox_ea); + + ox_ea (ox_pop); /* Application to the given population */ + // -------------------------------------------------------------------------------------------------- + + + + // The Second EA ------------------------------------------------------------------------------------ + + RouteInit route_init2; /* Its builds random routes */ + RouteEval full_eval2; /* Full route evaluator */ + + OrderXover order_cross2; /* Recombination */ + CitySwap city_swap_mut2; /* Mutation */ + + + eoPop ox_pop2 (POP_SIZE, route_init2); /* Population */ + + + eoGenContinue ox_cont2 (NUM_GEN); /* A fixed number of iterations */ + eoCheckPoint ox_checkpoint2 (ox_cont2); /* Checkpoint */ + peoSeqPopEval ox_pop_eval2 (full_eval2); + eoStochTournamentSelect ox_select_one2; + eoSelectNumber ox_select2 (ox_select_one2, POP_SIZE); + eoSGATransform ox_transform2 (order_cross2, CROSS_RATE, city_swap_mut2, MUT_RATE); + peoSeqTransform ox_seq_transform2 (ox_transform2); + eoEPReplacement ox_replace2 (2); + + /* The migration policy */ + eoPeriodicContinue ox_mig_cont2 (MIG_FREQ); /* Migration occurs periodically */ + eoStochTournamentSelect ox_mig_select_one2; /* Emigrants are randomly selected */ + eoSelectNumber ox_mig_select2 (ox_mig_select_one2, MIG_SIZE); + eoPlusReplacement ox_mig_replace2; /* Immigrants replace the worse individuals */ + + peoAsyncIslandMig ox_mig2 (ox_mig_cont2, ox_mig_select2, ox_mig_replace2, topo, ox_pop2, ox_pop2); + ox_checkpoint2.add (ox_mig2); + + peoEA ox_ea2 (ox_checkpoint2, ox_pop_eval2, ox_select2, ox_seq_transform2, ox_replace2); + ox_mig2.setOwner (ox_ea2); + + ox_ea2 (ox_pop2); /* Application to the given population */ + // -------------------------------------------------------------------------------------------------- + + + + peo :: run (); + peo :: finalize (); /* Termination */ + + + // rank 0 is assigned to the scheduler in the XML mapping file + if ( getNodeRank() == 1 ) { + + std::cout << "EA[ 0 ] -----> " << ox_pop.best_element().fitness() << std::endl; + std::cout << "EA[ 1 ] -----> " << ox_pop2.best_element().fitness() << std::endl; + } + + + return 0; +} diff --git a/branches/paradiseo-peo-meta-model/tutorial/Walkthrough/exampleD.cpp b/branches/paradiseo-peo-meta-model/tutorial/Walkthrough/exampleD.cpp new file mode 100644 index 000000000..16d05cb27 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/tutorial/Walkthrough/exampleD.cpp @@ -0,0 +1,75 @@ +// (c) OPAC Team, LIFL, July 2007 +// +// Contact: paradiseo-help@lists.gforge.inria.fr + +#include "param.h" +#include "route_init.h" +#include "route_eval.h" + +#include "order_xover.h" +#include "edge_xover.h" +#include "partial_mapped_xover.h" +#include "city_swap.h" +#include "part_route_eval.h" +#include "merge_route_eval.h" +#include "two_opt_init.h" +#include "two_opt_next.h" +#include "two_opt_incr_eval.h" + +#include + +#define POP_SIZE 10 +#define NUM_GEN 10 +#define CROSS_RATE 1.0 +#define MUT_RATE 0.01 + + + +int main (int __argc, char * * __argv) { + + peo :: init (__argc, __argv); + + + loadParameters (__argc, __argv); /* Processing some parameters relative to the tackled + problem (TSP) */ + + RouteInit route_init; /* Its builds random routes */ + RouteEval full_eval; /* Full route evaluator */ + + + OrderXover order_cross; /* Recombination */ + CitySwap city_swap_mut; /* Mutation */ + + + /** The EA */ + eoPop ox_pop (POP_SIZE, route_init); /* Population */ + + eoGenContinue ox_cont (NUM_GEN); /* A fixed number of iterations */ + eoCheckPoint ox_checkpoint (ox_cont); /* Checkpoint */ + peoSeqPopEval ox_pop_eval (full_eval); + eoStochTournamentSelect ox_select_one; + eoSelectNumber ox_select (ox_select_one, POP_SIZE); + eoSGATransform ox_transform (order_cross, CROSS_RATE, city_swap_mut, MUT_RATE); + peoSeqTransform ox_para_transform (ox_transform); + eoEPReplacement ox_replace (2); + + + peoEA ox_ea (ox_checkpoint, ox_pop_eval, ox_select, ox_para_transform, ox_replace); + + + ox_ea (ox_pop); /* Application to the given population */ + + peo :: run (); + peo :: finalize (); /* Termination */ + + + + // rank 0 is assigned to the scheduler in the XML mapping file + if ( getNodeRank() == 1 ) { + + std::cout << "EA[ 0 ] -----> " << ox_pop.best_element().fitness() << std::endl; + } + + + return 0; +} diff --git a/branches/paradiseo-peo-meta-model/tutorial/Walkthrough/exampleE.cpp b/branches/paradiseo-peo-meta-model/tutorial/Walkthrough/exampleE.cpp new file mode 100644 index 000000000..a5ecc3335 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/tutorial/Walkthrough/exampleE.cpp @@ -0,0 +1,83 @@ +// (c) OPAC Team, LIFL, July 2007 +// +// Contact: paradiseo-help@lists.gforge.inria.fr + +#include "param.h" +#include "route_init.h" +#include "route_eval.h" + +#include "order_xover.h" +#include "edge_xover.h" +#include "partial_mapped_xover.h" +#include "city_swap.h" +#include "part_route_eval.h" +#include "merge_route_eval.h" +#include "two_opt_init.h" +#include "two_opt_next.h" +#include "two_opt_incr_eval.h" + +#include + +#define POP_SIZE 10 +#define NUM_GEN 10 +#define CROSS_RATE 1.0 +#define MUT_RATE 0.01 + +#define NUM_PART_EVALS 2 + + +int main (int __argc, char * * __argv) { + + peo :: init (__argc, __argv); + + + loadParameters (__argc, __argv); /* Processing some parameters relative to the tackled + problem (TSP) */ + + RouteInit route_init; /* Its builds random routes */ + RouteEval full_eval; /* Full route evaluator */ + + + MergeRouteEval merge_eval; + + std :: vector *> part_eval; + for (unsigned i = 1 ; i <= NUM_PART_EVALS ; i ++) + part_eval.push_back (new PartRouteEval ((float) (i - 1) / NUM_PART_EVALS, (float) i / NUM_PART_EVALS)); + + + OrderXover order_cross; /* Recombination */ + CitySwap city_swap_mut; /* Mutation */ + + + /** The EA */ + eoPop ox_pop (POP_SIZE, route_init); /* Population */ + + eoGenContinue ox_cont (NUM_GEN); /* A fixed number of iterations */ + eoCheckPoint ox_checkpoint (ox_cont); /* Checkpoint */ + peoParaPopEval ox_pop_eval (full_eval); + eoStochTournamentSelect ox_select_one; + eoSelectNumber ox_select (ox_select_one, POP_SIZE); + eoSGATransform ox_transform (order_cross, CROSS_RATE, city_swap_mut, MUT_RATE); + peoSeqTransform ox_para_transform (ox_transform); + eoEPReplacement ox_replace (2); + + + peoEA ox_ea (ox_checkpoint, ox_pop_eval, ox_select, ox_para_transform, ox_replace); + + + ox_ea (ox_pop); /* Application to the given population */ + + peo :: run (); + peo :: finalize (); /* Termination */ + + + + // rank 0 is assigned to the scheduler in the XML mapping file + if ( getNodeRank() == 1 ) { + + std::cout << "EA[ 0 ] -----> " << ox_pop.best_element().fitness() << std::endl; + } + + + return 0; +} diff --git a/branches/paradiseo-peo-meta-model/tutorial/Walkthrough/paradiseo-peo-lsn.doxyfile b/branches/paradiseo-peo-meta-model/tutorial/Walkthrough/paradiseo-peo-lsn.doxyfile new file mode 100644 index 000000000..9f9d15d8f --- /dev/null +++ b/branches/paradiseo-peo-meta-model/tutorial/Walkthrough/paradiseo-peo-lsn.doxyfile @@ -0,0 +1,241 @@ +# Doxyfile 1.4.7 + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "ParadisEO-PEO Lesson1" +PROJECT_NUMBER = 0.1 +OUTPUT_DIRECTORY = ../../docs/html/lesson1 +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 = . +FILE_PATTERNS = *.cpp \ + *.h \ + NEWS \ + README +RECURSIVE = YES +EXCLUDE = +EXCLUDE_SYMLINKS = NO +EXCLUDE_PATTERNS = +EXAMPLE_PATH = +EXAMPLE_PATTERNS = * +EXAMPLE_RECURSIVE = NO +IMAGE_PATH = ../../docs/images +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 = peo +#--------------------------------------------------------------------------- +# 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 = YES +USE_PDFLATEX = YES +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-mo/docs/eo.doxytag=../../../../../paradiseo-mo/docs/html \ + ../../../paradiseo-mo/docs/mo.doxytag=../../../../../paradiseo-mo/docs/html \ + ../../docs/paradiseo-peo.doxytag=../../ \ + ../shared/paradiseo-peo-lsn-shared.doxytag=../../lsnshared/html +GENERATE_TAGFILE = ../../docs/paradiseo-peo-lsn.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/branches/paradiseo-peo-meta-model/tutorial/examples/CMakeLists.txt b/branches/paradiseo-peo-meta-model/tutorial/examples/CMakeLists.txt new file mode 100644 index 000000000..4e14e7c71 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/tutorial/examples/CMakeLists.txt @@ -0,0 +1,9 @@ + + +###################################################################################### +### 1) Where must cmake go now ? +###################################################################################### + +SUBDIRS(tsp) + +###################################################################################### \ No newline at end of file diff --git a/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/CMakeLists.txt b/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/CMakeLists.txt new file mode 100644 index 000000000..7574bc4f4 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/CMakeLists.txt @@ -0,0 +1,82 @@ + +###################################################################################### +### 0) Copy the "benchs" directory in the build directory to easily run the lessons +###################################################################################### + +ADD_CUSTOM_TARGET(install DEPENDS ${ParadisEO-PEO_SOURCE_DIR}/tutorial/examples/tsp/benchs) +ADD_CUSTOM_COMMAND( + TARGET install + POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_directory + ${ParadisEO-PEO_SOURCE_DIR}/tutorial/examples/tsp/benchs + ${ParadisEO-PEO_BINARY_DIR}/tutorial/examples/tsp/benchs) + +###################################################################################### + + +###################################################################################### +### 1) Include the sources +###################################################################################### + +INCLUDE_DIRECTORIES(${EO_SRC_DIR}) +INCLUDE_DIRECTORIES(${MO_SRC_DIR}) +INCLUDE_DIRECTORIES(${PEO_SRC_DIR}) + +###################################################################################### + + +###################################################################################### +### 2) Define your target(s): just the tsp lib here +###################################################################################### + +SET(TSP_LIB_OUTPUT_PATH ${TSP_BINARY_DIR}/lib) +SET(LIBRARY_OUTPUT_PATH ${TSP_LIB_OUTPUT_PATH}) + +SET (TSP_SOURCES data.h + data.cpp + opt_route.h + opt_route.cpp + param.h + param.cpp + node.h + node.cpp + route.h + route.cpp + route_init.h + route_init.cpp + route_eval.h + route_eval.cpp + two_opt.h + two_opt.cpp + two_opt_init.h + two_opt_init.cpp + two_opt_incr_eval.h + two_opt_incr_eval.cpp + two_opt_next.h + two_opt_next.cpp + order_xover.h + order_xover.cpp + partial_mapped_xover.h + partial_mapped_xover.cpp + edge_xover.h + edge_xover.cpp + city_swap.h + city_swap.cpp + part_route_eval.h + part_route_eval.cpp + merge_route_eval.h + merge_route_eval.cpp) + +ADD_LIBRARY(tsp STATIC ${TSP_SOURCES}) +###################################################################################### + + +###################################################################################### +### 3) Optionnal: define your lib's version +###################################################################################### + +SET(TSP_VERSION "1.0.beta") +SET_TARGET_PROPERTIES(tsp PROPERTIES VERSION "${TSP_VERSION}") +###################################################################################### + diff --git a/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/benchs/eil101.opt.tour b/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/benchs/eil101.opt.tour new file mode 100644 index 000000000..1d3fece5a --- /dev/null +++ b/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/benchs/eil101.opt.tour @@ -0,0 +1,108 @@ +NAME : eil101.opt.tour +COMMENT : Optimum tour for eil101.tsp (Length 629) +TYPE : TOUR +DIMENSION : 101 +TOUR_SECTION +1 +69 +27 +101 +53 +28 +26 +12 +80 +68 +29 +24 +54 +55 +25 +4 +39 +67 +23 +56 +75 +41 +22 +74 +72 +73 +21 +40 +58 +13 +94 +95 +97 +87 +2 +57 +15 +43 +42 +14 +44 +38 +86 +16 +61 +85 +91 +100 +98 +37 +92 +59 +93 +99 +96 +6 +89 +52 +18 +83 +60 +5 +84 +17 +45 +8 +46 +47 +36 +49 +64 +63 +90 +32 +10 +62 +11 +19 +48 +82 +7 +88 +31 +70 +30 +20 +66 +71 +65 +35 +34 +78 +81 +9 +51 +33 +79 +3 +77 +76 +50 +-1 +EOF diff --git a/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/benchs/eil101.tsp b/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/benchs/eil101.tsp new file mode 100644 index 000000000..9672f849e --- /dev/null +++ b/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/benchs/eil101.tsp @@ -0,0 +1,108 @@ +NAME : eil101 +COMMENT : 101-city problem (Christofides/Eilon) +TYPE : TSP +DIMENSION : 101 +EDGE_WEIGHT_TYPE : EUC_2D +NODE_COORD_SECTION +1 41 49 +2 35 17 +3 55 45 +4 55 20 +5 15 30 +6 25 30 +7 20 50 +8 10 43 +9 55 60 +10 30 60 +11 20 65 +12 50 35 +13 30 25 +14 15 10 +15 30 5 +16 10 20 +17 5 30 +18 20 40 +19 15 60 +20 45 65 +21 45 20 +22 45 10 +23 55 5 +24 65 35 +25 65 20 +26 45 30 +27 35 40 +28 41 37 +29 64 42 +30 40 60 +31 31 52 +32 35 69 +33 53 52 +34 65 55 +35 63 65 +36 2 60 +37 20 20 +38 5 5 +39 60 12 +40 40 25 +41 42 7 +42 24 12 +43 23 3 +44 11 14 +45 6 38 +46 2 48 +47 8 56 +48 13 52 +49 6 68 +50 47 47 +51 49 58 +52 27 43 +53 37 31 +54 57 29 +55 63 23 +56 53 12 +57 32 12 +58 36 26 +59 21 24 +60 17 34 +61 12 24 +62 24 58 +63 27 69 +64 15 77 +65 62 77 +66 49 73 +67 67 5 +68 56 39 +69 37 47 +70 37 56 +71 57 68 +72 47 16 +73 44 17 +74 46 13 +75 49 11 +76 49 42 +77 53 43 +78 61 52 +79 57 48 +80 56 37 +81 55 54 +82 15 47 +83 14 37 +84 11 31 +85 16 22 +86 4 18 +87 28 18 +88 26 52 +89 26 35 +90 31 67 +91 15 19 +92 22 22 +93 18 24 +94 26 27 +95 25 24 +96 22 27 +97 25 21 +98 19 21 +99 20 26 +100 18 18 +101 35 35 +EOF diff --git a/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/city_swap.cpp b/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/city_swap.cpp new file mode 100644 index 000000000..cf5afae8a --- /dev/null +++ b/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/city_swap.cpp @@ -0,0 +1,21 @@ +// "city_swap.cpp" + +// (c) OPAC Team, LIFL, 2002 + +/* + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#include + +#include "city_swap.h" + +bool CitySwap :: operator () (Route & __route) { + + std :: swap (__route [rng.random (__route.size ())], + __route [rng.random (__route.size ())]) ; + + __route.invalidate () ; + + return true ; +} diff --git a/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/city_swap.h b/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/city_swap.h new file mode 100644 index 000000000..cd7a6aaaf --- /dev/null +++ b/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/city_swap.h @@ -0,0 +1,26 @@ +// "city_swap.h" + +// (c) OPAC Team, LIFL, 2002 + +/* + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#ifndef city_swap_h +#define city_swap_h + +#include + +#include "route.h" + +/** Its swaps two vertices + randomly choosen */ +class CitySwap : public eoMonOp { + +public : + + bool operator () (Route & __route) ; + +} ; + +#endif diff --git a/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/data.cpp b/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/data.cpp new file mode 100644 index 000000000..415c30aa1 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/data.cpp @@ -0,0 +1,98 @@ +// "data.cpp" + +// (c) OPAC Team, LIFL, January 2006 + +/* + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#include +#include +#include +#include + +#include + +#include "data.h" +#include "node.h" + +#define MAX_TRASH_LENGTH 1000 +#define MAX_FIELD_LENGTH 1000 +#define MAX_LINE_LENGTH 1000 + +static void getNextField (FILE * __f, char * __buff) { + + char trash [MAX_TRASH_LENGTH]; + + fscanf (__f, "%[ \t:\n]", trash); /* Discarding sep. */ + fscanf (__f, "%[^:\n]", __buff); /* Reading the field */ + fgetc (__f); +} + +static void getLine (FILE * __f, char * __buff) { + + char trash [MAX_TRASH_LENGTH]; + + fscanf (__f, "%[ \t:\n]", trash); /* Discarding sep. */ + fscanf (__f, "%[^\n]", __buff); /* Reading the line */ +} + +void loadData (const char * __filename) { + + FILE * f = fopen (__filename, "r"); + + if (f) { + + printf ("Loading '%s'.\n", __filename); + + char field [MAX_FIELD_LENGTH]; + + getNextField (f, field); /* Name */ + assert (strstr (field, "NAME")); + getNextField (f, field); + printf ("NAME: %s.\n", field); + + getNextField (f, field); /* Comment */ + assert (strstr (field, "COMMENT")); + getLine (f, field); + printf ("COMMENT: %s.\n", field); + + getNextField (f, field); /* Type */ + assert (strstr (field, "TYPE")); + getNextField (f, field); + printf ("TYPE: %s.\n", field); + + getNextField (f, field); /* Dimension */ + assert (strstr (field, "DIMENSION")); + getNextField (f, field); + printf ("DIMENSION: %s.\n", field); + numNodes = atoi (field); + + getNextField (f, field); /* Edge weight type */ + assert (strstr (field, "EDGE_WEIGHT_TYPE")); + getNextField (f, field); + printf ("EDGE_WEIGHT_TYPE: %s.\n", field); + + getNextField (f, field); /* Node coord section */ + assert (strstr (field, "NODE_COORD_SECTION")); + loadNodes (f); + + getNextField (f, field); /* End of file */ + assert (strstr (field, "EOF")); + printf ("EOF.\n"); + } + else { + + fprintf (stderr, "Can't open '%s'.\n", __filename); + exit (1); + } +} + +void loadData (eoParser & __parser) { + + /* Getting the path of the instance */ + + eoValueParam param ("", "inst", "Path of the instance") ; + __parser.processParam (param) ; + loadData (param.value ().c_str ()); +} diff --git a/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/data.h b/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/data.h new file mode 100644 index 000000000..c00c6edfb --- /dev/null +++ b/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/data.h @@ -0,0 +1,18 @@ +// "data.h" + +// (c) OPAC Team, LIFL, January 2006 + +/* + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#ifndef __data_h +#define __data_h + +#include + +extern void loadData (const char * __filename); + +extern void loadData (eoParser & __parser); + +#endif diff --git a/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/display.cpp b/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/display.cpp new file mode 100644 index 000000000..0fbaad4b2 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/display.cpp @@ -0,0 +1,117 @@ +// "display.cpp" + +// (c) OPAC Team, LIFL, January 2006 + +/* + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#include +#include + +#include + +#include "display.h" +#include "node.h" +#include "opt_route.h" + +#define BORDER 20 +#define RATIO 0.5 + +#define screen_width 1024 +#define screen_height 768 + +static const char * filename; + +/* Computed coordinates */ +static unsigned * X_new_coord, * Y_new_coord ; + +/* this variable will contain the handle to the returned graphics context. */ +static GC gc; + +/* this variable will contain the pointer to the Display structure */ +static Display* disp; + +/* this variable will store the ID of the newly created window. */ +static Window win; + +static int screen; + +/* Create a new backing pixmap of the appropriate size */ + + /* Best tour */ + /* + gdk_gc_set_line_attributes (gc, 2, GDK_LINE_ON_OFF_DASH, GDK_CAP_NOT_LAST, GDK_JOIN_MITER) ; + + gdk_gc_set_foreground (gc, & color_green) ; + + for (int i = 0 ; i < (int) numNodes ; i ++) { + + gdk_draw_line (pixmap, gc, + X_new_coord [opt_route [i]], + Y_new_coord [opt_route [i]], + X_new_coord [opt_route [(i + 1) % numNodes]], + Y_new_coord [opt_route [(i + 1) % numNodes]]); + + }*/ + +void openMainWindow (const char * __filename) { + + filename = __filename; + + /* Map */ + int map_width = (int) (X_max - X_min); + int map_height = (int) (Y_max - Y_min); + int map_side = std :: max (map_width, map_height); + + /* Calculate the window's width and height. */ + int win_width = (int) (screen_width * RATIO * map_width / map_side); + int win_height = (int) (screen_height * RATIO * map_height / map_side); + + /* Computing the coordinates */ + X_new_coord = new unsigned [numNodes]; + Y_new_coord = new unsigned [numNodes]; + + for (unsigned i = 0; i < numNodes; i ++) { + X_new_coord [i] = (unsigned) (win_width * (1.0 - (X_coord [i] - X_min) / map_width) + BORDER); + Y_new_coord [i] = (unsigned) (win_height * (1.0 - (Y_coord [i] - Y_min) / map_height) + BORDER); + } + + /* Initialisation */ + XGCValues val ; + + disp = XOpenDisplay (NULL) ; + screen = DefaultScreen (disp) ; + win = XCreateSimpleWindow (disp, RootWindow (disp, screen), 0, 0, win_width + 2 * BORDER, win_height + 2 * BORDER, 2, BlackPixel (disp, screen), WhitePixel (disp, screen)) ; + val.foreground = BlackPixel(disp, screen) ; + val.background = WhitePixel(disp, screen) ; + gc = XCreateGC (disp, win, GCForeground | GCBackground, & val) ; + + XMapWindow (disp, win) ; + XFlush (disp) ; + + while (true) { + XClearWindow (disp, win) ; + + /* Vertices as circles */ + for (unsigned i = 1 ; i < numNodes ; i ++) + XDrawArc (disp, win, gc, X_new_coord [i] - 1, Y_new_coord [i] - 1, 3, 3, 0, 364 * 64) ; + + /* New tour */ + std :: ifstream f (filename); + if (f) { + Route route; + f >> route; + f.close (); + + for (int i = 0; i < (int) numNodes; i ++) + XDrawLine (disp, win, gc, + X_new_coord [route [i]], + Y_new_coord [route [i]], + X_new_coord [route [(i + 1) % numNodes]], + Y_new_coord [route [(i + 1) % numNodes]]); + } + XFlush (disp) ; + sleep (1) ; + } +} diff --git a/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/display.h b/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/display.h new file mode 100644 index 000000000..f534943d6 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/display.h @@ -0,0 +1,16 @@ +// "display.h" + +// (c) OPAC Team, LIFL, January 2006 + +/* + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#ifndef __display_h +#define __display_h + +#include "route.h" + +extern void openMainWindow (const char * __filename); + +#endif diff --git a/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/display_best_route.cpp b/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/display_best_route.cpp new file mode 100644 index 000000000..14b1ba0a3 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/display_best_route.cpp @@ -0,0 +1,22 @@ +// "display_best_route.cpp" + +// (c) OPAC Team, LIFL, January 2006 + +/* + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#include "display_best_route.h" +#include "display.h" + +DisplayBestRoute :: DisplayBestRoute (eoPop & __pop + ) : pop (__pop) { + + +} + +void DisplayBestRoute :: operator () () { + + displayRoute (pop.best_element ()); +} + diff --git a/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/display_best_route.h b/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/display_best_route.h new file mode 100644 index 000000000..5571c35be --- /dev/null +++ b/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/display_best_route.h @@ -0,0 +1,32 @@ +// "display_best_route.h" + +// (c) OPAC Team, LIFL, January 2006 + +/* + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#ifndef __display_best_route_h +#define __display_best_route_h + +#include + +#include + +#include "route.h" + +class DisplayBestRoute : public eoUpdater { + +public : + + DisplayBestRoute (eoPop & __pop); + + void operator () (); + +private : + + eoPop & pop; + +}; + +#endif diff --git a/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/edge_xover.cpp b/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/edge_xover.cpp new file mode 100644 index 000000000..441262e26 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/edge_xover.cpp @@ -0,0 +1,118 @@ +// "edge_xover.cpp" + +// (c) OPAC Team, LIFL, 2003 + +/* + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#include +#include + +#include + +#include "edge_xover.h" + +void EdgeXover :: build_map (const Route & __par1, const Route & __par2) { + + unsigned len = __par1.size () ; + + /* Initialization */ + _map.clear () ; + _map.resize (len) ; + + for (unsigned i = 0 ; i < len ; i ++) { + _map [__par1 [i]].insert (__par1 [(i + 1) % len]) ; + _map [__par2 [i]].insert (__par2 [(i + 1) % len]) ; + _map [__par1 [i]].insert (__par1 [(i - 1 + len) % len]) ; + _map [__par2 [i]].insert (__par2 [(i - 1 + len) % len]) ; + } + + visited.clear () ; + visited.resize (len, false) ; +} + +void EdgeXover :: remove_entry (unsigned __vertex, std :: vector > & __map) { + + std :: set & neigh = __map [__vertex] ; + + for (std :: set :: iterator it = neigh.begin () ; + it != neigh.end () ; + it ++) + __map [* it].erase (__vertex) ; + +} + +void EdgeXover :: add_vertex (unsigned __vertex, Route & __child) { + + visited [__vertex] = true ; + __child.push_back (__vertex) ; + remove_entry (__vertex, _map) ; /* Removing entries */ +} + +void EdgeXover :: cross (const Route & __par1, const Route & __par2, Route & __child) { + + build_map (__par1, __par2) ; + + unsigned len = __par1.size () ; + + /* Go ! */ + __child.clear () ; + + unsigned cur_vertex = rng.random (len) ; + + add_vertex (cur_vertex, __child) ; + + for (unsigned i = 1 ; i < len ; i ++) { + + unsigned len_min_entry = MAXINT ; + + std :: set & neigh = _map [cur_vertex] ; + + for (std :: set :: iterator it = neigh.begin () ; + it != neigh.end () ; + it ++) { + unsigned l = _map [* it].size () ; + if (len_min_entry > l) + len_min_entry = l ; + } + + std :: vector cand ; /* Candidates */ + + for (std :: set :: iterator it = neigh.begin () ; + it != neigh.end () ; + it ++) { + unsigned l = _map [* it].size () ; + if (len_min_entry == l) + cand.push_back (* it) ; + } + + if (! cand.size ()) { + + /* Oh no ! Implicit mutation */ + for (unsigned j = 0 ; j < len ; j ++) + if (! visited [j]) + cand.push_back (j) ; + } + + cur_vertex = cand [rng.random (cand.size ())] ; + + add_vertex (cur_vertex, __child) ; + } +} + +bool EdgeXover :: operator () (Route & __route1, Route & __route2) { + + // Init. copy + Route par [2] ; + par [0] = __route1 ; + par [1] = __route2 ; + + cross (par [0], par [1], __route1) ; + cross (par [1], par [0], __route2) ; + + __route1.invalidate () ; + __route2.invalidate () ; + + return true ; +} diff --git a/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/edge_xover.h b/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/edge_xover.h new file mode 100644 index 000000000..e8bb1f063 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/edge_xover.h @@ -0,0 +1,43 @@ +// "edge_xover.h" + +// (c) OPAC Team, LIFL, 2003 + +/* + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#ifndef edge_xover_h +#define edge_xover_h + +#include +#include + +#include + +#include "route.h" + +/** Edge Crossover */ +class EdgeXover : public eoQuadOp { + +public : + + bool operator () (Route & __route1, Route & __route2) ; + +private : + + void cross (const Route & __par1, const Route & __par2, Route & __child) ; /* Binary */ + + void remove_entry (unsigned __vertex, std :: vector > & __map) ; + /* Updating the map of entries */ + + void build_map (const Route & __par1, const Route & __par2) ; + + void add_vertex (unsigned __vertex, Route & __child) ; + + std :: vector > _map ; /* The handled map */ + + std :: vector visited ; /* Vertices that are already visited */ + +} ; + +#endif diff --git a/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/merge_route_eval.cpp b/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/merge_route_eval.cpp new file mode 100644 index 000000000..1c0d66870 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/merge_route_eval.cpp @@ -0,0 +1,17 @@ +// "merge_route_eval.cpp" + +// (c) OPAC Team, LIFL, 2005 + +/* + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#include "merge_route_eval.h" + +void MergeRouteEval :: operator () (Route & __route, const int & __part_fit) { + + int len = __route.fitness (); + len += __part_fit; + __route.fitness (len); +} + diff --git a/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/merge_route_eval.h b/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/merge_route_eval.h new file mode 100644 index 000000000..dd4a9534d --- /dev/null +++ b/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/merge_route_eval.h @@ -0,0 +1,24 @@ +// "merge_route_eval.h" + +// (c) OPAC Team, LIFL, 2005 + +/* + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#ifndef __merge_route_eval_h +#define __merge_route_eval_h + +#include + +#include "route.h" + +class MergeRouteEval : public peoAggEvalFunc { + +public : + + void operator () (Route & __route, const int & __part_fit) ; + +}; + +#endif diff --git a/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/mix.h b/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/mix.h new file mode 100644 index 000000000..ce5d9bf9e --- /dev/null +++ b/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/mix.h @@ -0,0 +1,25 @@ + + +/* + file: 'mix.h' + author: S. CAHON + mail: paradiseo-help@lists.gforge.inria.fr + date: dec. 2005 +*/ + +#ifndef __mix_h +#define __mix_h + +#include + +#include + +template void mix (std :: vector & __v) { + + unsigned len = __v.size () ; + + for (unsigned i = 0 ; i < len ; i ++) + std :: swap (__v [i], __v [rng.random (len)]) ; +} + +#endif diff --git a/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/node.cpp b/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/node.cpp new file mode 100644 index 000000000..cf0c0f523 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/node.cpp @@ -0,0 +1,77 @@ +// "node.cpp" + +// (c) OPAC Team, LIFL, January 2006 + +/* + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#include +#include + +#include "node.h" + +unsigned numNodes; /* Number of nodes */ + +//static unsigned * * dist; /* Square matrix of distances */ + +double * X_coord, * Y_coord; + +double X_min = MAXDOUBLE, X_max = MINDOUBLE, Y_min = MAXDOUBLE, Y_max = MINDOUBLE; + +void loadNodes (FILE * __f) { + + /* Coord */ + + X_coord = new double [numNodes]; + + Y_coord = new double [numNodes]; + + unsigned num; + + for (unsigned i = 0; i < numNodes; i ++) { + + fscanf (__f, "%u%lf%lf", & num, X_coord + i, Y_coord + i); + + if (X_coord [i] < X_min) + X_min = X_coord [i]; + if (X_coord [i] > X_max) + X_max = X_coord [i]; + if (Y_coord [i] < Y_min) + Y_min = Y_coord [i]; + if (Y_coord [i] > Y_max) + Y_max = Y_coord [i]; + } + + /* Allocation */ + /* + dist = new unsigned * [numNodes]; + + for (unsigned i = 0; i < numNodes; i ++) + dist [i] = new unsigned [numNodes]; + */ + /* Computation of the distances */ + + /* + for (unsigned i = 0; i < numNodes; i ++) { + + dist [i] [i] = 0; + + for (unsigned j = 0; j < numNodes; j ++) { + + double dx = X_coord [i] - X_coord [j], dy = Y_coord [i] - Y_coord [j]; + + dist [i] [j] = dist [j] [i] = (unsigned) (sqrt (dx * dx + dy * dy) + 0.5) ; + } + }*/ +} + +unsigned distance (Node __from, Node __to) { + + // return dist [__from] [__to]; + + double dx = X_coord [__from] - X_coord [__to], dy = Y_coord [__from] - Y_coord [__to]; + + return (unsigned) (sqrt (dx * dx + dy * dy) + 0.5) ; +} + diff --git a/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/node.h b/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/node.h new file mode 100644 index 000000000..fe735361a --- /dev/null +++ b/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/node.h @@ -0,0 +1,26 @@ +// "node.h" + +// (c) OPAC Team, LIFL, January 2006 + +/* + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#ifndef __node_h +#define __node_h + +#include + +typedef unsigned Node; + +extern double X_min, X_max, Y_min, Y_max; + +extern double * X_coord, * Y_coord; + +extern unsigned numNodes; /* Number of nodes */ + +extern void loadNodes (FILE * __f); + +extern unsigned distance (Node __from, Node __to); + +#endif diff --git a/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/opt_route.cpp b/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/opt_route.cpp new file mode 100644 index 000000000..2ee739358 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/opt_route.cpp @@ -0,0 +1,107 @@ +// "opt_route.cpp" + +// (c) OPAC Team, LIFL, January 2006 + +/* + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#include "opt_route.h" + +#define MAX_TRASH_LENGTH 1000 +#define MAX_FIELD_LENGTH 1000 +#define MAX_LINE_LENGTH 1000 + +static void getNextField (FILE * __f, char * __buff) { + + char trash [MAX_TRASH_LENGTH]; + + fscanf (__f, "%[ \t:\n]", trash); /* Discarding sep. */ + fscanf (__f, "%[^:\n]", __buff); /* Reading the field */ + fgetc (__f); +} + +static void getLine (FILE * __f, char * __buff) { + + char trash [MAX_TRASH_LENGTH]; + + fscanf (__f, "%[ \t:\n]", trash); /* Discarding sep. */ + fscanf (__f, "%[^\n]", __buff); /* Reading the line */ +} + +static void loadBestRoute (FILE * __f) { + + opt_route.clear (); + + for (unsigned i = 0; i < numNodes; i ++) { + Node node; + fscanf (__f, "%u", & node); + opt_route.push_back (node - 1); + } + int d; /* -1 ! */ + fscanf (__f, "%d", & d); +} + +void loadOptimumRoute (const char * __filename) { + + FILE * f = fopen (__filename, "r"); + + if (f) { + + printf ("Loading '%s'.\n", __filename); + + char field [MAX_FIELD_LENGTH]; + + getNextField (f, field); /* Name */ + assert (strstr (field, "NAME")); + getNextField (f, field); + //printf ("NAME: %s.\n", field); + + getNextField (f, field); /* Comment */ + assert (strstr (field, "COMMENT")); + getLine (f, field); + // printf ("COMMENT: %s.\n", field); + + getNextField (f, field); /* Type */ + assert (strstr (field, "TYPE")); + getNextField (f, field); + //printf ("TYPE: %s.\n", field); + + getNextField (f, field); /* Dimension */ + assert (strstr (field, "DIMENSION")); + getNextField (f, field); + // printf ("DIMENSION: %s.\n", field); + numNodes = atoi (field); + + getNextField (f, field); /* Tour section */ + assert (strstr (field, "TOUR_SECTION")); + loadBestRoute (f); + + getNextField (f, field); /* End of file */ + assert (strstr (field, "EOF")); + //printf ("EOF.\n"); + + printf ("The length of the best route is %u.\n", length (opt_route)); + } + else { + + fprintf (stderr, "Can't open '%s'.\n", __filename); + exit (1); + } +} + +void loadOptimumRoute (eoParser & __parser) { + + /* Getting the path of the instance */ + + eoValueParam param ("", "optimumTour", "Optimum tour") ; + __parser.processParam (param) ; + if (strlen (param.value ().c_str ())) + loadOptimumRoute (param.value ().c_str ()); + else + opt_route.fitness (0); +} + +Route opt_route; /* Optimum route */ + + diff --git a/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/opt_route.h b/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/opt_route.h new file mode 100644 index 000000000..52df469de --- /dev/null +++ b/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/opt_route.h @@ -0,0 +1,23 @@ +// "opt_route.h" + +// (c) OPAC Team, LIFL, January 2006 + +/* + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#ifndef __opt_route_h +#define __opt_route_h + +#include +#include + +#include "route.h" + +extern void loadOptimumRoute (const char * __filename); + +extern void loadOptimumRoute (eoParser & __parser); + +extern Route opt_route; /* Optimum route */ + +#endif diff --git a/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/order_xover.cpp b/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/order_xover.cpp new file mode 100644 index 000000000..5f8b3ba65 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/order_xover.cpp @@ -0,0 +1,64 @@ +// "order_xover.cpp" + +// (c) OPAC Team, LIFL, 2002 + +/* + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#include + +#include + +#include "order_xover.h" + +void OrderXover :: cross (const Route & __par1, const Route & __par2, Route & __child) { + + unsigned cut2 = 1 + rng.random (numNodes) ; + unsigned cut1 = rng.random (cut2); + unsigned l = 0; + + /* To store vertices that have already been crossed */ + std :: vector v (numNodes, false); + + /* Copy of the left partial route of the first parent */ + for (unsigned i = cut1 ; i < cut2 ; i ++) { + __child [l ++] = __par1 [i] ; + v [__par1 [i]] = true ; + } + + /* Searching the vertex of the second path, that ended the previous first one */ + unsigned from = 0 ; + for (unsigned i = 0; i < numNodes; i ++) + if (__par2 [i] == __child [cut2 - 1]) { + from = i ; + break ; + } + + /* Selecting a direction (Left or Right) */ + char direct = rng.flip () ? 1 : -1 ; + + for (unsigned i = 0; i < numNodes + 1; i ++) { + unsigned bidule = (direct * i + from + numNodes) % numNodes; + if (! v [__par2 [bidule]]) { + __child [l ++] = __par2 [bidule] ; + v [__par2 [bidule]] = true ; + } + } +} + +bool OrderXover :: operator () (Route & __route1, Route & __route2) { + + // Init. copy + Route par [2] ; + par [0] = __route1 ; + par [1] = __route2 ; + + cross (par [0], par [1], __route1) ; + cross (par [1], par [0], __route2) ; + + __route1.invalidate () ; + __route2.invalidate () ; + + return true ; +} diff --git a/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/order_xover.h b/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/order_xover.h new file mode 100644 index 000000000..9fc1907d8 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/order_xover.h @@ -0,0 +1,28 @@ +// "order_xover.h" + +// (c) OPAC Team, LIFL, 2003 + +/* + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#ifndef order_xover_h +#define order_xover_h + +#include + +#include "route.h" + +/** Order Crossover */ +class OrderXover : public eoQuadOp { + +public : + + bool operator () (Route & __route1, Route & __route2) ; + +private : + + void cross (const Route & __par1, const Route & __par2, Route & __child) ; +} ; + +#endif diff --git a/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/paradiseo-peo-lsn-shared.doxyfile b/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/paradiseo-peo-lsn-shared.doxyfile new file mode 100644 index 000000000..bd1a827a9 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/paradiseo-peo-lsn-shared.doxyfile @@ -0,0 +1,240 @@ +# Doxyfile 1.4.7 + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "ParadisEO-PEO - Lessons" +PROJECT_NUMBER = 0.1 +OUTPUT_DIRECTORY = ../../docs/html/lsnshared +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 = . +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 = peo +#--------------------------------------------------------------------------- +# 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 = YES +USE_PDFLATEX = YES +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-mo/docs/eo.doxytag=../../../../paradiseo-mo/docs/html \ + ../../../paradiseo-mo/docs/mo.doxytag=../../../../paradiseo-mo/docs/html \ + ../../docs/paradiseo-peo.doxytag=../../ +GENERATE_TAGFILE = ../../docs/paradiseo-peo-lsn-shared.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/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/param.cpp b/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/param.cpp new file mode 100644 index 000000000..ba41c71d3 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/param.cpp @@ -0,0 +1,23 @@ +// "param.cpp" + +// (c) OPAC Team, LIFL, January 2006 + +/* + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#include + +#include "data.h" +#include "opt_route.h" + +void loadParameters (int __argc, char * * __argv) { + + eoParser parser (__argc, __argv); + + loadData (parser); + + loadOptimumRoute (parser); +} + + diff --git a/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/param.h b/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/param.h new file mode 100644 index 000000000..ee21bf4d8 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/param.h @@ -0,0 +1,14 @@ +// "param.h" + +// (c) OPAC Team, LIFL, January 2006 + +/* + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#ifndef __param_h +#define __param_h + +extern void loadParameters (int __argc, char * * __argv); + +#endif diff --git a/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/part_route_eval.cpp b/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/part_route_eval.cpp new file mode 100644 index 000000000..e2d362230 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/part_route_eval.cpp @@ -0,0 +1,30 @@ +// "part_route_eval.cpp" + +// (c) OPAC Team, LIFL, 2003 + +/* + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#include "part_route_eval.h" +#include "node.h" + +PartRouteEval :: PartRouteEval (float __from, + float __to + ) : from (__from), + to (__to) { + +} + +void PartRouteEval :: operator () (Route & __route) { + + + unsigned len = 0 ; + + for (unsigned i = (unsigned) (__route.size () * from) ; + i < (unsigned) (__route.size () * to) ; + i ++) + len += distance (__route [i], __route [(i + 1) % numNodes]) ; + + __route.fitness (- (int) len) ; +} diff --git a/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/part_route_eval.h b/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/part_route_eval.h new file mode 100644 index 000000000..891737760 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/part_route_eval.h @@ -0,0 +1,33 @@ +// "part_route_eval.h" + +// (c) OPAC Team, LIFL, 2005 + +/* + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#ifndef __part_route_eval_h +#define __part_route_eval_h + +#include + +#include "route.h" + +/** Route Evaluator */ +class PartRouteEval : public eoEvalFunc { + +public : + + /** Constructor */ + PartRouteEval (float __from, float __to) ; + + void operator () (Route & __route) ; + +private : + + float from, to ; + +} ; + + +#endif diff --git a/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/partial_mapped_xover.cpp b/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/partial_mapped_xover.cpp new file mode 100644 index 000000000..1ad819a2d --- /dev/null +++ b/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/partial_mapped_xover.cpp @@ -0,0 +1,61 @@ +// "partial_mapped_xover.cpp" + +// (c) OPAC Team, LIFL, 2003 + +/* + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#include + +#include + +#include "partial_mapped_xover.h" +#include "mix.h" + +void PartialMappedXover :: repair (Route & __route, unsigned __cut1, unsigned __cut2) { + + unsigned v [__route.size ()] ; // Number of times a cities are visited ... + + for (unsigned i = 0 ; i < __route.size () ; i ++) + v [i] = 0 ; + + for (unsigned i = 0 ; i < __route.size () ; i ++) + v [__route [i]] ++ ; + + std :: vector vert ; + + for (unsigned i = 0 ; i < __route.size () ; i ++) + if (! v [i]) + vert.push_back (i) ; + + mix (vert) ; + + for (unsigned i = 0 ; i < __route.size () ; i ++) + if (i < __cut1 || i >= __cut2) + if (v [__route [i]] > 1) { + __route [i] = vert.back () ; + vert.pop_back () ; + } +} + +bool PartialMappedXover :: operator () (Route & __route1, Route & __route2) { + + unsigned cut1 = rng.random (__route1.size ()), cut2 = rng.random (__route2.size ()) ; + + if (cut2 < cut1) + std :: swap (cut1, cut2) ; + + // Between the cuts + for (unsigned i = cut1 ; i < cut2 ; i ++) + std :: swap (__route1 [i], __route2 [i]) ; + + // Outside the cuts + repair (__route1, cut1, cut2) ; + repair (__route2, cut1, cut2) ; + + __route1.invalidate () ; + __route2.invalidate () ; + + return true ; +} diff --git a/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/partial_mapped_xover.h b/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/partial_mapped_xover.h new file mode 100644 index 000000000..0c08531be --- /dev/null +++ b/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/partial_mapped_xover.h @@ -0,0 +1,28 @@ +// "partial_mapped_xover.h" + +// (c) OPAC Team, LIFL, 2003 + +/* + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#ifndef partial_mapped_xover_h +#define partial_mapped_xover_h + +#include + +#include "route.h" + +/** Partial Mapped Crossover */ +class PartialMappedXover : public eoQuadOp { + +public : + + bool operator () (Route & __route1, Route & __route2) ; + +private : + + void repair (Route & __route, unsigned __cut1, unsigned __cut2) ; +} ; + +#endif diff --git a/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/route.cpp b/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/route.cpp new file mode 100644 index 000000000..eea64ab51 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/route.cpp @@ -0,0 +1,21 @@ +// "route.cpp" + +// (c) OPAC Team, LIFL, January 2006 + +/* + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#include "route.h" + +unsigned length (const Route & __route) { + + unsigned len = 0 ; + + for (unsigned i = 0; i < numNodes; i ++) + len += distance (__route [i], __route [(i + 1) % numNodes]) ; + + return len; +} + + diff --git a/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/route.h b/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/route.h new file mode 100644 index 000000000..0ba026675 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/route.h @@ -0,0 +1,20 @@ +// "route.h" + +// (c) OPAC Team, LIFL, January 2006 + +/* + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#ifndef __route_h +#define __route_h + +#include + +#include "node.h" + +typedef eoVector Route; + +unsigned length (const Route & __route); + +#endif diff --git a/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/route_eval.cpp b/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/route_eval.cpp new file mode 100644 index 000000000..0fed8d481 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/route_eval.cpp @@ -0,0 +1,14 @@ +// "route_eval.cpp" + +// (c) OPAC Team, LIFL, January 2006 + +/* + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#include "route_eval.h" + +void RouteEval :: operator () (Route & __route) { + + __route.fitness (- (int) length (__route)); +} diff --git a/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/route_eval.h b/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/route_eval.h new file mode 100644 index 000000000..295f9a39b --- /dev/null +++ b/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/route_eval.h @@ -0,0 +1,23 @@ +// "route_eval.h" + +// (c) OPAC Team, LIFL, January 2006 + +/* + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#ifndef __route_eval_h +#define __route_eval_h + +#include + +#include "route.h" + +class RouteEval : public eoEvalFunc { + +public : + + void operator () (Route & __route) ; +} ; + +#endif diff --git a/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/route_init.cpp b/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/route_init.cpp new file mode 100644 index 000000000..93733f210 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/route_init.cpp @@ -0,0 +1,23 @@ +// "route_init.cpp" + +// (c) OPAC Team, LIFL, January 2006 + +/* + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#include + +#include "route_init.h" +#include "node.h" + +void RouteInit :: operator () (Route & __route) { + + __route.clear (); + + for (unsigned i = 0 ; i < numNodes ; i ++) + __route.push_back (i); + + for (unsigned i = 0 ; i < numNodes ; i ++) + std :: swap (__route [i], __route [rng.random (numNodes)]); +} diff --git a/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/route_init.h b/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/route_init.h new file mode 100644 index 000000000..937b38265 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/route_init.h @@ -0,0 +1,23 @@ +// "route_init.h" + +// (c) OPAC Team, LIFL, January 2006 + +/* + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#ifndef __route_init_h +#define __route_init_h + +#include + +#include "route.h" + +class RouteInit : public eoInit { + +public : + + void operator () (Route & __route); +} ; + +#endif diff --git a/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/two_opt.cpp b/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/two_opt.cpp new file mode 100644 index 000000000..8852ff910 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/two_opt.cpp @@ -0,0 +1,20 @@ +// "two_opt.cpp" + +// (c) OPAC Team, LIFL, January 2006 + +/* + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#include "two_opt.h" + +void TwoOpt :: operator () (Route & __route) { + + unsigned i = 0; + + while ((2 * i) < (second - first)) { + + std :: swap (__route [first + i], __route [second - i]); + i ++; + } +} diff --git a/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/two_opt.h b/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/two_opt.h new file mode 100644 index 000000000..0989f5e6e --- /dev/null +++ b/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/two_opt.h @@ -0,0 +1,25 @@ +// "two_opt.h" + +// (c) OPAC Team, LIFL, January 2006 + +/* + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#ifndef __two_opt_h +#define __two_opt_h + +#include +#include + +#include "route.h" + +class TwoOpt : public moMove , public std :: pair { + +public : + + void operator () (Route & __route); + +} ; + +#endif diff --git a/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/two_opt_incr_eval.cpp b/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/two_opt_incr_eval.cpp new file mode 100644 index 000000000..b3985f66e --- /dev/null +++ b/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/two_opt_incr_eval.cpp @@ -0,0 +1,24 @@ +// "TwoOptIncrEval.cpp" + +// (c) OPAC Team, LIFL, January 2006 + +/* + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#include "two_opt_incr_eval.h" +#include "node.h" + +int TwoOptIncrEval :: operator () (const TwoOpt & __move, const Route & __route) { + + /* From */ + Node v1 = __route [__move.first], v1_left = __route [(__move.first - 1 + numNodes) % numNodes]; + + /* To */ + Node v2 = __route [__move.second], v2_right = __route [(__move.second + 1) % numNodes]; + + if (v1 == v2 || v2_right == v1) + return __route.fitness (); + else + return __route.fitness () - distance (v1_left, v2) - distance (v1, v2_right) + distance (v1_left, v1) + distance (v2, v2_right); +} diff --git a/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/two_opt_incr_eval.h b/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/two_opt_incr_eval.h new file mode 100644 index 000000000..5f88496ed --- /dev/null +++ b/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/two_opt_incr_eval.h @@ -0,0 +1,23 @@ +// "TwoOptIncrEval.h" + +// (c) OPAC Team, LIFL, January 2006 + +/* + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#ifndef __two_opt_incr_eval_h +#define __two_opt_incr_eval_h + +#include +#include "two_opt.h" + +class TwoOptIncrEval : public moMoveIncrEval { + +public : + + int operator () (const TwoOpt & __move, const Route & __route) ; + +} ; + +#endif diff --git a/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/two_opt_init.cpp b/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/two_opt_init.cpp new file mode 100644 index 000000000..e19abc467 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/two_opt_init.cpp @@ -0,0 +1,14 @@ +// "two_opt_init.cpp" + +// (c) OPAC Team, LIFL, 2003 + +/* + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#include "two_opt_init.h" + +void TwoOptInit :: operator () (TwoOpt & __move, const Route & __route) { + + __move.first = __move.second = 0; +} diff --git a/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/two_opt_init.h b/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/two_opt_init.h new file mode 100644 index 000000000..9b4dd0bad --- /dev/null +++ b/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/two_opt_init.h @@ -0,0 +1,24 @@ +// "two_opt_init.h" + +// (c) OPAC Team, LIFL, January 2006 + +/* + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#ifndef __two_opt_init_h +#define __two_opt_init_h + +#include + +#include "two_opt.h" + +class TwoOptInit : public moMoveInit { + +public : + + void operator () (TwoOpt & __move, const Route & __route) ; + +} ; + +#endif diff --git a/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/two_opt_next.cpp b/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/two_opt_next.cpp new file mode 100644 index 000000000..9b7f8be16 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/two_opt_next.cpp @@ -0,0 +1,27 @@ +// "two_opt_next.cpp" + +// (c) OPAC Team, LIFL, January 2006 + +/* + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#include "two_opt_next.h" +#include "node.h" + +bool TwoOptNext :: operator () (TwoOpt & __move, const Route & __route) { + + if (__move.first == numNodes - 1 && __move.second == numNodes - 1) + return false; + + else { + + __move.second ++; + if (__move.second == numNodes) { + + __move.first ++; + __move.second = __move.first; + } + return true ; + } +} diff --git a/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/two_opt_next.h b/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/two_opt_next.h new file mode 100644 index 000000000..cd6605a8d --- /dev/null +++ b/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/two_opt_next.h @@ -0,0 +1,24 @@ +// "two_opt_next.h" + +// (c) OPAC Team, LIFL, January 2006 + +/* + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#ifndef __two_opt_next_h +#define __two_opt_next_h + +#include + +#include "two_opt.h" + +class TwoOptNext : public moNextMove { + +public : + + bool operator () (TwoOpt & __move, const Route & __route); + +}; + +#endif diff --git a/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/two_opt_rand.cpp b/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/two_opt_rand.cpp new file mode 100644 index 000000000..69d64879b --- /dev/null +++ b/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/two_opt_rand.cpp @@ -0,0 +1,21 @@ +// "two_opt_rand.cpp" + +// (c) OPAC Team, LIFL, January 2006 + +/* + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#include + +#include "two_opt_rand.h" +#include "node.h" + +void TwoOptRand :: operator () (TwoOpt & __move, const Route & __route) { + + __move.second = rng.random (numNodes); + + __move.first = rng.random (__move.second); +} + + diff --git a/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/two_opt_rand.h b/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/two_opt_rand.h new file mode 100644 index 000000000..44f602b53 --- /dev/null +++ b/branches/paradiseo-peo-meta-model/tutorial/examples/tsp/two_opt_rand.h @@ -0,0 +1,24 @@ +// "two_opt_rand.h" + +// (c) OPAC Team, LIFL, January 2006 + +/* + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#ifndef __two_opt_rand_h +#define __two_opt_rand_h + +#include + +#include "two_opt.h" + +class TwoOptRand : public eoMoveRand { + +public : + + void operator () (TwoOpt & __move, const Route & __route) ; + +} ; + +#endif