pacman.model.routing_table_by_partition package

Module contents

class pacman.model.routing_table_by_partition.MulticastRoutingTableByPartition

Bases: object

A set of multicast routing path objects.

add_path_entry(entry: RoutingEntry, router_x: int, router_y: int, source_vertex: AbstractVertex, partition_id: str)[source]

Adds a multicast routing path entry.

Parameters:
  • entry (RoutingEntry) – the entry to add

  • router_x (int) – the X coordinate of the router

  • router_y (int) – the Y coordinate of the router

  • source_vertex (ApplicationVertex or MachineVertex) – The source that will send via this entry

  • partition_id (str) – The ID of the partition being sent

get_entries_for_router(router_x: int, router_y: int) Dict[Tuple[AbstractVertex, str], RoutingEntry] | None[source]

Get the set of multicast path entries assigned to this router.

Parameters:
  • router_x (int) – the X coordinate of the router

  • router_y (int) – the Y coordinate of the router

Returns:

all router_path_entries for the router.

Return type:

dict(tuple((ApplicationVertex or MachineVertex), str), RoutingEntry)

get_entry_on_coords_for_edge(source_vertex: AbstractVertex, partition_id: str, router_x: int, router_y: int) RoutingEntry | None[source]

Get an entry from a specific coordinate.

Parameters:
Return type:

RoutingEntry or None

get_routers() Iterator[Tuple[int, int]][source]

Get the coordinates of all stored routers.

Return type:

iterable(tuple(int, int))

property n_routers: int

The number of routers stored.

Return type:

int