Hello! I am trying to use the Network class to perform multiple simulations. I created a function Model() in which i defined NeuronGroups and Synapses. Model() return Network(NeuronGroups, Synapses). Reading the Network source code I found that if I want to access to an object inside the Network class i need to call (if
net = Model())
net['NeuronGroup'] but it is not working.
def Model(): thalamus = NeuronGroup() crtx = NeuronGroup() S = Synapses(thalamus, crtx) return(Network(collect())) net = Model() input=PoissonGroup() S2 = Synapses(input, net['thalamus'])
and here i get the error KeyError: ‘No object with name “thalamus” found’
I initially thought was a namespace problem (it could be right?) but it doesn’t work even if i define a dummy neuron, add it to the net and try to access it.
dummy_neuron = NeuronGroup(1,....) net.add(dummy_neuron) net['dummy_neuron']
KeyError: ‘No object with name “dummy_neuron” found’
So i would like to know: How can i access to the Network objects and if i can use a single instance of Network() in multiple functions and saving step by step the state of the network