https://github.com/lab11/s2sim-python-client-lib
A Python library for S2Sim clients.
https://github.com/lab11/s2sim-python-client-lib
Last synced: 11 months ago
JSON representation
A Python library for S2Sim clients.
- Host: GitHub
- URL: https://github.com/lab11/s2sim-python-client-lib
- Owner: lab11
- Created: 2014-11-10T20:35:18.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2014-11-15T00:14:29.000Z (over 11 years ago)
- Last Synced: 2025-03-12T17:50:28.011Z (over 1 year ago)
- Language: Python
- Homepage:
- Size: 148 KB
- Stars: 0
- Watchers: 11
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README
Awesome Lists containing this project
README
To Do:
- Extend S2SimSession and the messages to reflect the new interoperability doc
- Write a sample negotiation/forecast client? Will need for testing anyway.
- Robustification of S2SimSession connection to timeouts
Python Client API:
# Create a S2Sim session object with an object name (must be obtained from S2Sim maintainers).
session = S2SimSession(obj_name)
# Connect to the S2Sim server. At this time, address='seelabc.ucsd.edu' and port=26999.
session.s2sim_connect(address, port)
# Disconnect cleanly from the S2Sim server.
session.s2sim_disconnect()
# Report your energy demand for the interval.
session.report_power(power_consumed)
# Get simulation time from S2Sim server.
session.get_time()
# Get last known price from S2Sim server. May not be final price for the interval.
session.get_price()
# Send list of projected energy demands in exchange for
session.send_demand_negotiation(energy_demands)
# Block until the client receives the interval price from the S2Sim server.
session.wait_for_price()
# Block until client receives message from S2Sim server
session.receive_from_server()
See S2SimSession.py for implementation details.
See Interoperability Document version XX for API details. (INCLUDE LINK)