Ejemplo n.º 1
0
                  debug=True)
    man.add_mod(lpu_ret)

    if not args.retina_only:
        print('Parsing lamina lpu data')
        n_dict_lam, s_dict_lam = LPU.lpu_parser(LAM_GEXF_FILE)
        print('Initializing lamina LPU')
        lpu_lam = LPU(dt, n_dict_lam, s_dict_lam,
                      input_file=None,
                      output_file=LAM_OUTPUT_FILE, port_ctrl=port_ctrl,
                      port_data=port_data, device=args.lam_dev, id='lamina',
                      debug=False)

        man.add_mod(lpu_lam)
        print('Connecting retina and lamina')
        eyemodel.connect_retina_lamina(man, lpu_ret, lpu_lam)

    print('Starting simulation')
    start_time = time.time()
    man.start(steps=args.steps)
    man.stop()
    
    print('Simulation complete: Duration {} seconds'.format(time.time() - 
                                                            start_time))

if args.output:
    eyemodel.visualise_output(media_file=RET_OUTPUT_MPEG,
                              model_output=RET_OUTPUT_GPOT,
                              config = {'LPU': 'retina',
                                        'type':args.video_type})
    if not args.retina_only:
Ejemplo n.º 2
0
    if 'm' in args.model:
        print('Parsing medulla LPU data')
        n_dict_med, s_dict_med = LPU.lpu_parser(MED_GEXF_FILE)
        print('Initializing medulla LPU')
        lpu_med = LPU(dt, n_dict_med, s_dict_med,
                      input_file=MED_INPUT,
                      output_file=MED_OUTPUT_FILE, port_ctrl=port_ctrl,
                      port_data=port_data, device=args.med_dev, id='medulla',
                      debug=True)
        man.add_mod(lpu_med)

    # if gexf files are not written again, 
    # patterns are loaded from previous files too
    from_file = not args.gexf
    print('Connecting retina and lamina')
    eyemodel.connect_retina_lamina(man, lpu_ret, lpu_lam, from_file)
    print('Connecting lamina and medulla')
    eyemodel.connect_lamina_medulla(man, lpu_lam, lpu_med, from_file)

    print('Starting simulation')
    start_time = time.time()
    man.start(steps=args.steps)
    man.stop()
    
    print('Simulation complete: Duration {} seconds'.format(time.time() - 
                                                            start_time))

if args.output:

    V = vis.visualizer()
Ejemplo n.º 3
0
        n_dict_lam, s_dict_lam = LPU.lpu_parser(LAM_GEXF_FILE)
        print('Initializing lamina LPU')
        lpu_lam = LPU(dt,
                      n_dict_lam,
                      s_dict_lam,
                      input_file=None,
                      output_file=LAM_OUTPUT_FILE,
                      port_ctrl=port_ctrl,
                      port_data=port_data,
                      device=args.lam_dev,
                      id='lamina',
                      debug=False)

        man.add_mod(lpu_lam)
        print('Connecting retina and lamina')
        eyemodel.connect_retina_lamina(man, lpu_ret, lpu_lam)

    print('Starting simulation')
    start_time = time.time()
    man.start(steps=args.steps)
    man.stop()

    print('Simulation complete: Duration {} seconds'.format(time.time() -
                                                            start_time))

if args.output:
    eyemodel.visualise_output(media_file=RET_OUTPUT_MPEG,
                              model_output=RET_OUTPUT_GPOT,
                              config={
                                  'LPU': 'retina',
                                  'type': args.video_type
Ejemplo n.º 4
0
                      n_dict_med,
                      s_dict_med,
                      input_file=MED_INPUT,
                      output_file=MED_OUTPUT_FILE,
                      port_ctrl=port_ctrl,
                      port_data=port_data,
                      device=args.med_dev,
                      id='medulla',
                      debug=True)
        man.add_mod(lpu_med)

    # if gexf files are not written again,
    # patterns are loaded from previous files too
    from_file = not args.gexf
    print('Connecting retina and lamina')
    eyemodel.connect_retina_lamina(man, lpu_ret, lpu_lam, from_file)
    print('Connecting lamina and medulla')
    eyemodel.connect_lamina_medulla(man, lpu_lam, lpu_med, from_file)

    print('Starting simulation')
    start_time = time.time()
    man.start(steps=args.steps)
    man.stop()

    print('Simulation complete: Duration {} seconds'.format(time.time() -
                                                            start_time))

if args.output:

    V = vis.visualizer()