Class EnumeratingDungTheoryGenerator

  • All Implemented Interfaces:
    java.util.Iterator<DungTheory>, DungTheoryGenerator, BeliefSetIterator<Argument,​DungTheory>

    public class EnumeratingDungTheoryGenerator
    extends java.lang.Object
    implements DungTheoryGenerator
    This generator generators all possible Dung argumentation theories. It starts with the argumentation frameworks just consisting of one arguments and then increases their size.
    Author:
    Matthias Thimm
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.Set<Argument> arguments
      The current set of arguments.
      private java.util.BitSet attacks
      used to enumerate all possible attack combinations.
      private int currentSize
      The size of the currently generated theories.
      private java.util.List<Attack> possibleAttacks
      The set of possible attacks.
    • Method Summary

      Modifier and Type Method Description
      private boolean addOneToBitSet​(java.util.BitSet b, int length)
      Adds "1" to the bitset.
      private java.util.List<Attack> generatePossibleAttacks​(java.util.Set<Argument> arguments)
      Computes all possible attacks.
      boolean hasNext()  
      DungTheory next()  
      DungTheory next​(Argument arg)
      Generates a new Dung theory where the given argument is enforced to be in the grounded extension
      void setSeed​(long seed)
      Set the seed for the generation.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.util.Iterator

        forEachRemaining, remove
    • Field Detail

      • currentSize

        private int currentSize
        The size of the currently generated theories.
      • attacks

        private java.util.BitSet attacks
        used to enumerate all possible attack combinations.
      • possibleAttacks

        private java.util.List<Attack> possibleAttacks
        The set of possible attacks.
      • arguments

        private java.util.Set<Argument> arguments
        The current set of arguments.
    • Constructor Detail

      • EnumeratingDungTheoryGenerator

        public EnumeratingDungTheoryGenerator()
        Creates a new enumerating Dung theory generator.
    • Method Detail

      • addOneToBitSet

        private boolean addOneToBitSet​(java.util.BitSet b,
                                       int length)
        Adds "1" to the bitset.
        Parameters:
        b - a bitset
        length - the length of the bitset
        Returns:
        "true" if the addition results in an overflow.
      • generatePossibleAttacks

        private java.util.List<Attack> generatePossibleAttacks​(java.util.Set<Argument> arguments)
        Computes all possible attacks.
        Parameters:
        arguments - some set of arguments
        Returns:
        the set of all possible attacks.
      • next

        public DungTheory next​(Argument arg)
        Description copied from interface: DungTheoryGenerator
        Generates a new Dung theory where the given argument is enforced to be in the grounded extension
        Specified by:
        next in interface DungTheoryGenerator
        Parameters:
        arg - an argument that is enforced to be in the grounded extension of the generated theory.
        Returns:
        a Dung theory,
      • setSeed

        public void setSeed​(long seed)
        Description copied from interface: DungTheoryGenerator
        Set the seed for the generation. Every two runs of generations with the same seed are ensured to be identical.
        Specified by:
        setSeed in interface DungTheoryGenerator
        Parameters:
        seed - some seed.