Package net.sf.tweety.arg.aspic.reasoner
Class RandomAspicReasoner<T extends Invertable>
- java.lang.Object
-
- net.sf.tweety.arg.aspic.reasoner.AbstractAspicReasoner<T>
-
- net.sf.tweety.arg.aspic.reasoner.RandomAspicReasoner<T>
-
- Type Parameters:
T
- The type of formulas.
- All Implemented Interfaces:
QualitativeReasoner<AspicArgumentationTheory<T>,T>
,Reasoner<java.lang.Boolean,AspicArgumentationTheory<T>,T>
public class RandomAspicReasoner<T extends Invertable> extends AbstractAspicReasoner<T>
This class implements an approximate reasoner for ASPIC+ that randomly samples arguments.- Author:
- Matthias Thimm
-
-
Field Summary
Fields Modifier and Type Field Description private int
maxArguments
The maximal number of arguments constructed by this reasoner.private int
maxDuplicates
The maximal number of duplicates tolerated before this reasoner cancels looking for more arguments (even ifmaxArguments
is not yet reached).private java.util.Random
rand
Random number generatorprivate SetTools<T>
setTools
For convenience methods on sets.
-
Constructor Summary
Constructors Constructor Description RandomAspicReasoner(AbstractExtensionReasoner aafReasoner, int maxArguments, int maxDuplicates)
Creates a new instance.
-
Method Summary
Modifier and Type Method Description DungTheory
getDungTheory(AspicArgumentationTheory<T> aat, T query)
Computes the Dung theory from which the answer will be derivedprivate AspicArgument<T>
sampleArgument(java.util.Map<T,java.util.List<InferenceRule<T>>> rules)
Samples a single ASPIC argument via a random search.private AspicArgument<T>
sampleArgument(java.util.Map<T,java.util.List<InferenceRule<T>>> rules, T conclusion, java.util.Set<T> conclusions)
Samples a single ASPIC argument for the given conclusion via a random search.java.lang.String
toString()
-
Methods inherited from class net.sf.tweety.arg.aspic.reasoner.AbstractAspicReasoner
query, query, query
-
-
-
-
Field Detail
-
rand
private java.util.Random rand
Random number generator
-
maxArguments
private int maxArguments
The maximal number of arguments constructed by this reasoner.
-
maxDuplicates
private int maxDuplicates
The maximal number of duplicates tolerated before this reasoner cancels looking for more arguments (even ifmaxArguments
is not yet reached).
-
setTools
private SetTools<T extends Invertable> setTools
For convenience methods on sets.
-
-
Constructor Detail
-
RandomAspicReasoner
public RandomAspicReasoner(AbstractExtensionReasoner aafReasoner, int maxArguments, int maxDuplicates)
Creates a new instance.- Parameters:
aafReasoner
- Underlying reasoner for AAFs.maxArguments
- The maximal number of arguments constructed by this reasoner.maxDuplicates
- The maximal number of duplicates tolerated before this reasoner cancels looking for more arguments (even ifmaxArguments
is not yet reached).
-
-
Method Detail
-
getDungTheory
public DungTheory getDungTheory(AspicArgumentationTheory<T> aat, T query)
Description copied from class:AbstractAspicReasoner
Computes the Dung theory from which the answer will be derived- Specified by:
getDungTheory
in classAbstractAspicReasoner<T extends Invertable>
- Parameters:
aat
- some Aspic theoryquery
- some query- Returns:
- a Dung theory
-
sampleArgument
private AspicArgument<T> sampleArgument(java.util.Map<T,java.util.List<InferenceRule<T>>> rules)
Samples a single ASPIC argument via a random search.- Parameters:
rules
- some rules- Returns:
- some ASPIC argument
-
sampleArgument
private AspicArgument<T> sampleArgument(java.util.Map<T,java.util.List<InferenceRule<T>>> rules, T conclusion, java.util.Set<T> conclusions)
Samples a single ASPIC argument for the given conclusion via a random search.- Parameters:
rules
- some rulesconclusion
- some conclusionconclusions
- the conclusions accumulated so far (from the top)- Returns:
- some ASPIC argument
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-