Simulator interface library for Bonsai AI platform v2
Project description
===========
Bonsai SDK
===========
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
```
Bonsai SDK
===========
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.0.2.tar.gz
(17.2 kB
view hashes)
Built Distribution
Close
Hashes for bonsai_ai-2.0.2-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c2ac5e22f908001a0fc074c6fde964ba2583cf04f81b36f0db3a4034402fec6e |
|
MD5 | 3cae335a514cde13c0b1b07e2182b6fe |
|
BLAKE2b-256 | db0f0987f11df8dd89fe399f8f0a93923627565382edfcebf1b15e8ca93037ad |