Skip to content

Commit f4533ff

Browse files
Fix issue #50: Improve documentation
1 parent 752c834 commit f4533ff

File tree

2 files changed

+97
-0
lines changed

2 files changed

+97
-0
lines changed

README.md

+87
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,49 @@
33
We envision GDPlib as an open library of GDP models to provide examples for prospective modelers, and to provide a benchmarking set for algorithm developers.
44
We invite contributions to this library from the community, provided under the same BSD-3-clause or compatible license.
55

6+
## Available Models
7+
8+
The library includes the following models:
9+
10+
- [Batch Processing](./gdplib/batch_processing/): Batch processing optimization model
11+
- [Biofuel](./gdplib/biofuel/): Biofuel production optimization
12+
- [CSTR](./gdplib/cstr/): Continuous Stirred Tank Reactor model
13+
- [Disease Model](./gdplib/disease_model/): Disease spread modeling
14+
- [Ex1 Linan 2023](./gdplib/ex1_linan_2023/): Example from Linan's 2023 paper
15+
- [GDP Column](./gdplib/gdp_col/): GDP Column design optimization
16+
- [HDA](./gdplib/hda/): Hydrodealkylation process model
17+
- [Jobshop](./gdplib/jobshop/): Job shop scheduling optimization
18+
- [Kaibel](./gdplib/kaibel/): Kaibel column design
19+
- [Med Term Purchasing](./gdplib/med_term_purchasing/): Medium-term purchasing optimization
20+
- [Methanol](./gdplib/methanol/): Methanol production process
21+
- [Mod HENS](./gdplib/mod_hens/): Modified Heat Exchanger Network Synthesis
22+
- [ModProdNet](./gdplib/modprodnet/): Modular Production Network
23+
- [Positioning](./gdplib/positioning/): Positioning optimization
24+
- [Small Batch](./gdplib/small_batch/): Small batch processing model
25+
- [SpectraLog](./gdplib/spectralog/): Spectral logging optimization
26+
- [Stranded Gas](./gdplib/stranded_gas/): Stranded gas utilization
27+
- [Syngas](./gdplib/syngas/): Syngas production optimization
28+
- [Water Network](./gdplib/water_network/): Water network design
29+
30+
Each model directory contains its own README.md with detailed model descriptions and specific usage instructions.
31+
32+
## Model Size Example
33+
34+
Here's an example of model size metrics for the Jobshop model:
35+
36+
| Component | Number |
37+
|:----------------------|---------:|
38+
| variables | 10 |
39+
| binary_variables | 6 |
40+
| integer_variables | 0 |
41+
| continuous_variables | 4 |
42+
| disjunctions | 3 |
43+
| disjuncts | 6 |
44+
| constraints | 9 |
45+
| nonlinear_constraints | 0 |
46+
47+
You can generate size reports for other models using the `generate_model_size_report.py` script.
48+
649
## Installation
750

851
GDPlib is an installable model library in Python.
@@ -35,6 +78,50 @@ from gdplib.biofuel import build_model as build_biofuel_model
3578
pyomo_model = build_biofuel_model()
3679
```
3780

81+
### Handling Multiple Cases
82+
83+
Many models in GDPlib support multiple cases or configurations. Here are some examples:
84+
85+
1. **Jobshop Scheduling with Different Problem Sizes**:
86+
```python
87+
from gdplib.jobshop import build_model
88+
# Default case
89+
model = build_model()
90+
# Custom case with specific number of jobs and machines
91+
model = build_model(num_jobs=4, num_machines=3)
92+
```
93+
94+
2. **Water Network with Different Configurations**:
95+
```python
96+
from gdplib.water_network import build_model
97+
# Default network configuration
98+
model = build_model()
99+
# Custom configuration with specific parameters
100+
model = build_model(
101+
num_sources=3,
102+
num_sinks=4,
103+
treatment_options=['RO', 'NF', 'UF']
104+
)
105+
```
106+
107+
3. **Batch Processing with Different Products**:
108+
```python
109+
from gdplib.batch_processing import build_model
110+
# Default product mix
111+
model = build_model()
112+
# Custom product mix with specific processing times
113+
model = build_model(
114+
products=['A', 'B', 'C'],
115+
processing_times={
116+
'A': {'mixing': 2, 'reaction': 3, 'separation': 1},
117+
'B': {'mixing': 1, 'reaction': 4, 'separation': 2},
118+
'C': {'mixing': 3, 'reaction': 2, 'separation': 2}
119+
}
120+
)
121+
```
122+
123+
Each model's README.md file contains detailed information about available parameters and their effects on the model behavior.
124+
38125
## Adding models to the library
39126

40127
To add new models to the library, the following steps should be taken:

gdplib/jobshop/model_size_report.md

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
| Component | Number |
2+
|:----------------------|---------:|
3+
| variables | 10 |
4+
| binary_variables | 6 |
5+
| integer_variables | 0 |
6+
| continuous_variables | 4 |
7+
| disjunctions | 3 |
8+
| disjuncts | 6 |
9+
| constraints | 9 |
10+
| nonlinear_constraints | 0 |

0 commit comments

Comments
 (0)