Package net.sf.tweety.arg.adf.syntax.adf
Class GraphAbstractDialecticalFramework
- java.lang.Object
-
- net.sf.tweety.arg.adf.syntax.adf.GraphAbstractDialecticalFramework
-
- All Implemented Interfaces:
AbstractDialecticalFramework,net.sf.tweety.commons.BeliefBase
public final class GraphAbstractDialecticalFramework extends Object implements AbstractDialecticalFramework
Internally represented as a graph-like structure. This allows for efficient queries at the cost of a bit more memory overhead, since every argument maintains references to its parents and children.- Author:
- Mathias Hofer
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface net.sf.tweety.arg.adf.syntax.adf.AbstractDialecticalFramework
AbstractDialecticalFramework.Signature
-
-
Method Summary
Modifier and Type Method Description Set<Argument>children(Argument parent)booleancontains(Argument arg)booleanequals(Object obj)AcceptanceConditiongetAcceptanceCondition(Argument argument)Guaranteed to be non-null if the ADF contains the argument.Set<Argument>getArguments()inthashCode()intincomingDegree(Argument arg)intkBipolar()Returns the count k of non-bipolar links, which makes this ADF k-bipolar.Linklink(Argument parent, Argument child)Computes the link (parent, child) iff necessary and returns it afterwards.Set<Link>links()If the caller just consumes some of the links, the methodAbstractDialecticalFramework.linksStream()should be preferred to this one.Set<Link>linksFrom(Argument parent)Stream<Link>linksStream()If the caller just consumes some links, this method should be used.Set<Link>linksTo(Argument child)intoutgoingDegree(Argument arg)Set<Argument>parents(Argument child)intsize()-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.sf.tweety.arg.adf.syntax.adf.AbstractDialecticalFramework
bipolar, getMinimalSignature
-
-
-
-
Method Detail
-
getArguments
public Set<Argument> getArguments()
- Specified by:
getArgumentsin interfaceAbstractDialecticalFramework- Returns:
- an unmodifiable set of all the arguments
-
size
public int size()
- Specified by:
sizein interfaceAbstractDialecticalFramework
-
links
public Set<Link> links()
Description copied from interface:AbstractDialecticalFrameworkIf the caller just consumes some of the links, the methodAbstractDialecticalFramework.linksStream()should be preferred to this one. Depending on the implementation, the links may be computed lazily and therefore we may avoid unnecessary computation.- Specified by:
linksin interfaceAbstractDialecticalFramework- Returns:
- an unmodifiable set of all the links
-
linksStream
public Stream<Link> linksStream()
Description copied from interface:AbstractDialecticalFrameworkIf the caller just consumes some links, this method should be used. Depending on the implementation, the links may be computed lazily and therefore we may avoid unnecessary computation.- Specified by:
linksStreamin interfaceAbstractDialecticalFramework- Returns:
- a stream of the links of this adf
-
link
public Link link(Argument parent, Argument child)
Description copied from interface:AbstractDialecticalFrameworkComputes the link (parent, child) iff necessary and returns it afterwards.- Specified by:
linkin interfaceAbstractDialecticalFramework- Parameters:
parent- the parentchild- the child- Returns:
- the link (parent, child)
-
contains
public boolean contains(Argument arg)
- Specified by:
containsin interfaceAbstractDialecticalFramework
-
linksTo
public Set<Link> linksTo(Argument child)
- Specified by:
linksToin interfaceAbstractDialecticalFramework- Parameters:
child- the child- Returns:
- a set of links (parent, child)
-
linksFrom
public Set<Link> linksFrom(Argument parent)
- Specified by:
linksFromin interfaceAbstractDialecticalFramework- Parameters:
parent- the parent- Returns:
- a set of links (parent, child)
-
parents
public Set<Argument> parents(Argument child)
- Specified by:
parentsin interfaceAbstractDialecticalFramework
-
children
public Set<Argument> children(Argument parent)
- Specified by:
childrenin interfaceAbstractDialecticalFramework
-
getAcceptanceCondition
public AcceptanceCondition getAcceptanceCondition(Argument argument)
Description copied from interface:AbstractDialecticalFrameworkGuaranteed to be non-null if the ADF contains the argument.- Specified by:
getAcceptanceConditionin interfaceAbstractDialecticalFramework- Parameters:
argument- some argument of this ADF- Returns:
- the found acceptance condition, never
null
-
incomingDegree
public int incomingDegree(Argument arg)
- Specified by:
incomingDegreein interfaceAbstractDialecticalFramework
-
outgoingDegree
public int outgoingDegree(Argument arg)
- Specified by:
outgoingDegreein interfaceAbstractDialecticalFramework
-
kBipolar
public int kBipolar()
Description copied from interface:AbstractDialecticalFrameworkReturns the count k of non-bipolar links, which makes this ADF k-bipolar.- Specified by:
kBipolarin interfaceAbstractDialecticalFramework- Returns:
- k
-
-