FuzzyVeracity()

FuzzyVeracity is the fuzzy equivalent of a crisp boolean in boolean logic. It represents the result of logical operations (IS, AND, OR...).
Its value can vary in the range [0.0, 1.0], 0.0 being the equivalent of "false" and 1.0 of "true".
You can acces logic operators through instances of this class, which enable fluent syntax for rules (Except IS and IS_NOT which are members of FuzzyValue).
Operators are methods in upper case.

new FuzzyVeracity()

Properties:
Name Type Description
veracity Number The veracity level in the range [0.0, 1.0]
Example
var logic = new FuzzyLogic();
var intense = logic.newSet("Intense", 0, 255);
// An RGB color to test
var color = [255,200,10];
// Separate channels
var redChannel = logic.newValue( color[0] );
var greenChannel = logic.newValue( color[1] );
var blueChannel = logic.newValue( color[2] );
// isRed will be a FuzzyVeracity, the result of the test.
// Note that FuzzyValue.IS returns a FuzzyVeracity, on which the methods AND and NOR are called.
// But this is all internal and you don't really need to know that to use this syntax.
var isRed = redChannel.IS( intense )
     .AND(
        greenChannel.IS( intense ).
        NOR( blueChannel.IS( intense ))
     )

Methods

AND(other) → {FuzzyVeracity}

The equivalent of the boolean operation this && other
Parameters:
Name Type Description
other FuzzyVeracity The other operand.
Returns:
FuzzyVeracity

AND_NOT(other) → {FuzzyVeracity}

The equivalent of the boolean operation this && !other or !(this || other)
Parameters:
Name Type Description
other FuzzyVeracity The other operand.
Returns:
FuzzyVeracity

DIFFERENT(other) → {FuzzyVeracity}

The equivalent of the boolean operation this != other
Parameters:
Name Type Description
other FuzzyVeracity The other operand.
Returns:
FuzzyVeracity

DOES_NOT_HAVE(other) → {FuzzyVeracity}

The equivalent of the boolean operation this && !other or !(this || other)
Parameters:
Name Type Description
other FuzzyVeracity The other operand.
Returns:
FuzzyVeracity

DOES_NOT_IMPLY(other) → {FuzzyVeracity}

The equivalent of the boolean operation this && !other or !(this || other)
Parameters:
Name Type Description
other FuzzyVeracity The other operand.
Returns:
FuzzyVeracity

EQUALS(other) → {FuzzyVeracity}

The equivalent of the boolean operation this == other
Parameters:
Name Type Description
other FuzzyVeracity The other operand.
Returns:
FuzzyVeracity

HAS(other) → {FuzzyVeracity}

The equivalent of the boolean operation !(this && other) or !this || other
Parameters:
Name Type Description
other FuzzyVeracity The other operand.
Returns:
FuzzyVeracity

IMPLIES(other) → {FuzzyVeracity}

The equivalent of the boolean operation !(this && other) or !this || other
Parameters:
Name Type Description
other FuzzyVeracity The other operand.
Returns:
FuzzyVeracity

IS(other) → {FuzzyVeracity}

The equivalent of the boolean operation this == other
Parameters:
Name Type Description
other FuzzyVeracity The other operand.
Returns:
FuzzyVeracity

IS_NOT(other) → {FuzzyVeracity}

The equivalent of the boolean operation this != other
Parameters:
Name Type Description
other FuzzyVeracity The other operand.
Returns:
FuzzyVeracity

NAND(other) → {FuzzyVeracity}

The equivalent of the boolean operation !(this && other)
Parameters:
Name Type Description
other FuzzyVeracity The other operand.
Returns:
FuzzyVeracity

NEGATE() → {FuzzyVeracity}

Negates the current veracity. A new veracity is returned, and the current veracity is not changed.
Returns:
FuzzyVeracity - The negation of this veracity.

NONE(other) → {FuzzyVeracity}

The equivalent of the boolean operation !(this || other)
Parameters:
Name Type Description
other FuzzyVeracity The other operand.
Returns:
FuzzyVeracity

NOR(other) → {FuzzyVeracity}

The equivalent of the boolean operation !(this || other)
Parameters:
Name Type Description
other FuzzyVeracity The other operand.
Returns:
FuzzyVeracity

NOT_BOTH(other) → {FuzzyVeracity}

The equivalent of the boolean operation !(this && other)
Parameters:
Name Type Description
other FuzzyVeracity The other operand.
Returns:
FuzzyVeracity

NXR(other) → {FuzzyVeracity}

The equivalent of the boolean operation this == other
Parameters:
Name Type Description
other FuzzyVeracity The other operand.
Returns:
FuzzyVeracity

OR(other) → {FuzzyVeracity}

The equivalent of the boolean operation this || other
Parameters:
Name Type Description
other FuzzyVeracity The other operand.
Returns:
FuzzyVeracity

WEIGHTED(other, weight) → {FuzzyVeracity}

Weights this and other according to a given factor.
The weight factor is applied to the other operand, and the 1 - weight factor is applied to this.
Parameters:
Name Type Description
other FuzzyVeracity The other operand.
weight Number The weight.
Returns:
FuzzyVeracity

WITH(other) → {FuzzyVeracity}

The equivalent of the boolean operation !(this && other) or !this || other
Parameters:
Name Type Description
other FuzzyVeracity The other operand.
Returns:
FuzzyVeracity

WITHOUT(other) → {FuzzyVeracity}

The equivalent of the boolean operation this && !other or !(this || other)
Parameters:
Name Type Description
other FuzzyVeracity The other operand.
Returns:
FuzzyVeracity

XOR(other) → {FuzzyVeracity}

The equivalent of the boolean operation this != other
Parameters:
Name Type Description
other FuzzyVeracity The other operand.
Returns:
FuzzyVeracity