Class CafTheoryGenerator
java.lang.Object
org.tweetyproject.arg.caf.util.CafTheoryGenerator
The
CafTheoryGenerator class is responsible for generating
ConstrainedArgumentationFramework (CAFs) based on a
given DungTheory. The class can generate one or multiple CAFs with random
constraints in CNF (Conjunctive Normal Form).
This generator can either use a custom DungTheoryGenerator
or instantiate a default one.- Author:
- Sandra Hoffmann
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.CafTheoryGenerator(DungTheoryGenerator generator) Constructor with a customDungTheoryGenerator. -
Method Summary
Modifier and TypeMethodDescriptionbooleanhasNext()Checks whether there is a next element.next()Generates a new CAF using a randomly generated constraint.next(int numCAFs) Generates numCAFs CAFs, each with a different randomly generated constraint.next(DungTheory theory, int numCAFs) Generates numCAFs CAFs, each with a different randomly generated constraint.voidsetSeed(long seed) Set the seed for the generation.
-
Constructor Details
-
CafTheoryGenerator
public CafTheoryGenerator()Default constructor. Instantiates a defaultDungTheoryGeneratorusing the defaultDungTheoryGenerationParameters. -
CafTheoryGenerator
Constructor with a customDungTheoryGenerator.- Parameters:
generator- the customDungTheoryGeneratorto use for generating Dung theories.
-
-
Method Details
-
hasNext
public boolean hasNext()Checks whether there is a next element.- Returns:
- whether there is a next element
-
next
Generates a new CAF using a randomly generated constraint.- Returns:
- the next CAF with a random constraint.
-
next
Generates numCAFs CAFs, each with a different randomly generated constraint. Each CAF is based on the same (randomly generated) DungTheory.- Parameters:
numCAFs- the number of constraints and CAFs to generate.- Returns:
- a list of CAFs with random constraints.
-
next
Generates numCAFs CAFs, each with a different randomly generated constraint. Each CAF is based on the same given DungTheory.- Parameters:
theory- the Dung theory for which the CAFs are generated.numCAFs- the number of constraints and CAFs to generate.- Returns:
- a list of CAFs with random constraints based on the given theory.
-
setSeed
public void setSeed(long seed) Set the seed for the generation. Every two runs of generations with the same seed are ensured to be identical.- Parameters:
seed- some seed.
-