Class NumericalArgumentRanking
- java.lang.Object
-
- net.sf.tweety.commons.AbstractInterpretation<DungTheory,Argument>
-
- net.sf.tweety.arg.dung.semantics.AbstractArgumentationInterpretation
-
- net.sf.tweety.arg.rankings.semantics.ArgumentRanking
-
- net.sf.tweety.arg.rankings.semantics.NumericalArgumentRanking
-
- All Implemented Interfaces:
java.util.Comparator<Argument>
,java.util.Map<Argument,java.lang.Double>
,Interpretation<DungTheory,Argument>
public class NumericalArgumentRanking extends ArgumentRanking implements java.util.Map<Argument,java.lang.Double>
This class provides a acceptability interpretation of arguments by assigning them real values where larger values indicate more acceptability.- Author:
- Matthias Thimm
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
NumericalArgumentRanking.SortingType
Possible sorting types for the numerical values.
-
Field Summary
Fields Modifier and Type Field Description static double
PRECISION
Precision for comparing values.NumericalArgumentRanking.SortingType
sortingType
-
Constructor Summary
Constructors Constructor Description NumericalArgumentRanking()
Creates a new empty argument rankingNumericalArgumentRanking(java.util.Collection<Argument> args, double initialvalue)
Creates a new argument ranking.
-
Method Summary
Modifier and Type Method Description void
clear()
boolean
containsIncomparableArguments()
boolean
containsKey(java.lang.Object arg0)
boolean
containsValue(java.lang.Object arg0)
java.util.Set<java.util.Map.Entry<Argument,java.lang.Double>>
entrySet()
java.lang.Double
get(java.lang.Object arg0)
Extension
getArgumentsOfStatus(ArgumentStatus status)
Returns all arguments that have the given status in this interpretation.NumericalArgumentRanking.SortingType
getSortingType()
boolean
isEmpty()
boolean
isIncomparable(Argument a, Argument b)
Returns "true" iff a and b are incomparable (i.e.boolean
isStrictlyLessOrEquallyAcceptableThan(Argument a, Argument b)
Returns "true" iff a is strictly less acceptable than b or a is equally acceptable as b or a and b are not comparable, i.e.java.util.Set<Argument>
keySet()
java.lang.Double
put(Argument arg0, java.lang.Double arg1)
void
putAll(java.util.Map<? extends Argument,? extends java.lang.Double> arg0)
java.lang.Double
remove(java.lang.Object arg0)
void
setSortingType(NumericalArgumentRanking.SortingType order)
Set the sorting type for ranking values.int
size()
java.lang.String
toString()
java.util.Collection<java.lang.Double>
values()
-
Methods inherited from class net.sf.tweety.arg.rankings.semantics.ArgumentRanking
compare, getMaximallyAcceptedArguments, getMinimallyAcceptedArguments, isEquallyAcceptableThan, isEquivalent, isStrictlyLessAcceptableThan, isStrictlyMoreAcceptableThan, isStrictlyMoreOrEquallyAcceptableThan
-
Methods inherited from class net.sf.tweety.arg.dung.semantics.AbstractArgumentationInterpretation
isAcceptable, isAdmissable, isConflictFree, satisfies, satisfies
-
Methods inherited from class net.sf.tweety.commons.AbstractInterpretation
satisfies
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
-
-
-
Field Detail
-
PRECISION
public static double PRECISION
Precision for comparing values.
-
sortingType
public NumericalArgumentRanking.SortingType sortingType
-
-
Constructor Detail
-
NumericalArgumentRanking
public NumericalArgumentRanking()
Creates a new empty argument ranking
-
NumericalArgumentRanking
public NumericalArgumentRanking(java.util.Collection<Argument> args, double initialvalue)
Creates a new argument ranking. All arguments given are assigned the given initial value.- Parameters:
args
- some set of argumentsinitialvalue
- an initial value for all arguments
-
-
Method Detail
-
isStrictlyLessOrEquallyAcceptableThan
public boolean isStrictlyLessOrEquallyAcceptableThan(Argument a, Argument b)
Description copied from class:ArgumentRanking
Returns "true" iff a is strictly less acceptable than b or a is equally acceptable as b or a and b are not comparable, i.e. a >= b (or a ~ b) (least arguments are maximally acceptable arguments)- Specified by:
isStrictlyLessOrEquallyAcceptableThan
in classArgumentRanking
- Parameters:
a
- some argumentb
- some argument- Returns:
- "true" iff a is strictly less acceptable than b or a is equally acceptable as b
-
getArgumentsOfStatus
public Extension getArgumentsOfStatus(ArgumentStatus status)
Description copied from class:AbstractArgumentationInterpretation
Returns all arguments that have the given status in this interpretation.- Specified by:
getArgumentsOfStatus
in classAbstractArgumentationInterpretation
- Parameters:
status
- the status of the arguments to be returned.- Returns:
- the set of arguments with the given status.
-
toString
public java.lang.String toString()
- Specified by:
toString
in classAbstractArgumentationInterpretation
-
clear
public void clear()
- Specified by:
clear
in interfacejava.util.Map<Argument,java.lang.Double>
-
containsKey
public boolean containsKey(java.lang.Object arg0)
- Specified by:
containsKey
in interfacejava.util.Map<Argument,java.lang.Double>
-
containsValue
public boolean containsValue(java.lang.Object arg0)
- Specified by:
containsValue
in interfacejava.util.Map<Argument,java.lang.Double>
-
entrySet
public java.util.Set<java.util.Map.Entry<Argument,java.lang.Double>> entrySet()
- Specified by:
entrySet
in interfacejava.util.Map<Argument,java.lang.Double>
-
get
public java.lang.Double get(java.lang.Object arg0)
- Specified by:
get
in interfacejava.util.Map<Argument,java.lang.Double>
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interfacejava.util.Map<Argument,java.lang.Double>
-
keySet
public java.util.Set<Argument> keySet()
- Specified by:
keySet
in interfacejava.util.Map<Argument,java.lang.Double>
-
put
public java.lang.Double put(Argument arg0, java.lang.Double arg1)
- Specified by:
put
in interfacejava.util.Map<Argument,java.lang.Double>
-
putAll
public void putAll(java.util.Map<? extends Argument,? extends java.lang.Double> arg0)
- Specified by:
putAll
in interfacejava.util.Map<Argument,java.lang.Double>
-
remove
public java.lang.Double remove(java.lang.Object arg0)
- Specified by:
remove
in interfacejava.util.Map<Argument,java.lang.Double>
-
size
public int size()
- Specified by:
size
in interfacejava.util.Map<Argument,java.lang.Double>
-
values
public java.util.Collection<java.lang.Double> values()
- Specified by:
values
in interfacejava.util.Map<Argument,java.lang.Double>
-
getSortingType
public NumericalArgumentRanking.SortingType getSortingType()
- Returns:
- sorting type of ranking values (descending, ascending or sorted lexicographically)
-
setSortingType
public void setSortingType(NumericalArgumentRanking.SortingType order)
Set the sorting type for ranking values. For example, the "ascending" type means that smaller values signify a higher ranking than bigger values.- Parameters:
order
- TODO add description
-
isIncomparable
public boolean isIncomparable(Argument a, Argument b)
Description copied from class:ArgumentRanking
Returns "true" iff a and b are incomparable (i.e. this ranking is a partial ranking).- Specified by:
isIncomparable
in classArgumentRanking
- Parameters:
a
- Argumentb
- Argument- Returns:
- "true" iff a and b are incomparable
-
containsIncomparableArguments
public boolean containsIncomparableArguments()
- Specified by:
containsIncomparableArguments
in classArgumentRanking
- Returns:
- true if this ranking contains incomparable arguments, false otherwise
-
-