|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sourceforge.jfl.core.DoubleInterpolatedFuzzySet
public class DoubleInterpolatedFuzzySet
This class implements the IFuzzySet
interface over Double
typa members.
This implementation not allows null
element.
It implements the set backed by and array. The membership funtion is a linear interpolation
of elements into the set.
Add an element into the set means add a point to the intorpolated membership function.
Call m the min element present into the set, all x < m has a memebrship value = u(m).
Call M the max element present into the set, all x > M has a membership value = u(M).
Field Summary | |
---|---|
protected boolean |
complementary
|
protected static int |
DEFAULT_ARRAY_INCREMENT
|
protected java.lang.String |
label
|
protected double[] |
membership
|
protected int |
size
|
protected double[] |
support
|
Constructor Summary | |
---|---|
DoubleInterpolatedFuzzySet()
|
|
DoubleInterpolatedFuzzySet(int initialCapacity)
Initialize the set with the passed capacity. |
Method Summary | |
---|---|
void |
addAllElement(java.util.Set<java.lang.Double> elements,
double membershipValue)
|
void |
addElement(java.lang.Double element,
double membershipValue)
|
DoubleInterpolatedFuzzySet |
and(IFuzzySet<java.lang.Double> anotherSet)
Performs a fuzzy logic and between this fuzzy set and the given one |
DoubleInterpolatedFuzzySet |
complement()
Return a fuzzy set represents the complentary of the set. |
protected void |
extend()
Extend the array by default value. |
protected void |
extend(int incrementSize)
Extend the array by passed value. |
java.lang.String |
getLabel()
Returns the label of this fuzzy set. |
double |
getMembership(java.lang.Double element)
returns the membership value of the provided element to this IFuzzySet. |
java.util.Set<java.lang.Double> |
getSupport()
Gets the fuzzy set support or, in other words, all the elements with non zero membership value. |
java.util.Set<Interval> |
getSupportIntervals()
Gets the fuzzy set support or, in other words, all the elements with non zero membership value. |
protected void |
insert(double element,
double membershipValue)
Insert the passed element with the passed memebership value. |
protected void |
insert(double element,
double membershipValue,
int index)
|
protected double |
membership(double element)
Retrieve membership |
DoubleInterpolatedFuzzySet |
or(IFuzzySet<java.lang.Double> anotherSet)
Performs a fuzzy logic or between this fuzzy set and the given one |
protected double |
remove(double element)
Remove a point of interpolation from the set. |
double |
removeElement(java.lang.Double element)
|
protected int |
searchLess(double element)
Return index of the first element less than passed. |
void |
setLabel(java.lang.String label)
Sets this fuzzy set label. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final int DEFAULT_ARRAY_INCREMENT
protected java.lang.String label
protected double[] support
protected double[] membership
protected int size
protected boolean complementary
Constructor Detail |
---|
public DoubleInterpolatedFuzzySet()
public DoubleInterpolatedFuzzySet(int initialCapacity)
initialCapacity
- Method Detail |
---|
public void setLabel(java.lang.String label)
IFuzzySet
setLabel
in interface IFuzzySet<java.lang.Double>
label
- the label to setpublic java.lang.String getLabel()
IFuzzySet
getLabel
in interface IFuzzySet<java.lang.Double>
public void addAllElement(java.util.Set<java.lang.Double> elements, double membershipValue)
public void addElement(java.lang.Double element, double membershipValue)
public double removeElement(java.lang.Double element)
public double getMembership(java.lang.Double element)
IFuzzySet
getMembership
in interface IFuzzySet<java.lang.Double>
element
- the element of which we want the membership value for this
IFuzzySet
public java.util.Set<java.lang.Double> getSupport()
IFuzzySet
getSupport
in interface IFuzzySet<java.lang.Double>
public java.util.Set<Interval> getSupportIntervals()
IFuzzySet
getSupportIntervals
in interface IFuzzySet<java.lang.Double>
public DoubleInterpolatedFuzzySet complement()
IFuzzySet
complement
in interface IFuzzySet<java.lang.Double>
protected double membership(double element)
element
-
protected int searchLess(double element)
d
-
protected void insert(double element, double membershipValue)
element
- membership
- protected void insert(double element, double membershipValue, int index)
element
- membership
- index
- index of element after insert the new one.protected double remove(double element)
element
- to be removed
protected void extend()
protected void extend(int incrementSize)
incrementSize
- increment sizepublic DoubleInterpolatedFuzzySet and(IFuzzySet<java.lang.Double> anotherSet)
IFuzzySet
and
in interface IFuzzySet<java.lang.Double>
anotherSet
- the fuzzy set to perform the fuzzy logic and with
public DoubleInterpolatedFuzzySet or(IFuzzySet<java.lang.Double> anotherSet)
IFuzzySet
or
in interface IFuzzySet<java.lang.Double>
anotherSet
- the fuzzy set to perform the fuzzy logic or with
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |