//////////////////////////////////////////////////////////////////////// /// \class RAT::Optimisers::MetaNSeed /// /// \brief Alter the seed N times and optimise /// /// \author Phil G Jones /// \author Matt Mottram < m.mottram@qmul.ac.uk> -- contact person /// /// REVISION HISTORY:\n /// 26/04/2011 : P G Jones - New file \n /// /// \details Optimises N times with N different seeds and chooses the best. /// Base class for Meta Optimisers that differ only in seeding /// conditions. This class changes the seed using a gaussian spread /// based on the initial seed error. /// //////////////////////////////////////////////////////////////////////// #ifndef __RAT_Optimiser_MetaNSeed__ #define __RAT_Optimiser_MetaNSeed__ #include #include #include #include namespace RAT { namespace Optimisers { class MetaNSeed : public MetaOptimiser { public: ~MetaNSeed(); virtual std::string GetName() const { return MetaNSeed::Name(); } static std::string Name() { return std::string( "metaNSeed" ); } /// Minimise the component virtual double Minimise(); /// Maximise the component virtual double Maximise(); /// Initialise the MetaOptimiser virtual void Initialise( const std::string& param ); /// Load settings from ratdb virtual void BeginOfRun( DS::Run& run ); virtual void EndOfRun( DS::Run& run ); protected: /// Produce a new seed based on the start seed virtual DS::FitResult NewSeed( const DS::FitResult& startSeed ); /// Optimize the component double Optimise(); Optimiser* fOptimiser; ///< Pointer to optimiser used by this meta optimiser, owned by this class => Must delete int fNSeeds; ///< Number of seeds to try double fMinFactor; ///< Min factor, -1 for maximise. }; } //::Optimiser } //::RAT #endif