| 1 |
"""Simulates an example network of 450 cell receiving two kinds of exernal input as defined in the configuration file""" |
| 2 |
|
| 3 |
|
| 4 |
import sys, os |
| 5 |
|
| 6 |
from bmtk.simulator import bionet |
| 7 |
|
| 8 |
|
| 9 |
def run(config_file): |
| 10 |
conf = bionet.Config.from_json(config_file, validate=True) |
| 11 |
conf.build_env() |
| 12 |
|
| 13 |
net = bionet.BioNetwork.from_config(conf) |
| 14 |
sim = bionet.BioSimulator.from_config(conf, network=net) |
| 15 |
sim.run() |
| 16 |
bionet.nrn.quit_execution() |
| 17 |
|
| 18 |
|
| 19 |
if __name__ == '__main__': |
| 20 |
if __file__ != sys.argv[-1]: |
| 21 |
run(sys.argv[-1]) |
| 22 |
else: |
| 23 |
run('config.json') |