#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace RAT; using namespace RAT::Optimisers; #include #include using namespace std; OptimiserFactory::OptimiserFactory() { fFactory.Register( Minuit::Name(), new Alloc() ); fFactory.Register( MetaNSeed::Name(), new Alloc() ); fFactory.Register( MetaAreaSeed::Name(), new Alloc() ); fFactory.Register( MetaDirectionSeed::Name(), new Alloc() ); fFactory.Register( MetaMedianSeed::Name(), new Alloc() ); fFactory.Register( MetaSphereSeed::Name(), new Alloc() ); fFactory.Register( MetaDriveCorrectSeed::Name(), new Alloc() ); fFactory.Register( Powell::Name(), new Alloc() ); fFactory.Register( Surface::Name(), new Alloc() ); fFactory.Register( Grid::Name(), new Alloc() ); fFactory.Register( SimulatedAnnealing::Name(), new Alloc() ); } void OptimiserFactory::Register( std::string name, AllocBase* allocator ) { fFactory.Register( name, allocator ); } Optimiser* OptimiserFactory::GetOptimiser( const std::string name ) { string optimiserName, initialisation(""); const size_t hyphenPos = name.find( "-" ); if( hyphenPos != string::npos ) { optimiserName = name.substr( 0, hyphenPos ); initialisation = name.substr( hyphenPos + 1 ); } else optimiserName = name; Optimiser* optimiser = fFactory.New( optimiserName ); optimiser->Initialise( initialisation ); return optimiser; }