Commit 3d45e08c authored by Theo Christiaanse's avatar Theo Christiaanse
Browse files

little print function to see if the settings land in the right spot.

parent 04a0c42d
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -87,13 +87,13 @@ class EHubModel:
        Returns:
            The results
        """
        print(solver_settings)
        if solver_settings is None:
            solver_settings = DEFAULT_SOLVER_SETTINGS

        solver      = solver_settings["name"]
        options     = solver_settings["options"]


        if options is None:
            options = {}

+4 −2
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@ def solve(
    minimize: bool = False,
    solver: str = "glpk",
    verbose: bool = False,
    options: list = None,
    **kwargs,
) -> Status:
    """
@@ -39,6 +40,7 @@ def solve(
        minimize: True for minimizing; False for maximizing
        solver: The solver to use. Current supports 'glpk', 'theo-cluster' and 'cplex'.
        verbose: If True, output the results of the solver
        options list: add options to the (glpk) solver
        **kwargs: is used to set the cluster path

    Returns:
@@ -64,14 +66,14 @@ def solve(

    if solver == "glpk":
        try:
            solver = pulp.solvers.GLPK(msg=verbose, path=kwargs['solver_path'], options=kwargs['options'])
            solver = pulp.solvers.GLPK(msg=verbose, path=kwargs['solver_path'], options=options)
        except:
            print("solver_path is not set, going to default, without options")
            # This catches the error if glpk_path is not set
            solver = pulp.solvers.GLPK(msg=verbose)
    elif solver == "glpk-cluster":
        try:
            solver = pulp.solvers.GLPK(msg=verbose, path=kwargs['solver_path'], options=kwargs['options'])
            solver = pulp.solvers.GLPK(msg=verbose, path=kwargs['solver_path'], options=options)
        except:
            print("solver_path is not set, going to default.")
            # This catches the error if glpk_path is not set