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

change the default solver used in Citibike OnlineLP example, from GLPK to CBC #391

Merged
merged 1 commit into from
Sep 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions examples/citi_bike/online_lp/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
# Performance

## Solver Used

To get stable problem solution, the experiments are made with **GLPK solver**.
To use GLPK solver, you need to first install the GLPK package in your platform
accordingly. Then replace the *PULP_CBC_CMD* solver with GLPK in the code.

```python
from pulp import GLPK

class CitiBikeILP():

def _formulate_and_solve(...):
...
problem.solve(GLPK(msg=0))
```

## Configuration

Below are the final environment metrics of the onlineLP in different topologies.
For each experiment, we setup the environment and test for a duration of 1 week
with environment random seed 0, 128, 1024. Besides the parameter listed in the
Expand Down
4 changes: 2 additions & 2 deletions examples/citi_bike/online_lp/citi_bike_ilp.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from typing import List, Tuple

import numpy as np
from pulp import GLPK, LpInteger, LpMaximize, LpProblem, LpVariable, lpSum
from pulp import PULP_CBC_CMD, LpInteger, LpMaximize, LpProblem, LpVariable, lpSum

from maro.utils import DottableDict

Expand Down Expand Up @@ -176,7 +176,7 @@ def _formulate_and_solve(
self._init_variables(init_inventory=init_inventory)
self._add_constraints(problem=problem, demand=demand, supply=supply)
self._set_objective(problem=problem)
problem.solve(GLPK(msg=0))
problem.solve(PULP_CBC_CMD(msg=0))

# ============================= private end =============================

Expand Down