|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectreasoner.Trapezoid
public class Trapezoid
This class represents a FuzzySet having trapezoidal membership function, delimited by 4 point: first and last having 0.0 value, second and third having 1.0 value.
Field Summary | |
---|---|
private java.lang.Double |
a
|
private java.lang.Double |
b
|
private java.lang.Double |
c
|
private java.lang.Double |
d
|
protected java.text.NumberFormat |
formatter
|
protected double |
maxval
|
protected java.lang.String |
meaning
|
protected double |
minval
|
protected java.lang.String |
name
|
protected static java.lang.String |
patternAround
|
protected static java.lang.String |
patternBetween
|
private static double |
v1
|
private static double |
v2
|
Constructor Summary | |
---|---|
Trapezoid()
constructor for the null trapezoid |
|
Trapezoid(java.lang.Double a1,
java.lang.Double b1,
java.lang.Double c1,
java.lang.Double d1)
Constructor by the 4 vertices |
|
Trapezoid(java.lang.String name)
Constructor by name: configures the vertices, knowing this Trapezoid name |
Method Summary | |
---|---|
java.lang.Integer |
card(java.lang.Double alpha1,
java.lang.String mode)
Gives the integer cardinality at the given alpha level. |
Trapezoid |
diff(Trapezoid t)
Fuzzy Set difference between this Trapezoid and a second one |
protected void |
fixVertices()
Fixes vertices to be internal to boundary min and max values |
protected java.lang.Double |
geta()
|
static boolean |
getAroundValue(java.lang.String name)
If the given name matches with "Around( |
protected java.lang.Double |
getb()
|
static boolean |
getBetweenValue(java.lang.String name)
If the given name matches with "Between(...)and( |
protected java.lang.Double |
getc()
|
protected java.lang.Double |
getd()
|
protected java.util.Vector<java.lang.Double> |
getKeys()
|
java.util.TreeSet<java.lang.Double> |
getLambda()
Gives Lambda, the alpha level set for membership values |
double |
getMaxval()
|
java.lang.String |
getMeaning()
|
double |
getMinval()
|
java.lang.String |
getName()
|
protected java.util.Vector<java.lang.Double> |
getVertValues()
|
Trapezoid |
intersection(FuzzySet f)
Intersection with a FuzzySet |
protected void |
print()
Prints on the standard output a String representation for this Trapezoid |
Trapezoid |
prod(Trapezoid t)
Fuzzy Set product between this Trapezoid and a second one |
java.lang.Double |
qvalue(java.lang.Double d)
Evaluation on this Trapezoid, for a given position |
Trapezoid |
ratio(Trapezoid t)
Fuzzy Set ratio between this Trapezoid and a second one. |
protected void |
seta(java.lang.Double a1)
|
protected void |
setb(java.lang.Double b1)
|
protected void |
setc(java.lang.Double c1)
|
protected void |
setd(java.lang.Double d1)
|
void |
setMaxval(double maxval)
|
protected void |
setMeaning()
Sets the meaning, for some particular cases. |
void |
setMeaning(java.lang.String meaning)
|
void |
setMinval(double minval)
|
void |
setName(java.lang.String name1)
|
protected void |
setVertices(java.lang.Double a1,
java.lang.Double b1,
java.lang.Double c1,
java.lang.Double d1)
Set the vertices |
Trapezoid |
sum(Trapezoid t)
Fuzzy Set sum between this Trapezoid and a second one |
java.lang.String |
toString()
return a String representation for this Trapezoid as a sequence of vertices |
Trapezoid |
union(FuzzySet f)
Union with a FuzzySet |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private java.lang.Double a
private java.lang.Double b
private java.lang.Double c
private java.lang.Double d
protected double maxval
protected double minval
protected java.lang.String name
protected java.lang.String meaning
protected static final java.lang.String patternAround
protected static final java.lang.String patternBetween
private static double v1
private static double v2
protected java.text.NumberFormat formatter
Constructor Detail |
---|
public Trapezoid()
public Trapezoid(java.lang.Double a1, java.lang.Double b1, java.lang.Double c1, java.lang.Double d1)
a1
- the first verticeb1
- the second verticec1
- the third verticed1
- the fourth verticepublic Trapezoid(java.lang.String name)
name
- the nameMethod Detail |
---|
protected void setVertices(java.lang.Double a1, java.lang.Double b1, java.lang.Double c1, java.lang.Double d1)
a1
- the first verticeb1
- the second verticec1
- the third verticed1
- the fourth verticepublic static boolean getAroundValue(java.lang.String name)
name
- the name
public static boolean getBetweenValue(java.lang.String name)
name
- the name
protected void setMeaning()
protected java.lang.Double getd()
protected java.lang.Double getc()
protected java.lang.Double getb()
protected java.lang.Double geta()
protected void setd(java.lang.Double d1)
d1
- the new d valueprotected void setc(java.lang.Double c1)
c1
- the new c valueprotected void setb(java.lang.Double b1)
b1
- the new b valueprotected void seta(java.lang.Double a1)
a1
- the new a valuepublic java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
public Trapezoid sum(Trapezoid t)
t
- the second Trapezoid
public Trapezoid diff(Trapezoid t)
t
- the second Trapezoid
public Trapezoid prod(Trapezoid t)
t
- the second Trapezoid
public Trapezoid ratio(Trapezoid t)
t
- the second Trapezoid
protected void fixVertices()
public Trapezoid intersection(FuzzySet f)
f
- the FuzzySet
public Trapezoid union(FuzzySet f)
f
- the FuzzySet
protected java.util.Vector<java.lang.Double> getKeys()
protected java.util.Vector<java.lang.Double> getVertValues()
public java.lang.Double qvalue(java.lang.Double d)
d
- the position
public double getMaxval()
public void setMaxval(double maxval)
maxval
- the maxval to setpublic double getMinval()
public void setMinval(double minval)
minval
- the minval to setpublic java.lang.String getName()
public void setName(java.lang.String name1)
name1
- the name to setpublic java.lang.Integer card(java.lang.Double alpha1, java.lang.String mode)
card
in interface FuzzySet
alpha1
- the given alpha levelmode
- the selecting String
public java.util.TreeSet<java.lang.Double> getLambda()
getLambda
in interface FuzzySet
protected void print()
public java.lang.String getMeaning()
public void setMeaning(java.lang.String meaning)
meaning
- the meaning to set
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |