use Constants instead of Bernoulli in testing Boolean operator overloading
package io.improbable.keanu.kotlin
import io.improbable.keanu.DeterministicRule
+import io.improbable.keanu.vertices.ConstantVertex
import io.improbable.keanu.vertices.VertexMatchers.hasValue
import io.improbable.keanu.vertices.bool.nonprobabilistic.ConstantBoolVertex
-import io.improbable.keanu.vertices.bool.probabilistic.BernoulliVertex
import junit.framework.TestCase
import org.hamcrest.MatcherAssert.assertThat
import org.junit.Assert.assertEquals
@@ -21,8 +21,8 @@ class BooleanOperatorOverloadingTest {
@Test
fun booleanVertexAnd() {
- val vertex1 = BernoulliVertex(0.5)
- val vertex2 = BernoulliVertex(0.5)
+ val vertex1 = ConstantVertex.of(true)
+ val vertex2 = ConstantVertex.of(false)
assertThat(vertex1 and vertex2, hasValue(vertex1.value and vertex2.value))
assertThat(vertex1 and false, hasValue(vertex1.value and false))
@@ -38,8 +38,8 @@ class BooleanOperatorOverloadingTest {
@Test
fun booleanVertexOr() {
- val vertex1 = BernoulliVertex(0.5)
- val vertex2 = BernoulliVertex(0.5)
+ val vertex1 = ConstantVertex.of(true)
+ val vertex2 = ConstantVertex.of(false)
assertThat(vertex1 or vertex2, hasValue(vertex1.value or vertex2.value))
assertThat(vertex1 or false, hasValue(vertex1.value or false))
