Spaces:
Sleeping
Sleeping
Update modules/field_visualizer.py
Browse files- modules/field_visualizer.py +31 -5
modules/field_visualizer.py
CHANGED
|
@@ -1,8 +1,34 @@
|
|
| 1 |
# Author: Liam Grinstead
|
| 2 |
-
# Renders Φᵢ, Kᵢⱼ, Φ_col
|
| 3 |
|
| 4 |
def render_fields(agent):
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
# Author: Liam Grinstead
|
| 2 |
+
# Renders Φᵢ, Kᵢⱼ, Φ_col as SVG diagrams
|
| 3 |
|
| 4 |
def render_fields(agent):
|
| 5 |
+
tier = agent.get("tier", "Tier_1")
|
| 6 |
+
Φᵢ_svg = f"""
|
| 7 |
+
<svg width="300" height="100">
|
| 8 |
+
<text x="10" y="30" font-size="20">Φᵢ Awareness Field</text>
|
| 9 |
+
<circle cx="150" cy="70" r="20" fill="purple" />
|
| 10 |
+
<text x="130" y="75" font-size="12">{tier}</text>
|
| 11 |
+
</svg>
|
| 12 |
+
"""
|
| 13 |
+
|
| 14 |
+
Kᵢⱼ_svg = f"""
|
| 15 |
+
<svg width="300" height="100">
|
| 16 |
+
<text x="10" y="30" font-size="20">Kᵢⱼ Correlation Kernel</text>
|
| 17 |
+
<line x1="50" y1="70" x2="250" y2="70" stroke="blue" stroke-width="2"/>
|
| 18 |
+
<text x="120" y="85" font-size="12">Operators Coupled</text>
|
| 19 |
+
</svg>
|
| 20 |
+
"""
|
| 21 |
+
|
| 22 |
+
Φ_col_svg = f"""
|
| 23 |
+
<svg width="300" height="100">
|
| 24 |
+
<text x="10" y="30" font-size="20">Φ_col Coherence Field</text>
|
| 25 |
+
<rect x="100" y="50" width="100" height="30" fill="green" />
|
| 26 |
+
<text x="110" y="70" font-size="12">Collective Awareness</text>
|
| 27 |
+
</svg>
|
| 28 |
+
"""
|
| 29 |
+
|
| 30 |
+
return {
|
| 31 |
+
"Φᵢ": Φᵢ_svg,
|
| 32 |
+
"Kᵢⱼ": Kᵢⱼ_svg,
|
| 33 |
+
"Φ_col": Φ_col_svg
|
| 34 |
+
}
|