Author: bugman Date: Mon Jan 7 16:47:41 2008 New Revision: 4435 URL: http://svn.gna.org/viewcvs/relax?rev=4435&view=rev Log: Implemented the grid_search() and overfit_deselect() methods of the N_state_model class. grid_search() calls the non-existant minimise() and therefore still fails. Modified: branches/N_state_model/specific_fns/n_state_model.py Modified: branches/N_state_model/specific_fns/n_state_model.py URL: http://svn.gna.org/viewcvs/relax/branches/N_state_model/specific_fns/n_state_model.py?rev=4435&r1=4434&r2=4435&view=diff ============================================================================== --- branches/N_state_model/specific_fns/n_state_model.py (original) +++ branches/N_state_model/specific_fns/n_state_model.py Mon Jan 7 16:47:41 2008 @@ -33,6 +33,40 @@ """Class containing functions for the N-state model.""" + def grid_search(self, lower, upper, inc, constraints, print_flag, sim_index=None): + """The grid search function. + + @param lower: The lower bounds of the grid search which must be equal to the number of + parameters in the model. + @type lower: array of numbers + @param upper: The upper bounds of the grid search which must be equal to the number of + parameters in the model. + @type upper: array of numbers + @param inc: The increments for each dimension of the space for the grid search. The + number of elements in the array must equal to the number of parameters + in the model. + @type inc: array of int + @param constraints: If true, constraints are applied during the grid search (elinating parts + of the grid). If false, no constraints are used. + @type constraints: bool + @param print_flag: A flag specifying the amount of information to print. The higher the + value, the greater the verbosity. + @type print_flag: int + """ + + # Arguments. + self.lower = lower + self.upper = upper + self.inc = inc + + # Minimisation. + self.minimise(min_algor='grid', constraints=constraints, print_flag=print_flag, sim_index=sim_index) + + + def overfit_deselect(self): + """Dummy function nornally for deselecting spins with insufficient data for minimisation.""" + + def return_data_name(self, name): """ N-state model data type string matching patterns