-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
38 lines (31 loc) · 1.27 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import yaml
from src.biocomp.biocomp import BiologicalSystem, Simulation, run_simulation
from src.biocomp.biograph import visualize_biological_system
from src.biocomp.fungi import run_simulation as run_fungi_simulation
from src.biocomp.physarum import simulate_reaction_diffusion, generate_plot, generate_graphviz_hierarchy
def main():
# Load a YAML file and create a BiologicalSystem
with open("biosystem/1/biocomp.yaml", "r") as file:
data = yaml.safe_load(file)
bio_system = BiologicalSystem(
name=data["biological_system"]["name"],
logic_gates=[], # Populate with LogicGate objects
molecules=[] # Populate with Molecule objects
)
# Run a simulation
simulation = Simulation(
system=bio_system,
conditions=data["simulation"]["conditions"],
outputs=data["simulation"]["outputs"]
)
run_simulation(simulation)
# Generate a graph visualization
visualize_biological_system(bio_system)
# Run a fungi simulation
run_fungi_simulation(simulation)
# Run a physarum simulation
physarum_sim = simulate_reaction_diffusion(simulation)
generate_plot(*physarum_sim, "physarum_plot")
generate_graphviz_hierarchy(simulation, "physarum_hierarchy")
if __name__ == "__main__":
main()