Package net.sf.tweety.preferences
Interface BinaryRelation<T>
-
- Type Parameters:
T- the generic type of objects/pairs in this binary relation
- All Superinterfaces:
Collection<net.sf.tweety.commons.util.Triple<T,T,Relation>>,Iterable<net.sf.tweety.commons.util.Triple<T,T,Relation>>,Set<net.sf.tweety.commons.util.Triple<T,T,Relation>>
- All Known Implementing Classes:
PreferenceOrder
public interface BinaryRelation<T> extends Set<net.sf.tweety.commons.util.Triple<T,T,Relation>>
This abstract class provides a basic implementation of a generic set of pairs to be used for preference ordering.- Author:
- Bastian Wolf
-
-
Method Summary
Modifier and Type Method Description booleanadd(net.sf.tweety.commons.util.Triple<T,T,Relation> t)adds a new triple containing two elements and its relationSet<T>getDomainElements()returns a set of the single elements in this binary relationbooleanisRelated(T a, T b)returns whether the elements a and b are relatedbooleanisTotal()checks whether the set is total or notbooleanisTransitive()checks whether the given set is transitive or notbooleanisValid()checks whether the preference order is valid (transitive, total and unique)StringtoString()returns a String with the elements of this set-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
-
-
-
Method Detail
-
add
boolean add(net.sf.tweety.commons.util.Triple<T,T,Relation> t)
adds a new triple containing two elements and its relation
-
isRelated
boolean isRelated(T a, T b)
returns whether the elements a and b are related- Parameters:
a- the first element to be checkedb- the second element to be checked- Returns:
- true if related, false if not.
-
getDomainElements
Set<T> getDomainElements()
returns a set of the single elements in this binary relation- Returns:
- a set of the single elements in this binary relation
-
isTotal
boolean isTotal()
checks whether the set is total or not- Returns:
- true if total, false otherwise
-
isTransitive
boolean isTransitive()
checks whether the given set is transitive or not- Returns:
- true if transitive, false otherwise
-
isValid
boolean isValid()
checks whether the preference order is valid (transitive, total and unique)- Returns:
- true if valid, false if not
-
-