Source code for pacman.model.constraints.key_allocator_constraints.share_key_constraint

# Copyright (c) 2017-2019 The University of Manchester
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

from .abstract_key_allocator_constraint import AbstractKeyAllocatorConstraint


[docs]class ShareKeyConstraint(AbstractKeyAllocatorConstraint): """ Constraint to allow the same keys to be allocated to multiple edges via partitions. .. warning:: This constraint appears to be unused. """ __slots__ = [ # The set of outgoing partitions to vertices which all share the same\ # key "_other_partitions" ] def __init__(self, other_partitions): """ :param list(AbstractSingleSourcePartition) other_partitions: the other edges which keys are shared with. """ self._other_partitions = other_partitions @property def other_partitions(self): """ the other edges which keys are shared with :rtype: list(AbstractSingleSourcePartition) """ return self._other_partitions