import gradio as gr from tmfs_topo import TMFS, CONFIG def run_sim(n_agents, steps, phase_step): CONFIG["n_agents"] = n_agents CONFIG["steps"] = steps CONFIG["phase_step"] = phase_step sim = TMFS() sim.run() final_dna = [a.dna for a in sim.agents] return f"Simulation complete. Final symbolic DNA: {final_dna}" iface = gr.Interface( fn=run_sim, inputs=[ gr.Slider(2, 10, value=5, label="Number of Agents"), gr.Slider(10, 100, value=50, step=10, label="Simulation Steps"), gr.Slider(0.01, 0.5, value=0.15, label="Toroidal Phase Step") ], outputs="text", title="Toroidal Morphic Field Simulator (TMFS)", description="Live demo of symbolic agents evolving with morphic memory, DNA mutation, and topological phase logic." ) if __name__ == "__main__": iface.launch()