Package net.sf.tweety.arg.dung.syntax
Class WeightedDungTheory
- java.lang.Object
-
- net.sf.tweety.commons.BeliefSet<Argument,DungSignature>
-
- net.sf.tweety.arg.dung.syntax.DungTheory
-
- net.sf.tweety.arg.dung.syntax.WeightedDungTheory
-
- All Implemented Interfaces:
java.lang.Comparable<DungTheory>
,java.lang.Iterable<Argument>
,java.util.Collection<Argument>
,BeliefBase
,Graph<Argument>
public class WeightedDungTheory extends DungTheory
Minimalistic Implementation of a weighted argumentation theory used for learning argumentation theories from labelings- Author:
- Lars Bengel
-
-
Field Summary
Fields Modifier and Type Field Description java.util.Map<Attack,java.lang.Double>
weights
listing of weights of every edge in the argumentation graph-
Fields inherited from class net.sf.tweety.commons.BeliefSet
EQUALS_USES_SIGNATURE
-
Fields inherited from interface net.sf.tweety.graphs.Graph
IGNORE_SELFLOOPS, INVERT_SELFLOOPS, REMOVE_SELFLOOPS
-
-
Constructor Summary
Constructors Constructor Description WeightedDungTheory()
initialize a new weighted argumentation theory
-
Method Summary
Modifier and Type Method Description boolean
addAttack(Argument attacker, Argument attacked)
add attack between both arguments to the theory and set weight to 1boolean
addAttack(Argument attacker, Argument attacked, double weight)
add attack between both arguments to the theory and set weight to given valueDungTheory
getDungTheory()
compute Dung Theory only containing attacks with weights greater than zeroDungTheory
getDungTheory(double threshold)
compute Dung Theory only containing attacks with weight above the given thresholdjava.lang.Double
getWeight(Argument attacker, Argument attacked)
return weight of the attack between the given argumentsjava.lang.Double
getWeight(Attack attack)
return weight of the given attack, weight is 0 if the attack is not presentboolean
remove(Attack attack)
remove attack from theory and reset weightboolean
removeDiscardedAttacks()
boolean
removeDiscardedAttacks(int threshold)
remove all attacks with weight < thresholdjava.lang.Double
setWeight(Attack attack, double weight)
sets the weight of the given attack to the given valuejava.lang.Double
updateWeight(Attack attack, double weight)
updates the weight of the given attack with the given value and return old value-
Methods inherited from class net.sf.tweety.arg.dung.syntax.DungTheory
add, add, add, add, add, addAllAttacks, areAdjacent, compareTo, contains, containsAll, containsAttack, containsCycle, equals, existsDirectedPath, faf, getAdjacencyMatrix, getAttacked, getAttackers, getAttacks, getChildren, getComplementGraph, getComponents, getEdge, getEdges, getInducedSubgraphs, getMinimalSignature, getNeighbors, getNodes, getNumberOfNodes, getParents, getRestriction, getStronglyConnectedComponents, getSubgraphs, hasAttackBranch, hasDefenseBranch, hashCode, hasSelfLoops, isAttackBranch, isAttacked, isAttacked, isAttackedBy, isAttackedBy, isAttackingAllOtherArguments, isCoherent, isDefenseBranch, isIndirectAttack, isRelativelyCoherent, isStable, isSupport, isWeightedGraph, isWellFounded, prettyPrint, remove, removeAll, toString
-
Methods inherited from class net.sf.tweety.commons.BeliefSet
add, addAll, clear, getSignature, isEmpty, iterator, remove, retainAll, setSignature, size, toArray, toArray
-
-
-
-
Field Detail
-
weights
public java.util.Map<Attack,java.lang.Double> weights
listing of weights of every edge in the argumentation graph
-
-
Method Detail
-
getWeight
public java.lang.Double getWeight(Argument attacker, Argument attacked)
return weight of the attack between the given arguments- Parameters:
attacker
- an argumentattacked
- an argument- Returns:
- weight of the attack
-
getWeight
public java.lang.Double getWeight(Attack attack)
return weight of the given attack, weight is 0 if the attack is not present- Parameters:
attack
- an attack- Returns:
- weight of attack
-
setWeight
public java.lang.Double setWeight(Attack attack, double weight)
sets the weight of the given attack to the given value- Parameters:
attack
- an attackweight
- new value for the weight- Returns:
- null or the previously associated value of attack
-
updateWeight
public java.lang.Double updateWeight(Attack attack, double weight)
updates the weight of the given attack with the given value and return old value- Parameters:
attack
- an attackweight
- new value for the weight- Returns:
- previously associated value of attack
-
getDungTheory
public DungTheory getDungTheory()
compute Dung Theory only containing attacks with weights greater than zero- Returns:
- computed Dung Theory
-
getDungTheory
public DungTheory getDungTheory(double threshold)
compute Dung Theory only containing attacks with weight above the given threshold- Parameters:
threshold
- cutoff for attacks- Returns:
- Dung Theory wrt. given threshold
-
addAttack
public boolean addAttack(Argument attacker, Argument attacked, double weight)
add attack between both arguments to the theory and set weight to given value- Parameters:
attacker
- an argumentattacked
- an argumentweight
- the weight of the attack- Returns:
- "true" if attack between the arguments was added
-
addAttack
public boolean addAttack(Argument attacker, Argument attacked)
add attack between both arguments to the theory and set weight to 1- Overrides:
addAttack
in classDungTheory
- Parameters:
attacker
- an argumentattacked
- an argument- Returns:
- "true" if attack between the arguments was added
-
remove
public boolean remove(Attack attack)
remove attack from theory and reset weight- Overrides:
remove
in classDungTheory
- Parameters:
attack
- an attack- Returns:
- "true" if attack successfully removed
-
removeDiscardedAttacks
public boolean removeDiscardedAttacks(int threshold)
remove all attacks with weight < threshold- Parameters:
threshold
- some threshold- Returns:
- "true" if all attacks were removed
-
removeDiscardedAttacks
public boolean removeDiscardedAttacks()
-
-