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
,BeliefBase
public final class GraphAbstractDialecticalFramework extends java.lang.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 java.util.Set<Argument>
children(Argument parent)
boolean
contains(Argument arg)
boolean
equals(java.lang.Object obj)
AcceptanceCondition
getAcceptanceCondition(Argument argument)
Guaranteed to be non-null if the ADF contains the argument.java.util.Set<Argument>
getArguments()
int
hashCode()
int
incomingDegree(Argument arg)
int
kBipolar()
Returns the count k of non-bipolar links, which makes this ADF k-bipolar.Link
link(Argument parent, Argument child)
Computes the link (parent, child) iff necessary and returns it afterwards.java.util.Set<Link>
links()
If the caller just consumes some of the links, the methodAbstractDialecticalFramework.linksStream()
should be preferred to this one.java.util.Set<Link>
linksFrom(Argument parent)
java.util.stream.Stream<Link>
linksStream()
If the caller just consumes some links, this method should be used.java.util.Set<Link>
linksTo(Argument child)
int
outgoingDegree(Argument arg)
java.util.Set<Argument>
parents(Argument child)
int
size()
-
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.sf.tweety.arg.adf.syntax.adf.AbstractDialecticalFramework
bipolar, getMinimalSignature
-
Methods inherited from interface net.sf.tweety.commons.BeliefBase
toString
-
-
-
-
Method Detail
-
getArguments
public java.util.Set<Argument> getArguments()
- Specified by:
getArguments
in interfaceAbstractDialecticalFramework
- Returns:
- an unmodifiable set of all the arguments
-
size
public int size()
- Specified by:
size
in interfaceAbstractDialecticalFramework
-
links
public java.util.Set<Link> links()
Description copied from interface:AbstractDialecticalFramework
If 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:
links
in interfaceAbstractDialecticalFramework
- Returns:
- an unmodifiable set of all the links
-
linksStream
public java.util.stream.Stream<Link> linksStream()
Description copied from interface:AbstractDialecticalFramework
If 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:
linksStream
in interfaceAbstractDialecticalFramework
- Returns:
- a stream of the links of this adf
-
link
public Link link(Argument parent, Argument child)
Description copied from interface:AbstractDialecticalFramework
Computes the link (parent, child) iff necessary and returns it afterwards.- Specified by:
link
in interfaceAbstractDialecticalFramework
- Parameters:
parent
- the parentchild
- the child- Returns:
- the link (parent, child)
-
contains
public boolean contains(Argument arg)
- Specified by:
contains
in interfaceAbstractDialecticalFramework
-
linksTo
public java.util.Set<Link> linksTo(Argument child)
- Specified by:
linksTo
in interfaceAbstractDialecticalFramework
- Parameters:
child
- the child- Returns:
- a set of links (parent, child)
-
linksFrom
public java.util.Set<Link> linksFrom(Argument parent)
- Specified by:
linksFrom
in interfaceAbstractDialecticalFramework
- Parameters:
parent
- the parent- Returns:
- a set of links (parent, child)
-
parents
public java.util.Set<Argument> parents(Argument child)
- Specified by:
parents
in interfaceAbstractDialecticalFramework
-
children
public java.util.Set<Argument> children(Argument parent)
- Specified by:
children
in interfaceAbstractDialecticalFramework
-
getAcceptanceCondition
public AcceptanceCondition getAcceptanceCondition(Argument argument)
Description copied from interface:AbstractDialecticalFramework
Guaranteed to be non-null if the ADF contains the argument.- Specified by:
getAcceptanceCondition
in interfaceAbstractDialecticalFramework
- Parameters:
argument
- some argument of this ADF- Returns:
- the found acceptance condition, never
null
-
incomingDegree
public int incomingDegree(Argument arg)
- Specified by:
incomingDegree
in interfaceAbstractDialecticalFramework
-
outgoingDegree
public int outgoingDegree(Argument arg)
- Specified by:
outgoingDegree
in interfaceAbstractDialecticalFramework
-
kBipolar
public int kBipolar()
Description copied from interface:AbstractDialecticalFramework
Returns the count k of non-bipolar links, which makes this ADF k-bipolar.- Specified by:
kBipolar
in interfaceAbstractDialecticalFramework
- Returns:
- k
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
-