Getting started
Getting started#
Bauwerk provides Gym environments. Thus, Bauwerk can be used using the standard Gym API as shown below:
import bauwerk
import gym
env = gym.make("bauwerk/SolarBatteryHouse-v0")
obs = env.reset(seed=42)
for _ in range(1000):
action = env.action_space.sample()
obs, reward, terminated, truncated, info = env.step(action)
env.close()
info
The above example shows the Gym API version >=0.26. Between Gym v0.21 and v0.26 this API has changed a lot. For example, env.step() now returns terminated and truncated instead of done.
Bauwerk is compatible with all Gym API versions greater/equal v0.21. To use a specific version of the Gym API, (after installing Bauwerk) run something like:
pip install gym==0.26
By satisfying older versions of this API Bauwerk can be used with popular RL libraries that may not have made the switch to the new API yet (such as stable-baselines3).