Package net.sf.tweety.arg.bipolar.syntax
Class AbstractBipolarFramework
- java.lang.Object
-
- net.sf.tweety.commons.BeliefSet<BArgument,net.sf.tweety.arg.dung.syntax.DungSignature>
-
- net.sf.tweety.arg.bipolar.syntax.AbstractBipolarFramework
-
- All Implemented Interfaces:
Iterable<BArgument>,Collection<BArgument>,net.sf.tweety.commons.BeliefBase,net.sf.tweety.graphs.Graph<BArgument>
- Direct Known Subclasses:
DeductiveArgumentationFramework,EvidentialArgumentationFramework,NecessityArgumentationFramework
public abstract class AbstractBipolarFramework extends net.sf.tweety.commons.BeliefSet<BArgument,net.sf.tweety.arg.dung.syntax.DungSignature> implements net.sf.tweety.graphs.Graph<BArgument>
This class implements a bipolar abstract argumentation framework with attack and support relations. Both relations need to have the form (BipolarEntity, BArgument)- Author:
- Lars Bengel
-
-
Field Summary
Fields Modifier and Type Field Description protected Map<BipolarEntity,Set<BArgument>>attackChildrenprotected Map<BArgument,Set<BipolarEntity>>attackParentsexplicit listing of direct attackers and attackees (for efficiency reasons)protected Map<BipolarEntity,Set<BArgument>>supportChildrenprotected Map<BArgument,Set<BipolarEntity>>supportParentsexplicit listing of direct supporters and supported (for efficiency reasons)
-
Constructor Summary
Constructors Constructor Description AbstractBipolarFramework()
-
Method Summary
Modifier and Type Method Description protected booleanadd(AbstractBipolarFramework theory)Adds all arguments, attacks and supports of the given argumentation framework to this frameworkabstract booleanadd(Attack attack)Adds the given attack to this argumentation frameworkbooleanadd(BArgument argument)Adds argument to this argumentation frameworkabstract booleanadd(Support support)Adds the given support to this argumentation framework.booleanadd(net.sf.tweety.arg.dung.syntax.Argument argument)Adds argument to this argumentation framework for better compatibility between dung theories and bipolar argumentation frameworksbooleanadd(net.sf.tweety.graphs.Edge<BArgument> edge)booleanaddAllAttacks(Collection<? extends Attack> c)Adds the set of attacks to this argumentation frameworkbooleanaddAllSupports(Collection<? extends Support> c)Adds the set of supports to this argumentation frameworkbooleanareAdjacent(BArgument a, BArgument b)booleanexistsDirectedPath(BArgument node1, BArgument node2)ArgumentSetfaf(ArgumentSet extension)The characteristic function of an bipolar argumentation framework: F_AF(S) = {A|A is acceptable wrt.net.sf.tweety.math.matrix.MatrixgetAdjacencyMatrix()Set<BArgument>getAttacked(BipolarEntity arg)Computes the set {A | (argument,A) in attacks}.Set<BipolarEntity>getAttackers(BArgument argument)Computes the set {A | (A,argument) in attacks}.abstract Set<Attack>getAttacks()Returns all attacks of this theory.Collection<BArgument>getChildren(net.sf.tweety.graphs.Node node)net.sf.tweety.graphs.Graph<BArgument>getComplementGraph(int i)Set<BArgument>getDirectSupported(BipolarEntity arg)Computes the set {A | (argument,A) in supports}.Set<BipolarEntity>getDirectSupporters(BArgument argument)Computes the set {A | (A,argument) in supports}.net.sf.tweety.graphs.Edge<BArgument>getEdge(BArgument a, BArgument b)Collection<? extends net.sf.tweety.graphs.Edge<? extends BArgument>>getEdges()net.sf.tweety.commons.SignaturegetMinimalSignature()Collection<BArgument>getNeighbors(BArgument node)Collection<BArgument>getNodes()intgetNumberOfNodes()Collection<BArgument>getParents(net.sf.tweety.graphs.Node node)net.sf.tweety.graphs.Graph<BArgument>getRestriction(Collection<BArgument> collection)Collection<Collection<BArgument>>getStronglyConnectedComponents()Collection<net.sf.tweety.graphs.Graph<BArgument>>getSubgraphs()abstract Set<Support>getSupports()Returns all supports of this theory.booleanhasSelfLoops()protected net.sf.tweety.arg.dung.syntax.DungSignatureinstantiateSignature()abstract booleanisAcceptable(BArgument argument, Collection<BArgument> ext)checks whether argument is acceptable wrt.booleanisAttackedBy(BArgument arg1, BipolarEntity arg2)Checks whether arg1 is attacked by arg2.booleanisDirectSupportedBy(BArgument arg1, BipolarEntity arg2)Checks whether arg1 is directly supported by arg2.booleanisWeightedGraph()StringprettyPrint()Pretty print of the framework.booleanremove(Attack attack)Removes the given attack from this argumentation framework.booleanremove(BArgument a)Removes the argument and all its attacks and supportsbooleanremove(Support support)Removes the given support from this argumentation framework.booleanremoveAll(Collection<?> c)-
Methods inherited from class net.sf.tweety.commons.BeliefSet
add, addAll, clear, contains, containsAll, equals, getSignature, hashCode, instantiateSet, isEmpty, iterator, remove, retainAll, setSignature, size, toArray, toArray, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, spliterator, stream, toArray
-
-
-
-
Field Detail
-
supportParents
protected Map<BArgument,Set<BipolarEntity>> supportParents
explicit listing of direct supporters and supported (for efficiency reasons)
-
supportChildren
protected Map<BipolarEntity,Set<BArgument>> supportChildren
-
attackParents
protected Map<BArgument,Set<BipolarEntity>> attackParents
explicit listing of direct attackers and attackees (for efficiency reasons)
-
attackChildren
protected Map<BipolarEntity,Set<BArgument>> attackChildren
-
-
Method Detail
-
getDirectSupporters
public Set<BipolarEntity> getDirectSupporters(BArgument argument)
Computes the set {A | (A,argument) in supports}.- Parameters:
argument- an argument- Returns:
- the set of all bipolar entities that support
argument.
-
getDirectSupported
public Set<BArgument> getDirectSupported(BipolarEntity arg)
Computes the set {A | (argument,A) in supports}.- Parameters:
arg- an instance of bipolar entity- Returns:
- the set of all arguments that are supported by
argument.
-
getAttackers
public Set<BipolarEntity> getAttackers(BArgument argument)
Computes the set {A | (A,argument) in attacks}.- Parameters:
argument- an argument- Returns:
- the set of all bipolar entities that attack
argument.
-
getAttacked
public Set<BArgument> getAttacked(BipolarEntity arg)
Computes the set {A | (argument,A) in attacks}.- Parameters:
arg- an instance of bipolar entity- Returns:
- the set of all arguments that are attacked by
argument.
-
isAcceptable
public abstract boolean isAcceptable(BArgument argument, Collection<BArgument> ext)
checks whether argument is acceptable wrt. ext- Parameters:
argument- some argumentext- a set of arguments- Returns:
- "true" if argument is acceptable wrt. ext
-
faf
public ArgumentSet faf(ArgumentSet extension)
The characteristic function of an bipolar argumentation framework: F_AF(S) = {A|A is acceptable wrt. S}.- Parameters:
extension- an extension (a set of arguments).- Returns:
- an extension (a set of arguments).
-
isDirectSupportedBy
public boolean isDirectSupportedBy(BArgument arg1, BipolarEntity arg2)
Checks whether arg1 is directly supported by arg2.- Parameters:
arg1- an argument.arg2- a bipolar entity- Returns:
- "true" if arg1 is directly supported by arg2
-
isAttackedBy
public boolean isAttackedBy(BArgument arg1, BipolarEntity arg2)
Checks whether arg1 is attacked by arg2.- Parameters:
arg1- an argument.arg2- a bipolar entity- Returns:
- "true" if arg1 is directly attacked by arg2
-
getSupports
public abstract Set<Support> getSupports()
Returns all supports of this theory.- Returns:
- all supports of this theory.
-
getAttacks
public abstract Set<Attack> getAttacks()
Returns all attacks of this theory.- Returns:
- all attacks of this theory.
-
add
public abstract boolean add(Support support)
Adds the given support to this argumentation framework.- Parameters:
support- a support- Returns:
- "true" if the set of supports has been modified.
-
addAllSupports
public boolean addAllSupports(Collection<? extends Support> c)
Adds the set of supports to this argumentation framework- Parameters:
c- a collection of supports- Returns:
- "true" if this argumentation framework has been modified.
-
add
public abstract boolean add(Attack attack)
Adds the given attack to this argumentation framework- Parameters:
attack- an attack- Returns:
- "true" if the set of attacks has been modified.
-
addAllAttacks
public boolean addAllAttacks(Collection<? extends Attack> c)
Adds the set of attacks to this argumentation framework- Parameters:
c- a collection of attacks- Returns:
- "true" if this argumentation framework has been modified.
-
add
protected boolean add(AbstractBipolarFramework theory)
Adds all arguments, attacks and supports of the given argumentation framework to this framework- Parameters:
theory- some abstract support framework- Returns:
- "true" if this framework has been modified
-
add
public boolean add(BArgument argument)
Adds argument to this argumentation framework- Specified by:
addin interfaceCollection<BArgument>- Specified by:
addin interfacenet.sf.tweety.graphs.Graph<BArgument>- Overrides:
addin classnet.sf.tweety.commons.BeliefSet<BArgument,net.sf.tweety.arg.dung.syntax.DungSignature>- Parameters:
argument- some argument- Returns:
- "true" if this framework has been modified
-
add
public boolean add(net.sf.tweety.arg.dung.syntax.Argument argument)
Adds argument to this argumentation framework for better compatibility between dung theories and bipolar argumentation frameworks- Parameters:
argument- some argument- Returns:
- "true" if this framework has been modified
-
remove
public boolean remove(Support support)
Removes the given support from this argumentation framework.- Parameters:
support- a support- Returns:
- "true" if the set of supports has been modified.
-
remove
public boolean remove(Attack attack)
Removes the given attack from this argumentation framework.- Parameters:
attack- an attack- Returns:
- "true" if the set of supports has been modified.
-
remove
public boolean remove(BArgument a)
Removes the argument and all its attacks and supports- Parameters:
a- some argument- Returns:
- true if this structure has been changed
-
removeAll
public boolean removeAll(Collection<?> c)
- Specified by:
removeAllin interfaceCollection<BArgument>- Overrides:
removeAllin classnet.sf.tweety.commons.BeliefSet<BArgument,net.sf.tweety.arg.dung.syntax.DungSignature>
-
prettyPrint
public String prettyPrint()
Pretty print of the framework.- Returns:
- the pretty print of the framework.
-
instantiateSignature
protected net.sf.tweety.arg.dung.syntax.DungSignature instantiateSignature()
- Specified by:
instantiateSignaturein classnet.sf.tweety.commons.BeliefSet<BArgument,net.sf.tweety.arg.dung.syntax.DungSignature>
-
getMinimalSignature
public net.sf.tweety.commons.Signature getMinimalSignature()
- Specified by:
getMinimalSignaturein interfacenet.sf.tweety.commons.BeliefBase
-
add
public boolean add(net.sf.tweety.graphs.Edge<BArgument> edge)
- Specified by:
addin interfacenet.sf.tweety.graphs.Graph<BArgument>
-
getNodes
public Collection<BArgument> getNodes()
- Specified by:
getNodesin interfacenet.sf.tweety.graphs.Graph<BArgument>
-
getNumberOfNodes
public int getNumberOfNodes()
- Specified by:
getNumberOfNodesin interfacenet.sf.tweety.graphs.Graph<BArgument>
-
areAdjacent
public boolean areAdjacent(BArgument a, BArgument b)
- Specified by:
areAdjacentin interfacenet.sf.tweety.graphs.Graph<BArgument>
-
getEdge
public net.sf.tweety.graphs.Edge<BArgument> getEdge(BArgument a, BArgument b)
- Specified by:
getEdgein interfacenet.sf.tweety.graphs.Graph<BArgument>
-
getEdges
public Collection<? extends net.sf.tweety.graphs.Edge<? extends BArgument>> getEdges()
- Specified by:
getEdgesin interfacenet.sf.tweety.graphs.Graph<BArgument>
-
getChildren
public Collection<BArgument> getChildren(net.sf.tweety.graphs.Node node)
- Specified by:
getChildrenin interfacenet.sf.tweety.graphs.Graph<BArgument>
-
getParents
public Collection<BArgument> getParents(net.sf.tweety.graphs.Node node)
- Specified by:
getParentsin interfacenet.sf.tweety.graphs.Graph<BArgument>
-
existsDirectedPath
public boolean existsDirectedPath(BArgument node1, BArgument node2)
- Specified by:
existsDirectedPathin interfacenet.sf.tweety.graphs.Graph<BArgument>
-
getNeighbors
public Collection<BArgument> getNeighbors(BArgument node)
- Specified by:
getNeighborsin interfacenet.sf.tweety.graphs.Graph<BArgument>
-
getAdjacencyMatrix
public net.sf.tweety.math.matrix.Matrix getAdjacencyMatrix()
- Specified by:
getAdjacencyMatrixin interfacenet.sf.tweety.graphs.Graph<BArgument>
-
getComplementGraph
public net.sf.tweety.graphs.Graph<BArgument> getComplementGraph(int i)
- Specified by:
getComplementGraphin interfacenet.sf.tweety.graphs.Graph<BArgument>
-
getStronglyConnectedComponents
public Collection<Collection<BArgument>> getStronglyConnectedComponents()
- Specified by:
getStronglyConnectedComponentsin interfacenet.sf.tweety.graphs.Graph<BArgument>
-
getSubgraphs
public Collection<net.sf.tweety.graphs.Graph<BArgument>> getSubgraphs()
- Specified by:
getSubgraphsin interfacenet.sf.tweety.graphs.Graph<BArgument>
-
getRestriction
public net.sf.tweety.graphs.Graph<BArgument> getRestriction(Collection<BArgument> collection)
- Specified by:
getRestrictionin interfacenet.sf.tweety.graphs.Graph<BArgument>
-
hasSelfLoops
public boolean hasSelfLoops()
- Specified by:
hasSelfLoopsin interfacenet.sf.tweety.graphs.Graph<BArgument>
-
isWeightedGraph
public boolean isWeightedGraph()
- Specified by:
isWeightedGraphin interfacenet.sf.tweety.graphs.Graph<BArgument>
-
-