wtf-wildlife-trial-framework 0.0.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- wtf_wildlife_trial_framework-0.0.2.0/LICENSE +21 -0
- wtf_wildlife_trial_framework-0.0.2.0/MANIFEST.in +77 -0
- wtf_wildlife_trial_framework-0.0.2.0/PKG-INFO +85 -0
- wtf_wildlife_trial_framework-0.0.2.0/PYPI_README.md +63 -0
- wtf_wildlife_trial_framework-0.0.2.0/README.md +132 -0
- wtf_wildlife_trial_framework-0.0.2.0/_build_support.py +30 -0
- wtf_wildlife_trial_framework-0.0.2.0/environment.schema.json +2284 -0
- wtf_wildlife_trial_framework-0.0.2.0/environments/a2c.json +165 -0
- wtf_wildlife_trial_framework-0.0.2.0/environments/alpine_pass.json +189 -0
- wtf_wildlife_trial_framework-0.0.2.0/environments/baseline.json +165 -0
- wtf_wildlife_trial_framework-0.0.2.0/environments/champion_lineage.json +173 -0
- wtf_wildlife_trial_framework-0.0.2.0/environments/day_night.json +219 -0
- wtf_wildlife_trial_framework-0.0.2.0/environments/dense_obstacles.json +165 -0
- wtf_wildlife_trial_framework-0.0.2.0/environments/dqn.json +171 -0
- wtf_wildlife_trial_framework-0.0.2.0/environments/enclosed_valleys.json +222 -0
- wtf_wildlife_trial_framework-0.0.2.0/environments/grpo.json +191 -0
- wtf_wildlife_trial_framework-0.0.2.0/environments/highlands.json +185 -0
- wtf_wildlife_trial_framework-0.0.2.0/environments/lake_islands.json +193 -0
- wtf_wildlife_trial_framework-0.0.2.0/environments/mappo.json +197 -0
- wtf_wildlife_trial_framework-0.0.2.0/environments/maskable_ppo.json +204 -0
- wtf_wildlife_trial_framework-0.0.2.0/environments/meandering_river.json +212 -0
- wtf_wildlife_trial_framework-0.0.2.0/environments/mixed_brains.json +185 -0
- wtf_wildlife_trial_framework-0.0.2.0/environments/ppo.json +169 -0
- wtf_wildlife_trial_framework-0.0.2.0/environments/ppo_large_predator.json +195 -0
- wtf_wildlife_trial_framework-0.0.2.0/environments/predator_heavy.json +165 -0
- wtf_wildlife_trial_framework-0.0.2.0/environments/qrdqn.json +201 -0
- wtf_wildlife_trial_framework-0.0.2.0/environments/recurrent_ppo.json +199 -0
- wtf_wildlife_trial_framework-0.0.2.0/environments/reinforce.json +164 -0
- wtf_wildlife_trial_framework-0.0.2.0/environments/river_crossing.json +189 -0
- wtf_wildlife_trial_framework-0.0.2.0/environments/river_crossing_ppo.json +193 -0
- wtf_wildlife_trial_framework-0.0.2.0/environments/river_crossing_strong_predator.json +216 -0
- wtf_wildlife_trial_framework-0.0.2.0/environments/river_crossing_strong_predator_deep.json +216 -0
- wtf_wildlife_trial_framework-0.0.2.0/environments/river_delta.json +193 -0
- wtf_wildlife_trial_framework-0.0.2.0/environments/scarce_food.json +165 -0
- wtf_wildlife_trial_framework-0.0.2.0/maps/alpine_pass.json +54 -0
- wtf_wildlife_trial_framework-0.0.2.0/maps/enclosed_valleys.json +53 -0
- wtf_wildlife_trial_framework-0.0.2.0/maps/highlands.json +54 -0
- wtf_wildlife_trial_framework-0.0.2.0/maps/lake_islands.json +54 -0
- wtf_wildlife_trial_framework-0.0.2.0/maps/meandering_river.json +78 -0
- wtf_wildlife_trial_framework-0.0.2.0/maps/river_crossing.json +54 -0
- wtf_wildlife_trial_framework-0.0.2.0/maps/river_delta.json +63 -0
- wtf_wildlife_trial_framework-0.0.2.0/packaging_assets.json +67 -0
- wtf_wildlife_trial_framework-0.0.2.0/pyproject.toml +43 -0
- wtf_wildlife_trial_framework-0.0.2.0/setup.cfg +4 -0
- wtf_wildlife_trial_framework-0.0.2.0/setup.py +78 -0
- wtf_wildlife_trial_framework-0.0.2.0/viewer/api.mjs +38 -0
- wtf_wildlife_trial_framework-0.0.2.0/viewer/app.js +1221 -0
- wtf_wildlife_trial_framework-0.0.2.0/viewer/behavior-stats.mjs +33 -0
- wtf_wildlife_trial_framework-0.0.2.0/viewer/binary-codec.mjs +187 -0
- wtf_wildlife_trial_framework-0.0.2.0/viewer/birth-highlights.mjs +35 -0
- wtf_wildlife_trial_framework-0.0.2.0/viewer/brain-activations.mjs +267 -0
- wtf_wildlife_trial_framework-0.0.2.0/viewer/branding/favicon.png +0 -0
- wtf_wildlife_trial_framework-0.0.2.0/viewer/branding/favicon.svg +10 -0
- wtf_wildlife_trial_framework-0.0.2.0/viewer/branding/wtf-symbol-dark.png +0 -0
- wtf_wildlife_trial_framework-0.0.2.0/viewer/branding/wtf-symbol-dark.svg +10 -0
- wtf_wildlife_trial_framework-0.0.2.0/viewer/branding/wtf-symbol-light.png +0 -0
- wtf_wildlife_trial_framework-0.0.2.0/viewer/branding/wtf-symbol-light.svg +10 -0
- wtf_wildlife_trial_framework-0.0.2.0/viewer/branding/wtf-symbol-motion-dark.svg +22 -0
- wtf_wildlife_trial_framework-0.0.2.0/viewer/branding/wtf-symbol-motion-light.svg +22 -0
- wtf_wildlife_trial_framework-0.0.2.0/viewer/dashboard-stats.mjs +173 -0
- wtf_wildlife_trial_framework-0.0.2.0/viewer/dashboard.mjs +288 -0
- wtf_wildlife_trial_framework-0.0.2.0/viewer/day-night.mjs +120 -0
- wtf_wildlife_trial_framework-0.0.2.0/viewer/death-highlights.mjs +82 -0
- wtf_wildlife_trial_framework-0.0.2.0/viewer/explainability.mjs +647 -0
- wtf_wildlife_trial_framework-0.0.2.0/viewer/index.html +429 -0
- wtf_wildlife_trial_framework-0.0.2.0/viewer/inspector-stats.mjs +297 -0
- wtf_wildlife_trial_framework-0.0.2.0/viewer/inspector.mjs +431 -0
- wtf_wildlife_trial_framework-0.0.2.0/viewer/kill-highlights.mjs +60 -0
- wtf_wildlife_trial_framework-0.0.2.0/viewer/network-structure.mjs +382 -0
- wtf_wildlife_trial_framework-0.0.2.0/viewer/playback.mjs +242 -0
- wtf_wildlife_trial_framework-0.0.2.0/viewer/replay-codec.mjs +115 -0
- wtf_wildlife_trial_framework-0.0.2.0/viewer/species-style.mjs +37 -0
- wtf_wildlife_trial_framework-0.0.2.0/viewer/style.css +1438 -0
- wtf_wildlife_trial_framework-0.0.2.0/viewer/terrain.mjs +76 -0
- wtf_wildlife_trial_framework-0.0.2.0/viewer/theme.mjs +59 -0
- wtf_wildlife_trial_framework-0.0.2.0/wtf/__init__.py +29 -0
- wtf_wildlife_trial_framework-0.0.2.0/wtf/__main__.py +4 -0
- wtf_wildlife_trial_framework-0.0.2.0/wtf/cli.py +397 -0
- wtf_wildlife_trial_framework-0.0.2.0/wtf/commands.py +30 -0
- wtf_wildlife_trial_framework-0.0.2.0/wtf/config.py +896 -0
- wtf_wildlife_trial_framework-0.0.2.0/wtf/experiment/__init__.py +1 -0
- wtf_wildlife_trial_framework-0.0.2.0/wtf/experiment/early_stopping.py +91 -0
- wtf_wildlife_trial_framework-0.0.2.0/wtf/experiment/lineage.py +150 -0
- wtf_wildlife_trial_framework-0.0.2.0/wtf/experiment/runner.py +645 -0
- wtf_wildlife_trial_framework-0.0.2.0/wtf/inspection/__init__.py +1 -0
- wtf_wildlife_trial_framework-0.0.2.0/wtf/inspection/analyze.py +452 -0
- wtf_wildlife_trial_framework-0.0.2.0/wtf/inspection/explainability.py +378 -0
- wtf_wildlife_trial_framework-0.0.2.0/wtf/inspection/explanations.py +227 -0
- wtf_wildlife_trial_framework-0.0.2.0/wtf/inspection/telemetry.py +203 -0
- wtf_wildlife_trial_framework-0.0.2.0/wtf/learning/__init__.py +1 -0
- wtf_wildlife_trial_framework-0.0.2.0/wtf/learning/activation_diagnostics.py +13 -0
- wtf_wildlife_trial_framework-0.0.2.0/wtf/learning/brain.py +237 -0
- wtf_wildlife_trial_framework-0.0.2.0/wtf/learning/brains.py +263 -0
- wtf_wildlife_trial_framework-0.0.2.0/wtf/learning/contextual_ppo.py +316 -0
- wtf_wildlife_trial_framework-0.0.2.0/wtf/learning/grouped_rollouts.py +178 -0
- wtf_wildlife_trial_framework-0.0.2.0/wtf/learning/mutation.py +88 -0
- wtf_wildlife_trial_framework-0.0.2.0/wtf/learning/optimization.py +58 -0
- wtf_wildlife_trial_framework-0.0.2.0/wtf/learning/policy_gradients.py +417 -0
- wtf_wildlife_trial_framework-0.0.2.0/wtf/learning/ppo.py +538 -0
- wtf_wildlife_trial_framework-0.0.2.0/wtf/learning/qrdqn.py +190 -0
- wtf_wildlife_trial_framework-0.0.2.0/wtf/learning/recurrent_ppo.py +365 -0
- wtf_wildlife_trial_framework-0.0.2.0/wtf/native/__init__.py +1 -0
- wtf_wildlife_trial_framework-0.0.2.0/wtf/native/_kernels.c +369 -0
- wtf_wildlife_trial_framework-0.0.2.0/wtf/native/_kernels_data.h +460 -0
- wtf_wildlife_trial_framework-0.0.2.0/wtf/native/_kernels_math.h +605 -0
- wtf_wildlife_trial_framework-0.0.2.0/wtf/native/_kernels_spatial.h +311 -0
- wtf_wildlife_trial_framework-0.0.2.0/wtf/native/kernels.py +61 -0
- wtf_wildlife_trial_framework-0.0.2.0/wtf/native/numeric.py +94 -0
- wtf_wildlife_trial_framework-0.0.2.0/wtf/progress.py +60 -0
- wtf_wildlife_trial_framework-0.0.2.0/wtf/resources.py +50 -0
- wtf_wildlife_trial_framework-0.0.2.0/wtf/server.py +236 -0
- wtf_wildlife_trial_framework-0.0.2.0/wtf/simulation/__init__.py +1 -0
- wtf_wildlife_trial_framework-0.0.2.0/wtf/simulation/actions.py +19 -0
- wtf_wildlife_trial_framework-0.0.2.0/wtf/simulation/day_night.py +30 -0
- wtf_wildlife_trial_framework-0.0.2.0/wtf/simulation/geography.py +136 -0
- wtf_wildlife_trial_framework-0.0.2.0/wtf/simulation/perception.py +255 -0
- wtf_wildlife_trial_framework-0.0.2.0/wtf/simulation/placement.py +93 -0
- wtf_wildlife_trial_framework-0.0.2.0/wtf/simulation/world.py +1464 -0
- wtf_wildlife_trial_framework-0.0.2.0/wtf/storage/__init__.py +1 -0
- wtf_wildlife_trial_framework-0.0.2.0/wtf/storage/binary_io.py +335 -0
- wtf_wildlife_trial_framework-0.0.2.0/wtf/storage/checkpoint_io.py +279 -0
- wtf_wildlife_trial_framework-0.0.2.0/wtf/storage/compress_recordings.py +256 -0
- wtf_wildlife_trial_framework-0.0.2.0/wtf/storage/library.py +879 -0
- wtf_wildlife_trial_framework-0.0.2.0/wtf/storage/model_io.py +83 -0
- wtf_wildlife_trial_framework-0.0.2.0/wtf/storage/optimize_checkpoints.py +153 -0
- wtf_wildlife_trial_framework-0.0.2.0/wtf/storage/optimize_storage.py +301 -0
- wtf_wildlife_trial_framework-0.0.2.0/wtf/storage/recording.py +419 -0
- wtf_wildlife_trial_framework-0.0.2.0/wtf/storage/replay_codec.py +249 -0
- wtf_wildlife_trial_framework-0.0.2.0/wtf/storage/replay_io.py +42 -0
- wtf_wildlife_trial_framework-0.0.2.0/wtf_wildlife_trial_framework.egg-info/PKG-INFO +85 -0
- wtf_wildlife_trial_framework-0.0.2.0/wtf_wildlife_trial_framework.egg-info/SOURCES.txt +133 -0
- wtf_wildlife_trial_framework-0.0.2.0/wtf_wildlife_trial_framework.egg-info/dependency_links.txt +1 -0
- wtf_wildlife_trial_framework-0.0.2.0/wtf_wildlife_trial_framework.egg-info/entry_points.txt +5 -0
- wtf_wildlife_trial_framework-0.0.2.0/wtf_wildlife_trial_framework.egg-info/requires.txt +1 -0
- wtf_wildlife_trial_framework-0.0.2.0/wtf_wildlife_trial_framework.egg-info/top_level.txt +1 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Sagnik Roy
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
include _build_support.py LICENSE README.md PYPI_README.md pyproject.toml setup.py packaging_assets.json
|
|
2
|
+
recursive-include wtf *.py *.c *.h
|
|
3
|
+
include environment.schema.json
|
|
4
|
+
include environments/a2c.json
|
|
5
|
+
include environments/alpine_pass.json
|
|
6
|
+
include environments/baseline.json
|
|
7
|
+
include environments/champion_lineage.json
|
|
8
|
+
include environments/day_night.json
|
|
9
|
+
include environments/dense_obstacles.json
|
|
10
|
+
include environments/dqn.json
|
|
11
|
+
include environments/enclosed_valleys.json
|
|
12
|
+
include environments/grpo.json
|
|
13
|
+
include environments/highlands.json
|
|
14
|
+
include environments/lake_islands.json
|
|
15
|
+
include environments/mappo.json
|
|
16
|
+
include environments/maskable_ppo.json
|
|
17
|
+
include environments/meandering_river.json
|
|
18
|
+
include environments/mixed_brains.json
|
|
19
|
+
include environments/ppo.json
|
|
20
|
+
include environments/ppo_large_predator.json
|
|
21
|
+
include environments/predator_heavy.json
|
|
22
|
+
include environments/qrdqn.json
|
|
23
|
+
include environments/recurrent_ppo.json
|
|
24
|
+
include environments/reinforce.json
|
|
25
|
+
include environments/river_crossing.json
|
|
26
|
+
include environments/river_crossing_ppo.json
|
|
27
|
+
include environments/river_crossing_strong_predator.json
|
|
28
|
+
include environments/river_crossing_strong_predator_deep.json
|
|
29
|
+
include environments/river_delta.json
|
|
30
|
+
include environments/scarce_food.json
|
|
31
|
+
include maps/alpine_pass.json
|
|
32
|
+
include maps/enclosed_valleys.json
|
|
33
|
+
include maps/highlands.json
|
|
34
|
+
include maps/lake_islands.json
|
|
35
|
+
include maps/meandering_river.json
|
|
36
|
+
include maps/river_crossing.json
|
|
37
|
+
include maps/river_delta.json
|
|
38
|
+
include viewer/api.mjs
|
|
39
|
+
include viewer/app.js
|
|
40
|
+
include viewer/behavior-stats.mjs
|
|
41
|
+
include viewer/binary-codec.mjs
|
|
42
|
+
include viewer/birth-highlights.mjs
|
|
43
|
+
include viewer/brain-activations.mjs
|
|
44
|
+
include viewer/dashboard-stats.mjs
|
|
45
|
+
include viewer/dashboard.mjs
|
|
46
|
+
include viewer/day-night.mjs
|
|
47
|
+
include viewer/death-highlights.mjs
|
|
48
|
+
include viewer/explainability.mjs
|
|
49
|
+
include viewer/index.html
|
|
50
|
+
include viewer/inspector-stats.mjs
|
|
51
|
+
include viewer/inspector.mjs
|
|
52
|
+
include viewer/kill-highlights.mjs
|
|
53
|
+
include viewer/network-structure.mjs
|
|
54
|
+
include viewer/playback.mjs
|
|
55
|
+
include viewer/replay-codec.mjs
|
|
56
|
+
include viewer/species-style.mjs
|
|
57
|
+
include viewer/style.css
|
|
58
|
+
include viewer/terrain.mjs
|
|
59
|
+
include viewer/theme.mjs
|
|
60
|
+
global-exclude __pycache__ *.py[cod] *.so *.pyd *.dylib *.dll
|
|
61
|
+
prune tests
|
|
62
|
+
prune docs
|
|
63
|
+
prune work
|
|
64
|
+
prune examples
|
|
65
|
+
prune results
|
|
66
|
+
prune brain_library
|
|
67
|
+
prune .cache
|
|
68
|
+
prune .venv
|
|
69
|
+
|
|
70
|
+
include viewer/branding/favicon.png
|
|
71
|
+
include viewer/branding/favicon.svg
|
|
72
|
+
include viewer/branding/wtf-symbol-dark.png
|
|
73
|
+
include viewer/branding/wtf-symbol-dark.svg
|
|
74
|
+
include viewer/branding/wtf-symbol-light.png
|
|
75
|
+
include viewer/branding/wtf-symbol-light.svg
|
|
76
|
+
include viewer/branding/wtf-symbol-motion-light.svg
|
|
77
|
+
include viewer/branding/wtf-symbol-motion-dark.svg
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: wtf-wildlife-trial-framework
|
|
3
|
+
Version: 0.0.2.0
|
|
4
|
+
Summary: WTF — Wildlife Trial Framework: a reinforcement learning ecosystem simulator
|
|
5
|
+
Author: Sagnik Roy
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/sagnik1511/wtf
|
|
8
|
+
Project-URL: Documentation, https://sagnik1511.github.io/wtf/
|
|
9
|
+
Project-URL: Source, https://github.com/sagnik1511/wtf
|
|
10
|
+
Project-URL: Issues, https://github.com/sagnik1511/wtf/issues
|
|
11
|
+
Keywords: reinforcement-learning,wtf,simulation,multi-agent
|
|
12
|
+
Classifier: Development Status :: 3 - Alpha
|
|
13
|
+
Classifier: Intended Audience :: Science/Research
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
16
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
17
|
+
Requires-Python: >=3.12
|
|
18
|
+
Description-Content-Type: text/markdown
|
|
19
|
+
License-File: LICENSE
|
|
20
|
+
Requires-Dist: tqdm<5,>=4.66
|
|
21
|
+
Dynamic: license-file
|
|
22
|
+
|
|
23
|
+
# WTF — Wildlife Trial Framework
|
|
24
|
+
|
|
25
|
+
A Python ecosystem simulator with independently learning animals, multiple named
|
|
26
|
+
species, configurable JSON worlds, terrain, rivers, day/night cycles and paired
|
|
27
|
+
reproduction. A bundled JavaScript viewer replays saved experiments separately
|
|
28
|
+
from training. It requires no Node.js build step.
|
|
29
|
+
|
|
30
|
+
Supported learners include Q-network/DQN, PPO, A2C, REINFORCE, experimental GRPO,
|
|
31
|
+
recurrent PPO, QR-DQN, masked PPO and MAPPO. Controllers, optimizers and RNGs are
|
|
32
|
+
private to each animal. These are experimental implementations, not claims of
|
|
33
|
+
biological realism or established policy improvement.
|
|
34
|
+
|
|
35
|
+
Requires Python **3.12 or newer**. Optional native kernels support CPython
|
|
36
|
+
3.12–3.13; newer interpreters use the Python backend.
|
|
37
|
+
|
|
38
|
+
## TestPyPI trial installation
|
|
39
|
+
|
|
40
|
+
Use Python 3.12+ in a virtual environment. Install the runtime dependency from
|
|
41
|
+
PyPI, then install the trial package from TestPyPI without mixing package indexes:
|
|
42
|
+
|
|
43
|
+
```sh
|
|
44
|
+
python -m venv .venv
|
|
45
|
+
# Activate .venv using your platform's shell command.
|
|
46
|
+
python -m pip install "tqdm>=4.66,<5"
|
|
47
|
+
python -m pip install --index-url https://test.pypi.org/simple/ --no-deps wtf-wildlife-trial-framework==0.0.2.0
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
TestPyPI is a separate trial index. Availability there does not mean the package
|
|
51
|
+
has been published on the production PyPI index.
|
|
52
|
+
|
|
53
|
+
## Local package installation
|
|
54
|
+
|
|
55
|
+
For an unpublished checkout, build distributions and install the resulting wheel:
|
|
56
|
+
|
|
57
|
+
```sh
|
|
58
|
+
python -m pip install build
|
|
59
|
+
python -m build
|
|
60
|
+
python -m pip install dist/wtf_wildlife_trial_framework-0.0.2.0-py3-none-any.whl
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Run from any writable working directory:
|
|
64
|
+
|
|
65
|
+
```sh
|
|
66
|
+
wtf presets
|
|
67
|
+
wtf run maskable_ppo --runs 1 --steps 200 --seed 100 --progress
|
|
68
|
+
wtf view --results results
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Open http://127.0.0.1:8000 and load the generated recording. Maintained presets,
|
|
72
|
+
terrain maps, schema and viewer assets are included. Results default to the
|
|
73
|
+
current directory's `results/`; they are not written into the installed package.
|
|
74
|
+
The default wheel is pure Python. Native CPU kernels are an optional source-build
|
|
75
|
+
choice for supported CPython versions; they are not required to install or run.
|
|
76
|
+
|
|
77
|
+
Use `wtf --help`, `wtf run --help`, `wtf view --help` and `wtf analyze --help`
|
|
78
|
+
for commands. `python -m wtf` provides the same command hub.
|
|
79
|
+
|
|
80
|
+
See the [documentation](https://sagnik1511.github.io/wtf/) and
|
|
81
|
+
[source repository](https://github.com/sagnik1511/wtf) for
|
|
82
|
+
installation, Docker, complete tutorials, all configuration definitions, species,
|
|
83
|
+
policy/action/geography extension guidance, storage and artifact compatibility.
|
|
84
|
+
|
|
85
|
+
MIT License. Copyright (c) 2026 Sagnik Roy.
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# WTF — Wildlife Trial Framework
|
|
2
|
+
|
|
3
|
+
A Python ecosystem simulator with independently learning animals, multiple named
|
|
4
|
+
species, configurable JSON worlds, terrain, rivers, day/night cycles and paired
|
|
5
|
+
reproduction. A bundled JavaScript viewer replays saved experiments separately
|
|
6
|
+
from training. It requires no Node.js build step.
|
|
7
|
+
|
|
8
|
+
Supported learners include Q-network/DQN, PPO, A2C, REINFORCE, experimental GRPO,
|
|
9
|
+
recurrent PPO, QR-DQN, masked PPO and MAPPO. Controllers, optimizers and RNGs are
|
|
10
|
+
private to each animal. These are experimental implementations, not claims of
|
|
11
|
+
biological realism or established policy improvement.
|
|
12
|
+
|
|
13
|
+
Requires Python **3.12 or newer**. Optional native kernels support CPython
|
|
14
|
+
3.12–3.13; newer interpreters use the Python backend.
|
|
15
|
+
|
|
16
|
+
## TestPyPI trial installation
|
|
17
|
+
|
|
18
|
+
Use Python 3.12+ in a virtual environment. Install the runtime dependency from
|
|
19
|
+
PyPI, then install the trial package from TestPyPI without mixing package indexes:
|
|
20
|
+
|
|
21
|
+
```sh
|
|
22
|
+
python -m venv .venv
|
|
23
|
+
# Activate .venv using your platform's shell command.
|
|
24
|
+
python -m pip install "tqdm>=4.66,<5"
|
|
25
|
+
python -m pip install --index-url https://test.pypi.org/simple/ --no-deps wtf-wildlife-trial-framework==0.0.2.0
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
TestPyPI is a separate trial index. Availability there does not mean the package
|
|
29
|
+
has been published on the production PyPI index.
|
|
30
|
+
|
|
31
|
+
## Local package installation
|
|
32
|
+
|
|
33
|
+
For an unpublished checkout, build distributions and install the resulting wheel:
|
|
34
|
+
|
|
35
|
+
```sh
|
|
36
|
+
python -m pip install build
|
|
37
|
+
python -m build
|
|
38
|
+
python -m pip install dist/wtf_wildlife_trial_framework-0.0.2.0-py3-none-any.whl
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Run from any writable working directory:
|
|
42
|
+
|
|
43
|
+
```sh
|
|
44
|
+
wtf presets
|
|
45
|
+
wtf run maskable_ppo --runs 1 --steps 200 --seed 100 --progress
|
|
46
|
+
wtf view --results results
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Open http://127.0.0.1:8000 and load the generated recording. Maintained presets,
|
|
50
|
+
terrain maps, schema and viewer assets are included. Results default to the
|
|
51
|
+
current directory's `results/`; they are not written into the installed package.
|
|
52
|
+
The default wheel is pure Python. Native CPU kernels are an optional source-build
|
|
53
|
+
choice for supported CPython versions; they are not required to install or run.
|
|
54
|
+
|
|
55
|
+
Use `wtf --help`, `wtf run --help`, `wtf view --help` and `wtf analyze --help`
|
|
56
|
+
for commands. `python -m wtf` provides the same command hub.
|
|
57
|
+
|
|
58
|
+
See the [documentation](https://sagnik1511.github.io/wtf/) and
|
|
59
|
+
[source repository](https://github.com/sagnik1511/wtf) for
|
|
60
|
+
installation, Docker, complete tutorials, all configuration definitions, species,
|
|
61
|
+
policy/action/geography extension guidance, storage and artifact compatibility.
|
|
62
|
+
|
|
63
|
+
MIT License. Copyright (c) 2026 Sagnik Roy.
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
<h1 align="center">
|
|
2
|
+
<picture>
|
|
3
|
+
<source media="(prefers-color-scheme: dark)" srcset="docs/assets/branding/wtf-lockup-dark.svg" type="image/svg+xml" />
|
|
4
|
+
<source media="(prefers-color-scheme: light)" srcset="docs/assets/branding/wtf-lockup-light.svg" type="image/svg+xml" />
|
|
5
|
+
<source media="(prefers-color-scheme: dark)" srcset="docs/assets/branding/wtf-lockup-dark.png" />
|
|
6
|
+
<img src="docs/assets/branding/wtf-lockup-light.png" width="280" alt="WTF — Wildlife Trial Framework" />
|
|
7
|
+
</picture>
|
|
8
|
+
</h1>
|
|
9
|
+
|
|
10
|
+
A Python reinforcement-learning ecosystem with independently learning prey and
|
|
11
|
+
predators, growing resources, obstacles and paired male/female reproduction. Environments are JSON;
|
|
12
|
+
a JavaScript canvas viewer replays saved runs. Add named prey/predator species
|
|
13
|
+
through JSON; the presets start with one of each.
|
|
14
|
+
|
|
15
|
+
The simulator records first and the viewer plays later, keeping training and
|
|
16
|
+
rendering independent. Replay chunks use structured binary deltas and lossless XZ compression to reduce disk usage.
|
|
17
|
+
|
|
18
|
+
<picture class="replay-preview">
|
|
19
|
+
<source media="(prefers-color-scheme: light)" srcset="docs/assets/themed/simulation-playback-light.webp" type="image/webp" />
|
|
20
|
+
<source media="(prefers-color-scheme: dark)" srcset="docs/assets/simulation-playback.gif" type="image/gif" />
|
|
21
|
+
<img src="docs/assets/simulation-playback.gif" alt="Saved ecosystem playback with prey, predators, obstacles and event highlights" />
|
|
22
|
+
</picture>
|
|
23
|
+
|
|
24
|
+
A short replay of a saved experiment. See the [live species charts](docs/recording.md#per-step-species-dashboard)
|
|
25
|
+
for population, energy, births and hunting trends.
|
|
26
|
+
|
|
27
|
+
For Python and Docker setup, see [INSTALL.md](INSTALL.md).
|
|
28
|
+
The Python import is `wtf`; the distribution is `wtf-wildlife-trial-framework`.
|
|
29
|
+
See [package layout and import migration](docs/package-layout.md) for the
|
|
30
|
+
responsibility-based modules and the 0.0.2.0 import changes.
|
|
31
|
+
|
|
32
|
+
## Tech stack
|
|
33
|
+
|
|
34
|
+
[](https://www.python.org/downloads/)
|
|
35
|
+
[](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules)
|
|
36
|
+
[](https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API)
|
|
37
|
+
[](https://developer.mozilla.org/en-US/docs/Web/CSS)
|
|
38
|
+
[](docs/native-kernels.md)
|
|
39
|
+
[](docs/configuration.md)
|
|
40
|
+
[](https://docs.docker.com/get-started/get-docker/)
|
|
41
|
+
[](https://squidfunk.github.io/mkdocs-material/)
|
|
42
|
+
|
|
43
|
+
Python owns simulation, custom RL models, learning and artifact storage. Optional
|
|
44
|
+
CPython C kernels accelerate CPU hot paths. Plain JavaScript, HTML, CSS, Canvas
|
|
45
|
+
and SVG provide the replay viewer; JSON defines worlds, species and policies.
|
|
46
|
+
MkDocs with Material builds the documentation website.
|
|
47
|
+
|
|
48
|
+
### Software and requirements
|
|
49
|
+
|
|
50
|
+
| Software | When you need it |
|
|
51
|
+
| --- | --- |
|
|
52
|
+
| [Python 3.12+](https://www.python.org/downloads/) and [tqdm](https://tqdm.github.io/) | Required for simulation and the local playback server. `tqdm` is the only Python runtime dependency; install it through [requirements.txt](requirements.txt). |
|
|
53
|
+
| Modern browser with [JavaScript modules](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules), [Canvas](https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API) and [SVG](https://developer.mozilla.org/en-US/docs/Web/SVG) | Required to use the viewer. |
|
|
54
|
+
| [Git](https://git-scm.com/downloads) | Clone the source checkout; documentation builds also use Git to filter published files. |
|
|
55
|
+
| [Docker](https://docs.docker.com/get-started/get-docker/) and [Compose](https://docs.docker.com/compose/install/) | Optional container-based installation. |
|
|
56
|
+
| [GCC](https://gcc.gnu.org/) or [Clang](https://clang.llvm.org/), Python development headers and [setuptools](https://setuptools.pypa.io/en/latest/) | Optional native CPU kernels, validated on CPython 3.12–3.13. See [native setup](INSTALL.md#optional-native-cpu-kernels). |
|
|
57
|
+
| [Node.js 20+](https://nodejs.org/en/download) | Optional JavaScript tests and viewer illustration tooling. |
|
|
58
|
+
| [MkDocs](https://www.mkdocs.org/) and [Material](https://squidfunk.github.io/mkdocs-material/) | Optional local documentation builds; pinned versions are in [requirements-docs.txt](requirements-docs.txt). |
|
|
59
|
+
| [FFmpeg and ffprobe](https://ffmpeg.org/download.html) | Optional documentation GIF exports. |
|
|
60
|
+
|
|
61
|
+
The viewer runs directly in the browser without npm packages or a frontend build.
|
|
62
|
+
Models use the project's own implementations; NumPy, PyTorch and a GPU are not
|
|
63
|
+
required. [Installation](INSTALL.md) covers commands and platform details;
|
|
64
|
+
[development setup](docs/development.md#mandatory-formatting) covers formatter tools.
|
|
65
|
+
|
|
66
|
+
## Quick start
|
|
67
|
+
|
|
68
|
+
Requires Python 3.12+. Run from the project directory:
|
|
69
|
+
|
|
70
|
+
```sh
|
|
71
|
+
cd /path/to/wtf
|
|
72
|
+
python3.12 -m venv .venv
|
|
73
|
+
.venv/bin/python -m pip install --cache-dir .cache/pip -r requirements.txt
|
|
74
|
+
.venv/bin/python -m wtf.cli environments/baseline.json --runs 1
|
|
75
|
+
./run.sh
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Open <http://127.0.0.1:8000>, select the saved experiment and click **Play recording**.
|
|
79
|
+
You can close the simulator before starting playback. Python packages stay in
|
|
80
|
+
`.venv`; the viewer needs no packages or build step.
|
|
81
|
+
|
|
82
|
+
## Keep learned brains
|
|
83
|
+
|
|
84
|
+
Completed training runs archive health, kills, lifespan and food-gain champions
|
|
85
|
+
for each species/sex group inside `results/<run-name>/champions/`. Models keep their scores and ancestry.
|
|
86
|
+
Use the longest-lived prey champions and predator hunting champions to start a new generation:
|
|
87
|
+
|
|
88
|
+
```sh
|
|
89
|
+
.venv/bin/python -m wtf.cli environments/baseline.json --runs 1 \
|
|
90
|
+
--brains-from PREVIOUS_RUN_NAME --brain prey=lifespan --brain predator=kills
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
Replace `PREVIOUS_RUN_NAME` with a folder name under `results/` containing compatible Q champions. See the
|
|
94
|
+
[saved-brain guide](docs/brain-library.md) to choose another criterion, algorithm
|
|
95
|
+
or exact model generation. Species-wide selectors resolve matching female and male champions separately.
|
|
96
|
+
With multiple runs, each group’s champion seeds the next run by default; add `--no-chain-brains` to restart from the original models.
|
|
97
|
+
|
|
98
|
+
## Documentation
|
|
99
|
+
|
|
100
|
+
Browse the [documentation hub](docs/index.md) for a reading path, or use the
|
|
101
|
+
[GitHub Pages documentation](https://sagnik1511.github.io/wtf/) once its deployment
|
|
102
|
+
is enabled. The site adds search, grouped navigation and **light/dark modes** to these same
|
|
103
|
+
guides. Use the sun/moon icon in the top-right header to switch appearance; the
|
|
104
|
+
initial theme follows your system preference.
|
|
105
|
+
|
|
106
|
+
| Area | Entry points |
|
|
107
|
+
| --- | --- |
|
|
108
|
+
| Get started | [Installation](INSTALL.md), [complete tutorial](docs/tutorial.md), [run/resume](docs/running.md) |
|
|
109
|
+
| Worlds and species | [Customization](docs/customization.md), [configuration](docs/configuration.md), [geography](docs/geography.md), [species](docs/species.md) |
|
|
110
|
+
| Learning and behavior | [Algorithms](docs/algorithms.md), [observations](docs/observations.md), [champions](docs/brain-library.md), [evaluation](docs/evaluation.md) |
|
|
111
|
+
| Viewer and storage | [Playback](docs/recording.md), [appearance](docs/viewer-visual-reference.md), [explainability](docs/explainability.md), [artifact structures](docs/replay-data-structures.md) |
|
|
112
|
+
| Development | [Architecture](docs/architecture.md), [testing](docs/development.md), [extensions](docs/extending-worlds-and-actions.md), [packaging](docs/packaging.md) |
|
|
113
|
+
| Reference | [Configuration fields](docs/configuration-reference.md), [commands](docs/command-reference.md), [visual guide](docs/visual-guide.md), [compatibility](docs/compatibility.md) |
|
|
114
|
+
|
|
115
|
+
## Project layout
|
|
116
|
+
|
|
117
|
+
```text
|
|
118
|
+
wtf/ Python simulation, learning, archives and analysis
|
|
119
|
+
viewer/ JavaScript playback engine
|
|
120
|
+
environments/ JSON experiment presets
|
|
121
|
+
maps/ Editable river, highland and valley layouts
|
|
122
|
+
docs/ Detailed guides
|
|
123
|
+
tests/ Python and JavaScript checks
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
Generated `results/`, `brain_library/`, `.cache/` and `.venv/` remain local and are
|
|
127
|
+
ignored by Git. Observed survival and champion scores are useful diagnostics;
|
|
128
|
+
checking learning quality requires matched evaluation on unseen world seeds.
|
|
129
|
+
|
|
130
|
+
## License
|
|
131
|
+
|
|
132
|
+
Copyright © 2026 Sagnik Roy. Released under the [MIT License](LICENSE).
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"""Shared build-time compiler selection; no effect on runtime imports."""
|
|
2
|
+
|
|
3
|
+
import os
|
|
4
|
+
from pathlib import Path
|
|
5
|
+
import sys
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def configure_compiler():
|
|
9
|
+
# Use installed binaries/SDK directly on macOS; Apple's command shims can
|
|
10
|
+
# fail during an Xcode update. Explicit user CC/SDKROOT choices still win.
|
|
11
|
+
if sys.platform == "darwin":
|
|
12
|
+
candidates = (
|
|
13
|
+
[Path(os.environ["DEVELOPER_DIR"])]
|
|
14
|
+
if os.environ.get("DEVELOPER_DIR")
|
|
15
|
+
else [
|
|
16
|
+
Path("/Applications/Xcode.app/Contents/Developer"),
|
|
17
|
+
Path("/Library/Developer/CommandLineTools"),
|
|
18
|
+
]
|
|
19
|
+
)
|
|
20
|
+
for developer in candidates:
|
|
21
|
+
cc = developer / "Toolchains/XcodeDefault.xctoolchain/usr/bin/clang"
|
|
22
|
+
if not cc.is_file():
|
|
23
|
+
cc = developer / "usr/bin/clang"
|
|
24
|
+
sdk = developer / "Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk"
|
|
25
|
+
if not sdk.is_dir():
|
|
26
|
+
sdk = developer / "SDKs/MacOSX.sdk"
|
|
27
|
+
if cc.is_file() and (sdk / "usr/include/stdio.h").is_file():
|
|
28
|
+
os.environ.setdefault("CC", str(cc))
|
|
29
|
+
os.environ.setdefault("SDKROOT", str(sdk))
|
|
30
|
+
break
|