mechmotum / cyipopt

Cython interface for the interior point optimzer IPOPT
Eclipse Public License 2.0
229 stars 54 forks source link

The max_wall_time and max_cpu_time are not working? #171

Closed hssharadga closed 1 year ago

hssharadga commented 1 year ago

The max_wall_time and max_cpu_time are not working?

See example:

nlp = cyipopt.Problem( n=len(x0), m=len(cl), problem_obj=HS071(), lb=lb, ub=ub, cl=cl, cu=cu, )

The following are not working: nlp.add_option('max_wall_time', 20) nlp.add_option('max_cpu_time', 20)

it says TypeError: Error while assigning an option

hssharadga commented 1 year ago

The solution is shown below. I just figured that out, so I thought it would be better to leave the question that might be helpful for others.

It accepts float rather than integer!

nlp.add_option('max_wall_time', 20.0)

nlp.add_option('max_cpu_time', 20.0)

moorepants commented 1 year ago

Thanks for the note, I'll close this but others can find it.