pacman.model.constraints.key_allocator_constraints package

Module contents

class pacman.model.constraints.key_allocator_constraints.AbstractKeyAllocatorConstraint

Bases: pacman.model.constraints.AbstractConstraint

A constraint on key allocation

class pacman.model.constraints.key_allocator_constraints.ContiguousKeyRangeContraint

Bases: pacman.model.constraints.key_allocator_constraints.AbstractKeyAllocatorConstraint

Key allocator constraint that keeps the keys allocated to a contiguous range. Without this constraint, keys can be allocated across the key space.

Note

All current key allocators always allocate contiguous keys.

class pacman.model.constraints.key_allocator_constraints.FixedKeyAndMaskConstraint(keys_and_masks, partition=None)

Bases: pacman.model.constraints.key_allocator_constraints.AbstractKeyAllocatorConstraint

Key allocator constraint that fixes the key and mask of an edge.

Note

Used for neuron-connected input (“sensory neurons”) and output (“motor neurons”) devices.

Parameters:
  • keys_and_masks (iterable(BaseKeyAndMask)) – The key and mask combinations to fix
  • partition (str or None) – The identifier of the partition to which this constraint applies, or None if it applies to all partitions (meaning there is only one partition expected)
applies_to_partition(partition)[source]

Determine if this applies to the given partition identifier or not

Parameters:partition (str) – The identifier of the partition to check
Return type:bool
keys_and_masks

The keys and masks to be fixed

Returns:An iterable of key and mask combinations
Return type:iterable(BaseKeyAndMask)
partition
The identifier of the partition to which this constraint applies,
or None if it applies to the only expected partition
Return type:str or None