Class FileDungTheoryGenerator
java.lang.Object
org.tweetyproject.arg.dung.util.FileDungTheoryGenerator
- All Implemented Interfaces:
Iterator<DungTheory>,DungTheoryGenerator,BeliefSetIterator<Argument,DungTheory>
This generator receives a list of files containing Dung theories
and returns those step by step.
- Author:
- Matthias Thimm
-
Constructor Summary
ConstructorsConstructorDescriptionFileDungTheoryGenerator(File[] files, Parser<DungTheory, ?> parser, boolean loop) Creates a new theory generator for the given files, which can be parsed by the given parser.FileDungTheoryGenerator(String path, String suffix, Parser<DungTheory, ?> parser, boolean loop) Creates a new theory generator for all files in the given folder with the given suffix, which can be parsed by the given parser. -
Method Summary
Modifier and TypeMethodDescriptionReturns the absolute path of the next fileReturns the file of the theory previously returned by "next()"booleanhasNext()next()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.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Iterator
forEachRemaining, remove
-
Constructor Details
-
FileDungTheoryGenerator
public FileDungTheoryGenerator(String path, String suffix, Parser<DungTheory, ?> parser, boolean loop) Creates a new theory generator for all files in the given folder with the given suffix, which can be parsed by the given parser.- Parameters:
path- a string to a path with AAF filessuffix- the file suffix of the filesparser- a parser for the files.loop- whether to loop the files indefinitely.
-
FileDungTheoryGenerator
Creates a new theory generator for the given files, which can be parsed by the given parser.- Parameters:
files- an array of files.parser- a parser for the files.loop- whether to loop the files indefinitely.
-
-
Method Details
-
hasNext
public boolean hasNext()- Specified by:
hasNextin interfaceBeliefSetIterator<Argument,DungTheory> - Specified by:
hasNextin interfaceDungTheoryGenerator- Specified by:
hasNextin interfaceIterator<DungTheory>
-
next
- Specified by:
nextin interfaceBeliefSetIterator<Argument,DungTheory> - Specified by:
nextin interfaceDungTheoryGenerator- Specified by:
nextin interfaceIterator<DungTheory>
-
getAbsolutePathOfNext
Returns the absolute path of the next file- Returns:
- the absolute path of the next file
-
getPreviousFile
Returns the file of the theory previously returned by "next()"- Returns:
- the file of the theory previously returned by "next()" (or NULL if there was none)
-
next
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.
-