deflex.DeflexScenario.solve

DeflexScenario.solve(model, solver='cbc', with_duals=True, **solver_kwargs)

Solve the solph.Model. This method is included in the compute() method and is only needed for advanced usage.

Parameters:
  • model (oemof.solph.Model) –
  • solver (str) –
  • with_duals (bool) –
Other Parameters:
 
  • tee (bool) – Set to False to suppress the solver output (default: True).
  • logfile (str) – Define the path where to store the log file of the solver.

Examples

>>> import deflex as dflx
>>> fn = dflx.fetch_test_files("de02_no-heat_csv")
>>> sc = dflx.create_scenario(fn, "csv")
>>> sc.table2es()
>>> my_model = sc.create_model()
>>> sc.solve(my_model, with_duals=False)  # doctest: +ELLIPSIS
Welcome to the CBC MILP ...
>>> sc.results.keys()
['Problem', 'Solver', 'Solution', 'Main', 'Param', 'Meta']