#NEWLINE# def __init__( self , model ) : #NEWLINE# #INDENT# '\n        Initialize an instance of UAI writer class\n\n        Parameters\n        ----------\n        model: A Bayesian or Markov model\n            The model to write\n        ' #NEWLINE# if isinstance ( self , BayesianModel ) : #NEWLINE# #INDENT# self . network = 'BAYES\n' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if isinstance ( model , MarkovModel ) : #NEWLINE# #INDENT# self . network = 'MARKOV\n' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise TypeError ( 'Model must be an instance of Bayesian or Markov model.' ) #NEWLINE# #UNINDENT# #UNINDENT# self . model = model #NEWLINE# self . no_nodes = self . get_nodes ( ) #NEWLINE# self . domain = self . get_domain ( ) #NEWLINE# self . functions = self . get_functions ( ) #NEWLINE# self . tables = self . get_tables ( )