Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

spopt as solver agnostic? #49

Closed
jGaboardi opened this issue May 11, 2020 · 5 comments
Closed

spopt as solver agnostic? #49

jGaboardi opened this issue May 11, 2020 · 5 comments

Comments

@jGaboardi
Copy link
Member

The current implementation of BaseSpOptExactSolver sets the solver to the ortools wrapper for CBC: pywraplp.Solver. In order to make spopt child model classes solver agnostic should we remove the declaration of self.spOptSolver here and have self.solve as an @abstractmethod like in BaseSpOptHeuristicSolver?

Related: #18

@jGaboardi
Copy link
Member Author

jGaboardi commented Jun 5, 2020

or maybe have a parameter for solver in BaseSpOptExactSolver? For example, with mip

import mip

class BaseSpOptExactSolver(BaseSpOptSolver):
    def __init__(self, solver):
        self.spOptSolver = solver
    def solve(self):
        self.spOptSolver.solve()


BaseSpOptExactSolver(mip.Model("name"))

@jGaboardi
Copy link
Member Author

jGaboardi commented Jun 5, 2020

@xf37 @knaaptime @sjsrey

UPDATE

We decided on adopting mip a specific package, which is itself solver agnostic. Currently supports:

Highlights

  • region previously used pulp
  • migrating models from pulp to mip is straightforward
  • find regionalization models from last release of region that still used pulp for implementation

@jGaboardi
Copy link
Member Author

We can close this issue after the following:

  • documentation is updated (README.md, etc.)
  • at least one functional model is merged into the code base
  • other?

@jGaboardi
Copy link
Member Author

Other options to round out the discussion:

@jGaboardi
Copy link
Member Author

closing for now -- solver agnostic is the way to go -- we just have to make sure the include all necessary solvers/wrappers in the requirements, etc.

@jGaboardi jGaboardi moved this from To do to Done in Release v0.2.0 Aug 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

2 participants