|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--infosapient.system.ObservableImpl | +--infosapient.system.FzySystemComponent | +--infosapient.system.FzyClauseComponent | +--infosapient.system.FzySet
Class FzySet is the abstract class of all fuzzy set representations.
A fuzzy set is a set that permits partial membership within a given set;
and that membership is measured by m such that 0 <= m <= 1
.
Internally, mis represented by type double
.
1.0
represents complete membership within the set.
0.0
represents no membership within the set.
Class FzySet is declared abstract because the initialization of the individual fuzzy set is type specific.
FzySCurve
,
FzyTriangle
,
FzyGaussian
,
FzyPI
,
FzyBeta
,
FzySingleton
, Serialized FormField Summary | |
private double |
alfaCut
|
private double |
completeMembership
completeMembership is the DOMAIN value of the set where the range is == 1.0. |
private int |
curveSide
|
protected double[] |
domain
|
private boolean |
hasSolution
|
private java.util.Stack |
hedges
|
private double |
height
|
private boolean |
leftShouldered
|
protected double[] |
membership
|
private FzyAttribute |
myAttribute
|
protected double |
resolvedValue
|
private boolean |
rightShouldered
|
(package private) static long |
serialVersionUID
|
private int |
setType
|
private boolean |
twoSided
|
protected int |
VECMAX
|
Fields inherited from class infosapient.system.FzyClauseComponent |
owner,
text |
Fields inherited from class infosapient.system.FzySystemComponent |
DEBUG_,
myID,
name,
pcs,
serialVersionUID,
trace,
vcs |
Fields inherited from class infosapient.system.ObservableImpl |
arr,
changed,
obs,
serialVersionUID |
Constructor Summary | |
FzySet()
|
Method Summary | |
void |
addHedge(FzyHedge ah)
Add a hedge for future fuzzy surface modification. |
abstract java.lang.Object |
clone()
Implemented by FzySet subclasses to provide deep copies of themselves. |
boolean |
doesContain(double aVal)
Determine whether this set contains aVal within its domain |
double |
domainForMembership(double m)
Return the mean of domain(s) that are mapped to a membership value. |
void |
dump()
Used for debugging. |
java.lang.StringBuffer |
dumpAsStringBuffer()
Insert the method's description here. |
double |
getAlphaCut()
|
FzyAttribute |
getAttribute()
Return this sets owning attribute. |
double |
getCmpMembership()
The DOMAIN VALUE of complete membership within this set. |
double |
getDOM(double domainValue)
Returns a membership value between 0.0 and 1.0 given a domain value contained within this set. |
double |
getDomain(int index)
Return the domain specified by an index into the domain array. |
double[] |
getDomainArray()
Return the domain array for this set. |
java.util.Stack |
getHedges()
Return the collection of hedges to be applied to this set as a java.util.Stack. |
double |
getHighDomain()
Return the current high domain value of this set. |
int |
getIndexForDomain(double domainValue)
|
double |
getLowDomain()
Return the current low domain value for this set. |
double |
getMaxHeight()
Height is current maximum membership (typically wanted after correlation). |
double[] |
getMemberArray()
Return the membership array for this set. |
double |
getMembership(int loc)
Return the value for the indicated index into membership array. |
double |
getMinHeight()
Height is current minimum membership (typically wanted after correlation). |
java.lang.String |
getQualifiedName()
Returns the name of this set appended to the attribute that it belongs to. |
java.lang.String |
getSides()
|
double |
getSolution()
Return the current solution domain value of this FzySolutionSet. |
double |
getSolutionDOM()
Return the solution degree of membership for this FzySolutionSet. |
int |
getVECMAX()
Return the length of the membership and domain arrays. |
boolean |
hasSolution()
Return true if this set has a membership and cooresponding domain computed for it yet. |
void |
initializeDomain(double low,
double high)
Validate the low and high domain to make sure we can do calculations. |
abstract FzySet |
initializeMembership()
This method must be implemented by my subclasses. |
double |
integrateMbr()
Convienence method to invoke integrateMbr on the entire length of the membership array. |
double |
integrateMbr(int start,
int end)
Compute the area under the curve for the index start to the index end. |
boolean |
isLeftShouldered()
|
boolean |
isNormal()
Returns a boolean based on whether membership is: 0.0 <= m[i] <= 1.0. |
boolean |
isRightShouldered()
|
boolean |
isTwoSided()
Used for quick check of whether this set is two sided or not. |
boolean |
lessThanOrEquals(FzySet aSet)
A cheap comparison of sets to make sure that the sets are added to the attribute in decreasing order. |
void |
printOn(java.io.Writer outWriter,
int nTabs)
Used to represent this set on an outputStream. |
void |
reset()
Overridden as a no op because reset is not applicable to Fuzzy Sets |
protected void |
setAttribute(FzyAttribute fa)
Set the owning attribute for this set. |
void |
setCmpMembership(double m)
Used to set the domain value for complete membership during set initialization. |
void |
setDomain(double value,
int inx)
Inject an arbitrary value into the domain array. |
void |
setDomainArray(double[] d)
Sets a double array as the domain for this set. |
void |
setHedges(java.util.Stack hedgeStack)
Set the hedges to be applied. |
void |
setHighDomain(double value)
Sets the high domain value for this fuzzy set. |
FzySet |
setLeftShouldered()
Declare this set to be left shouldered. |
void |
setLowDomain(double value)
Set the low domain value of this set to be value. |
void |
setMembership(double value,
int inx)
Insert an arbitrary value into the membership array. |
void |
setMembershipArray(double[] a)
Sets an array of double to be the membership of this fuzzy set. |
FzySet |
setRightShouldered()
Declare this set to be right shouldered. |
void |
setSolution(double v)
Method setSolution is implemented in FzySet rather than FzySolutionSet so as to not require frequent casting to FzySolutionSet. |
FzySet |
setTwoSided()
declare this set to be two sided. |
double |
sumDomain(int start,
int end)
Returns the sum of all the current domain values of this fuzzy set, based on the indices start and end. |
java.lang.StringBuffer |
toXML(int nTabs)
Represent this set as XML tags. |
abstract java.lang.String |
typeAsString()
|
FzySet |
validate(double low,
double high)
Validate the low and high domain to make sure we can do calculations. |
FzySet |
validate(double low,
double high,
double m)
Validate to make sure we can do calculations. |
Methods inherited from class infosapient.system.FzyClauseComponent |
append,
append,
getOwner,
getText,
setOwnerClause,
setText,
toText |
Methods inherited from class infosapient.system.FzySystemComponent |
addPropertyChangeListener,
addVetoableChangeListener,
equals,
getID,
getName,
getPropertyChangeSupport,
getVetoableChangeSupport,
hashCode,
removePropertyChangeListener,
removeVetoableChangeListener,
setID,
setName |
Methods inherited from class infosapient.system.ObservableImpl |
addObserver,
clearChanged,
containsObserver,
countObservers,
deleteObserver,
deleteObservers,
hasChanged,
notifyObservers,
notifyObservers,
setChanged |
Methods inherited from class java.lang.Object |
|
Field Detail |
static final long serialVersionUID
private FzyAttribute myAttribute
private boolean rightShouldered
private boolean leftShouldered
private boolean twoSided
private boolean hasSolution
protected int VECMAX
protected double[] membership
protected double[] domain
private int curveSide
private int setType
private double alfaCut
private double height
protected double resolvedValue
private java.util.Stack hedges
private double completeMembership
Constructor Detail |
public FzySet()
Method Detail |
public void addHedge(FzyHedge ah)
FzyHedge
- the hedge to be applied.public abstract java.lang.Object clone()
public boolean doesContain(double aVal)
double
- aValpublic double domainForMembership(double m) throws java.lang.IllegalArgumentException, FzySystemException
WARNING: This method cannot guarantee a unique solution as there may be several domain values that match the given membership. Therefore the mean is returned, intstead of a single value. If there is only one domain for a given membership, then that value is returned.
double
- membership
for the domain currently sought.domain
that the membership is mapped to.membership
is Double.NaN or membership
is < 0 or >1.0public void dump()
public java.lang.StringBuffer dumpAsStringBuffer()
public double getAlphaCut()
public FzyAttribute getAttribute()
public double getCmpMembership()
public final double getDOM(double domainValue) throws java.lang.IllegalArgumentException, FzySystemException
double
- the domain valuepublic final double getDomain(int index) throws java.lang.IllegalArgumentException
int
- the index to the domain value.public double[] getDomainArray()
public java.util.Stack getHedges()
public double getHighDomain()
public final int getIndexForDomain(double domainValue) throws java.lang.IllegalArgumentException, FzySystemException
public double getLowDomain()
public double getMaxHeight()
public double[] getMemberArray()
public final double getMembership(int loc) throws java.lang.IllegalArgumentException
double
- loc the location in the membership.public double getMinHeight()
public java.lang.String getQualifiedName()
public java.lang.String getSides()
public double getSolution() throws java.lang.IllegalStateException
public double getSolutionDOM() throws java.lang.IllegalStateException
public final int getVECMAX()
public boolean hasSolution()
public void initializeDomain(double low, double high) throws FzySystemException
double
- low
- the lowdomain of this setdouble
- high
- the highdomain of this set low >= high
public abstract FzySet initializeMembership() throws FzySystemException
public double integrateMbr()
public double integrateMbr(int start, int end)
int
- start the starting index.int
- end the ending index.public boolean isLeftShouldered()
public boolean isNormal()
public boolean isRightShouldered()
public boolean isTwoSided()
public boolean lessThanOrEquals(FzySet aSet)
FzySet
- - the set to be compared to.public void printOn(java.io.Writer outWriter, int nTabs) throws java.io.IOException
java.io.Writer
- -- the outputWriter streamint
- -- the number of tabs to indent for pretty printing.public void reset()
protected void setAttribute(FzyAttribute fa)
FzyAttribute
- -- the owning clause component for this set.public void setCmpMembership(double m)
double
- the DOMAIN value at which 100% membership is attained.public void setDomain(double value, int inx) throws java.lang.IllegalArgumentException
double
- -- the new domain value to be injected.int
- -- the index for the domain value.public final void setDomainArray(double[] d)
double[]
- the domain array for this fuzzy set.public void setHedges(java.util.Stack hedgeStack)
Stack
- the hedges to be applied in LIFO order.public final void setHighDomain(double value)
double
- value the high domain for this set.public FzySet setLeftShouldered()
public final void setLowDomain(double value)
public void setMembership(double value, int inx)
double
- the new value.int
- the index into the membership array.public final void setMembershipArray(double[] a)
double[]
- the array of membership values for this set.public FzySet setRightShouldered()
public void setSolution(double v) throws java.lang.IllegalStateException
double
- the computed (domain) value of this set.public FzySet setTwoSided()
public double sumDomain(int start, int end) throws java.lang.IllegalArgumentException
int
- start -- the index within this set to start summation.int
- end -- the index within this set to end summation.public java.lang.StringBuffer toXML(int nTabs)
public abstract java.lang.String typeAsString()
public FzySet validate(double low, double high) throws FzySystemException
double
- - the lowdomain of this setdouble
- - the highdomain of this setpublic FzySet validate(double low, double high, double m) throws FzySystemException
double
- - the lowdomain of this setdouble
- - the highdomain of this setdouble
- - the completeMembership of this set.
|
License to use this program is provided under the TERMS OF THE COMMON PUBLIC LICENSE 0.5. ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |