#NEWLINE# def __init__( self , interface , numPlannedRuns , numParams , minBoundary , maxBoundary , initParams , initSimplexDisp , configDict ) : #NEWLINE# #INDENT# super ( NelderController , self ) . __init__ ( interface , numPlannedRuns , numParams , minBoundary , maxBoundary , configDict ) #NEWLINE# self . initParams = nm . asfarray ( initParams ) . flatten ( ) #NEWLINE# self . initSimplexDisp = nm . asfarray ( initSimplexDisp ) . flatten ( ) #NEWLINE# self . numBoundaryHits = 0 #NEWLINE# N = len ( self . initParams ) #NEWLINE# self . sim = nm . zeros ( ( ( N + 1 ) , N ) , dtype = self . initParams . dtype ) #NEWLINE# self . fsim = nm . zeros ( ( ( N + 1 ) , ) , float ) #NEWLINE# self . saveEverything ( ) #NEWLINE# if ( self . numPlannedRuns < self . numParams ) : #NEWLINE# #INDENT# sys . exit ( 'Not enough runs to form initial simplex. Increase the number of experimental runs (much more than number of parameters).' ) #NEWLINE# #UNINDENT# if ( initParams . size != numParams ) : #NEWLINE# #INDENT# sys . exit ( 'Number of initial parameters elements does not match number of parameters.' ) #NEWLINE# #UNINDENT# if ( initSimplexDisp . size != numParams ) : #NEWLINE# #INDENT# sys . exit ( 'Number of initial simplex displacements does not match number of parameters.' ) #NEWLINE# #UNINDENT# if nm . any ( ( self . initParams < self . minBoundary ) ) : #NEWLINE# #INDENT# sys . exit ( 'Initial parameters outside of minimum boundary.' ) #NEWLINE# #UNINDENT# if nm . any ( ( self . maxBoundary < ( self . initParams + self . initSimplexDisp ) ) ) : #NEWLINE# #INDENT# print ( 'WARNING: Initial simplex outside of maximum boundary. Projecting to be within boundaries' ) #NEWLINE# self . initSimplexDisp = ( nm . minimum ( ( self . initParams + self . initSimplexDisp ) , self . maxBoundary ) - self . initParams ) #NEWLINE# #UNINDENT# if ( not nm . all ( nm . isfinite ( self . initParams ) ) ) : #NEWLINE# #INDENT# sys . exit ( 'Initial parameters are infinite of Nan.' ) #NEWLINE# #UNINDENT# if ( not nm . all ( nm . isfinite ( self . initSimplexDisp ) ) ) : #NEWLINE# #INDENT# sys . exit ( 'Initial simplex displacements are infinite of Nan.' )