@@ -81,7 +81,12 @@ def individual_data(indiv):
8181 badvalue = config .getfloat ('EVALUATOR' , 'badvalue' )
8282
8383 # Get the Individual as a formal expressions and make some replacements
84- formal = indiv .get_formal ()
84+ formal = None
85+ if type (indiv .get_formal ()) == list :
86+ formal = indiv .get_formal ()[0 ]
87+ else :
88+ formal = indiv .get_formal ()
89+
8590 # Simulink does not support .*
8691 formal = formal .replace ('.*' , '*' )
8792 # Replace the sensor with a Heaviside step function
@@ -189,14 +194,17 @@ def cost(indiv):
189194 return simulink_results ['j0' ]
190195
191196
192- def show_best (index , indiv , block = True ):
197+ def show_best (index , generation , indiv , cost , block = True ):
193198 # TODO: Add texlive-latex-extra and textlive-latex-recommended in the Wiki if we want to use LaTeX fonts
194199 sl_results = individual_data (indiv )
195200 config = Config .get_instance ()
196201 problem_variables = retrieve_problem_variables (config )
197202 fig_title = create_figure_title (problem_variables , indiv .get_value ())
198203
199- plt .clf ()
204+ fig = plt .figure ()
205+ # Put figure window on top of all other windows
206+ fig .canvas .manager .window .setWindowModality (Qt .ApplicationModal )
207+
200208 plt .rc ('text' , usetex = True )
201209 plt .rc ('font' , family = 'serif' )
202210 plt .suptitle (fig_title )
0 commit comments