Solvers

To configure a solver, you must first initialize the Engine with the list of all the solvers you want to use, and then you must specify the specific solver to use for each run. Trident will load certain solvers by default:

  • COIN-CLP

  • IBM Cplex

COIN-CLP

The COIN Linear Programming solver is supported by default and is provided as part of the Trident python package. It is enabled by default.

To load it explicitly, provide the following parameter to Engine:

engine = Engine(solver_modules=["trident.solver.coin"])

To use the solver in a run, specify in the run config:

{
    // ...
    "solver": {"name": "coin-clp"}
    // ...
}

IBM Cplex

Integration with the Cplex solver for solving hydro power optimization problems is provided by default. The cplex sovler DLL is not provided as part of the trident python package, and must be provided separately by the user.

To load it explicitly, provide the following parameter to Engine:

engine = Engine(solver_modules=["trident.solver.cplex"])

To use the solver in a run, specify in the run config:

{
    // ...
    "solver": {"name": "cplex"}
    // ...
}

Providing the Cplex solver on Windows or Linux

If the cplex solver DLL is present on your system, you can provide the path to Trident via the CPLEX_DLL_PATH environment variable on Windows, or the LD_LIBRARY_PATH environment variable on Linux.

If IBM Cplex Studio is installed on your system, then Trident will automatically detect the path to the solver.

Disabling Cplex

To disable loading of the Cplex solver, there are two options:

  • Either: set the TRIDENT_WITH_CPLEX enironment variable to 0.

  • Or: explicitly provide the solver_modules parameter to Engine.

LP solver algorithm

You can specify which LP algorithm to use in the run config:

{
    // ...
    "solver": {
        "name": "cplex",
        "algorithm": "dual_simplex"
    }
    // ...
}

Supported values are:

  • “dual_simplex”

  • “barrier”

  • “primal_simplex”