From 0f61cbee4c6fc72a159a3b3bb91ca2a7cb553ccd Mon Sep 17 00:00:00 2001 From: meliurwen Date: Tue, 31 Jan 2023 09:30:40 +0100 Subject: [PATCH] Refactored CIM validation for `UniformParametersGenerator` test --- reCTBN/tests/tools.rs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/reCTBN/tests/tools.rs b/reCTBN/tests/tools.rs index f04fb2a..59ed71c 100644 --- a/reCTBN/tests/tools.rs +++ b/reCTBN/tests/tools.rs @@ -1,6 +1,7 @@ use std::ops::Range; use ndarray::{arr1, arr2, arr3}; +use reCTBN::params::ParamsTrait; use reCTBN::process::ctbn::*; use reCTBN::process::NetworkProcess; use reCTBN::params; @@ -167,12 +168,9 @@ fn uniform_parameters_generator_right_densities() { let mut cim_generator: UniformParametersGenerator = RandomParametersGenerator::new(interval, seed); cim_generator.generate_parameters(&mut net); for node in net.get_node_indices() { - match &mut net.get_node_mut(node) { - params::Params::DiscreteStatesContinousTime(param) => { - assert_eq!( - Ok(()), - param.set_cim(param.get_cim().clone().unwrap())); - } - } + assert_eq!( + Ok(()), + net.get_node(node).validate_params() + ); } }