feat(moeo): add finalize() lifecycle hook for algorithm post-processing
Add virtual finalize() and hasFinalize() to moeoAlgo/moeoPopAlgo hierarchy. NSGA-II implements finalize() to recompute fitness and diversity assignments after population modifications (e.g. immigrant integration in island model).
This commit is contained in:
parent
3259d1b452
commit
d306ef81d9
3 changed files with 27 additions and 2 deletions
|
|
@ -47,6 +47,14 @@
|
|||
*/
|
||||
template < class MOEOT >
|
||||
class moeoPopAlgo : public moeoAlgo, public eoAlgo < MOEOT >
|
||||
{};
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* Recompute fitness/diversity after external population changes (e.g. immigrant integration).
|
||||
* Default implementation is a no-op. Override in subclasses that need it.
|
||||
* @param _pop the population to finalize
|
||||
*/
|
||||
virtual void finalize(eoPop<MOEOT>&) {}
|
||||
};
|
||||
|
||||
#endif /*MOEOPOPALGO_H_*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue