use ndarray::prelude::*; use petgraph::prelude::*; use crate::network; use crate::node; use crate::params::Params; pub struct Trajectory { time: Array1, events: Array2 } pub struct Dataset { trajectories: Vec } fn trajectory_generator(net: &Box, n_trajectories: u64, t_end: f64) -> Dataset { let mut dataset = Dataset{ trajectories: Vec::new() }; let node_idx: Vec<_> = net.get_node_indices().collect(); for _ in 0..n_trajectories { let t = 0.0; let mut time: Vec = Vec::new(); let mut events: Vec> = Vec::new(); let mut current_state: Vec = node_idx.iter().map(|x| { match net.get_node_weight(&x).get_params() { node::NodeType::DiscreteStatesContinousTime(params) => params.get_random_state_uniform() } }).collect(); let next_transitions: Vec> = (0..node_idx.len()).map(|_| Option::None).collect(); events.push(current_state.clone()); time.push(t.clone()); while t < t_end { } } dataset }