Skip to content

Commit 21b1418

Browse files
committed
Update README
1 parent 8d6d78e commit 21b1418

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

README.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,26 @@ pip install psplib
1717

1818
## Example usage
1919

20-
See [this](https://github.com/PyJobShop/PSPLIB/blob/main/example.ipynb) notebook for an example demonstration of PSPLIB.
20+
``` python
21+
>>> from psplib import parse
22+
>>> instance = parse("data/j301_1.sm", instance_format="psplib")
23+
>>> instance.num_resources
24+
4
25+
26+
>>> instance.resources
27+
[Resource(capacity=12, renewable=True), ..., Resource(capacity=12, renewable=True)]
28+
29+
>>> instance.num_activities
30+
32
31+
32+
>>> instance.activities
33+
[Activity(modes=[Mode(duration=0, demands=[0, 0, 0, 0])], successors=[1, 2, 3], delays=None, name=''),
34+
Activity(modes=[Mode(duration=8, demands=[4, 0, 0, 0])], successors=[5, 10, 14], delays=None, name=''),
35+
...,
36+
Activity(modes=[Mode(duration=0, demands=[0, 0, 0, 0])], successors=[], delays=None, name='')]
37+
```
38+
39+
See [this](https://github.com/PyJobShop/PSPLIB/blob/main/example.ipynb) notebook for a slightly longer example demonstration of PSPLIB.
2140

2241
## Instance formats
2342

0 commit comments

Comments
 (0)