Class InstanceAssignment

  • All Implemented Interfaces:
    Serializable, Cloneable, Map<Collection<? extends net.sf.tweety.logics.commons.syntax.Constant>,​Integer>

    public class InstanceAssignment
    extends HashMap<Collection<? extends net.sf.tweety.logics.commons.syntax.Constant>,​Integer>
    Instances of this class represent assignenment of true instances for a given predicate wrt. to a set of constants.
    Author:
    Matthias Thimm
    See Also:
    Serialized Form
    • Constructor Detail

      • InstanceAssignment

        public InstanceAssignment​(net.sf.tweety.logics.commons.syntax.Predicate predicate)
        Creates a new instance assignment for the given predicate with no assignments.
        Parameters:
        predicate - a predicate.
      • InstanceAssignment

        public InstanceAssignment​(net.sf.tweety.logics.commons.syntax.Predicate predicate,
                                  Map<? extends Collection<? extends net.sf.tweety.logics.commons.syntax.Constant>,​Integer> map)
        Creates a new instance assignment for the given predicate with the given map.
        Parameters:
        predicate - a predicate.
        map - a map mapping sets of constants to integers.
    • Method Detail

      • getPredicate

        public net.sf.tweety.logics.commons.syntax.Predicate getPredicate()
        Returns the predicate of this assignment.
        Returns:
        the predicate of this assignment.
      • numberOfConstants

        public int numberOfConstants()
        Returns the number of constants assigned by this assignment, i.e. the sum of the values in this map.
        Returns:
        the number of constants assigned by this assignment.
      • enumerateInstanceAssignments

        public static Set<InstanceAssignment> enumerateInstanceAssignments​(net.sf.tweety.logics.commons.syntax.Predicate p,
                                                                           Set<Set<net.sf.tweety.logics.commons.syntax.Constant>> constants)
        Determines the set of all instance assignments for the given predicate and equivalence classes.
        Parameters:
        p - a predicate.
        constants - a set of constants.
        Returns:
        a set of instance assignments.