예제 #1
0
    def __init__(
            self,
            protocol,
            devices,

            # default params for the neuron model type
            tau_m=20.0,
            cm=1.0,
            v_rest=0.0,
            v_reset=0.0,
            tau_syn_E=5.0,
            tau_syn_I=5.0,
            tau_refrac=0.1,
            i_offset=0.0,
            v=0.0,
            isyn_exc=0.0,
            isyn_inh=0.0):
        # pylint: disable=too-many-arguments, too-many-locals

        command_protocol = MunichIoSpiNNakerLinkProtocol(
            protocol.mode, uart_id=protocol.uart_id)
        for device in devices:
            device.set_command_protocol(command_protocol)

        # Initialise the abstract LIF class
        super().__init__(devices, True, None, tau_m, cm, v_rest, v_reset,
                         tau_syn_E, tau_syn_I, tau_refrac, i_offset, v,
                         isyn_exc, isyn_inh)
예제 #2
0
    def __init__(
            self,
            n_neurons,
            protocol,
            devices,

            # default params from abstract pop vertex
            spikes_per_second=_abstract_defaults['spikes_per_second'],
            label=_abstract_defaults['label'],
            ring_buffer_sigma=_abstract_defaults['ring_buffer_sigma'],
            incoming_spike_buffer_size=_abstract_defaults[
                'incoming_spike_buffer_size'],
            constraints=_abstract_defaults['constraints'],

            # default params for the neuron model type
            tau_m=_extern_defaults['tau_m'],
            cm=_extern_defaults['cm'],
            v_rest=_extern_defaults['v_rest'],
            v_reset=_extern_defaults['v_reset'],
            tau_syn_E=_extern_defaults['tau_syn_E'],
            tau_syn_I=_extern_defaults['tau_syn_I'],
            tau_refrac=_extern_defaults['tau_refrac'],
            i_offset=_extern_defaults['i_offset'],
            v_init=initialize_parameters['v_init']):
        # pylint: disable=too-many-arguments, too-many-locals

        self._command_protocol = MunichIoSpiNNakerLinkProtocol(
            protocol.mode, uart_id=protocol.uart_id)
        for device in devices:
            device.set_command_protocol(self._command_protocol)

        # Initialise the abstract LIF class
        super(PushBotLifSpinnakerLink, self).__init__(
            n_neurons=n_neurons,
            devices=devices,
            create_edges=True,
            spikes_per_second=spikes_per_second,
            label=label,
            ring_buffer_sigma=ring_buffer_sigma,
            incoming_spike_buffer_size=incoming_spike_buffer_size,
            constraints=constraints,
            tau_m=tau_m,
            cm=cm,
            v_rest=v_rest,
            v_reset=v_reset,
            tau_syn_E=tau_syn_E,
            tau_syn_I=tau_syn_I,
            tau_refrac=tau_refrac,
            i_offset=i_offset,
            v_init=v_init)
 def test_call_each_function(self):
     protocol = MunichIoSpiNNakerLinkProtocol(
         mode=MunichIoSpiNNakerLinkProtocol.MODES.PUSH_BOT)
     protocol.add_payload_logic_to_current_output(0)
     protocol.add_payload_logic_to_current_output_key
     protocol.bias_values(0, 0)
     protocol.bias_values_key
     protocol.configure_master_key(0)
     protocol.configure_master_key_key
     protocol.disable_retina()
     protocol.disable_retina_key
     protocol.enable_disable_motor_key
     protocol.generic_motor0_raw_output_leak_to_0(0)
     protocol.generic_motor0_raw_output_leak_to_0_key
     protocol.generic_motor0_raw_output_permanent(0)
     protocol.generic_motor0_raw_output_permanent_key
     protocol.generic_motor1_raw_output_leak_to_0(0)
     protocol.generic_motor1_raw_output_leak_to_0_key
     protocol.generic_motor1_raw_output_permanent(0)
     protocol.generic_motor1_raw_output_permanent_key
     protocol.generic_motor_disable()
     protocol.generic_motor_enable()
     protocol.generic_motor_total_period(0)
     protocol.generic_motor_total_period_key
     protocol.instance_key
     protocol.master_slave_key
     protocol.master_slave_set_master_clock_active()
     protocol.master_slave_set_master_clock_not_started()
     protocol.master_slave_set_slave()
     protocol.master_slave_use_internal_counter()
     protocol.mode
     protocol.poll_individual_sensor_continuously(0, 0)
     protocol.poll_individual_sensor_continuously_key
     protocol.poll_sensors_once(0)
     protocol.poll_sensors_once_key
     protocol.push_bot_laser_config_active_time(0)
     protocol.push_bot_laser_config_active_time_key
     protocol.push_bot_laser_config_total_period(0)
     protocol.push_bot_laser_config_total_period_key
     protocol.push_bot_laser_set_frequency(0)
     protocol.push_bot_laser_set_frequency_key
     protocol.push_bot_led_back_active_time(0)
     protocol.push_bot_led_back_active_time_key
     protocol.push_bot_led_front_active_time(0)
     protocol.push_bot_led_front_active_time_key
     protocol.push_bot_led_set_frequency(0)
     protocol.push_bot_led_set_frequency_key
     protocol.push_bot_led_total_period(0)
     protocol.push_bot_led_total_period_key
     protocol.push_bot_motor_0_leaking_towards_zero(0)
     protocol.push_bot_motor_0_leaking_towards_zero_key
     protocol.push_bot_motor_0_permanent(0)
     protocol.push_bot_motor_0_permanent_key
     protocol.push_bot_motor_1_leaking_towards_zero(0)
     protocol.push_bot_motor_1_leaking_towards_zero_key
     protocol.push_bot_motor_1_permanent(0)
     protocol.push_bot_motor_1_permanent_key
     protocol.push_bot_speaker_config_active_time(0)
     protocol.push_bot_speaker_config_active_time_key
     protocol.push_bot_speaker_config_total_period(0)
     protocol.push_bot_speaker_config_total_period_key
     protocol.push_bot_speaker_set_melody(0)
     protocol.push_bot_speaker_set_melody_key
     protocol.push_bot_speaker_set_tone(0)
     protocol.push_bot_speaker_set_tone_key
     protocol.pwm_pin_output_timer_a_channel_0_ratio(0)
     protocol.pwm_pin_output_timer_a_channel_0_ratio_key
     protocol.pwm_pin_output_timer_a_channel_1_ratio(0)
     protocol.pwm_pin_output_timer_a_channel_1_ratio_key
     protocol.pwm_pin_output_timer_a_duration(0)
     protocol.pwm_pin_output_timer_a_duration_key
     protocol.pwm_pin_output_timer_b_channel_0_ratio(0)
     protocol.pwm_pin_output_timer_b_channel_0_ratio_key
     protocol.pwm_pin_output_timer_b_channel_1_ratio(0)
     protocol.pwm_pin_output_timer_b_channel_1_ratio_key
     protocol.pwm_pin_output_timer_b_duration(0)
     protocol.pwm_pin_output_timer_b_duration_key
     protocol.pwm_pin_output_timer_c_channel_0_ratio(0)
     protocol.pwm_pin_output_timer_c_channel_0_ratio_key
     protocol.pwm_pin_output_timer_c_channel_1_ratio(0)
     protocol.pwm_pin_output_timer_c_channel_1_ratio_key
     protocol.pwm_pin_output_timer_c_duration(0)
     protocol.pwm_pin_output_timer_c_duration_key
     protocol.query_state_of_io_lines()
     protocol.query_state_of_io_lines_key
     protocol.remove_payload_logic_to_current_output(0)
     protocol.remove_payload_logic_to_current_output_key
     protocol.reset_retina()
     protocol.reset_retina_key
     protocol.sensor_transmission_key(0)
     protocol.sent_mode_command()
     protocol.set_mode()
     protocol.set_mode_key
     protocol.set_output_pattern_for_payload(0)
     protocol.set_output_pattern_for_payload_key
     protocol.set_payload_pins_to_high_impedance
     protocol.set_payload_pins_to_high_impedance_key
     protocol.set_retina_key(0)
     protocol.set_retina_key_key
     protocol.set_retina_transmission(RetinaKey.FIXED_KEY)
     protocol.set_retina_transmission_key
     protocol.turn_off_sensor_reporting(0)
     protocol.turn_off_sensor_reporting_key
     protocol.uart_id
 def test_call_each_function(self):
     protocol = MunichIoSpiNNakerLinkProtocol(
         mode=MunichIoSpiNNakerLinkProtocol.MODES.PUSH_BOT)
     protocol.add_payload_logic_to_current_output(0)
     protocol.add_payload_logic_to_current_output_key
     protocol.bias_values(0, 0)
     protocol.bias_values_key
     protocol.configure_master_key(0)
     protocol.configure_master_key_key
     protocol.disable_retina()
     protocol.disable_retina_key
     protocol.enable_disable_motor_key
     protocol.generic_motor0_raw_output_leak_to_0(0)
     protocol.generic_motor0_raw_output_leak_to_0_key
     protocol.generic_motor0_raw_output_permanent(0)
     protocol.generic_motor0_raw_output_permanent_key
     protocol.generic_motor1_raw_output_leak_to_0(0)
     protocol.generic_motor1_raw_output_leak_to_0_key
     protocol.generic_motor1_raw_output_permanent(0)
     protocol.generic_motor1_raw_output_permanent_key
     protocol.generic_motor_disable()
     protocol.generic_motor_enable()
     protocol.generic_motor_total_period(0)
     protocol.generic_motor_total_period_key
     protocol.instance_key
     protocol.master_slave_key
     protocol.master_slave_set_master_clock_active()
     protocol.master_slave_set_master_clock_not_started()
     protocol.master_slave_set_slave()
     protocol.master_slave_use_internal_counter()
     protocol.mode
     protocol.poll_individual_sensor_continuously(0, 0)
     protocol.poll_individual_sensor_continuously_key
     protocol.poll_sensors_once(0)
     protocol.poll_sensors_once_key
     protocol.push_bot_laser_config_active_time(0)
     protocol.push_bot_laser_config_active_time_key
     protocol.push_bot_laser_config_total_period(0)
     protocol.push_bot_laser_config_total_period_key
     protocol.push_bot_laser_set_frequency(0)
     protocol.push_bot_laser_set_frequency_key
     protocol.push_bot_led_back_active_time(0)
     protocol.push_bot_led_back_active_time_key
     protocol.push_bot_led_front_active_time(0)
     protocol.push_bot_led_front_active_time_key
     protocol.push_bot_led_set_frequency(0)
     protocol.push_bot_led_set_frequency_key
     protocol.push_bot_led_total_period(0)
     protocol.push_bot_led_total_period_key
     protocol.push_bot_motor_0_leaking_towards_zero(0)
     protocol.push_bot_motor_0_leaking_towards_zero_key
     protocol.push_bot_motor_0_permanent(0)
     protocol.push_bot_motor_0_permanent_key
     protocol.push_bot_motor_1_leaking_towards_zero(0)
     protocol.push_bot_motor_1_leaking_towards_zero_key
     protocol.push_bot_motor_1_permanent(0)
     protocol.push_bot_motor_1_permanent_key
     protocol.push_bot_speaker_config_active_time(0)
     protocol.push_bot_speaker_config_active_time_key
     protocol.push_bot_speaker_config_total_period(0)
     protocol.push_bot_speaker_config_total_period_key
     protocol.push_bot_speaker_set_melody(0)
     protocol.push_bot_speaker_set_melody_key
     protocol.push_bot_speaker_set_tone(0)
     protocol.push_bot_speaker_set_tone_key
     protocol.pwm_pin_output_timer_a_channel_0_ratio(0)
     protocol.pwm_pin_output_timer_a_channel_0_ratio_key
     protocol.pwm_pin_output_timer_a_channel_1_ratio(0)
     protocol.pwm_pin_output_timer_a_channel_1_ratio_key
     protocol.pwm_pin_output_timer_a_duration(0)
     protocol.pwm_pin_output_timer_a_duration_key
     protocol.pwm_pin_output_timer_b_channel_0_ratio(0)
     protocol.pwm_pin_output_timer_b_channel_0_ratio_key
     protocol.pwm_pin_output_timer_b_channel_1_ratio(0)
     protocol.pwm_pin_output_timer_b_channel_1_ratio_key
     protocol.pwm_pin_output_timer_b_duration(0)
     protocol.pwm_pin_output_timer_b_duration_key
     protocol.pwm_pin_output_timer_c_channel_0_ratio(0)
     protocol.pwm_pin_output_timer_c_channel_0_ratio_key
     protocol.pwm_pin_output_timer_c_channel_1_ratio(0)
     protocol.pwm_pin_output_timer_c_channel_1_ratio_key
     protocol.pwm_pin_output_timer_c_duration(0)
     protocol.pwm_pin_output_timer_c_duration_key
     protocol.query_state_of_io_lines()
     protocol.query_state_of_io_lines_key
     protocol.remove_payload_logic_to_current_output(0)
     protocol.remove_payload_logic_to_current_output_key
     protocol.reset_retina()
     protocol.reset_retina_key
     protocol.sensor_transmission_key(0)
     protocol.sent_mode_command()
     protocol.set_mode()
     protocol.set_mode_key
     protocol.set_output_pattern_for_payload(0)
     protocol.set_output_pattern_for_payload_key
     protocol.set_payload_pins_to_high_impedance
     protocol.set_payload_pins_to_high_impedance_key
     protocol.set_retina_key(0)
     protocol.set_retina_key_key
     protocol.set_retina_transmission(RetinaKey.FIXED_KEY)
     protocol.set_retina_transmission_key
     protocol.turn_off_sensor_reporting(0)
     protocol.turn_off_sensor_reporting_key
     protocol.uart_id