00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef EOUPDATEGLOBALIFBETTER_H
00012 #define EOUPDATEGLOBALIFBETTER_H
00013
00014
00015 #include <eoParticleBestUpdater.h>
00016 #include <eoParticleArchive.h>
00017
00018
00019
00023 template < class POT > class eoUpdateGlobalIfBetter:public eoParticleBestUpdater <
00024 POT >
00025 {
00026
00027 public:
00029 eoUpdateGlobalIfBetter (eoSingleParticleArchive < POT > &_archive):archive(_archive) {}
00030
00031 void operator () (POT & _po)
00032 {
00033
00034 if (_po.fitness () > archive.best ().fitness())
00035 archive.best (_po);
00036 }
00037
00038 protected:
00039 eoSingleParticleArchive < POT > &archive;
00040
00041 };
00042
00043 #endif
00044
00045