Remove eoBinaryTerm, should not have been here in the first place
This commit is contained in:
parent
7ac7389589
commit
2af4074c2c
1 changed files with 0 additions and 70 deletions
|
|
@ -52,75 +52,5 @@ public:
|
||||||
virtual bool operator() ( const eoPop< EOT >& _pop ) = 0 ;
|
virtual bool operator() ( const eoPop< EOT >& _pop ) = 0 ;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/** eoParamTerm, a terminator that compares two statistics and decides whether the
|
|
||||||
* algorithm should stop or not.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <utils/eoParam.h>
|
|
||||||
|
|
||||||
template<class EOT, class Pred>
|
|
||||||
class eoBinaryTerm : public eoTerm<EOT>
|
|
||||||
{
|
|
||||||
public :
|
|
||||||
|
|
||||||
typedef typename Pred::first_argument_type first_argument_type;
|
|
||||||
typedef typename Pred::second_argument_type second_argument_type;
|
|
||||||
|
|
||||||
/// Ctors/dtors
|
|
||||||
eoBinaryTerm(first_argument_type& _param1, second_argument_type& _param2) : param1(_param1), param2(_param2), compare() {}
|
|
||||||
|
|
||||||
virtual ~eoBinaryTerm() {};
|
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
virtual bool operator() ( const eoPop< EOT >& _pop )
|
|
||||||
{
|
|
||||||
return compare(param1, param2);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Class name.
|
|
||||||
virtual string className() const { return "eoStatTerm"; }
|
|
||||||
|
|
||||||
private :
|
|
||||||
|
|
||||||
first_argument_type& param1;
|
|
||||||
second_argument_type& param2;
|
|
||||||
Pred compare;
|
|
||||||
};
|
|
||||||
|
|
||||||
#include <utility>
|
|
||||||
/** Combined termination condition for the genetic algorithm
|
|
||||||
*
|
|
||||||
* The eoCombinedTerm will perform a logical and on all the terminators
|
|
||||||
* contained in it. This means that the terminator will say stop (return false)
|
|
||||||
* when one of the contained terminators says so
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* So now you can say:
|
|
||||||
|
|
||||||
eoTerm1<EOT> term1;
|
|
||||||
eoTerm2<EOT> term2;
|
|
||||||
eoCombinedTerm<EOT> term3(term1, term2);
|
|
||||||
|
|
||||||
|
|
||||||
template <class EOT>
|
|
||||||
class eoCombinedTerm : public eoTerm<EOT>, public std::pair<eoTerm<EOT>&, eoTerm<EOT>& >
|
|
||||||
{
|
|
||||||
public :
|
|
||||||
|
|
||||||
eoCombinedTerm(const eoTerm<EOT>& _first, const eoTerm<EOT>& _second) : std::pair(_first, _second) {}
|
|
||||||
|
|
||||||
~eoCombinedTerm() {}
|
|
||||||
|
|
||||||
bool operator()(const eoPop<EOT>& _pop)
|
|
||||||
{
|
|
||||||
if (first(_pop))
|
|
||||||
return second(_pop);
|
|
||||||
|
|
||||||
return false; // quit evolution
|
|
||||||
}
|
|
||||||
};
|
|
||||||
*/
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
||||||
Reference in a new issue