oemof / DHNx

District heating system optimisation and simulation models
MIT License
27 stars 12 forks source link

Solver cmdline options not exposed to user #55

Closed jnettels closed 3 years ago

jnettels commented 3 years ago

Currently, it is not possible to send command line options to the solver. self.om.solve() offers the parameter cmdline_options, but it is not used. I am creating a PR for exposing this parameter to the user. Then the following becomes available (for example):


settings = dict(solver='cbc',
                solve_kw={
                    'tee': True,  # print solver output
                },
                solver_cmdline_options={
                    # 'allowableGap': 1e-5,  # default: 1e-10
                    'ratioGap': 1e-2,  # default: 0
                    'seconds': 60*10,  # default: 1e+100
                    },
                )

network.optimize_investment(invest_options=invest_opt, **settings)