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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
---
|
| 13 |
|
| 14 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
| 9 |
pinned: false
|
| 10 |
license: other
|
| 11 |
short_description: Agent drift, torque & coherence simulator.
|
| 12 |
+
---
|
| 13 |
+
---
|
| 14 |
+
|
| 15 |
+
RFT Agent Simulation Engine — MVP Release
|
| 16 |
+
|
| 17 |
+
A symbolic multi‑agent simulation engine built to model drift, stability, coherence, and emergent behaviour in complex systems.
|
| 18 |
+
Developed as the first operational software implementation of the Rendered Frame Theory (RFT) agent architecture.
|
| 19 |
+
|
| 20 |
+
This MVP provides a clean, modular, reproducible simulation environment that runs entirely in Python and is fully compatible with Google Colab and Hugging Face Spaces.
|
| 21 |
+
|
| 22 |
+
---
|
| 23 |
+
|
| 24 |
+
🚀 Features
|
| 25 |
+
|
| 26 |
+
✔ Multi‑Agent Simulation
|
| 27 |
+
|
| 28 |
+
Each agent evolves over time through:
|
| 29 |
+
|
| 30 |
+
• Awareness field updates (Φ)
|
| 31 |
+
• Collapse‑torque dynamics (τ_eff)
|
| 32 |
+
• Mutation
|
| 33 |
+
• Drift
|
| 34 |
+
• Fitness scoring
|
| 35 |
+
• Tier‑independent behaviour
|
| 36 |
+
|
| 37 |
+
|
| 38 |
+
✔ System‑Level Metrics
|
| 39 |
+
|
| 40 |
+
The engine computes:
|
| 41 |
+
|
| 42 |
+
• Coherence (average Φ across agents)
|
| 43 |
+
• Stability (variance of Φ)
|
| 44 |
+
• Emergent divergence patterns
|
| 45 |
+
|
| 46 |
+
|
| 47 |
+
✔ Full Visualization Suite
|
| 48 |
+
|
| 49 |
+
Automatically generates and saves:
|
| 50 |
+
|
| 51 |
+
• phi_plot.png
|
| 52 |
+
• tau_plot.png
|
| 53 |
+
• fitness_plot.png
|
| 54 |
+
• coherence_plot.png
|
| 55 |
+
• stability_plot.png
|
| 56 |
+
|
| 57 |
+
|
| 58 |
+
All plots are high‑resolution (300 dpi).
|
| 59 |
+
|
| 60 |
+
✔ JSON Export
|
| 61 |
+
|
| 62 |
+
Final agent states are exported to:
|
| 63 |
+
|
| 64 |
+
• final_agent_states.json
|
| 65 |
+
|
| 66 |
+
|
| 67 |
+
✔ One‑Click Packaging
|
| 68 |
+
|
| 69 |
+
A built‑in ZIP builder creates:
|
| 70 |
+
|
| 71 |
+
• rft_simulation_engine.zip
|
| 72 |
+
containing all project files and generated artifacts.
|
| 73 |
+
|
| 74 |
+
|
| 75 |
+
✔ Colab‑Optimized Dev Mode
|
| 76 |
+
|
| 77 |
+
When running in Google Colab:
|
| 78 |
+
|
| 79 |
+
• Gradio UI is bypassed
|
| 80 |
+
• Simulation runs automatically
|
| 81 |
+
• Plots display inline
|
| 82 |
+
• All files save to disk
|
| 83 |
+
|
| 84 |
+
|
| 85 |
+
---
|
| 86 |
+
|
| 87 |
+
📦 Project Structure
|
| 88 |
+
|
| 89 |
+
agent.py # RFTAgent class
|
| 90 |
+
simulation.py # RFTSimulation engine
|
| 91 |
+
visualization.py # Plotting utilities
|
| 92 |
+
utils.py # JSON export + ZIP builder
|
| 93 |
+
app.py # Gradio UI + Colab dev mode
|
| 94 |
+
test_runner.py # Automated test simulation
|
| 95 |
+
requirements.txt # Dependencies
|
| 96 |
+
README.md # Documentation
|
| 97 |
+
|
| 98 |
+
|
| 99 |
+
---
|
| 100 |
+
|
| 101 |
+
▶️ Running the Simulation (Colab)
|
| 102 |
+
|
| 103 |
+
To run the engine in Google Colab:
|
| 104 |
+
|
| 105 |
+
from test_runner import run_test_simulation
|
| 106 |
+
run_test_simulation()
|
| 107 |
+
|
| 108 |
+
|
| 109 |
+
This will:
|
| 110 |
+
|
| 111 |
+
• Run a 3‑agent, 100‑step simulation
|
| 112 |
+
• Display all plots inline
|
| 113 |
+
• Save all PNGs
|
| 114 |
+
• Export final_agent_states.json
|
| 115 |
+
• Print file paths
|
| 116 |
+
|
| 117 |
+
|
| 118 |
+
---
|
| 119 |
+
|
| 120 |
+
🌐 Running the Gradio App (Hugging Face Space)
|
| 121 |
+
|
| 122 |
+
When deployed on Hugging Face:
|
| 123 |
+
|
| 124 |
+
python app.py
|
| 125 |
+
|
| 126 |
+
|
| 127 |
+
The UI allows you to configure:
|
| 128 |
+
|
| 129 |
+
• Number of agents
|
| 130 |
+
• Number of steps
|
| 131 |
+
• Mutation rate
|
| 132 |
+
• Drift rate
|
| 133 |
+
• Random seed
|
| 134 |
+
|
| 135 |
+
|
| 136 |
+
And outputs:
|
| 137 |
+
|
| 138 |
+
• All plots
|
| 139 |
+
• JSON export
|
| 140 |
+
• Downloadable results
|
| 141 |
+
|
| 142 |
+
|
| 143 |
+
---
|
| 144 |
+
|
| 145 |
+
🧪 Example Output
|
| 146 |
+
|
| 147 |
+
The engine produces:
|
| 148 |
+
|
| 149 |
+
• Divergent agent trajectories
|
| 150 |
+
• Torque evolution curves
|
| 151 |
+
• Fitness progression
|
| 152 |
+
• System coherence decay
|
| 153 |
+
• Stability variance growth
|
| 154 |
+
|
| 155 |
+
|
| 156 |
+
These behaviours emerge naturally from the agent update rules.
|
| 157 |
+
|
| 158 |
+
---
|
| 159 |
+
|
| 160 |
+
📁 Packaging the Project
|
| 161 |
+
|
| 162 |
+
To generate a ZIP containing all files and outputs:
|
| 163 |
+
|
| 164 |
+
from utils import zip_project
|
| 165 |
+
zip_project()
|
| 166 |
+
|
| 167 |
+
|
| 168 |
+
This creates:
|
| 169 |
+
|
| 170 |
+
• rft_simulation_engine.zip
|
| 171 |
+
ready for download or distribution.
|
| 172 |
+
|
| 173 |
+
|
| 174 |
+
---
|
| 175 |
+
|
| 176 |
+
🛠 Requirements
|
| 177 |
+
|
| 178 |
+
numpy
|
| 179 |
+
matplotlib
|
| 180 |
+
gradio
|
| 181 |
+
|
| 182 |
+
|
| 183 |
+
---
|
| 184 |
+
|
| 185 |
+
📣 About This Project
|
| 186 |
+
|
| 187 |
+
This MVP demonstrates the first operational implementation of the RFT agent architecture.
|
| 188 |
+
It is designed for:
|
| 189 |
+
|
| 190 |
+
• AI researchers
|
| 191 |
+
• Complex systems modellers
|
| 192 |
+
• Simulation engineers
|
| 193 |
+
• Worldbuilders
|
| 194 |
+
• Anyone exploring emergent behaviour
|
| 195 |
+
|
| 196 |
+
|
| 197 |
+
Future versions will introduce:
|
| 198 |
+
|
| 199 |
+
• Agent packs
|
| 200 |
+
• Mutation packs
|
| 201 |
+
• Universe packs
|
| 202 |
+
• Codex integration
|
| 203 |
+
• Long‑run simulations
|
| 204 |
+
• Advanced metrics
|
| 205 |
+
|
| 206 |
+
|
| 207 |
---
|
| 208 |
|
| 209 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|