From 8ad41a1523216b5b01fc3bb5336f282e9fd222f3 Mon Sep 17 00:00:00 2001 From: philpMartin Date: Wed, 10 Jun 2020 22:04:31 +0200 Subject: [PATCH] Add rate_matrix class --- main_package/classes/dynamic_graph.py | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/main_package/classes/dynamic_graph.py b/main_package/classes/dynamic_graph.py index 68b84b3..7a4585d 100644 --- a/main_package/classes/dynamic_graph.py +++ b/main_package/classes/dynamic_graph.py @@ -68,7 +68,6 @@ class DynamicGraph(): Returns: void """ - matrix_traj = trajectory.get_trajectory_as_matrix() current_state = matrix_traj[0][1] #Aggiungi se necessario i primi due stati @@ -96,14 +95,20 @@ class DynamicGraph(): else: self.append_new_trajectory(trajectory) + def get_root_node(self): + return self.graph[list(self.graph)[0]]["Node"] + + def get_neighbours(self, node): + return self.graph[node.state_id]["Arcs"] + ######Veloci Tests####### -s1 = sp.SamplePath() -s1.build_trajectories() -print(s1.get_number_trajectories()) +#s1 = sp.SamplePath() +#s1.build_trajectories() +#print(s1.get_number_trajectories()) -g1 = DynamicGraph(s1) -g1.build_graph() -print(g1.graph) -print(g1.states_number) \ No newline at end of file +#g1 = DynamicGraph(s1) +#g1.build_graph() +#print(g1.graph) +#print(g1.states_number) \ No newline at end of file