-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmarket_model.py
54 lines (43 loc) · 1.87 KB
/
market_model.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
54
import numpy as np
from WaterMarket import WaterMarket
basin_matrix = np.array([[0, 0, 1, 1, 0, 0, 0, 0],
[0, 0, 0, 0, 1, 1, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 1, 1],
[0, 0, 0, 0, 0, 0, 1, 1],
[0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0]])
out_min = np.array([[0, 0, 12, 10, 0, 0, 0, 0],
[0, 0, 0, 0, 8, 6, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 7.5, 5],
[0, 0, 0, 0, 0, 0, 7.5, 5],
[0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0]])
penalty = np.array([[0, 0, 15, 15, 0, 0, 0, 0],
[0, 0, 0, 0, 15, 15, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 15, 15],
[0, 0, 0, 0, 0, 0, 15, 15],
[0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0]])
water_permit = [50, 40, 20, 20, 20, 20, 20, 20]
res = [15, 15, 25, 25, 25, 25, 45, 45]
u = [[-0.20, 6, -5], # 15, 15, 62.55, 69.57
[-0.13, 6, -6],
[-0.20, 6, -5],
[-0.06, 2.5, 0],
[-0.29, 6.28, -3],
[-0.13, 6, -6],
[-0.15, 7.6, -15],
[-0.056, 3.74, -23]]
beta = [0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2]
mu = [0.05, 0.05, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1]
market = WaterMarket(basin_matrix=basin_matrix, precipitation=[100, 100, 50, 50, 50, 50, 0, 0],u=u, out_min=out_min,
water_permit=water_permit, beta=beta, mu=mu, penalty=penalty, res=res,
market='discriminatory-price')
while market.running:
market.step()