Remove NonSaveableVertex interface
@@ -5,7 +5,7 @@ import io.improbable.keanu.vertices.bool.BoolVertex;
import io.improbable.keanu.vertices.dbl.KeanuRandom;
-public class AssertVertex extends BoolVertex implements NonProbabilistic<BooleanTensor>, NonSaveableVertex {
+public class AssertVertex extends BoolVertex implements NonProbabilistic<BooleanTensor> {
private static final String PREDICATE_NAME = "predicate";
private static final String ERROR_MESSAGE_NAME = "error";
@@ -13,6 +13,13 @@ public class AssertVertex extends BoolVertex implements NonProbabilistic<Boolean
private final Vertex<? extends BooleanTensor> predicate;
private final String errorMessage;
+ /**
+ * A vertex that asserts a {@link BoolVertex} is all true on calculation.
+ *
+ * @param predicate the predicate to evaluate
+ * @param errorMessage a message to include in the {@link AssertionError}
+ * @throws AssertionError if any element of the predicate is false when calculated.
+ */
public AssertVertex(@LoadVertexParam(PREDICATE_NAME) Vertex<? extends BooleanTensor> predicate,
@LoadVertexParam(ERROR_MESSAGE_NAME) String errorMessage) {
super(predicate.getShape());
