Class ArgumentTree
- java.lang.Object
-
- net.sf.tweety.graphs.DefaultGraph<DeductiveArgumentNode>
-
- net.sf.tweety.arg.deductive.semantics.ArgumentTree
-
- All Implemented Interfaces:
java.lang.Iterable<DeductiveArgumentNode>
,Graph<DeductiveArgumentNode>
public class ArgumentTree extends DefaultGraph<DeductiveArgumentNode>
Instances of this class represent argument trees in the sense of Definition 6.1 in
Philippe Besnard and Anthony Hunter. A logic-based theory of deductive arguments. In Artificial Intelligence, 128(1-2):203-235, 2001.- Author:
- Matthias Thimm
-
-
Field Summary
Fields Modifier and Type Field Description private DeductiveArgumentNode
rootNode
The root node of this tree.-
Fields inherited from interface net.sf.tweety.graphs.Graph
IGNORE_SELFLOOPS, INVERT_SELFLOOPS, REMOVE_SELFLOOPS
-
-
Constructor Summary
Constructors Constructor Description ArgumentTree(DeductiveArgumentNode root)
Creates an empty argument tree for the given root node.
-
Method Summary
Modifier and Type Method Description DeductiveArgumentNode
getRoot()
Returns the root node of this tree.java.lang.String
prettyPrint()
Returns a string representation of this argument tree.private java.lang.String
prettyPrint(DeductiveArgumentNode node, java.util.Set<DeductiveArgumentNode> visitedNodes, int depth)
Returns a string representation of the subtree rooted at the given node.-
Methods inherited from class net.sf.tweety.graphs.DefaultGraph
add, add, areAdjacent, contains, containsBackEdge, containsCycle, existsDirectedPath, existsDirectedPath, getAdjacencyMatrix, getChildren, getComplementGraph, getEdge, getEdges, getNeighbors, getNodes, getNumberOfNodes, getParents, getRestriction, getStronglyConnectedComponents, getStronglyConnectedComponents, getSubgraphs, getSubgraphs, hasSelfLoops, isWeightedGraph, iterator, toString
-
-
-
-
Field Detail
-
rootNode
private DeductiveArgumentNode rootNode
The root node of this tree.
-
-
Constructor Detail
-
ArgumentTree
public ArgumentTree(DeductiveArgumentNode root)
Creates an empty argument tree for the given root node.- Parameters:
root
- the root node.
-
-
Method Detail
-
getRoot
public DeductiveArgumentNode getRoot()
Returns the root node of this tree.- Returns:
- the root node of this tree.
-
prettyPrint
public java.lang.String prettyPrint()
Returns a string representation of this argument tree.- Returns:
- a string representation of this argument tree.
-
prettyPrint
private java.lang.String prettyPrint(DeductiveArgumentNode node, java.util.Set<DeductiveArgumentNode> visitedNodes, int depth)
Returns a string representation of the subtree rooted at the given node.- Parameters:
node
- some node.visitedNodes
- already visited nodes.depth
- depth for indentation.- Returns:
- a string.
-
-