ibpsa / project1-boptest

Building Optimization Performance Tests
Other
101 stars 66 forks source link

IBPSA Project 1 - BOPTEST

Build Status

Building Optimization Performance Tests

Visit the BOPTEST Home Page for more information about the project, software, and documentation.

This repository contains code for the Building Optimization Performance Test framework (BOPTEST) that is being developed as part of the IBPSA Project 2 and was previously developed as part of the IBPSA Project 1.

Structure

Quick-Start to Deploy a Test Case

1) Download this repository. 2) Install Docker and Docker Compose. 3) To build and deploy a test case, use the following commands within the root directory of the extracted software:

4) In a separate process, use the test case API defined below to interact with the test case using your test controller. Alternatively, view and run an example test controller as described below. 5) Shutdown the test case by the command docker-compose down executed in the root directory of this repository

Run an example test controller:

Test Case RESTful API

Example RESTful interaction:

Interaction Request
Advance simulation with control input and receive measurements. POST advance with optional arguments <input_name_u>:<value>, and corresponding <input_name_activate>:<0 or 1>, where 1 enables value overwrite and 0 disables (0 is default)
Initialize simulation to a start time using a warmup period in seconds. Also resets point data history and KPI calculations. PUT initialize with required arguments start_time=<value>, warmup_period=<value>
Receive communication step in seconds. GET step
Set communication step in seconds. PUT step with required argument step=<value>
Receive sensor signal point names (y) and metadata. GET measurements
Receive control signal point names (u) and metadata. GET inputs
Receive test result data for the given point names between the start and final time in seconds. PUT results with required arguments point_names=<list of strings>, start_time=<value>, final_time=<value>
Receive test KPIs. GET kpi
Receive test case name. GET name
Receive boundary condition forecast from current communication step for the given point names for the horizon and at the interval in seconds. PUT forecast with required arguments point_names=<list of strings>, horizon=<value>, interval=<value>
Receive boundary condition forecast available point names and metadata. GET forecast_points
Receive current test scenario. GET scenario
Set test scenario. Setting the argument time_period performs an initialization with predefined start time and warmup period and will only simulate for predefined duration. | PUT scenario with optional arguments electricity_price=<string>, time_period=<string>. See README in /testcases for options and test case documentation for details.
Receive BOPTEST version. GET version
Submit KPIs, other test information, and optional string tags (up to 10) to online dashboard. Requires a formal test scenario to be completed, initialized using the PUT scenario API. | POST submit with required argument api_key=<string> and optional arguments tag#=<string> where # is an integer between 1 and 10. The API key can be obtained from the user account registered with the online dashboard.

Development

Community development is welcome through reporting issues and/or making pull requests. If making a pull request, make sure an issue is opened first, name the development branch according to the convention issue<issue#>_<descriptor>, and cite in the pull request which issue is being addressed.

This repository uses pre-commit to ensure that the files meet standard formatting conventions (such as line spacing, layout, etc). Presently only a handful of checks are enabled and will expanded in the near future. To run pre-commit first install pre-commit into your Python version using pip pip install pre-commit. Pre-commit can either be manually by calling pre-commit run --all-files from within the BOPTEST checkout directory, or you can install pre-commit to be run automatically as a hook on all commits by calling pre-commit install in the root directory of the BOPTEST GitHub checkout.

Additional Software

Deployment as a Web-Service

BOPTEST is delpoyed as a web-service using BOPTEST-Service. See the related section in the user guide for getting started.

OpenAI-Gym Environment

An OpenAI-Gym environment for BOPTEST is implemented in ibpsa/project1-boptest-gym. See the documentation there for getting started.

BACnet Interface

A BACnet interface for BOPTEST is implemented in the /bacnet directory of this repository. See the /bacnet/README.md there for getting started.

Results Dashboard

A proposed BOPTEST home page and dashboard for creating accounts and sharing results is published here https://xd.adobe.com/view/0e0c63d4-3916-40a9-5e5c-cc03f853f40a-783d/.

Use Cases and Development Requirements

See the wiki for use cases and development requirements.

Publications

To cite, please use:

D. Blum, J. Arroyo, S. Huang, J. Drgona, F. Jorissen, H.T. Walnum, Y. Chen, K. Benne, D. Vrabie, M. Wetter, and L. Helsen. (2021). "Building optimization testing framework (BOPTEST) for simulation-based benchmarking of control strategies in buildings." Journal of Building Performance Simulation, 14(5), 586-610.

Additional publications:

See the Publications page.