if RANK == 0:
        parameters_time = time() - tic
        # open file object for writing
        logfile = file(os.path.join(PSET.OUTPUTPATH, 'log.txt'), 'w', 0)
        logfile.write('initialization {}\n'.format(initialization_time))
        print('Parameters in {} seconds'.format(parameters_time))
        logfile.write('parameters {}\n'.format(parameters_time))
    tic = time()


    ############################################################################
    # Create population, provide noisy input to each cell, connect network
    ############################################################################
    # create network object instance
    network = Network(dt=PSET.dt, tstop=PSET.tstop, v_init=PSET.v_init,
                      celsius=PSET.celsius,
                      OUTPUTPATH=PSET.OUTPUTPATH)
    # create populations iteratively
    for name, pop_args, rotation_args, POP_SIZE in zip(
        PSET.populationParameters['me_type'],
        PSET.populationParameters['pop_args'],
        PSET.populationParameters['rotation_args'],
        (PSET.populationParameters['POP_SIZE']).astype(int)):
        network.create_population(CWD=PSET.CWD, CELLPATH=PSET.CELLPATH,
                                  Cell=NetworkCell, POP_SIZE=POP_SIZE,
                                  name=name, cell_args=PSET.cellParameters[name],
                                  pop_args=pop_args, rotation_args=rotation_args)

    # tic-toc
    if RANK == 0:
        create_population_time = time() - tic
Example #2
0
    if RANK == 0:
        parameters_time = time() - tic
        # open file object for writing
        logfile = open(os.path.join(PSET.OUTPUTPATH, 'log.txt'), 'w')
        logfile.write('initialization {}\n'.format(initialization_time))
        print('Parameters in {} seconds'.format(parameters_time))
        logfile.write('parameters {}\n'.format(parameters_time))
    tic = time()

    ############################################################################
    # Create population, provide noisy input to each cell, connect network
    ############################################################################
    # create network object instance
    network = Network(dt=PSET.dt,
                      tstop=PSET.tstop,
                      v_init=PSET.v_init,
                      celsius=PSET.celsius,
                      OUTPUTPATH=PSET.OUTPUTPATH)
    # create populations iteratively
    for name, pop_args, rotation_args, POP_SIZE in zip(
            PSET.populationParameters['me_type'],
            PSET.populationParameters['pop_args'],
            PSET.populationParameters['rotation_args'],
        (PSET.populationParameters['POP_SIZE']).astype(int)):
        network.create_population(CWD=PSET.CWD,
                                  CELLPATH=PSET.CELLPATH,
                                  Cell=NetworkCell,
                                  POP_SIZE=POP_SIZE,
                                  name=name,
                                  cell_args=PSET.cellParameters[name],
                                  pop_args=pop_args,
Example #3
0
if __name__ == '__main__':
    ##########################################################################
    # Main simulation
    ##########################################################################
    if RANK == 0:
        # create directory for output:
        if not os.path.isdir(OUTPUTPATH):
            os.mkdir(OUTPUTPATH)
        # remove old simulation output if directory exist
        else:
            for fname in os.listdir(OUTPUTPATH):
                os.unlink(os.path.join(OUTPUTPATH, fname))
    COMM.Barrier()

    # instantiate Network:
    network = Network(**networkParameters)

    # create E and I populations:
    for name, size in zip(population_names, population_sizes):
        network.create_population(name=name,
                                  POP_SIZE=size,
                                  **populationParameters)

        # create excitatory background synaptic activity for each cell
        # with Poisson statistics
        for cell in network.populations[name].cells:
            idx = cell.get_rand_idx_area_norm(section='allsec', nidx=64)
            for i in idx:
                syn = Synapse(cell=cell,
                              idx=i,
                              syntype='Exp2Syn',
Example #4
0
                                           dict(loc=0., scale=100.)],
                                  funweights=[1., 0.5]
                                 ) for _ in range(2)]]

if __name__ == '__main__':
    ############################################################################
    # Main simulation
    ############################################################################
    # create directory for output:
    if not os.path.isdir(OUTPUTPATH):
        if RANK == 0:
            os.mkdir(OUTPUTPATH)
    COMM.Barrier()

    # instantiate Network:
    network = Network(**networkParameters)

    # create E and I populations:
    for name, size in zip(population_names, population_sizes):
        network.create_population(name=name, POP_SIZE=size,
                                  **populationParameters)


        # create excitatory background synaptic activity for each cell
        # with Poisson statistics
        for cell in network.populations[name].cells:
            idx = cell.get_rand_idx_area_norm(section='allsec', nidx=64)
            for i in idx:
                syn = Synapse(cell=cell, idx=i, syntype='Exp2Syn',
                              weight=0.002,
                              **dict(tau1=0.2, tau2=1.8, e=0.))
Example #5
0
                                           dict(loc=0., scale=100.)],
                                  funweights=[1., 0.5]
                                 ) for _ in range(2)]]

if __name__ == '__main__':
    ############################################################################
    # Main simulation
    ############################################################################
    # create directory for output:
    if not os.path.isdir(OUTPUTPATH):
        if RANK == 0:
            os.mkdir(OUTPUTPATH)
    COMM.Barrier()

    # instantiate Network:
    network = Network(**networkParameters)

    # create E and I populations:
    for name, size in zip(population_names, population_sizes):
        network.create_population(name=name, POP_SIZE=size,
                                  **populationParameters)


        # create excitatpry background synaptic activity for each cell
        # with Poisson statistics
        for cell in network.populations[name].cells:
            idx = cell.get_rand_idx_area_norm(section='allsec', nidx=64)
            for i in idx:
                syn = Synapse(cell=cell, idx=i, syntype='Exp2Syn',
                              weight=0.002,
                              **dict(tau1=0.2, tau2=1.8, e=0.))