-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathExample3.py
38 lines (27 loc) · 1.01 KB
/
Example3.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
from neuromllite import *
from neuromllite.NetworkGenerator import *
from neuromllite.utils import load_network_json
import sys
################################################################################
### Reuse network from Example2
filename = "Example2_TestNetwork.json"
net = load_network_json(filename)
net.id = "Example3_Network"
net.notes = "Example 3: simple network with 2 populations of NeuroML2 cells, a projection between them and spiking input."
print(net)
new_json_file = net.to_json_file()
################################################################################
### Build Simulation object & save as JSON
sim = Simulation(
id="SimExample3",
network=new_json_file,
duration="1000",
dt="0.025",
record_traces={"all": "*"},
)
sim.to_json_file()
################################################################################
### Run in some simulators
from neuromllite.NetworkGenerator import check_to_generate_or_run
import sys
check_to_generate_or_run(sys.argv, sim)