public class T1MF_Discretized extends T1MF_Prototype
Modifier and Type | Field and Description |
---|---|
protected int |
discretizationLevel |
protected double |
peak |
protected java.util.ArrayList<Tuple> |
set |
protected boolean |
sorted |
isLeftShoulder, isRightShoulder, name, support
Constructor and Description |
---|
T1MF_Discretized(java.lang.String name) |
T1MF_Discretized(java.lang.String name,
int initialSize)
Creates a new instance of T1MF_Discretized
|
T1MF_Discretized(java.lang.String name,
Tuple[] points) |
Modifier and Type | Method and Description |
---|---|
void |
addPoint(Tuple p)
Adds a point to the discretized set - forces resorting.
|
void |
addPoints(Tuple[] p)
Adds a series of points to the discretized set - forces resorting.
|
int |
compareTo(java.lang.Object o) |
Tuple |
getAlphaCut(double alpha)
Returns the x values where the alpha cut using the alpha (y) value provided "cuts" the function curve
|
int |
getAlphaCutDisretizationLevel() |
double |
getDefuzzifiedCentroid(int numberOfDiscretizations)
Returns the defuzzified value of this set computed using the centroid algorithm.
|
double |
getFS(double x) |
int |
getNumberOfPoints() |
double |
getPeak()
Returns the xCoordinate of the peak value.
|
Tuple |
getPointAt(int i)
Returns point at i
|
java.util.ArrayList |
getPoints()
Returns all points in the set
|
Tuple |
getSupport() |
void |
setAlphaCutDisretizationLevel(int alphaCutDiscLevel) |
void |
setLeftShoulderSet(double shoulderStart) |
void |
setRightShoulderSet(double shoulderStart) |
java.lang.String |
toString() |
java.lang.String |
writeToFile(java.lang.String filename) |
java.lang.String |
writeToFileHighRes(java.lang.String filename,
int resolution)
Uses interpolation to supply high-res visualisation of the set.
|
getDefuzzifiedCOS, getName, isLeftShoulder, isRightShoulder, setLeftShoulder, setName, setRightShoulder, setSupport
protected java.util.ArrayList<Tuple> set
protected double peak
protected boolean sorted
protected int discretizationLevel
public T1MF_Discretized(java.lang.String name, int initialSize)
public T1MF_Discretized(java.lang.String name)
public T1MF_Discretized(java.lang.String name, Tuple[] points)
public void addPoint(Tuple p)
p
- 2-D coordinates of the point in the order y,x.public void addPoints(Tuple[] p)
p
- 2-D coordinates of the points in the order y,x.public int getAlphaCutDisretizationLevel()
public void setAlphaCutDisretizationLevel(int alphaCutDiscLevel)
public int getNumberOfPoints()
public double getFS(double x)
public Tuple getAlphaCut(double alpha)
public java.util.ArrayList getPoints()
public Tuple getPointAt(int i)
public double getPeak()
public Tuple getSupport()
getSupport
in interface T1MF_Interface
getSupport
in class T1MF_Prototype
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String writeToFile(java.lang.String filename)
public java.lang.String writeToFileHighRes(java.lang.String filename, int resolution)
filename
- The path/name for the output file.resolution
- The number of discretizations to be performed.public void setLeftShoulderSet(double shoulderStart)
public void setRightShoulderSet(double shoulderStart)
public double getDefuzzifiedCentroid(int numberOfDiscretizations)
getDefuzzifiedCentroid
in interface T1MF_Interface
getDefuzzifiedCentroid
in class T1MF_Prototype
numberOfDiscretizations
- The number of discretizations to be employed.
The number of discretizations is not used - instead the centroid is
computed on all the discrete values in the set.public int compareTo(java.lang.Object o)