Old engine for Continuous Time Bayesian Networks. Superseded by reCTBN. 🐍
https://github.com/madlabunimib/PyCTBN
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.
24 lines
683 B
24 lines
683 B
|
|
|
|
class Structure:
|
|
|
|
def __init__(self, structure, variables):
|
|
self.structure_frame = structure
|
|
self.variables_frame = variables
|
|
|
|
def list_of_edge_ids(self):
|
|
edges_list = []
|
|
for indx, row in self.structure_frame.iterrows():
|
|
row_tuple = (row.From, row.To)
|
|
edges_list.append(row_tuple)
|
|
return edges_list
|
|
|
|
def list_of_node_ids(self):
|
|
#print(self.variables_frame)
|
|
return self.variables_frame['Name']
|
|
|
|
def get_node_id(self, node_indx):
|
|
return self.variables_frame['Name'][node_indx]
|
|
|
|
def get_node_indx(self, node_id):
|
|
return list(self.variables_frame['Name']).index(node_id)
|
|
|