#include #include #include #include #include using namespace RAT::Optimisers; using namespace std; void Grid::Initialise( const std::string& param ) { // Convert input string to fDiv, else make fDiv take default val if ( param.empty() ){ fDiv=40; } else { stringstream strStream(param); strStream >> fDiv; } } double Grid::Minimise() { fMinFactor = 1.0; return fMinFactor*Evaluate(); } double Grid::Maximise() { fMinFactor = -1.0; return fMinFactor*Evaluate(); } double Grid::Evaluate() { // Get initial seed parameters fParams = fComponent->GetParams(); fPositiveErrors = fComponent->GetPositiveErrors(); fNegativeErrors = fComponent->GetNegativeErrors(); fTotalDim=fParams.size(); // Initialise starting point of mixed space grid and increments fStartPos = fParams; fIncrements = fParams; // Range to be evaluated is from (seed-NegativeError) to (seed+PositiveError) for (int ii=0; ii coords, int dimension ) { for( int spacePosition=0 ; spacePosition