pacman.model.graphs.application.abstract package

Module contents

class pacman.model.graphs.application.abstract.Abstract2DDeviceVertex

Bases: object

A helper for 2D input devices.

Note

This assumes that the input keys will contain a field for each of the X and Y dimensions with X field in the LSBs and the Y field in the next adjacent bits. If the fields are in different places, override the methods: _source_x_shift, _source_y_shift, _source_x_mask and _source_y_mask. If the key has bits in addition to the X and Y values, you can also override _key_shift.

abstract property atoms_shape: Tuple[int, ...]

The “shape” of the atoms in the vertex i.e. how the atoms are split between the dimensions of the vertex. By default everything is 1-dimensional, so the value will be a 1-tuple but can be overridden by a vertex that supports multiple dimensions.

Return type:

tuple(int, …)

The “shape” of the atoms in the vertex i.e. how the atoms are split between the dimensions of the vertex. By default everything is 1-dimensional, so the value will be a 1-tuple but can be overridden by a vertex that supports multiple dimensions.

Return type:

tuple(int, …)

abstract property height: int

The height of the device.

Return type:

int

abstract property sub_height: int

The height of the sub-rectangles to divide the input into.

Return type:

int

abstract property sub_width: int

The width of the sub-rectangles to divide the input into.

Return type:

int

abstract property width: int

The width of the device.

Return type:

int

class pacman.model.graphs.application.abstract.AbstractOneAppOneMachineVertex(machine_vertex: V, label: str | None, n_atoms: int = 1)

Bases: ApplicationVertex, Generic[V]

An application vertex that has a fixed singleton MachineVertex.

Parameters:
  • machine_vertex (MachineVertex) – The fixed machine vertex.

  • label (str) – The optional name of the vertex.

property machine_vertex: V

Provides access to the machine vertex at all times

Return type:

MachineVertex

property n_atoms: int

The number of atoms in the vertex.

Return type:

int

remember_machine_vertex(machine_vertex: V)[source]

Adds the machine vertex to the iterable returned by machine_vertices

Parameters:

machine_vertex (MachineVertex) – A pointer to a machine_vertex

reset() None[source]

Forget all machine vertices in the application vertex, and reset the splitter (if any).