diff --git a/smp/src/MWModel.h b/smp/src/MWModel.h index 15d2bd3ec..4e35bfc9f 100644 --- a/smp/src/MWModel.h +++ b/smp/src/MWModel.h @@ -48,7 +48,7 @@ namespace smp /** MWModel: Master / Worker Model for multicore computation -The MW Model wraps any algorithm in order to apply it on several populations. +The MW Model wraps any algorithm in order to dispatch load between threads. @see smp::Worker, smp::Thread */ @@ -100,7 +100,7 @@ protected: void operator()(eoPop& pop, const eoEasyEA_tag&); /** - * Specifid algorithm for EasyPSO + * Specific algorithm for EasyPSO */ void operator()(eoPop& pop, const eoEasyPSO_tag&); diff --git a/smp/src/abstractIsland.h b/smp/src/abstractIsland.h index 61193f6bd..1760a7d02 100644 --- a/smp/src/abstractIsland.h +++ b/smp/src/abstractIsland.h @@ -41,14 +41,15 @@ namespace smp { // Forward declaration -template +template class IslandModel; /** AbstractIsland: An abstract island. The abstract island is used to manipulate island pointers wihout the knowledge of the algorithm. +The template is the base type for individuals. -@see smp::Island +@see smp::Island smp::IslandModel */ template @@ -59,26 +60,31 @@ public: virtual void operator()() = 0; /** - * Check if there is population to receive + * Set the Island Model. + * @param _model The model which manipulate the island. */ virtual void setModel(IslandModel* _model) = 0; /** - * Check if there is population to receive or to emigrate + * Check if there is population to receive or to emigrate. */ virtual void check(void) = 0; /** - * Update the island by adding population to send in the imigrants list. + * Update the island by adding population to send in the imigrants list. + * @param _data Population to integrate. */ virtual void update(eoPop _data) = 0; /** * Check if the algorithm is stopped. - * @return true if stopped + * @return true if stopped. */ virtual bool isStopped(void) const = 0; + /** + * Receive population by integrate individuals. + */ virtual void receive(void) = 0; protected: diff --git a/smp/src/algoDispatching.h b/smp/src/algoDispatching.h index 5e60b895d..aea7920bf 100644 --- a/smp/src/algoDispatching.h +++ b/smp/src/algoDispatching.h @@ -38,7 +38,7 @@ namespace smp { /** Algo Dispatching -The Algo Dispatching enable to choose the algorithm to call at compile time by tag-dispatching method +The Algo Dispatching enables to choose the algorithm to call at compile time by tag-dispatching method **/ diff --git a/smp/src/bimap.h b/smp/src/bimap.h index 82c26781b..ee7f5cb57 100644 --- a/smp/src/bimap.h +++ b/smp/src/bimap.h @@ -44,7 +44,7 @@ A and B objects are stocked in two std::map, then if you would like to avoid ins template A and B with pointers. **/ -template + template class Bimap { public: @@ -53,55 +53,51 @@ public: * @param A right key * @param B left key */ - void add(A& a, B& b) - { - rightAssociation[a] = b; - leftAssociation[b] = a; - } + void add(A& a, B& b); - std::map getRight() const - { - return rightAssociation; - } + /** + * Return a map which represents the right association. + * @return rightAssociation + */ + std::map getRight() const; - std::map getLeft() const - { - return leftAssociation; - } + /** + * Return a map which represents the left association. + * @return leftAssociation + */ + std::map getLeft() const; - void removeFromRight(const A& a) - { - for(auto& it : leftAssociation) - if(it->second == a) - leftAssociation.erase(it); - - rightAssociation.erase(a); - } + /** + * Remove an association from a right key. + * @param Right key of the association to be removed. + */ + void removeFromRight(const A& a); - void removeFromLeft(const B& b) - { - for(auto& it : rightAssociation) - if(it->second == b) - rightAssociation.erase(it); - - leftAssociation.erase(b); - } + /** + * Remove an association from a left key. + * @param Left key of the association to be removed. + */ + void removeFromLeft(const B& b); + + /** + * Return the number of associations. + * @return Size of bimap + */ + unsigned size() const; - unsigned size() const - { - return leftAssociation.size(); - } - - bool empty() const - { - return leftAssociation.empty(); - } + /** + * Check if the bimap is empty + * @return true if the bimap is empty + */ + bool empty() const; protected: std::map rightAssociation; std::map leftAssociation; }; +#include + } } diff --git a/smp/src/contDispatching.h b/smp/src/contDispatching.h index 3870ce2d4..b23616565 100644 --- a/smp/src/contDispatching.h +++ b/smp/src/contDispatching.h @@ -32,7 +32,7 @@ Contact: paradiseo-help@lists.gforge.inria.fr /** Continuator Dispatching -The Continuator Dispatching enable to wrap continuators in Island constructor for a better user interface +The Continuator Dispatching enables to wrap continuators in the Island constructor for a better user interface and, moreover, avoiding side effect. **/ diff --git a/smp/src/contWrapper.h b/smp/src/contWrapper.h index ed9e640b0..fe3eefa7f 100644 --- a/smp/src/contWrapper.h +++ b/smp/src/contWrapper.h @@ -57,9 +57,9 @@ public: /** * Constructor * @param _cont Original continuators - * @param _policy Policy to wrap with continuators + * @param _island Pointer on the island used by the notifier */ - ContWrapper(eoContinue& _cont, AIsland* island); + ContWrapper(eoContinue& _cont, AIsland* _island); protected: eoCheckPoint ck; diff --git a/smp/src/homogeneousModel.h b/smp/src/homogeneousModel.h index 3b6ae651b..214a770a4 100644 --- a/smp/src/homogeneousModel.h +++ b/smp/src/homogeneousModel.h @@ -45,18 +45,33 @@ namespace paradiseo namespace smp { +/** HomogeneousIslandModel: Wrapper to create homogeneous model easily + +@see smp::IslandModel +*/ template