examples/bio_nsg/bio_450cells/run_bionet.py
raw| 1 | import sys |
| 2 | from bmtk.simulator import bionet |
| 3 | |
| 4 | |
| 5 | def run(config_file): |
| 6 | conf = bionet.Config.from_json(config_file, validate=True) |
| 7 | conf.build_env() |
| 8 | |
| 9 | net = bionet.BioNetwork.from_config(conf) |
| 10 | sim = bionet.BioSimulator.from_config(conf, network=net) |
| 11 | sim.run() |
| 12 | bionet.nrn.quit_execution() |
| 13 | |
| 14 | |
| 15 | if __name__ == '__main__': |
| 16 | if __file__ != sys.argv[-1]: |
| 17 | run(sys.argv[-1]) |
| 18 | else: |
| 19 | run('config.json') |