コード例 #1
0
ファイル: decision.py プロジェクト: martinh89/PRIMO
 def get_ut_index(self, node_value_pairs):
     nodes, values = zip(*node_value_pairs)
     index = []
     for node in self.variables:
         index_in_values_list = nodes.index(node)
         value = values[index_in_values_list]
         index.append(node.value_range.index(value))
     return tuple(index)
コード例 #2
0
ファイル: decision.py プロジェクト: vishalbelsare/PRIMO
 def get_ut_index(self, node_value_pairs):
     nodes, values = zip(*node_value_pairs)
     index = []
     for node in self.variables:
         index_in_values_list = nodes.index(node)
         value = values[index_in_values_list]
         index.append(node.value_range.index(value))
     return tuple(index)
コード例 #3
0
ファイル: densities.py プロジェクト: martinh89/PRIMO
 def get_cpt_index(self, node_value_pairs):
     '''
     Can be used to determine the index in this densitys cpt that accords to
     a completely specified node-value combination for all nodes that this
     density depends on
     @param node_value_pairs: A list of (Node,Value) pairs
     @returns: A tuple representing the index
     '''
     nodes, values = zip(*node_value_pairs)
     index = []
     for node in self.variables:
         index_in_values_list = nodes.index(node)
         value = values[index_in_values_list]
         index.append(node.value_range.index(value))
     return tuple(index)
コード例 #4
0
ファイル: densities.py プロジェクト: vishalbelsare/PRIMO
 def get_cpt_index(self, node_value_pairs):
     '''
     Can be used to determine the index in this densitys cpt that accords to
     a completely specified node-value combination for all nodes that this
     density depends on
     @param node_value_pairs: A list of (Node,Value) pairs
     @returns: A tuple representing the index
     '''
     nodes, values = zip(*node_value_pairs)
     index = []
     for node in self.variables:
         index_in_values_list = nodes.index(node)
         value = values[index_in_values_list]
         index.append(node.value_range.index(value))
     return tuple(index)