Library to describe Gymnasium spaces as Python objects
Project description
Human Abstraction Gymnasium Language (HAGL)
Goal of this library is to simplify work with environment. In some times when you create environment there are necessity to use Box space because of library support, simplicity and etc. For example
Box(-1, 1, (20,))
And then, when implementing step method work with observation as numerical array:
position = observation[0:2]
Such work could be very uncomfortable. One of the existed solution is to use Dict space:
Dict({
"position": Box(-1, 1, (2,)),
"velocity": Box(-1, 1, (2,))
})
Dict can be transformed in Box space with flatten, unflatten and flatten_space functions from Gymnasium. With HAGL it can be written in such way:
class Observation:
position = Position()
velocity = Velocity()
This allows to use objects in step function:
position = observation.position
And then, using compile_type function or HAGLWrapper (for Gymnasium), HAGLParallelWrapper (for PettingZoo) this will be transformed to Box space. Difference of HAGL and Dict is that:
- Can add method to class and use it in step function
- Can use inheritance
- When describe spaces with HAGL there are possibility to use usual python types for float, bool and arrays
- There are some built-in types, for example Position and Velocity.
As a result: HAGL can be used to automate transformation of Gymnasium space representation to Python object
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyhagl-0.0.1.tar.gz.
File metadata
- Download URL: pyhagl-0.0.1.tar.gz
- Upload date:
- Size: 11.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.31.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1e676edc59f9def4b4d4452d49a9ed967ebe2affacd23f3c02785b802b619f15
|
|
| MD5 |
677894ec192ffed4d16cc384b34e8eed
|
|
| BLAKE2b-256 |
fa4b9c76c6a110bf21b50260f9011e2cb681a2a0131002f1c4e77b812310752d
|
File details
Details for the file pyhagl-0.0.1-py3-none-any.whl.
File metadata
- Download URL: pyhagl-0.0.1-py3-none-any.whl
- Upload date:
- Size: 12.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.31.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
696ab04d021a28465513a0e575322523dbada4e6a0d6c6bf73e1b298f5002fbb
|
|
| MD5 |
8a9b17da9fcb25db12f8eee8660325f5
|
|
| BLAKE2b-256 |
d297eb781dbafb46e3f109c9b6f36c1416112c6dd0f50d392b5e35577fd2eb78
|