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
Metadata
Release files for pyhagl 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pyhagl-0.0.1.tar.gz | 11.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pyhagl-0.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 24.0 kB
Release files / pyhagl-0.0.1.tar.gz
| Download URL | pyhagl-0.0.1.tar.gz |
|---|---|
| Size | 11.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1e676edc59f9def4b4d4452d49a9ed967ebe2affacd23f3c02785b802b619f15
|
|
BLAKE2b-256 checksum How to use checksums |
fa4b9c76c6a110bf21b50260f9011e2cb681a2a0131002f1c4e77b812310752d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-requests/2.31.0
|
Release files / pyhagl-0.0.1-py3-none-any.whl
| Download URL | pyhagl-0.0.1-py3-none-any.whl |
|---|---|
| Size | 12.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
696ab04d021a28465513a0e575322523dbada4e6a0d6c6bf73e1b298f5002fbb
|
|
BLAKE2b-256 checksum How to use checksums |
d297eb781dbafb46e3f109c9b6f36c1416112c6dd0f50d392b5e35577fd2eb78
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-requests/2.31.0
|