Example #1
0
        ################################################################################
        ###   Add a projection

        if fln>0.0:
            net.projections.append(Projection(id='proj_%s_%s'%(src,tgt),
                                              presynaptic=src, 
                                              postsynaptic=tgt,
                                              synapse='ampa',
                                              weight=fln))

            #net.projections[0].random_connectivity=RandomConnectivity(probability=0.5)



print(net)
net.id = 'TestNetwork'

print(net.to_json())
new_file = net.to_json_file('Example1_%s.json'%net.id)


################################################################################
###   Export to some formats
###   Try:
###        python Example1.py -graph2

from neuromllite.NetworkGenerator import check_to_generate_or_run
from neuromllite import Simulation
import sys

check_to_generate_or_run(sys.argv, Simulation(id='SimExample1',network=new_file))
input_source_i = InputSource(id='Inh_in',
                             neuroml2_input='PulseGenerator',
                             parameters={
                                 'amplitude': 'inh_input',
                                 'delay': 'input_delay',
                                 'duration': 'input_duration'
                             })
net.input_sources.append(input_source_i)
net.inputs.append(
    Input(id='Inh_stim',
          input_source=input_source_i.id,
          population=inh_pop.id,
          percentage=100))

# Save to JSON format
net.id = 'WC'
new_file = net.to_json_file('WC.json')

sim = Simulation(id='SimWC',
                 duration='100',
                 dt='0.005',
                 network=new_file,
                 recordRates={'all': '*'},
                 plots2D={
                     'E-I': {
                         'x_axis': 'Excitatory/0/Exc/r',
                         'y_axis': 'Inhibitory/0/Inh/r'
                     }
                 })

sim.to_json_file('SimWC.nmllite.json')
Example #3
0
            inh_syn = Synapse(id='rsInh',
                              lems_source_file='figure1b_Parameters.xml')
            net.synapses.append(exc_syn)
            net.synapses.append(inh_syn)

            #### Weak GBA
            syns = {exc_pop.id: exc_syn.id, inh_pop.id: inh_syn.id}

            W = [['wee', 'wie'], ['wei', 'wii']]

            # Add internal connections
            pops = [exc_pop, inh_pop]
            internal_connections(pops, W, syns)

            # Save to JSON format
            net.id = 'Joglekar_figure1b'
            new_file = net.to_json_file('Joglekar_figure1c.json')

            sim = Simulation(id='SimJoglekar_figure1b',
                             duration='2',
                             dt='0.02',
                             network=new_file,
                             recordVariables={'r': {
                                 'all': '*'
                             }})

            sim.to_json_file('SimJoglekar_figure1c.nmllite.json')

            check_to_generate_or_run(sys.argv, sim)

            # Open data file
Example #4
0
################################################################################
###   Add a projection

net.projections.append(
    Projection(id="proj0",
               presynaptic=p0.id,
               postsynaptic=p1.id,
               synapse="ampa"))

net.projections[0].random_connectivity = RandomConnectivity(probability=0.5)

################################################################################
###   Save to JSON format

print(net)
net.id = "TestNetwork"

print(net.to_json())
new_file = net.to_json_file("Example1_%s.json" % net.id)

################################################################################
###   Export to some formats, e.g. try:
###        python Example1.py -graph2

from neuromllite.NetworkGenerator import check_to_generate_or_run
from neuromllite import Simulation
import sys

check_to_generate_or_run(sys.argv,
                         Simulation(id="SimExample1", network=new_file))
Example #5
0
          percentage=100))

exc_syn = Synapse(id='rsExc', lems_source_file='Demirtas_Parameters.xml')
inh_syn = Synapse(id='rsInh', lems_source_file='Demirtas_Parameters.xml')
net.synapses.append(exc_syn)
net.synapses.append(inh_syn)

syns = {exc_pop.id: exc_syn.id, inh_pop.id: inh_syn.id}
W = [['wee', 'wie'], ['wei', 'wii']]

# Add internal connections
pops = [exc_pop, inh_pop]
internal_connections(pops, W)

# Save to JSON format
net.id = 'Demirtas_network'
new_file = net.to_json_file('Demirtas_network.json')

sim = Simulation(id='SimDemirtas_network',
                 duration='1000',
                 dt='0.1',
                 network=new_file,
                 recordVariables={
                     'r': {
                         'all': '*'
                     },
                     'e': {
                         'all': '*'
                     },
                     'f': {
                         'all': '*'