A new, blazing-fast learning engine for Continuous Time Bayesian Networks. Written in pure Rust. 🦀
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
reCTBN/src/node.rs

45 lines
1014 B

use std::collections::BTreeSet; use petgraph::prelude::*;
use crate::params::*;
3 years ago
pub enum NodeType {
DiscreteStatesContinousTime(DiscreteStatesContinousTimeParams)
}
3 years ago
pub struct Node {
pub params: NodeType,
3 years ago
pub label: String
}
impl Node {
pub fn reset_params(&mut self) {
match &mut self.params {
NodeType::DiscreteStatesContinousTime(params) => {params.reset_params();}
}
}
pub fn get_params(&self) -> &NodeType {
&self.params
}
pub fn get_reserved_space_as_parent(&self) -> usize {
match &self.params {
NodeType::DiscreteStatesContinousTime(params) => params.get_reserved_space_as_parent()
}
}
pub fn state_to_index(&self,state: &StateType) -> usize{
match &self.params {
NodeType::DiscreteStatesContinousTime(params) => params.state_to_index(state)
}
}
}
3 years ago
impl PartialEq for Node {
fn eq(&self, other: &Node) -> bool{
self.label == other.label
}
}
3 years ago