Class EquivalenceCompExFinder
java.lang.Object
org.tweetyproject.arg.dung.equivalence.EquivalenceCompExFinder
This class represents an example generator. Objects of this class generate argumentation frameworks, which comply
conditions regarding their state of equivalence to each other. The conditions are expressed by different
definitions of equivalence between the two frameworks and whether the frameworks have to be equivalent or must not.
- Version:
- TweetyProject 1.23
- Author:
- Julian Sander
-
Constructor Summary
ConstructorDescriptionEquivalenceCompExFinder
(Equivalence<DungTheory> equivalence1, Equivalence<DungTheory> equivalence2, DecisionMaker decisionMaker) -
Method Summary
Modifier and TypeMethodDescriptionfindAllExamples
(int numberOfMaxRandomGenerationTries, DungTheory framework1, EnumeratingDungTheoryGenerator generatorFramework2, Function<DungTheory, Boolean> askIf1stFrameInteresting, Function<DungTheory[], Boolean> askIfInterestingPair, Function<EnumeratingDungTheoryGenerator, Boolean> askGen2Finished) Generates all possible examples of pairs of frameworks, containing the specified framework.findExample
(int numberOfMaxRandomGenerationTries, DungTheory framework1, Iterator<DungTheory> generatorFramework2, Function<DungTheory, Boolean> askIf1stFrameInteresting, Function<DungTheory[], Boolean> askIfInterestingPair, Function<String, Boolean> askContinueGenerate2nd) Generates a second argumentation framework, so that the pair has the specified behavior.
-
Constructor Details
-
EquivalenceCompExFinder
public EquivalenceCompExFinder(Equivalence<DungTheory> equivalence1, Equivalence<DungTheory> equivalence2, DecisionMaker decisionMaker) - Parameters:
equivalence1
- Compares if two generated frameworks are equivalent to one another, the definition of the equivalence should be different than the one used for equivalence2equivalence2
- Compares if two generated frameworks are equivalent to one another, the definition of the equivalence should be different than the one used for equivalence1decisionMaker
- Object, which decides if the resulting equivalences are acceptable
-
-
Method Details
-
findAllExamples
public LinkedHashMap<DungTheory,HashSet<DungTheory>> findAllExamples(int numberOfMaxRandomGenerationTries, DungTheory framework1, EnumeratingDungTheoryGenerator generatorFramework2, Function<DungTheory, Boolean> askIf1stFrameInteresting, Function<DungTheory[], throws NoExampleFoundExceptionBoolean> askIfInterestingPair, Function<EnumeratingDungTheoryGenerator, Boolean> askGen2Finished) Generates all possible examples of pairs of frameworks, containing the specified framework. These pairs show an behavior wrt. equivalence as specified in the decisionMaker.- Parameters:
numberOfMaxRandomGenerationTries
- Maximum Number of iterations trying to generate randomly 2 frameworks compliant to the specified conditions. After surpassing this threshold, the second framework will be generated on the basis of the first one (if a an equivalent framework was demanded)framework1
- Framework, for which a second partner shall be generated.generatorFramework2
- Iterator, which generates the second framework (Note that the framework will be generated as an equivalent theory if wished, in case this generator fails.askIf1stFrameInteresting
- Function which checks if the generated 1st framework is interesting enough to try to generate a partner frameworkaskIfInterestingPair
- Function which checks, if the generated pair is interesting enough to examine its equivalenceaskGen2Finished
- Function which checks, if the generation of 2nd frameworks in order to form a valide pair, should be continued or not, based on the properties of the last generated pair- Returns:
- Pair of frameworks, which are equivalent to each other as specified in the method call
- Throws:
NoExampleFoundException
- Thrown if no pair of frameworks (compliant to the equivalent-conditions) could be generated
-
findExample
public LinkedHashMap<DungTheory,DungTheory> findExample(int numberOfMaxRandomGenerationTries, DungTheory framework1, Iterator<DungTheory> generatorFramework2, Function<DungTheory, Boolean> askIf1stFrameInteresting, Function<DungTheory[], throws NoExampleFoundExceptionBoolean> askIfInterestingPair, Function<String, Boolean> askContinueGenerate2nd) Generates a second argumentation framework, so that the pair has the specified behavior.- Parameters:
numberOfMaxRandomGenerationTries
- Maximum Number of iterations trying to generate randomly 2 frameworks compliant to the specified conditions. After surpassing this threshold, the second framework will be generated on the basis of the first one (if a an equivalent framework was demanded)framework1
- Framework, for which a second partner shall be generated.generatorFramework2
- Iterator, which generates the second framework (Note that the framework will be generated as an equivalent theory if wished, in case this generator fails.askIf1stFrameInteresting
- Function which checks if the generated 1st framework is interesting enough to try to generate a partner frameworkaskIfInterestingPair
- Function which checks, if the generated pair is interesting enough to examine its equivalenceaskContinueGenerate2nd
- Function which checks, if the generation of 2nd frameworks in order to form a valide pair, should be continued or not, based on the properties of the last generated pair- Returns:
- Pair of frameworks, which are equivalent to each other as specified in the method call
- Throws:
NoExampleFoundException
- Thrown if no pair of frameworks (compliant to the equivalent-conditions) could be generated
-