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:
Comparable<DungTheory>,Iterable<Argument>,Collection<Argument>,net.sf.tweety.commons.BeliefBase,net.sf.tweety.graphs.Graph<Argument>
public class WeightedDungTheory extends DungTheory
Minimalistic Implementation of a weighted argumentation theory used for learning argumentation theories from labelings- Author:
- Lars Bengel
-
-
Constructor Summary
Constructors Constructor Description WeightedDungTheory()initialize a new weighted argumentation theory
-
Method Summary
Modifier and Type Method Description booleanaddAttack(Argument attacker, Argument attacked)add attack between both arguments to the theory and set weight to 1booleanaddAttack(Argument attacker, Argument attacked, double weight)add attack between both arguments to the theory and set weight to given valueDungTheorygetDungTheory()compute Dung Theory only containing attacks with weights greater than zeroDungTheorygetDungTheory(double threshold)compute Dung Theory only containing attacks with weight above the given thresholdDoublegetWeight(Argument attacker, Argument attacked)return weight of the attack between the given argumentsDoublegetWeight(Attack attack)return weight of the given attack, weight is 0 if the attack is not presentbooleanremove(Attack attack)remove attack from theory and reset weightbooleanremoveDiscardedAttacks()booleanremoveDiscardedAttacks(int threshold)remove all attacks with weight < thresholdDoublesetWeight(Attack attack, double weight)sets the weight of the given attack to the given valueDoubleupdateWeight(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, instantiateSignature, 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, instantiateSet, isEmpty, iterator, remove, retainAll, setSignature, size, toArray, toArray
-
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
-
-
-
-
Method Detail
-
getWeight
public 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 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 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 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:
addAttackin 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:
removein 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()
-
-