This operator shrinks the population size (i.e. it "decimates" the population). The decimation is done by keeping the n best individuals of the population, where n is
and ratio is the decimation ratio, which is less than or equal to 1.0.
More...
#include <beagle/DecimateOp.hpp>
Inheritance diagram for Beagle::DecimateOp:

Public Types | |
| typedef AllocatorT< DecimateOp, Operator::Alloc > | Alloc |
| DecimateOp allocator type. | |
| typedef PointerT< DecimateOp, Operator::Handle > | Handle |
| DecimateOp handle type. | |
| typedef ContainerT< DecimateOp, Operator::Bag > | Bag |
| DecimateOp bag type. | |
Public Member Functions | |
| DecimateOp (string inDecimationRatioName="ec.decimation.ratio", string inName="DecimateOp") | |
| Construct a plain new decimation operator. | |
| virtual | ~DecimateOp () |
| virtual void | initialize (System &ioSystem) |
| Initialize the decimation operator. | |
| virtual void | operate (Deme &ioDeme, Context &ioContext) |
| Apply the decimation operation on the deme. | |
| virtual PointerT< Operator, NamedObject::Handle > | giveReference () |
| Give a reference to the current operator. | |
| virtual void | readWithMap (PACC::XML::ConstIterator inIter, OperatorMap &inOpMap) |
| Read an operator from a XML subtree. | |
| virtual void | write (PACC::XML::Streamer &ioStreamer, bool inIndent=true) const |
| Write an operator into an XML stream. | |
| bool | isInitialized () const |
| bool | isPostInitialized () const |
| virtual void | postInit (System &ioSystem) |
| Post-initialization operator hook. | |
| void | setInitialized (bool inInitialized=true) |
| Set the operator initialization state. | |
| void | setPostInitialized (bool inPostInitialized=true) |
| Set the operator initialization state. | |
| virtual void | read (PACC::XML::ConstIterator inIter) |
| Reading a operator with method read is undefined. Use readWithMap instead. | |
| virtual const string & | getName () const |
| Returns the name of the object. | |
| virtual void | setName (const string &inName) |
| Sets the name of the object. | |
| virtual bool | isEqual (const Object &inRightObj) const |
| Test if an object is equal to another. | |
| virtual bool | isLess (const Object &inRightObj) const |
| Test if an object is less than another. | |
| virtual string | serialize (bool inIndent=false, unsigned int inIndentWidth=0) const |
| Transform an Object into a linear string (using write method). | |
| unsigned int | getRefCounter () const |
| Gives the number of smart pointers that refer to the actual object. | |
| Object * | refer () |
| Increments the reference counter and returns a pointer to the actual object. | |
| void | unrefer () |
| Decrement the reference counter and deletes the actual object if it reaches zero. | |
Protected Attributes | |
| UIntArray::Handle | mPopSize |
| Population size for the evolution. | |
| Float::Handle | mDecimationRatio |
| Decimation ratio for the actual population. | |
| string | mDecimationRatioName |
| Decimation ratio parameter name. | |
Related Functions | |
| (Note that these are not member functions.) | |
| template<class CastPointerType> | |
| CastPointerType | castObjectT (Beagle::Object *inObject) |
| Cast a Beagle::Object pointer into a CastType pointer. | |
| template<class CastPointerType> | |
| CastPointerType | castObjectT (const Beagle::Object *inObject) |
| Cast a Beagle::Object constant pointer into a CastType constant pointer. | |
| template<class CastRefType> | |
| CastRefType | castObjectT (Beagle::Object &inObject) |
| Cast a Beagle::Object reference into a CastType reference. | |
| template<class CastConstRefType> | |
| CastConstRefType | castObjectT (const Beagle::Object &inObject) |
| Cast a Beagle::Object constant reference into a CastType constant reference. | |
| template<class CastType> | |
| CastType::Handle & | castHandleT (Beagle::Object::Handle &inObject) |
| Cast a Beagle::Object smart pointer into a CastType handle type. | |
| template<class CastType> | |
| const CastType::Handle & | castHandleT (const Beagle::Object::Handle &inObject) |
| Cast a constant Beagle::Object smart pointer into a constant CastType handle type. | |
| bool | operator< (const Beagle::Object &inLeftObj, const Beagle::Object &inRightObj) |
| Test whether an object is less than another. | |
| bool | operator<= (const Beagle::Object &inLeftObj, const Beagle::Object &inRightObj) |
| Test whether an object is less than, or equal to another. | |
| bool | operator> (const Beagle::Object &inLeftObj, const Beagle::Object &inRightObj) |
| Test whether an object is more than another. | |
| bool | operator>= (const Beagle::Object &inLeftObj, const Beagle::Object &inRightObj) |
| Test whether an object is more than, or equal to another. | |
| bool | operator== (const Beagle::Object &inLeftObj, const Beagle::Object &inRightObj) |
| Test whether an object is equal to another. | |
| bool | operator!= (const Beagle::Object &inLeftObj, const Beagle::Object &inRightObj) |
| Test whether an object is not equal to another. | |
This operator shrinks the population size (i.e. it "decimates" the population). The decimation is done by keeping the n best individuals of the population, where n is
and ratio is the decimation ratio, which is less than or equal to 1.0.
The name of the decimation ratio defaults to "ec.decimation.ratio".
A special decimation ratio exists: -1.0. If this ratio is used then the population will be reduced to the size specified in the register variable "ec.pop.size". If the use of this special ratio would result in an increase in the population size then an exception is thrown.
To increase the size of the population, consider Beagle::OversizeOp.
Definition at line 81 of file DecimateOp.hpp.
|
|
DecimateOp allocator type.
Reimplemented from Beagle::Operator. Definition at line 87 of file DecimateOp.hpp. |
|
|
DecimateOp bag type.
Reimplemented from Beagle::Operator. Definition at line 93 of file DecimateOp.hpp. |
|
|
DecimateOp handle type.
Reimplemented from Beagle::Operator. Definition at line 90 of file DecimateOp.hpp. |
|
||||||||||||
|
Construct a plain new decimation operator.
Definition at line 49 of file DecimateOp.cpp. |
|
|
Definition at line 97 of file DecimateOp.hpp. |
|
|
|
Gives the number of smart pointers that refer to the actual object.
Definition at line 185 of file Object.hpp. Referenced by Beagle::ObjectException::setObjectState(). |
|
|
Give a reference to the current operator.
Reimplemented in Beagle::IfThenElseOp. Definition at line 58 of file Operator.cpp. References Beagle_StackTraceBeginM, and Beagle_StackTraceEndM. |
|
|
Initialize the decimation operator.
Reimplemented from Beagle::Operator. Definition at line 59 of file DecimateOp.cpp. References Beagle::Register::addEntry(), Beagle_StackTraceBeginM, Beagle_StackTraceEndM, Beagle::Register::getEntry(), Beagle::System::getRegister(), Beagle::Operator::initialize(), Beagle::Register::isRegistered(), mDecimationRatio, mDecimationRatioName, and mPopSize. |
|
|
Test if an object is equal to another.
Reimplemented in Beagle::ArrayT< T >, Beagle::Container, Beagle::FitnessMultiObj, Beagle::FitnessSimple, Beagle::Map, Beagle::WrapperT< T >, Beagle::GA::BitString, Beagle::GA::ESVector, Beagle::GA::FloatVector, Beagle::GA::IntegerVector, Beagle::GP::Primitive, and Beagle::GP::Tree. Definition at line 111 of file Object.cpp. References Beagle_StackTraceBeginM, Beagle_StackTraceEndM, Beagle_UndefinedMethodInternalExceptionM, and Beagle::Object::getName(). Referenced by Beagle::Object::operator!=(), Beagle::Object::operator<=(), Beagle::Object::operator==(), and Beagle::Object::operator>=(). |
|
|
Definition at line 167 of file Operator.hpp. References Beagle_StackTraceBeginM, and Beagle_StackTraceEndM. |
|
|
Test if an object is less than another.
Reimplemented in Beagle::ArrayT< T >, Beagle::Container, Beagle::FitnessMultiObj, Beagle::FitnessMultiObjMin, Beagle::FitnessSimple, Beagle::FitnessSimpleMin, Beagle::Map, Beagle::WrapperT< T >, Beagle::GA::BitString, Beagle::GA::FloatVector, and Beagle::GA::IntegerVector. Definition at line 125 of file Object.cpp. References Beagle_StackTraceBeginM, Beagle_StackTraceEndM, Beagle_UndefinedMethodInternalExceptionM, and Beagle::Object::getName(). Referenced by Beagle::Object::operator<(), Beagle::Object::operator<=(), Beagle::Object::operator>(), and Beagle::Object::operator>=(). |
|
|
Definition at line 177 of file Operator.hpp. References Beagle_StackTraceBeginM, and Beagle_StackTraceEndM. |
|
||||||||||||
|
Apply the decimation operation on the deme.
Implements Beagle::Operator. Definition at line 106 of file DecimateOp.cpp. References Beagle_AssertM, Beagle_LogTraceM, Beagle_StackTraceBeginM, Beagle_StackTraceEndM, Beagle_ValidateParameterM, Beagle::Context::getDemeIndex(), Beagle::System::getLogger(), Beagle::Context::getSystem(), mDecimationRatio, mDecimationRatioName, mPopSize, Beagle::ContainerT< T, BaseType >::resize(), and Beagle::uint2ordinal(). |
|
|
Post-initialization operator hook.
Reimplemented in Beagle::IfThenElseOp, Beagle::NPGA2Op, Beagle::NSGA2Op, Beagle::ReplacementStrategyOp, Beagle::GA::MuWCommaLambdaCMAFltVecOp, Beagle::GP::MutationStandardOp, KnapsackEvalOp, TSPEvalOp, SymbRegEvalOp, and SpambaseEvalOp. Definition at line 188 of file Operator.hpp. Referenced by SymbRegEvalOp::postInit(), SpambaseEvalOp::postInit(), TSPEvalOp::postInit(), and KnapsackEvalOp::postInit(). |
|
|
Reading a operator with method read is undefined. Use readWithMap instead.
Reimplemented from Beagle::Object. Definition at line 69 of file Operator.cpp. References Beagle_StackTraceBeginM, Beagle_StackTraceEndM, Beagle_UndefinedMethodInternalExceptionM, and Beagle::NamedObject::getName(). |
|
||||||||||||
|
|
Increments the reference counter and returns a pointer to the actual object.
Definition at line 194 of file Object.hpp. Referenced by Beagle::Pointer::operator=(). |
|
||||||||||||
|
Transform an Object into a linear string (using write method).
Definition at line 153 of file Object.cpp. References Beagle_StackTraceBeginM, Beagle_StackTraceEndM, and Beagle::Object::write(). Referenced by Beagle::GP::ModuleCompressOp::compress(), Beagle::GP::ModuleExpandOp::expand(), Beagle::GP::Primitive::get1stArgument(), Beagle::GP::Tree::interpret(), Beagle::Logger::logObject(), Beagle::Register::readWithSystem(), Beagle::GP::Individual::run(), Beagle::ObjectException::setObjectState(), Beagle::GP::EvaluationOp::setValue(), and Beagle::Coev::GPEvaluationOp::setValue(). |
|
|
Set the operator initialization state.
Definition at line 194 of file Operator.hpp. References Beagle_StackTraceBeginM, and Beagle_StackTraceEndM. |
|
|
Sets the name of the object.
Definition at line 65 of file NamedObject.cpp. References Beagle_StackTraceBeginM, and Beagle_StackTraceEndM. |
|
|
Set the operator initialization state.
Definition at line 205 of file Operator.hpp. References Beagle_StackTraceBeginM, and Beagle_StackTraceEndM. |
|
|
Decrement the reference counter and deletes the actual object if it reaches zero.
Definition at line 203 of file Object.hpp. Referenced by Beagle::Pointer::operator=(), and Beagle::Pointer::~Pointer(). |
|
||||||||||||
|
Write an operator into an XML stream.
Reimplemented from Beagle::Object. Reimplemented in Beagle::BreederOp, Beagle::IfThenElseOp, Beagle::MuCommaLambdaOp, Beagle::MuPlusLambdaOp, Beagle::NSGA2Op, Beagle::OversizeOp, Beagle::ReplacementStrategyOp, Beagle::TermMaxFitnessOp, Beagle::TermMinFitnessOp, and Beagle::GP::TermMaxHitsOp. Definition at line 100 of file Operator.cpp. References Beagle_StackTraceBeginM, Beagle_StackTraceEndM, PACC::XML::Streamer::closeTag(), Beagle::NamedObject::getName(), and PACC::XML::Streamer::openTag(). |
|
||||||||||||
|
Test whether an object is not equal to another.
Definition at line 301 of file Object.hpp. References Beagle::Object::isEqual(). |
|
||||||||||||
|
Test whether an object is less than another.
Definition at line 226 of file Object.hpp. References Beagle::Object::isLess(). |
|
||||||||||||
|
Test whether an object is less than, or equal to another.
Definition at line 241 of file Object.hpp. References Beagle::Object::isEqual(), and Beagle::Object::isLess(). |
|
||||||||||||
|
Test whether an object is equal to another.
Definition at line 286 of file Object.hpp. References Beagle::Object::isEqual(). |
|
||||||||||||
|
Test whether an object is more than another.
Definition at line 256 of file Object.hpp. References Beagle::Object::isLess(). |
|
||||||||||||
|
Test whether an object is more than, or equal to another.
Definition at line 271 of file Object.hpp. References Beagle::Object::isEqual(), and Beagle::Object::isLess(). |
|
|
Decimation ratio for the actual population.
Definition at line 104 of file DecimateOp.hpp. Referenced by initialize(), and operate(). |
|
|
Decimation ratio parameter name.
Definition at line 105 of file DecimateOp.hpp. Referenced by initialize(), and operate(). |
|
|
Population size for the evolution.
Definition at line 103 of file DecimateOp.hpp. Referenced by initialize(), and operate(). |
1.4.4