Class WeightedDungTheory

All Implemented Interfaces:
Comparable<DungTheory>, Iterable<Argument>, Collection<Argument>, ArgumentationFramework<Argument>, BeliefBase, GeneralGraph<Argument>, 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 Details

    • weights

      public Map<Attack,Double> weights
      listing of weights of every edge in the argumentation graph
  • Constructor Details

    • WeightedDungTheory

      public WeightedDungTheory()
      initialize a new weighted argumentation theory
  • Method Details

    • getWeight

      public Double getWeight(Argument attacker, Argument attacked)
      return weight of the attack between the given arguments
      Parameters:
      attacker - an argument
      attacked - 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 attack
      weight - 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 attack
      weight - 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 argument
      attacked - an argument
      weight - 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 class DungTheory
      Parameters:
      attacker - an argument
      attacked - 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 class DungTheory
      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()
      Returns:
      removeDiscardedAttacks