code: def test_reward_function_dd(self):
      self.model_data = {
          "reward_function": [
              {
                  "Var": "reward_rover",
                  "Parent": ["action_rover", "rover_0", "rock_0"],
                  "Type": "DD",
                  "Parameter": {
                      "action_rover": {
                          "amw": {
                              "rover_0": {
                                  "s0": "-100.0",
                                  "s1": "0.0",
                                  "s2": "0.0",
                              }
                          },
                          "ame": {
                              "rover_0": {
                                  "s0": "0.0",
                                  "s1": "10.0",
                                  "s2": "0.0",
                              }
                          },
                          "ac": "0.0",
                          "as": {
                              "rover_0": {
                                  "s0": {
                                      "rock_0": {
                                          "good": "10",
                                          "bad": "-10",
                                      }
                                  },
                                  "s1": "-100",
                                  "s2": "-100",
                              }
                          },
                      }
                  },
              }
          ]
      }
  
      self.writer = PomdpXWriter(model_data=self.model_data)
      expected_xml = etree.XML(
          """
  <RewardFunction>
    <Func>
      <Var>reward_rover</Var>
      <Parent>action_rover rover_0 rock_0</Parent>
      <Parameter type="DD">
        <DAG>
          <Node var="action_rover">
            <Edge val="ac">
              <Terminal>0.0</Terminal>
            </Edge>
            <Edge val="ame">
              <Node var="rover_0">
                <Edge val="s0">
                  <Terminal>0.0</Terminal>
                </Edge>
                <Edge val="s1">
                  <Terminal>10.0</Terminal>
                </Edge>
                <Edge val="s2">
                  <Terminal>0.0</Terminal>
                </Edge>
              </Node>
            </Edge>
            <Edge val="amw">
              <Node var="rover_0">
                <Edge val="s0">
                  <Terminal>-100.0</Terminal>
                </Edge>
                <Edge val="s1">
                  <Terminal>0.0</Terminal>
                </Edge>
                <Edge val="s2">
                  <Terminal>0.0</Terminal>
                </Edge>
              </Node>
            </Edge>
            <Edge val="as">
              <Node var="rover_0">
                <Edge val="s0">
                  <Node var="rock_0">
                    <Edge val="bad">
                      <Terminal>-10</Terminal>
                    </Edge>
                    <Edge val="good">
                      <Terminal>10</Terminal>
                    </Edge>
                  </Node>
                </Edge>
                <Edge val="s1">
                  <Terminal>-100</Terminal>
                </Edge>
                <Edge val="s2">
                  <Terminal>-100</Terminal>
                </Edge>
              </Node>
            </Edge>
          </Node>
        </DAG>
      </Parameter>
    </Func>
  </RewardFunction>"""
      )
      self.maxDiff = None
      self.assertEqual(
          self.writer.add_reward_function(),
          etree.tostring(expected_xml),
      )
  
imports: import io
  import sys
  import unittest
  import xml.etree.ElementTree
  from pgmpy.readwrite import PomdpXReader, PomdpXWriter
label_desc: Use image node_id 10 for calling the TestPomdpXWriter obj's underlying member method code with example usage: obj.test_reward_function_dd() without return types