-
Notifications
You must be signed in to change notification settings - Fork 5
/
fleet_interface.py
51 lines (39 loc) · 1.33 KB
/
fleet_interface.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
# -*- coding: utf-8 -*- {{{
#
# Your license here
# }}}
class FleetInterface:
"""
This class is base class for all services
"""
def __init__(self, *args, **kwargs):
"""
Constructor
"""
pass
def process_request(self, ts, P_req, Q_req):
"""
Request for timestep ts
:param P_req:
:param Q_req:
:return res: an instance of FleetResponse
"""
pass
def forecast(self, requests):
"""
Request for current timestep
:param requests: list of requests
:return res: list of FleetResponse
"""
pass
def change_config(self, **kwargs):
"""
This function is here for future use. The idea of having it is for a service to communicate with a fleet
in a nondeterministic manner during a simulation
:param kwargs: a dictionary of (key, value) pairs. The exact keys are decided by a fleet.
Example: Some fleets can operate in an autonomous mode, where they're not responding to requests,
but watching, say, the voltage. If the voltage dips below some defined threshold (which a service might define),
then the fleet responds in a pre-defined way.
In this example, the kwargs can be {"voltage_threshold": new_value}
"""
pass