forked from DimaKudosh/pydfs-lineup-optimizer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
dimakudosh
authored and
dimakudosh
committed
Jul 8, 2021
1 parent
4a766a1
commit 544d43f
Showing
15 changed files
with
278 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,23 @@ | ||
import os | ||
from typing import Type | ||
from pydfs_lineup_optimizer.solvers.base import Solver | ||
from pydfs_lineup_optimizer.solvers.pulp_solver import PuLPSolver | ||
from pydfs_lineup_optimizer.solvers.constants import SolverSign | ||
from pydfs_lineup_optimizer.solvers.exceptions import SolverException, SolverInfeasibleSolutionException | ||
|
||
|
||
__all__ = ['Solver', 'PuLPSolver', 'SolverSign', 'SolverException', 'SolverInfeasibleSolutionException'] | ||
__all__ = ['Solver', 'PuLPSolver', 'SolverSign', 'SolverException', 'SolverInfeasibleSolutionException', | ||
'get_default_solver'] | ||
|
||
|
||
def get_default_solver() -> Type[Solver]: | ||
solver_backend = os.environ.get('SOLVER_BACKEND') | ||
if solver_backend is None: | ||
return PuLPSolver | ||
solver_backend_name = solver_backend.lower() | ||
if solver_backend_name == 'pulp': | ||
return PuLPSolver | ||
elif solver_backend_name == 'mip': | ||
from pydfs_lineup_optimizer.solvers.mip_solver import MIPSolver | ||
return MIPSolver | ||
raise ValueError('Unknown solver backend: %s' % solver_backend) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.