class_docstr: Initialize an instance of PomdpX reader class
  
  Parameters
  ----------
  path : file or str
      Path of the file containing PomdpX information.
  
  string : str
      String containing PomdpX information.
  
  Example
  -------
  reader = PomdpXReader('TestPomdpX.xml')
  
  Reference
  ---------
  http://bigbird.comp.nus.edu.sg/pmwiki/farm/appl/index.php?n=Main.PomdpXDocumentation
class_docstr_tok: ["Initialize","an","instance","of","PomdpX","reader","class","Parameters","--","--","--","--","--","path",":","file","or","str","Path","of","the","file","containing","PomdpX","information",".","string",":","str","String","containing","PomdpX","information",".","Example","--","--","--","-","reader","=","PomdpXReader","(","'TestPomdpX.xml","'",")","Reference","--","--","--","--","-","http",":","\/\/bigbird.comp.nus.edu.sg\/pmwiki\/farm\/appl\/index.php","?","n=Main.PomdpXDocumentation"]
docstr: This method returns parameters as nested dicts in case of decision
  diagram parameter.
docstr_tok: ["This","method","returns","parameters","as","nested","dicts","in","case","of","decision","diagram","parameter","."]
code: def get_parameter_dd(self, parameter):
      """
      This method returns parameters as nested dicts in case of decision
      diagram parameter.
      """
      dag = defaultdict(list)
      dag_elem = parameter.find("DAG")
      node = dag_elem.find("Node")
      root = node.get("var")
  
      def get_param(node):
          edges = defaultdict(list)
          for edge in node.findall("Edge"):
              if edge.find("Terminal") is not None:
                  edges[edge.get("val")] = edge.find("Terminal").text
              elif edge.find("Node") is not None:
                  node_cpd = defaultdict(list)
                  node_cpd[edge.find("Node").get("var")] = get_param(
                      edge.find("Node")
                  )
                  edges[edge.get("val")] = node_cpd
              elif edge.find("SubDAG") is not None:
                  subdag_attribute = defaultdict(list)
                  subdag_attribute["type"] = edge.find("SubDAG").get(
                      "type"
                  )
                  if subdag_attribute["type"] == "template":
                      subdag_attribute["idref"] = edge.find(
                          "SubDAG"
                      ).get("idref")
                  if edge.find("SubDAG").get("var"):
                      subdag_attribute["var"] = edge.find("SubDAG").get(
                          "var"
                      )
                  if edge.find("SubDAG").get("val"):
                      subdag_attribute["val"] = edge.find("SubDAG").get(
                          "val"
                      )
                  edges[edge.get("val")] = subdag_attribute
          return edges
  
      if parameter.find("SubDAGTemplate") is not None:
          SubDAGTemplate = parameter.find("SubDAGTemplate")
          subdag_root = SubDAGTemplate.find("Node")
          subdag_node = subdag_root.get("var")
          subdag_dict = defaultdict(list)
          subdag_dict[subdag_node] = get_param(subdag_root)
          dag["SubDAGTemplate"] = subdag_dict
          dag["id"] = SubDAGTemplate.get("id")
      dag[root] = get_param(node)
      return dag
  
imports: import xml.etree.ElementTree
  from collections import defaultdict
label_desc: Use image node_id 11 for calling the PomdpXReader obj's underlying member method code with example usage: obj.get_parameter_dd(parameter) and returns: dag, edges