<s> """<STR_LIT>""" <EOL> from numpy . random import normal , rand <EOL> class OnePlusOneEA ( object ) : <EOL> def minimize ( self , parameter , mean , sigma , interval , iterations , args , algorithm ) : <EOL> """<STR_LIT>""" <EOL> feasible = False <EOL> while ( not feasible ) : <EOL> parent = normal ( mean , sigma ) <EOL> if ( interval [ <NUM_LIT:0> ] <= parent <= interval [ <NUM_LIT:1> ] ) : <EOL> print parent <EOL> feasible = True <EOL> args [ parameter ] = parent <EOL> best_error = algorithm ( args ) <EOL> for i in xrange ( iterations ) : <EOL> feasible = False <EOL> while ( not feasible ) : <EOL> offspring = parent + normal ( mean , sigma ) <EOL> if ( interval [ <NUM_LIT:0> ] <= offspring <= interval [ <NUM_LIT:1> ] ) : <EOL> print offspring <EOL> feasible = True <EOL> args [ parameter ] = offspring <EOL> error = algorithm ( args ) <EOL> if ( error < best_error ) : <EOL> parent = offspring <EOL> best_error = error <EOL> print parent , error <EOL> return parent , best_error </s>
