Assertions at multiple stages in a more complex graph
@@ -160,7 +160,7 @@ public class AssertVertexTest {
}
@Test
- public void optimizerWithAssertThatShoudlntFire() {
+ public void optimizerWithAssertThatShouldntFire() {
UniformVertex temperature = new UniformVertex(20., 30.);
temperature.lessThan(new ConstantDoubleVertex(35)).assertTrue();
temperature.greaterThan(new ConstantDoubleVertex(15)).assertTrue();
@@ -170,6 +170,9 @@ public class AssertVertexTest {
firstThermometer.observe(25.);
secondThermometer.observe(30.);
+ firstThermometer.greaterThan(new ConstantDoubleVertex(24)).assertTrue();
+ secondThermometer.greaterThan(new ConstantDoubleVertex(28)).assertTrue();
+
BayesianNetwork bayesNet = new BayesianNetwork(temperature.getConnectedGraph());
KeanuOptimizer.of(bayesNet).maxAPosteriori();
assertEquals(26, temperature.getValue().scalar(), 0.1);
