-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMarketResults.py
72 lines (63 loc) · 2.21 KB
/
MarketResults.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# -*- coding: utf-8 -*-
"""
Created on Sun Apr 19 16:31:19 2020
@author: intgridnb-02
"""
from misc import initializer
class MarketResults():
@initializer
def __init__(self,
name,
issuer="None",
confirmedBids=[],
rejectedBids=[],
partiallyConfirmedBids=[],
marketClearingPrice=9999,
marginalUnit="None",
energyDeficit=0,
energySurplus=0,
status="N/A",
timestamp="N/A"):
"""
Parameters
----------
name : TYPE
DESCRIPTION.
issuer : TYPE, optional
DESCRIPTION. The default is "None".
confirmedBids : TYPE, optional
DESCRIPTION. The default is [].
rejectedBids : TYPE, optional
DESCRIPTION. The default is [].
marketClearingPrice : TYPE, optional
DESCRIPTION. The default is 9999.
marginalUnit : TYPE, optional
DESCRIPTION. The default is "None".
energyDeficit : TYPE, optional
DESCRIPTION. The default is 0.
energySurplus : TYPE, optional
DESCRIPTION. The default is 0.
status : TYPE, optional
DESCRIPTION. The default is "N/A".
timestamp : TYPE, optional
DESCRIPTION. The default is "N/A".
Returns
-------
None.
"""
self.feedback()
#self.describe()
def describe(self):
print("|---------------------------------------------")
print("|Rejected bids: {:>20}".format(len(self.rejectedBids)))
print("|Confirmed bids: {:>19}".format(len(self.confirmedBids)))
print("|Partially confirmed bids: {:>9}".format(len(self.partiallyConfirmedBids)))
print("|Market clearing price: {:>13.2f}".format(self.marketClearingPrice))
print("|---------------------------------------------")
def feedback(self):
for bid in self.confirmedBids:
bid.issuer.feedback(bid)
for bid in self.partiallyConfirmedBids:
bid.issuer.feedback(bid)
for bid in self.rejectedBids:
bid.issuer.feedback(bid)