1
0
Fork 0

Add rate_matrix class

parallel_struct_est
philpMartin 4 years ago
parent 3b3759d05b
commit 8ad41a1523
  1. 21
      main_package/classes/dynamic_graph.py

@ -68,7 +68,6 @@ class DynamicGraph():
Returns: Returns:
void void
""" """
matrix_traj = trajectory.get_trajectory_as_matrix() matrix_traj = trajectory.get_trajectory_as_matrix()
current_state = matrix_traj[0][1] #Aggiungi se necessario i primi due stati current_state = matrix_traj[0][1] #Aggiungi se necessario i primi due stati
@ -96,14 +95,20 @@ class DynamicGraph():
else: else:
self.append_new_trajectory(trajectory) 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####### ######Veloci Tests#######
s1 = sp.SamplePath() #s1 = sp.SamplePath()
s1.build_trajectories() #s1.build_trajectories()
print(s1.get_number_trajectories()) #print(s1.get_number_trajectories())
g1 = DynamicGraph(s1) #g1 = DynamicGraph(s1)
g1.build_graph() #g1.build_graph()
print(g1.graph) #print(g1.graph)
print(g1.states_number) #print(g1.states_number)