PyPositionSenderModel

Full Name

neuroptimiser.core.models.PyPositionSenderModel

Description

class PyPositionSenderModel[source]

Bases: PyLoihiProcessModel

Position sender model for Loihi-based perturbation-based nheuristics

This model sends the position and fitness values of an agent/unit to the external world, allowing other processes to access this information.

See also

neuroptimiser.core.processes.PositionSender

Process that sends the position and fitness values of an agent/unit in a NeuroHeuristicUnit.

__init__(proc_params)[source]

Initialises the position sender model with the given parameters.

Arguments
proc_paramsdict
A dictionary containing the parameters for the process model. It must include:
  • agent_id: int, identifier of the agent

  • external_shape: tuple, shape of the external state (e.g., number of agents and dimensions)

fp_in: PyInPort = LavaPyType(cls=<class 'lava.magma.core.model.py.ports.PyInPortVectorDense'>, d_type=<class 'numpy.float32'>, precision=None)
fp_out: PyOutPort = LavaPyType(cls=<class 'lava.magma.core.model.py.ports.PyOutPortVectorDense'>, d_type=<class 'numpy.float32'>, precision=None)
implements_process

alias of PositionSender

implements_protocol

alias of LoihiProtocol

p_in: PyInPort = LavaPyType(cls=<class 'lava.magma.core.model.py.ports.PyInPortVectorDense'>, d_type=<class 'numpy.float32'>, precision=None)
p_out: PyOutPort = LavaPyType(cls=<class 'lava.magma.core.model.py.ports.PyOutPortVectorDense'>, d_type=<class 'numpy.float32'>, precision=None)
required_resources: ty.List[ty.Type[AbstractResource]] = [<class 'lava.magma.core.resources.CPU'>]
run_spk()[source]

Runs the position sender process model.

The process is summarised as follows:
  1. Receives the input position vector and fitness value from the inports.

  2. Prepares the output position matrix and fitness vector using the input spikes.

  3. Sends the output position matrix and fitness vector to the outports.