Search code examples
genetic-algorithmopenmdao

OpenMDAO SimpleGADriver penalty


In SimpleGADriver of OpenMDAO, is the penalty factor applied on the scaled constraint values or the original ones?

In my problem I have an objective and a few constraints each of different orders of magnitude, therefore I apply scaling factors when defining them, for instance: model.add_objective('obj', ref=1e6). This way, at the driver level, I have all functions of the order of 1.

enter image description here

I set penalty_exponent=2 and penalty_parameter=20, which are quite high, yet the driver seems to favour highly unfeasible points with low objective function value.

I would appreciate any tips.


Solution

  • The code is applying the penalty to the scaled objectives and constraints. The relevant lines are here, and specifically lines

    obj_values = self.get_objective_values() and fun = obj + penalty * sum(np.power(constraint_violations, exponent))

    The get_objective_values() method by default returns thing in driver scaled values. The constraints work the same way.