parameters: (veh_comp_d, veh_type_d, speed_d, root)
docstring: append the vehicle distribution data to the given dom document
      :param veh_comp_d:
      :type veh_comp_d:   dict
      :param veh_type_d:
      :type veh_type_d:   dict
      :param speed_d:
      :type speed_d:      dict
      :param root:   XML root element to append children to
  
      .. note:: *modifies/extends* XML root element
docstring_summary: append the vehicle distribution data to the given dom document
      :param veh_comp_d:
      :type veh_comp_d:   dict
      :param veh_type_d:
      :type veh_type_d:   dict
      :param speed_d:
      :type speed_d:      dict
      :param root:   XML root element to append children to
docstring_tokens: append the vehicle distribution data to the given dom document : param veh_comp_d : : type veh_comp_d : dict : param veh_type_d : : type veh_type_d : dict : param speed_d : : type speed_d : dict : param root : XML root element to append children to
function: def create_vTypeDistribution_elems(veh_comp_d, veh_type_d, speed_d, root):
      """append the vehicle distribution data to the given dom document
      :param veh_comp_d:
      :type veh_comp_d:   dict
      :param veh_type_d:
      :type veh_type_d:   dict
      :param speed_d:
      :type speed_d:      dict
      :param root:   XML root element to append children to
  
      .. note:: *modifies/extends* XML root element
      """
      # iterate vehicle compositions
      for c_id, comps in veh_comp_d.items():
          v_type_dist = root.ownerDocument.createElement("vTypeDistribution")
          v_type_dist.setAttribute("id", c_id)
          root.appendChild(v_type_dist)
          for comp in comps:
              v_type = root.ownerDocument.createElement("vType")
              v_type.setAttribute(
                  "id",
                  "t{}_D{}".format(
                      veh_type_d[comp["vehType"]]["id"],
                      c_id))
              v_type.setAttribute("accel", veh_type_d[comp["vehType"]]["acc"])
              v_type.setAttribute("length",
                                  veh_type_d[comp["vehType"]]["length"])
              v_type.setAttribute("probability", comp["rel_flow"])
              v_type.setAttribute("maxSpeed", speed_d[comp["desSpeedDistr"]])
              v_type_dist.appendChild(v_type)
function_tokens: def create_vTypeDistribution_elems ( veh_comp_d , veh_type_d , speed_d , root ) : # iterate vehicle compositions for c_id , comps in veh_comp_d . items ( ) : v_type_dist = root . ownerDocument . createElement ( "vTypeDistribution" ) v_type_dist . setAttribute ( "id" , c_id ) root . appendChild ( v_type_dist ) for comp in comps : v_type = root . ownerDocument . createElement ( "vType" ) v_type . setAttribute ( "id" , "t{}_D{}" . format ( veh_type_d [ comp [ "vehType" ] ] [ "id" ] , c_id ) ) v_type . setAttribute ( "accel" , veh_type_d [ comp [ "vehType" ] ] [ "acc" ] ) v_type . setAttribute ( "length" , veh_type_d [ comp [ "vehType" ] ] [ "length" ] ) v_type . setAttribute ( "probability" , comp [ "rel_flow" ] ) v_type . setAttribute ( "maxSpeed" , speed_d [ comp [ "desSpeedDistr" ] ] ) v_type_dist . appendChild ( v_type )