Commit ef2e3216 authored by Theo Christiaanse's avatar Theo Christiaanse
Browse files

improved the handleing of the solver_path

parent ad5ce5f3
Loading
Loading
Loading
Loading
Loading
+11 −5
Original line number Diff line number Diff line
@@ -76,7 +76,10 @@ class EHubModel:
        else:
            raise RuntimeError("Can't create a hub with no data.")

    def solve(self, solver_settings: dict = None, is_verbose: bool = False):
    def solve(self,
              solver_settings: dict = None,
              is_verbose: bool = False
              ):
        """
        Solve the model.

@@ -89,22 +92,25 @@ class EHubModel:
        """
        if solver_settings is None:
            solver_settings = DEFAULT_SOLVER_SETTINGS
        print(solver_settings)

        solver      = solver_settings["name"]
        options     = solver_settings["options"]
        print(solver)
        print(options)

        if options is None:
            options = {}

        if not self._compiled:
            self.compile()

        if "solver_path" in solver_settings:
            solver_path = solver_settings["solver_path"]
        else:
            solver_path = None

        # try:
            # Use of the solver path is optional, however,
            # needed when doing cluster submission.
        solver_path = solver_settings["solver_path"]

        print(solver_path)

        status = pylp.solve(objective=self.objective,