lib/solvers/cbc.rb contains this code for constructing a solver command:
def solver_command(model_path, solution_path, args)
['coin.cbc', model_path] + args + ['printingOptions', 'all', 'solve', 'solution', solution_path]
end
The 'coin.cbc' part may be different on different platforms. Similarly, lib/solvers/scip.rb uses this code:
def solver_command(model_path, _solution_path, args)
['scip', '-c', "read #{model_path}"] + args +
['-c', 'optimize', '-c', 'display solution', '-c', 'display dualsolution', '-c', 'quit']
end
scip might be in a custom location.
We should use an environment variable to override these default command names. For example,
- CBC defaults to
'coin.cbc', unless the RAMS_SOLVER_PATH_CBC env var is set to override it.
- CLP defaults to
'clp', unless the RAMS_SOLVER_PATH_CLP env var is set to override it.
- etc.
Let's do this for each solver we support.
🤔 Open question: What is the best env var structure?
RAMS_SOLVER_PATH_<SOLVER>
RAMS_<SOLVER>_SOLVER_PATH
lib/solvers/cbc.rbcontains this code for constructing a solver command:The
'coin.cbc'part may be different on different platforms. Similarly,lib/solvers/scip.rbuses this code:scipmight be in a custom location.We should use an environment variable to override these default command names. For example,
'coin.cbc', unless theRAMS_SOLVER_PATH_CBCenv var is set to override it.'clp', unless theRAMS_SOLVER_PATH_CLPenv var is set to override it.Let's do this for each solver we support.
🤔 Open question: What is the best env var structure?
RAMS_SOLVER_PATH_<SOLVER>RAMS_<SOLVER>_SOLVER_PATH