ei_net.setVelocityCurrentInput_e()

    # place cells
    if o.pcON:
        # activate place cells (including start place cells))
        ei_net.setPlaceCells(distribution='box_outline', boxSize=border_dim)
    elif o.spcON:
        # activate start place cells only
        ei_net.setStartPlaceCells(ConstPosInputs(0, 0))
    else:
        pass

    # border cells
    if o.bcON:
        # create the border cells
        ei_net.create_border_cells(borders=borders, N_per_border=o.bcNum)
        # connect border cells according to chosen method
        if o.bcConnMethod == "line":
            ei_net.connect_border_cells_line_method(o.bc_conn_weight)
        elif o.bcConnMethod == "place":
            ei_net.connect_border_cells_modified_place_cell_method(
                o.bc_conn_weight)
        elif o.bcConnMethod == "predef":
            ei_net.connect_border_cells_predefined_weights(o.bc_conn_weight)
        elif o.bcConnMethod == "none":
            pass

    try:
        ei_net.simulate(o.time, printTime=o.printTime)
    except NESTError as e:
        print("Simulation interrupted. Message: {0}".format(str(e)))
        # activate place cells (including start place cells))
        ei_net.setPlaceCells()
    # start place cells
    if o.spcON:
        # activate start place cells only
        ei_net.setStartPlaceCells(pos)

    # border cells
    if o.bcON:
        # create the border cells - "crosshair"
        arena_borders = [
            ((0.0 + x_off[trial_idx], 90.0), (0.0 + x_off[trial_idx], -90.0)),
            ((-90.0, 0.0 + y_off[trial_idx]), (90.0, 0.0 + y_off[trial_idx]))
        ]
        ei_net.create_border_cells(borders=arena_borders,
                                   N_per_border=o.bcNum,
                                   posIn=pos)
        # connect border cells according to chosen method
        if o.bcConnMethod == "line":
            ei_net.connect_border_cells_line_method(o.bc_conn_weight)
        elif o.bcConnMethod == "place":
            ei_net.connect_border_cells_modified_place_cell_method(
                o.bc_conn_weight)
        elif o.bcConnMethod == "none":
            pass

    try:
        ei_net.simulate(o.time, printTime=o.printTime)
    except NESTError as e:
        print("Simulation interrupted. Message: {0}".format(str(e)))
        print("Not saving the data. Trying to clean up if possible...")
    # turn velocity inputs on
    ei_net.setVelocityCurrentInput_e()
    
    # place cells
    if o.pcON:
        # activate place cells (including start place cells))
        ei_net.setPlaceCells()
    else:
        # activate start place cells only
        ei_net.setStartPlaceCells(ConstPosInputs(0, 0)) 

    # border cells
    if o.bcON:
        # create a set of border cells defining a mesh over the arena
        lines = create_mesh((-180.0,180.0), (180.0,-180.0), 6.0, 6.0)
        ei_net.create_border_cells(lines, N_per_border=1)
        # connect border cells according to chosen method
        if o.border_cell_connect_method == "line":
            ei_net.connect_border_cells_line_method(o.bc_conn_weight)
        elif o.border_cell_connect_method == "none":
            pass

    try:
        ei_net.simulate(o.time, printTime=o.printTime)
    except NESTError as e:
        print("Simulation interrupted. Message: {0}".format(str(e)))
        print("Not saving the data. Trying to clean up if possible...")
        stop = True
    ei_net.endSimulation()
    # get simulation data
    sim_data = ei_net.getAllData()