nrc.fuzzy
Class SetPoint

java.lang.Object
  |
  +--nrc.fuzzy.SetPoint
All Implemented Interfaces:
java.io.Serializable

public class SetPoint
extends java.lang.Object
implements java.io.Serializable

The SetPoint class provides a means for representing a point with an x and y coordinate. In this implementation of fuzzy logic, the y value represents the membership value of the FuzzyValue/FuzzySet at that particular x. The name SetPoint came from the fact that FuzzySets are made up of sets of such points.

See Also:
Parameters, Serialized Form

Field Summary
protected  double x
          The x value of this SetPoint.
protected  double y
          The membership value (graphically, the y value) of the point x in a FuzzySet.
 
Constructor Summary
SetPoint()
          Constructs a new SetPoint object initialized with its x and y values equal to zero.
SetPoint(double x, double y)
          Constructs a new SetPoint object which has x and y values equal to the double arguments, x and y.
SetPoint(nrc.fuzzy.SetPoint a)
          Constructs a new SetPoint object which has x and y values equal to that of the SetPoint argument.
 
Method Summary
 boolean equals(nrc.fuzzy.SetPoint a)
          Tests whether the SetPoint argument is equal to this SetPoint.
 double getX()
          Gets the x value of the SetPoint.
 double getY()
          Gets the y value of the SetPoint.
protected  boolean inHorizontalAlignment(nrc.fuzzy.SetPoint a)
          Tests whether the SetPoint argument is in horizontal alignment with this SetPoint.
protected  boolean inVerticalAlignment(nrc.fuzzy.SetPoint a)
          Tests whether the SetPoint argument is in vertical alignment with this SetPoint.
 void setX(double x)
          Sets the x value of the SetPoint.
 void setXY(double x, double y)
          Sets the x and y values of the SetPoint.
 void setY(double y)
          Sets the y value of the SetPoint.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

x

protected double x
The x value of this SetPoint.


y

protected double y
The membership value (graphically, the y value) of the point x in a FuzzySet.

Constructor Detail

SetPoint

public SetPoint()
Constructs a new SetPoint object initialized with its x and y values equal to zero.


SetPoint

public SetPoint(nrc.fuzzy.SetPoint a)
Constructs a new SetPoint object which has x and y values equal to that of the SetPoint argument.

Parameters:
a - the SetPoint whose x and y values will be used to initialize the x and y values of the newly created SetPoint object

SetPoint

public SetPoint(double x,
                double y)
Constructs a new SetPoint object which has x and y values equal to the double arguments, x and y.

Parameters:
x - the double value used to initialize the x value of the new SetPoint object
y - the double value used to initialize the y value of the new SetPoint object
Method Detail

equals

public boolean equals(nrc.fuzzy.SetPoint a)
Tests whether the SetPoint argument is equal to this SetPoint. Note that the x and y values of the two SetPoints do not have to be identical, they only need to be very close as determined by the value of Parameters.FUZZY_TOLERANCE.

Parameters:
a - the SetPoint to compare this SetPoint to
Returns:
true if the x and y variables of the two SetPoints are equal within the value of Parameters.FUZZY_TOLERANCE.

inVerticalAlignment

protected boolean inVerticalAlignment(nrc.fuzzy.SetPoint a)
Tests whether the SetPoint argument is in vertical alignment with this SetPoint.

Parameters:
a - the SetPoint whose x value is to be compared to the x value of this SetPoint
Returns:
true if the x values of both SetPoints are equal within fuzzy tolerance.

inHorizontalAlignment

protected boolean inHorizontalAlignment(nrc.fuzzy.SetPoint a)
Tests whether the SetPoint argument is in horizontal alignment with this SetPoint.

Parameters:
a - the SetPoint whose y value is to be compared to the y value of this SetPoint
Returns:
true if the y values of both SetPoints are equal within fuzzy tolerance.

setXY

public void setXY(double x,
                  double y)
Sets the x and y values of the SetPoint.

Parameters:
x - the double value to be assigned to the x variable of this SetPoint
y - the double value to be assigned to the y variable of this SetPoint

setX

public void setX(double x)
Sets the x value of the SetPoint.

Parameters:
x - the double value to be assigned to the x variable of this SetPoint

setY

public void setY(double y)
Sets the y value of the SetPoint.

Parameters:
y - the double value to be assigned to the y variable of this SetPoint

getX

public double getX()
Gets the x value of the SetPoint.


getY

public double getY()
Gets the y value of the SetPoint.