You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue is to address the raising of an error when optimization options try to be changed after an initial optimization is solved. That is in something like the following:
# Instantiate optimization problem
opt_problem = optimization.Optimization(model, \
optimization.EnergyMin, \
optimization.JModelica, \
'q_flow');
# Solve optimization problem
opt_problem.optimize(start_time, final_time);
# Get options
opt_options = opt_problem.get_optimization_options();
# Set new options
opt_options['IPOPT_options']['max_iter'] = 2;
opt_options['n_e'] = 2;
opt_options['result_mode'] = 'mesh_points';
opt_problem.set_optimization_options(opt_options)
# Resolve optimization problem
opt_problem.optimize(start_time, final_time);
It will raise the following error:
Traceback (most recent call last):
File "/home/dhb-lx/git/mpcpy/MPCPy/unittests/test_optimization.py", line 261, in test_set_options_iterative
opt_problem.set_optimization_options(opt_options)
File "/home/dhb-lx/git/mpcpy/MPCPy/mpcpy/optimization.py", line 177, in set_optimization_options
return self._package_type._set_optimization_options(opt_options);
File "/home/dhb-lx/git/mpcpy/MPCPy/mpcpy/optimization.py", line 835, in _set_optimization_options
raise KeyError('Key {} is set automatically upon solve.'.format(key));
KeyError: 'Key external_data is set automatically upon solve.'
The text was updated successfully, but these errors were encountered:
This issue is to address the raising of an error when optimization options try to be changed after an initial optimization is solved. That is in something like the following:
It will raise the following error:
The text was updated successfully, but these errors were encountered: