Package net.sf.tweety.arg.dung.util
Class DefaultDungTheoryGenerator
- java.lang.Object
-
- net.sf.tweety.arg.dung.util.DefaultDungTheoryGenerator
-
- All Implemented Interfaces:
java.util.Iterator<DungTheory>,DungTheoryGenerator,BeliefSetIterator<Argument,DungTheory>
public class DefaultDungTheoryGenerator extends java.lang.Object implements DungTheoryGenerator
Implements a customizable Dung theory generator.- Author:
- Matthias Thimm
-
-
Field Summary
Fields Modifier and Type Field Description private DungTheoryGenerationParametersparamsThe parameters for generation.private java.util.RandomrandomRandom numbers generator.
-
Constructor Summary
Constructors Constructor Description DefaultDungTheoryGenerator(DungTheoryGenerationParameters params)Creates a new generator with the given parameters.
-
Method Summary
Modifier and Type Method Description private DungTheorygenerateTreeShape(Argument arg)Generates a Dung theory with a tree shape where the given argument is the root.booleanhasNext()DungTheorynext()DungTheorynext(Argument arg)Generates a new Dung theory where the given argument is enforced to be in the grounded extensionvoidsetSeed(long seed)Set the seed for the generation.java.lang.StringtoString()
-
-
-
Field Detail
-
params
private DungTheoryGenerationParameters params
The parameters for generation.
-
random
private java.util.Random random
Random numbers generator.
-
-
Constructor Detail
-
DefaultDungTheoryGenerator
public DefaultDungTheoryGenerator(DungTheoryGenerationParameters params)
Creates a new generator with the given parameters.- Parameters:
params- some generation parameters.
-
-
Method Detail
-
next
public DungTheory next()
- Specified by:
nextin interfaceBeliefSetIterator<Argument,DungTheory>- Specified by:
nextin interfaceDungTheoryGenerator- Specified by:
nextin interfacejava.util.Iterator<DungTheory>
-
next
public DungTheory next(Argument arg)
Description copied from interface:DungTheoryGeneratorGenerates a new Dung theory where the given argument is enforced to be in the grounded extension- Specified by:
nextin interfaceDungTheoryGenerator- 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:DungTheoryGeneratorSet the seed for the generation. Every two runs of generations with the same seed are ensured to be identical.- Specified by:
setSeedin interfaceDungTheoryGenerator- Parameters:
seed- some seed.
-
generateTreeShape
private DungTheory generateTreeShape(Argument arg)
Generates a Dung theory with a tree shape where the given argument is the root.- Parameters:
arg- some argument.- Returns:
- a Dung theory.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
hasNext
public boolean hasNext()
- Specified by:
hasNextin interfaceBeliefSetIterator<Argument,DungTheory>- Specified by:
hasNextin interfaceDungTheoryGenerator- Specified by:
hasNextin interfacejava.util.Iterator<DungTheory>
-
-