diff --git a/branches/newMo/doc/mo.doxyfile.cmake b/branches/newMo/doc/mo.doxyfile.cmake index 745755e2c..862e9e731 100644 --- a/branches/newMo/doc/mo.doxyfile.cmake +++ b/branches/newMo/doc/mo.doxyfile.cmake @@ -109,7 +109,7 @@ ALWAYS_DETAILED_SEC = NO # members were ordinary class members. Constructors, destructors and assignment # operators of the base classes will not be shown. -INLINE_INHERITED_MEMB = NO +INLINE_INHERITED_MEMB = YES # If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full # path before files name in the file list and in the header files. If set @@ -139,7 +139,7 @@ STRIP_FROM_INC_PATH = # (but less readable) file names. This can be useful is your file systems # doesn't support long names like on DOS, Mac, or CD-ROM. -SHORT_NAMES = NO +SHORT_NAMES = YES # If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen # will interpret the first line (until the first dot) of a JavaDoc-style @@ -235,7 +235,7 @@ EXTENSION_MAPPING = # func(std::string) {}). This also make the inheritance and collaboration # diagrams that involve STL classes more complete and accurate. -BUILTIN_STL_SUPPORT = NO +BUILTIN_STL_SUPPORT = YES # If you use Microsoft's C++/CLI language, you should set this option to YES to # enable parsing support. @@ -480,7 +480,7 @@ SHOW_USED_FILES = YES # then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy # in the documentation. The default is NO. -SHOW_DIRECTORIES = NO +SHOW_DIRECTORIES = YES # Set the SHOW_FILES tag to NO to disable the generation of the Files page. # This will remove the Files entry from the Quick Index and from the @@ -1352,7 +1352,7 @@ HIDE_UNDOC_RELATIONS = YES # toolkit from AT&T and Lucent Bell Labs. The other options in this section # have no effect if this option is set to NO (the default) -HAVE_DOT = NO +HAVE_DOT = YES # By default doxygen will write a font called FreeSans.ttf to the output # directory and reference it in all dot files that doxygen generates. This @@ -1389,7 +1389,7 @@ CLASS_GRAPH = YES # indirect implementation dependencies (inheritance, containment, and # class references variables) of the class with other documented classes. -COLLABORATION_GRAPH = YES +COLLABORATION_GRAPH = NO # If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen # will generate a graph for groups, showing the direct groups dependencies @@ -1400,12 +1400,12 @@ GROUP_GRAPHS = YES # collaboration diagrams in a style similar to the OMG's Unified Modeling # Language. -UML_LOOK = NO +UML_LOOK = YES # If set to YES, the inheritance and collaboration graphs will show the # relations between templates and their instances. -TEMPLATE_RELATIONS = NO +TEMPLATE_RELATIONS = YES # If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT # tags are set to YES then doxygen will generate a graph for each documented @@ -1427,7 +1427,7 @@ INCLUDED_BY_GRAPH = YES # the time of a run. So in most cases it will be better to enable call graphs # for selected functions only using the \callgraph command. -CALL_GRAPH = NO +CALL_GRAPH = YES # If the CALLER_GRAPH and HAVE_DOT tags are set to YES then # doxygen will generate a caller dependency graph for every global function diff --git a/branches/newMo/src/continuator/moCheckpoint.h b/branches/newMo/src/continuator/moCheckpoint.h index d5ae0a45a..95d68f1f8 100644 --- a/branches/newMo/src/continuator/moCheckpoint.h +++ b/branches/newMo/src/continuator/moCheckpoint.h @@ -39,6 +39,9 @@ #include #include +/** + * Continuator allowing to add others (continuators, stats, monitors or updaters) + */ template class moCheckpoint : public moContinuator { public : @@ -46,22 +49,65 @@ public : typedef NH Neighborhood ; typedef typename Neighborhood::EOT EOT ; + /** + * Default constructor (moCheckpoint must have at least one continuator) + * @param _cont a continuator + */ moCheckpoint(moContinuator& _cont) { continuators.push_back(&_cont); } - void add(moContinuator& _cont) { continuators.push_back(&_cont); } - void add(moStatBase& _stat) { stats.push_back(&_stat); } - void add(eoMonitor& _mon) { monitors.push_back(&_mon); } - void add(eoUpdater& _upd) { updaters.push_back(&_upd); } + /** + * add a continuator to the checkpoint + * @param _cont a continuator + */ + void add(moContinuator& _cont) { + continuators.push_back(&_cont); + } + /** + * add a statistic operator to the checkpoint + * @param _stat a statistic operator + */ + void add(moStatBase& _stat) { + stats.push_back(&_stat); + } + + /** + * add a monitor to the checkpoint + * @param _mon a monitor + */ + void add(eoMonitor& _mon) { + monitors.push_back(&_mon); + } + + /** + * add a updater to the checkpoint + * @param _upd an updater + */ + void add(eoUpdater& _upd) { + updaters.push_back(&_upd); + } + + /** + * init all continuators containing in the checkpoint regarding a solution + * @param _sol the corresponding solution + */ virtual void init(EOT& _sol) { for(unsigned i = 0; i < continuators.size(); ++i) continuators[i]->init(_sol); } + /** + * @return the name of the class + */ virtual std::string className(void) const { return "moCheckPoint"; } + /** + * apply operator of checkpoint's containers + * @param _sol reference of the solution + * @return true if all continuator return true + */ bool operator()(EOT & _sol) { unsigned i; bool bContinue = true; @@ -82,6 +128,10 @@ public : return bContinue; } + /** + * last call of statistic operators, monitors and updaters + * @param _sol reference of the solution + */ void lastCall(EOT& _sol){ unsigned int i; for (i = 0; i < stats.size(); ++i) @@ -95,11 +145,15 @@ public : } private : + /** continuators vector */ + std::vector*> continuators; + /** statistic operators vector */ + std::vector*> stats; + /** monitors vector */ + std::vector monitors; + /** updaters vector */ + std::vector updaters; - std::vector*> continuators; - std::vector*> stats; - std::vector monitors; - std::vector updaters; }; diff --git a/branches/newMo/src/explorer/moFirstImprExplorer.h b/branches/newMo/src/explorer/moFirstImprExplorer.h index 8657e20ac..c784ecd02 100644 --- a/branches/newMo/src/explorer/moFirstImprExplorer.h +++ b/branches/newMo/src/explorer/moFirstImprExplorer.h @@ -56,7 +56,8 @@ public: * Constructor * @param _neighborhood the neighborhood * @param _eval the evaluation function - * @param _comparator a neighbor comparator + * @param _neighborComparator a neighbor comparator + * @param _solNeighborComparator a solution vs neighbor comparator */ moFirstImprExplorer(Neighborhood& _neighborhood, moEval& _eval, moNeighborComparator& _neighborComparator, moSolNeighborComparator& _solNeighborComparator) : moNeighborhoodExplorer(_neighborhood, _eval), neighborComparator(_neighborComparator), solNeighborComparator(_solNeighborComparator) { isAccept = false; diff --git a/branches/newMo/src/explorer/moHCneutralExplorer.h b/branches/newMo/src/explorer/moHCneutralExplorer.h index 1bbf18bed..1a8f4933c 100644 --- a/branches/newMo/src/explorer/moHCneutralExplorer.h +++ b/branches/newMo/src/explorer/moHCneutralExplorer.h @@ -60,7 +60,9 @@ public: * Constructor * @param _neighborhood the neighborhood * @param _eval the evaluation function - * @param _comparator a neighbor comparator + * @param _neighborComparator a neighbor comparator + * @param _solNeighborComparator a solution vs neighbor comparator + * @param _nbStep maximum step to do */ moHCneutralExplorer(Neighborhood& _neighborhood, moEval& _eval, diff --git a/branches/newMo/src/explorer/moMetropolisHastingExplorer.h b/branches/newMo/src/explorer/moMetropolisHastingExplorer.h index c9b15a564..ff937dbdd 100644 --- a/branches/newMo/src/explorer/moMetropolisHastingExplorer.h +++ b/branches/newMo/src/explorer/moMetropolisHastingExplorer.h @@ -57,7 +57,9 @@ public: * Constructor * @param _neighborhood the neighborhood * @param _eval the evaluation function - * @param _comparator a neighbor comparator + * @param _neighborComparator a neighbor comparator + * @param _solNeighborComparator a solution vs neighbor comparator + * @param _nbStep maximum number of step to do */ moMetropolisHastingExplorer(Neighborhood& _neighborhood, moEval& _eval, moNeighborComparator& _neighborComparator, moSolNeighborComparator& _solNeighborComparator, unsigned int _nbStep) : moNeighborhoodExplorer(_neighborhood, _eval), neighborComparator(_neighborComparator), solNeighborComparator(_solNeighborComparator), nbStep(_nbStep) { isAccept = false; @@ -73,23 +75,26 @@ public: /** * initialization of the number of step to be done + * @param _solution the solution (unused here) */ - virtual void initParam(EOT & solution){ + virtual void initParam(EOT & _solution){ step = 0; isAccept = true; }; /** * increase the number of step + * @param _solution the solution (unused here) */ - virtual void updateParam(EOT & solution){ + virtual void updateParam(EOT & _solution){ step++; }; /** * terminate: NOTHING TO DO + * @param _solution the solution (unused here) */ - virtual void terminate(EOT & solution){}; + virtual void terminate(EOT & _solution){}; /** * Explore the neighborhood of a solution diff --git a/branches/newMo/src/explorer/moNeighborhoodExplorer.h b/branches/newMo/src/explorer/moNeighborhoodExplorer.h index 460f02832..4a2a13f29 100644 --- a/branches/newMo/src/explorer/moNeighborhoodExplorer.h +++ b/branches/newMo/src/explorer/moNeighborhoodExplorer.h @@ -56,7 +56,6 @@ public: * Constructor with a Neighborhood and evaluation function * @param _neighborhood the neighborhood * @param _eval the evaluation function - * @param _comparator a neighbor comparator */ moNeighborhoodExplorer(Neighborhood& _neighborhood, moEval& _eval):neighborhood(_neighborhood), eval(_eval), isMoved(false) {} diff --git a/branches/newMo/src/explorer/moRandomNeutralWalkExplorer.h b/branches/newMo/src/explorer/moRandomNeutralWalkExplorer.h index fc1beba21..f98b461b1 100644 --- a/branches/newMo/src/explorer/moRandomNeutralWalkExplorer.h +++ b/branches/newMo/src/explorer/moRandomNeutralWalkExplorer.h @@ -57,7 +57,8 @@ public: * Constructor * @param _neighborhood the neighborhood * @param _eval the evaluation function - * @param _comparator a neighbor comparator + * @param _solNeighborComparator a solution vs neighbor comparator + * @param _nbStep maximum number of step to do */ moRandomNeutralWalkExplorer(Neighborhood& _neighborhood, moEval& _eval, moSolNeighborComparator& _solNeighborComparator, diff --git a/branches/newMo/src/explorer/moRandomWalkExplorer.h b/branches/newMo/src/explorer/moRandomWalkExplorer.h index a1b30631d..96b546d06 100644 --- a/branches/newMo/src/explorer/moRandomWalkExplorer.h +++ b/branches/newMo/src/explorer/moRandomWalkExplorer.h @@ -56,7 +56,7 @@ public: * Constructor * @param _neighborhood the neighborhood * @param _eval the evaluation function - * @param _comparator a neighbor comparator + * @param _nbStep maximum number of step to do */ moRandomWalkExplorer(Neighborhood& _neighborhood, moEval& _eval, unsigned _nbStep) : moNeighborhoodExplorer(_neighborhood, _eval), nbStep(_nbStep) { isAccept = false; diff --git a/branches/newMo/src/explorer/moSimpleHCexplorer.h b/branches/newMo/src/explorer/moSimpleHCexplorer.h index 73221be66..6a737aa4a 100644 --- a/branches/newMo/src/explorer/moSimpleHCexplorer.h +++ b/branches/newMo/src/explorer/moSimpleHCexplorer.h @@ -56,7 +56,8 @@ public: * Constructor * @param _neighborhood the neighborhood * @param _eval the evaluation function - * @param _comparator a neighbor comparator + * @param _neighborComparator a neighbor comparator + * @param _solNeighborComparator solution vs neighbor comparator */ moSimpleHCexplorer(Neighborhood& _neighborhood, moEval& _eval, moNeighborComparator& _neighborComparator, moSolNeighborComparator& _solNeighborComparator) : moNeighborhoodExplorer(_neighborhood, _eval), neighborComparator(_neighborComparator), solNeighborComparator(_solNeighborComparator) { isAccept = false; diff --git a/branches/newMo/src/explorer/moSimpleHCneutralExplorer.h b/branches/newMo/src/explorer/moSimpleHCneutralExplorer.h index 3561cc005..0d7d11e93 100644 --- a/branches/newMo/src/explorer/moSimpleHCneutralExplorer.h +++ b/branches/newMo/src/explorer/moSimpleHCneutralExplorer.h @@ -56,7 +56,8 @@ public: * Constructor * @param _neighborhood the neighborhood * @param _eval the evaluation function - * @param _comparator a neighbor comparator + * @param _neighborComparator a neighbor comparator + * @param _solNeighborComparator solution vs neighbor comparator */ moSimpleHCneutralExplorer(Neighborhood& _neighborhood, moEval& _eval, diff --git a/branches/newMo/src/explorer/moTSExplorer.h b/branches/newMo/src/explorer/moTSExplorer.h index b00cdbd2c..ec92ac635 100644 --- a/branches/newMo/src/explorer/moTSExplorer.h +++ b/branches/newMo/src/explorer/moTSExplorer.h @@ -40,6 +40,9 @@ #include #include #include +#include +#include + /** * Explorer for a Tabu Search @@ -135,6 +138,7 @@ public: */ virtual void operator()(EOT & _solution) { + bool found=false; intensification(_solution); diversification(_solution); if(neighborhood.hasNeighbor(_solution)) diff --git a/branches/newMo/src/neighborhood/moIndexNeighbor.h b/branches/newMo/src/neighborhood/moIndexNeighbor.h index c847332fb..922882f87 100644 --- a/branches/newMo/src/neighborhood/moIndexNeighbor.h +++ b/branches/newMo/src/neighborhood/moIndexNeighbor.h @@ -86,7 +86,7 @@ public: /** * Setter - * @param index of the IndexNeighbor + * @param _key index of the IndexNeighbor */ void index(unsigned int _key){ key=_key; diff --git a/branches/newMo/src/neighborhood/moIndexNeighborhood.h b/branches/newMo/src/neighborhood/moIndexNeighborhood.h index 559342d7c..a258aacd1 100644 --- a/branches/newMo/src/neighborhood/moIndexNeighborhood.h +++ b/branches/newMo/src/neighborhood/moIndexNeighborhood.h @@ -51,7 +51,7 @@ public: /** * Constructor - * @param _neighborhood the size of the neighborhood + * @param _neighborhoodSize the size of the neighborhood */ moIndexNeighborhood(unsigned int _neighborhoodSize):neighborhoodSize(_neighborhoodSize){} diff --git a/branches/newMo/src/neighborhood/moOrderNeighborhood.h b/branches/newMo/src/neighborhood/moOrderNeighborhood.h index 80b10e831..dc8f2806e 100644 --- a/branches/newMo/src/neighborhood/moOrderNeighborhood.h +++ b/branches/newMo/src/neighborhood/moOrderNeighborhood.h @@ -57,7 +57,7 @@ public: /** * Constructor - * @param _neighborhood the size of the neighborhood + * @param _neighborhoodSize the size of the neighborhood */ moOrderNeighborhood(unsigned int _neighborhoodSize): moIndexNeighborhood(_neighborhoodSize), currentIndex(0){} diff --git a/branches/newMo/src/neighborhood/moRndWithReplNeighborhood.h b/branches/newMo/src/neighborhood/moRndWithReplNeighborhood.h index f6253760e..52928b2b2 100644 --- a/branches/newMo/src/neighborhood/moRndWithReplNeighborhood.h +++ b/branches/newMo/src/neighborhood/moRndWithReplNeighborhood.h @@ -57,7 +57,7 @@ public: /** * Constructor - * @param _neighborhood the size of the neighborhood + * @param _neighborhoodSize the size of the neighborhood */ moRndWithReplNeighborhood(unsigned int _neighborhoodSize): moIndexNeighborhood(_neighborhoodSize){} diff --git a/branches/newMo/src/neighborhood/moRndWithoutReplNeighborhood.h b/branches/newMo/src/neighborhood/moRndWithoutReplNeighborhood.h index 79fbe54aa..9cea6f182 100644 --- a/branches/newMo/src/neighborhood/moRndWithoutReplNeighborhood.h +++ b/branches/newMo/src/neighborhood/moRndWithoutReplNeighborhood.h @@ -57,7 +57,7 @@ public: /** * Constructor - * @param _neighborhood the size of the neighborhood + * @param _neighborhoodSize the size of the neighborhood */ moRndWithoutReplNeighborhood(unsigned int _neighborhoodSize): moIndexNeighborhood(_neighborhoodSize), maxIndex(0){ for(unsigned int i=0; i < neighborhoodSize; i++)