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.
36 lines
1.4 KiB
36 lines
1.4 KiB
4 years ago
|
import set_of_cims as socim
|
||
4 years ago
|
|
||
|
|
||
4 years ago
|
|
||
|
class SetsOfCimsContainer:
|
||
4 years ago
|
"""
|
||
4 years ago
|
Aggrega un insieme di oggetti SetOfCims
|
||
4 years ago
|
"""
|
||
|
# list_of_vars_orders contiene tutte le liste con i parent ordinati secondo il valore indx
|
||
4 years ago
|
def __init__(self, list_of_keys, states_number_per_node, list_of_parents_states_number):
|
||
4 years ago
|
self.sets_of_cims = []
|
||
4 years ago
|
self.init_cims_structure(list_of_keys, states_number_per_node, list_of_parents_states_number)
|
||
|
#self.states_per_variable = states_number
|
||
4 years ago
|
|
||
4 years ago
|
def init_cims_structure(self, keys, states_number_per_node, list_of_parents_states_number):
|
||
4 years ago
|
for indx, key in enumerate(keys):
|
||
4 years ago
|
self.sets_of_cims.append(
|
||
|
socim.SetOfCims(key, list_of_parents_states_number[indx], states_number_per_node[indx]))
|
||
4 years ago
|
|
||
4 years ago
|
def get_set_of_cims(self, node_indx):
|
||
|
return self.sets_of_cims[node_indx]
|
||
4 years ago
|
|
||
4 years ago
|
def get_cims_of_node(self, node_indx, cim_indx):
|
||
|
return self.sets_of_cims[node_indx].get_cim(cim_indx)
|
||
|
|
||
4 years ago
|
"""
|
||
4 years ago
|
def get_vars_order(self, node):
|
||
|
return self.actual_cims[node][1]
|
||
|
|
||
4 years ago
|
def update_state_transition_for_matrix(self, node, which_matrix, element_indx):
|
||
|
self.sets_of_cims[node].update_state_transition(which_matrix, element_indx)
|
||
4 years ago
|
|
||
|
def update_state_residence_time_for_matrix(self, which_node, which_matrix, which_element, time):
|
||
|
self.sets_of_cims[which_node].update_state_residence_time(which_matrix, which_element, time)
|
||
4 years ago
|
"""
|