pacman.model.placements package¶
Module contents¶

class
pacman.model.placements.
Placement
(vertex, x, y, p)¶ Bases:
object
The placement of a vertex on to a machine chip and core.
Parameters: 
location
¶ The (x,y,p) tuple that represents the location of this placement.
Return type: tuple(int,int,int)

vertex
¶ The vertex that was placed
Return type: MachineVertex


class
pacman.model.placements.
Placements
(placements=None)¶ Bases:
object
The placements of vertices on the chips of the machine.
Parameters: placements (iterable(Placement)) – Any initial placements
Raises:  PacmanAlreadyPlacedError – If there is any vertex with more than one placement.
 PacmanProcessorAlreadyOccupiedError – If two placements are made to the same processor.

add_placement
(placement)[source]¶ Add a placement
Parameters: placement (Placement) – The placement to add
Raises:  PacmanAlreadyPlacedError – If there is any vertex with more than one placement.
 PacmanProcessorAlreadyOccupiedError – If two placements are made to the same processor.

add_placements
(placements)[source]¶ Add some placements
Parameters: placements (iterable(Placement)) – The placements to add

get_placement_of_vertex
(vertex)[source]¶ Return the placement information for a vertex
Parameters: vertex (MachineVertex) – The vertex to find the placement of Returns: The placement Return type: Placement Raises: PacmanNotPlacedError – If the vertex has not been placed.

get_placement_on_processor
(x, y, p)[source]¶  Return the placement on a specific processor or raises an exception
 if the processor has not been allocated
Parameters: Returns: the placement on the given processor
Return type: Raises: PacmanProcessorNotOccupiedError – If the processor is not occupied

is_processor_occupied
(x, y, p)[source]¶ Determine if a processor has a vertex on it
Parameters: Return bool: Whether the processor has an assigned vertex.

is_vertex_placed
(vertex)[source]¶ Determine if a vertex has been placed
Parameters: vertex (MachineVertex) – The vertex to determine the status of Return type: bool

iterate_placements_by_vertex_type
(vertex_type)[source]¶ Iterate over placements on any chip with this vertex_type
Parameters: vertex_type (class) – Class of vertex to find Return type: Placement

iterate_placements_by_xy_and_type
(x, y, vertex_type)[source]¶ Iterate over placements with this x, y and this vertex_type
Parameters: Return type:

iterate_placements_on_core
(x, y)[source]¶ Iterate over placements with this x, y and this type
Parameters: Return type:

n_placements_on_chip
(x, y)[source]¶ The number of placements on the given chip :param int x: x coordinate of chip. :param int y: y coordinate of chip.

placements
¶ All of the placements :return: iterable of placements :rtype: iterable(Placement)