Simulator interface library for Bonsai AI platform v2
Project description
A python library for integrating data sources with Bonsai BRAIN.
Installation
- To install the current release version:
$ pip install bonsai-ai
Usage
Clients will subclass bonsai.Simulator and implement the required methods.
Example:
#!/usr/bin/env python3 import sys from bonsai_ai import Simulator, Brain, Config class MySim(Simulator): def episode_start(self, parameters): initial = {"value": 1.0} return initial def simulate(self, action, objective): terminal = True state = {"value": 1.0} return (state, 1.0, terminal)
Then, the simulator is configured and assigned a BRAIN and run.
def example(): config = Config(sys.argv) brain = Brain(config) sim = MySim(brain, 'example_simulator') while sim.run(): continue
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
bonsai-ai-2.1.1.tar.gz
(29.2 kB
view hashes)
Built Distribution
Close
Hashes for bonsai_ai-2.1.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bcb40d43d6dd1d9d1ae9b4233e2e06ebb3ddbe3046b64770efe4a67ac5cad5f9 |
|
MD5 | 532069ea82ce0a4522b7fac674ee39ab |
|
BLAKE2b-256 | a3d7fb229e8fd99215702b815203e02d9184b17fdd12a7ca6c2032f323dd4050 |