pacman.model.graphs.common package

Module contents

class pacman.model.graphs.common.ConstrainedObject(constraints=None)

Bases: object

An implementation of an object which holds constraints.

Parameters:constraints (iterable(AbstractConstraint)) – Any initial constraints

Add a new constraint to the collection of constraints

Parameters:constraint (AbstractConstraint) – constraint to add
Raises:PacmanInvalidParameterException – If the constraint is not valid

Add an iterable of constraints to the collection of constraints

Parameters:constraints (AbstractConstraint) – the constraints to add
Raises:PacmanInvalidParameterException – If one of the constraints is not valid

An iterable of constraints

Return type:iterable(AbstractConstraint)
class pacman.model.graphs.common.Slice

Bases: pacman.model.graphs.common.slice.Slice

Represents a slice of a vertex.

Attr int lo_atom:
 The lowest atom represented in the slice.
Attr int hi_atom:
 The highest atom represented in the slice.
Attr int n_atoms:
 The number of atoms represented by the slice.
Attr slice as_slice:
 This slice represented as a slice object (for use in indexing lists, arrays, etc.)

Create a new Slice object.

  • lo_atom (int) – Index of the lowest atom to represent.
  • hi_atom (int) – Index of the highest atom to represent.

PacmanValueError – If the bounds of the slice are invalid.