add tests interfaces as examples in the doc ; remove unused test binaries ; some code formating

This commit is contained in:
Johann Dreo 2010-11-07 23:12:28 +01:00
commit bd236ee67f
54 changed files with 129 additions and 1410 deletions

View file

@ -628,7 +628,7 @@ EXCLUDE_SYMBOLS =
# directories that contain example code fragments that are included (see # directories that contain example code fragments that are included (see
# the \include command). # the \include command).
EXAMPLE_PATH = EXAMPLE_PATH = @CMAKE_SOURCE_DIR@/test
# If the value of the EXAMPLE_PATH tag contains directories, you can use the # If the value of the EXAMPLE_PATH tag contains directories, you can use the
# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp

View file

@ -60,4 +60,3 @@ article in Lecture Notes In Computer Science, 2310, Selected Papers from the 5th
- http://eodev.sourceforge.net/eo/doc/LeCreusot.pdf - http://eodev.sourceforge.net/eo/doc/LeCreusot.pdf
- http://eodev.sourceforge.net/eo/doc/EO_EA2001.pdf - http://eodev.sourceforge.net/eo/doc/EO_EA2001.pdf
*/ */

View file

@ -55,6 +55,8 @@
@ref Operators that effectively modify EO objects must invalidate them. @ref Operators that effectively modify EO objects must invalidate them.
The fitness object must have, besides an void ctor, a copy ctor. The fitness object must have, besides an void ctor, a copy ctor.
@example t-eo.cpp
*/ */
template<class F = double> class EO: public eoObject, public eoPersistent template<class F = double> class EO: public eoObject, public eoPersistent
{ {

View file

@ -307,5 +307,7 @@ eoAlgo<EOT> & do_make_algo_scalar(eoParser& _parser, eoState& _state, eoEvalFunc
// that's it! // that's it!
return *algo; return *algo;
} }
/** @example t-eoGA.cpp
*/
#endif #endif

View file

@ -273,9 +273,11 @@ template<class EOT> class eoEasyEA: public eoAlgo<EOT>
// Friend classes // Friend classes
friend class eoIslandsEasyEA <EOT> ; friend class eoIslandsEasyEA <EOT> ;
friend class eoDistEvalEasyEA <EOT> ; friend class eoDistEvalEasyEA <EOT> ;
}; };
/**
//----------------------------------------------------------------------------- @example t-eoEasyEA.cpp
Example of a test program building an EA algorithm.
*/
#endif #endif

View file

@ -188,6 +188,9 @@ protected:
}dummyInit; }dummyInit;
}; };
/**
* @example t-eoEasyPSO.cpp
* Example of a test program building a PSO algorithm.
*/
#endif /*_EOEASYPSO_H*/ #endif /*_EOEASYPSO_H*/

View file

@ -35,7 +35,9 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
/** Extended velocity performer for particle swarm optimization. Derivated from abstract eoVelocity, /** Extended velocity performer for particle swarm optimization.
*
* Derivated from abstract eoVelocity,
* At step t: v(t+1)= w * v(t) + c1 * r1 * ( xbest(t)-x(t) ) + c2 * r2 * ( lbest(t) - x(t) ) + c3 * r3 * ( gbest(t) - x(t) ) * At step t: v(t+1)= w * v(t) + c1 * r1 * ( xbest(t)-x(t) ) + c2 * r2 * ( lbest(t) - x(t) ) + c3 * r3 * ( gbest(t) - x(t) )
* It includes both a "topology" best and a global best in the social knowledge. Each topology * It includes both a "topology" best and a global best in the social knowledge. Each topology
* provides a method to retrieve the global best <=> the best of all the neighborhood the topology contains. * provides a method to retrieve the global best <=> the best of all the neighborhood the topology contains.
@ -60,7 +62,7 @@ public:
* @param _c3 - Learning factor used for the global best * @param _c3 - Learning factor used for the global best
* @param _bounds - An eoRealBaseVectorBounds: real bounds for real velocities. * @param _bounds - An eoRealBaseVectorBounds: real bounds for real velocities.
* If the velocities are not real, they won't be bounded by default. Should have a eoBounds ? * If the velocities are not real, they won't be bounded by default. Should have a eoBounds ?
* @param _boundsModifier - An eoRealBoundModifier used to modify the bounds (for real bounds only). * @param _bndsModifier - An eoRealBoundModifier used to modify the bounds (for real bounds only).
* @param _gen - The eo random generator, default=rng * @param _gen - The eo random generator, default=rng
*/ */
eoExtendedVelocity (eoTopology < POT > & _topology, eoExtendedVelocity (eoTopology < POT > & _topology,
@ -204,7 +206,9 @@ protected:
// If the bound modifier doesn't need to be used, use the dummy instance // If the bound modifier doesn't need to be used, use the dummy instance
eoDummyRealBoundModifier dummyModifier; eoDummyRealBoundModifier dummyModifier;
}; };
/** @todo this example does not appear in the doc for an unknown reason
* @example t-eoExtendedVelocity.cpp
* Example of a test program using this class:
*/
#endif /*eoExtendedVelocity_H */ #endif /*eoExtendedVelocity_H */

View file

@ -60,6 +60,8 @@ public :
/// tag to identify a binary function in compile time function selection @see functor_category /// tag to identify a binary function in compile time function selection @see functor_category
struct binary_function_tag {}; struct binary_function_tag {};
}; };
/** @example t-eoFunctop.cpp
*/
/** /**
Basic Function. Derive from this class when defining Basic Function. Derive from this class when defining

View file

@ -81,6 +81,8 @@ class eoGenOp : public eoOp<EOT>, public eoUF<eoPopulator<EOT> &, void>
*/ */
virtual void apply(eoPopulator<EOT>& _pop) = 0; virtual void apply(eoPopulator<EOT>& _pop) = 0;
}; };
/** @example t-eoGenOp.cpp
*/
/** Wrapper for eoMonOp */ /** Wrapper for eoMonOp */

View file

@ -183,6 +183,8 @@ class eoInitPermutation: public eoInit<EOT>
unsigned startFrom; unsigned startFrom;
UF_random_generator<unsigned int> gen; UF_random_generator<unsigned int> gen;
}; };
/** @example t-eoInitPermutation.cpp
*/
/** /**

View file

@ -54,6 +54,8 @@ template <class FitT> class eoInt: public eoVector<FitT, int>
} }
}; };
/** @example t-eoInt.cpp
*/
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------

View file

@ -63,10 +63,16 @@ Variators are operators that modify individuals.
Selectors are operators that select a subset of a population. Selectors are operators that select a subset of a population.
Example:
@include t-eoSelect.cpp
@defgroup Replacors Replacement operators @defgroup Replacors Replacement operators
Replacors are operators that replace a subset of a population by another set of individuals. Replacors are operators that replace a subset of a population by another set of individuals.
Here is an example with several replacement operators:
@include t-eoReplacement.cpp
*/ */
/** Abstract data types for EO operators. /** Abstract data types for EO operators.

View file

@ -84,5 +84,7 @@ template<class Chrom> class eoOrderXover: public eoQuadOp<Chrom>
} }
}; };
/** @example t-eoOrderXover.cpp
*/
#endif #endif

View file

@ -81,5 +81,7 @@ private :
typedef std::vector<typename EOT::Fitness> FitVec; typedef std::vector<typename EOT::Fitness> FitVec;
FitVec cumulative; FitVec cumulative;
}; };
/** @example t-eoRoulette.cpp
*/
#endif #endif

View file

@ -188,5 +188,7 @@ protected:
unsigned neighborhoodSize; unsigned neighborhoodSize;
bool isSetup; bool isSetup;
}; };
/** @example t-eoRingTopology.cpp
*/
#endif /*EORINGTOPOLOGY_H_*/ #endif /*EORINGTOPOLOGY_H_*/

View file

@ -79,6 +79,9 @@ class eoScalarFitness
private : private :
ScalarType value; ScalarType value;
}; };
/** @example t-eofitness.cpp
*
*/
/** /**
Typedefs for fitness comparison, Maximizing Fitness compares with less, Typedefs for fitness comparison, Maximizing Fitness compares with less,

View file

@ -77,6 +77,8 @@ public:
private: private:
static std::vector<std::string> TermDescriptions; static std::vector<std::string> TermDescriptions;
}; };
/** @example t-eoFitnessAssembled.cpp
*/
//! Implements fitness as std::vector, storing all values that might occur during fitness assembly //! Implements fitness as std::vector, storing all values that might occur during fitness assembly
/*! Properties: /*! Properties:
@ -237,6 +239,10 @@ public:
bool operator>=(const eoScalarFitnessAssembled<ScalarType, Compare, FitnessTraits>& y ) const { return !(*this < y); } bool operator>=(const eoScalarFitnessAssembled<ScalarType, Compare, FitnessTraits>& y ) const { return !(*this < y); }
}; };
/**
* @example t-eoFitnessAssembledEA.cpp
*/
/** /**
Typedefs for fitness comparison, Maximizing Fitness compares with less, Typedefs for fitness comparison, Maximizing Fitness compares with less,

View file

@ -64,6 +64,8 @@ public:
} }
}; };
/** @example t-eoSecondsElapsedContinue.cpp
*/
#endif #endif

View file

@ -53,6 +53,8 @@ class eoSelectOne : public eoUF<const eoPop<EOT>&, const EOT&>
(void)_pop; (void)_pop;
} }
}; };
/** @example t-eoSelectOne.cpp
*/
#endif #endif

View file

@ -53,5 +53,7 @@ public:
private : private :
eoSharing<EOT> sharing; // derived from eoPerf2Worth eoSharing<EOT> sharing; // derived from eoPerf2Worth
}; };
/** @example t-eoSharing.cpp
*/
#endif #endif

Some files were not shown because too many files have changed in this diff Show more