function [precision_required] = set_precision(iterations_ratio, precision_automation_type)
% SET_PRECISON: Set precisoon required for the optimiser
%
%    GENERAL
%
%      [precision_required] = set_precision(iterations_ratio)
%
%    INPUT/S
%
%      -iterations_ratio:
%            The ratio between the current iteration and the total number of iterations.
%
%           
%      -precision_automation_type
%            The way in which precision is chosen
%
%    OUTPUT/S
%
%      -precision_required:
%            The precsion required
%
%    PENDING WORK
%
%      -
%
%    KNOWN BUG/S
%
%      -None.
%
%    COMMENT/S
%
%      -
%
%    RELATED FUNCTION/S
%
%      
%
%    ABOUT
%
%      -Created:     May 5th, 2004
%      -Last update: May 5th, 2004
%      -Revision:    0.0.1
%      -Author:      R. S. Schestowitz, University of Manchester
% ==============================================================


switch precision_automation_type,
    
  case 'default'
	if (iterations_ratio > 9),
     precision_required = 1e-3;
	elseif (iterations_ratio > 8),
     precision_required = 1e-4; 
	elseif (iterations_ratio > 6),
     precision_required = 1e-5;            
	elseif (iterations_ratio > 4),
     precision_required = 1e-6;              
	elseif (iterations_ratio > 3),
     precision_required = 1e-7;                          
	elseif (iterations_ratio > 2),
     precision_required = 1e-8;
	else
     precision_required = 1e-10;  
	end
  case 'smart'
     % do some good choice of precision here... use knowledge about
     % optimisation state
    precision_required = 1e-5;
end
