NeuroHeuristicUnit

Full Name

neuroptimiser.core.processes.NeuroHeuristicUnit

Description

class NeuroHeuristicUnit[source]

Bases: AbstractProcess

General model for a Neuro-Heuristic (Nheuristic) unit

This unit can be used to define a complete neuro-heuristic model using the “atomic” processes of the Neuroptimiser framework, such as Spiking Core, Selector, Spiking Handler, Position Sender, and Position Receiver.

Inports
a_inInPort

Input port for the spiking activity from other agents.

g_inInPort

Input port for the global best position.

fg_inInPort

Input port for the global best fitness.

pn_inInPort, optional

Input port for the positions of the neighbours.

fpn_inInPort, optional

Input port for the fitness of the neighbours.

Variables
xVar

Variable for the current position of the unit.

v1Var

Variable for the first neuromorphic state (e.g., membrane potential).

v2Var

Variable for the second neuromorphic state (e.g., adaptation/auxiliary variable).

Outports
s_outOutPort

Output port for the spiking activity to other agents.

p_outOutPort

Output port for the current position of the unit.

fp_outOutPort

Output port for the fitness of the unit.

See also

neuroptimiser.core.models.PyNeuroHeuristicUnitModel

Model implementation of the NeuroHeuristicUnit process.

__init__(agent_id: int = 0, num_dimensions: int = 2, num_neighbours: int = 0, num_agents: int = 10, spiking_core: AbstractProcess | None = None, function=None, core_params=None, selector_params=None, **kwargs)[source]

Initialise the NeuroHeuristicUnit with the given parameters.

Parameters:
  • agent_id (int, optional) – ID of the agent for which the unit is being created. Default is 0.

  • num_dimensions (int, optional) – Number of dimensions for the position and fitness variables. Default is 2.

  • num_neighbours (int, optional) – Number of neighbours for the unit. Default is 0, meaning no neighbours are considered.

  • num_agents (int, optional) – Number of agents in the system. Default is 10.

  • spiking_core (AbstractProcess, optional) – Instance of a spiking core process to be used in the unit. If not provided, a default spiking core will be created.

  • function (callable, optional) – Function to be used for evaluating the fitness of the positions. Default is None, which means no function is applied but an error will be raised if not provided.

  • core_params (dict, optional) – Parameters for the spiking core process. If not provided, default parameters will be used.

  • selector_params (dict, optional) – Parameters for the selector process. If not provided, default parameters will be used.

Keyword Arguments:

**kwargs (dict, optional) – Additional keyword arguments to be passed to the parent class AbstractProcess.

reset() None[source]

Reset the NeuroHeuristicUnit to its initial state.