Package org.tweetyproject.math.algebra
Class BooleanSemiring
This class represents a Boolean semiring. In this semiring, the addition operation corresponds to logical OR,
the multiplication operation corresponds to logical AND, the additive identity is false,
and the multiplicative identity is true.
- Author:
- Sandra Hoffmann
-
Constructor Summary
ConstructorDescriptionConstructs a BooleanSemiring with logical OR, logical AND as addition and multiplication operations, respectively. -
Method Summary
Modifier and TypeMethodDescriptionImplements the division operation in this semiring.Generates a random Boolean element.double
toNumericalValue
(Boolean weight) Converts a Boolean weight to its numerical representation.Methods inherited from class org.tweetyproject.math.algebra.Semiring
add, betterOrSame, getAddition, getMultiplication, getOneElement, getZeroElement, multiply, validateAndReturn
-
Constructor Details
-
BooleanSemiring
public BooleanSemiring()Constructs a BooleanSemiring with logical OR, logical AND as addition and multiplication operations, respectively. The additive identity is false, and the multiplicative identity is true.
-
-
Method Details
-
getRandomElement
Generates a random Boolean element.- Specified by:
getRandomElement
in classSemiring<Boolean>
- Returns:
- A random Boolean element.
-
toNumericalValue
Converts a Boolean weight to its numerical representation.- Overrides:
toNumericalValue
in classSemiring<Boolean>
- Parameters:
weight
- The Boolean weight to be converted.- Returns:
- 1.0 if the weight is true, 0.0 otherwise.
-
divide
-