forked from quaquel/EMAworkbench
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsd_prim_wcm.py
53 lines (33 loc) · 1.05 KB
/
sd_prim_wcm.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
"""
Created on Feb 13, 2014
This example demonstrates the use of PRIM. The dataset was generated
using the world container model
(Tavasszy et al 2011; https://dx.doi.org/10.1016/j.jtrangeo.2011.05.005)
"""
import matplotlib.pyplot as plt
from ema_workbench import ema_logging, load_results
from ema_workbench.analysis import prim
ema_logging.log_to_stderr(ema_logging.INFO)
default_flow = 2.178849944502783e7
def classify(outcomes):
ooi = "throughput Rotterdam"
outcome = outcomes[ooi]
outcome = outcome / default_flow
classes = outcome < 1
return classes
fn = r"./data/5000 runs WCM.tar.gz"
results = load_results(fn)
prim_obj = prim.setup_prim(results, classify, mass_min=0.05, threshold=0.75)
# let's find a first box
box1 = prim_obj.find_box()
# let's analyze the peeling trajectory
box1.show_ppt()
box1.show_tradeoff()
box1.inspect_tradeoff()
box1.write_ppt_to_stdout()
# based on the peeling trajectory, we pick entry number 44
box1.select(44)
# show the resulting box
prim_obj.show_boxes()
prim_obj.boxes_to_dataframe()
plt.show()