parameters: (self, fd, indent=0)
docstring: Write simpla xml config file
docstring_summary: Write simpla xml config file
docstring_tokens: Write simpla xml config file
function: def write_xml(self, fd, indent=0):
          """
          Write simpla xml config file
          """
          print 'Simplaconfig.write_xml'
          fd.write(xm.begin(self.xmltag, indent))
          attrsman = self.get_attrsman()
          vtypes = self.parent.get_scenario().demand.vtypes
          ids_sumo_vtypes = vtypes.ids_sumo
          # <controlRate value="0.5" />
          # <maxPlatoonGap value="15.0" />
          # <catchupDist value="100.0" />
          # <switchImpatienceFactor value="0.1" />
          # <platoonSplitTime value="3.0" />
          # <lcMode original="597" leader="597" follower="514" catchup="514" catchupFollower="514" />
          # <speedFactor original="1.0" leader="1.0" follower="2.0" catchup="2.5" catchupFollower="3.0" />
          # <verbosity value="1" />
          # <vTypeMap original="passenger1" leader="leaderVTypeID" follower="followerVTypeID" catchup="catchupVTypeID" catchupFollower="catchupFollowerVTypeID" />
  
          #ids_plattypes = ['catchup','follower','original']
          #ids_plattypes = self._typemap.keys()
          #ids_vtypes_plat_sumo = []
          # for id_mode in self.ids_platoonmodes:
          #    ids_vtype_sumo= ids_sumo_vtypes[vtypes.select_by_mode(id_mode=id_mode)]
          #    #print '  id_mode',id_mode,'ids_vtype',ids_vtype.tolist()
          #    for id_vtype_sumo in ids_vtype_sumo:
          #        if id_vtype in ids_plattypes
          #            #if id_vtype_sumo.split('_')[-1] not in plattypes:
          #            ids_vtypes_plat_sumo.append(id_vtype_sumo)
  
          ids_vtypes_plat_sumo = ids_sumo_vtypes[self._typemap.keys()]
          fd.write(xm.start('vehicleSelectors', indent+2))
          fd.write(xm.arr('value', ids_vtypes_plat_sumo, sep=','))
          fd.write(xm.stopit())
  
          fd.write(xm.start('lcMode', indent+2))
          fd.write(xm.num('leader', self.lanechangemode_leader))
          fd.write(xm.num('follower', self.lanechangemode_follower))
          fd.write(xm.num('catchup', self.lanechangemode_catchup))
          fd.write(xm.num('catchupFollower', self.lanechangemode_catchup_follower))
          fd.write(xm.stopit())
  
          fd.write(xm.start('speedFactor', indent+2))
          fd.write(xm.num('original', 1.0))
          fd.write(xm.num('leader', self.speedfactor_leader))
          fd.write(xm.num('follower', self.speedfactor_follower))
          fd.write(xm.num('catchup', self.speedfactor_catchup))
          fd.write(xm.num('catchupFollower', self.speedfactor_catchup_follower))
          fd.write(xm.stopit())
  
          for plattypes in self._typemap.values():
              fd.write(xm.start('vTypeMap', indent+2))
              for plattype, id_vtype in plattypes.iteritems():
                  fd.write(xm.num(plattype, ids_sumo_vtypes[id_vtype]))
              fd.write(xm.stopit())
  
          for attrconfig in attrsman.get_configs():
              if attrconfig.xmltag is not None:
                  if (attrconfig.xmltag == 'switchImpatienceFactor') & (attrconfig.get_value() < 0):
                      pass
                  else:
                      fd.write(xm.start(attrconfig.xmltag, indent+2))
                      fd.write(xm.num('value', attrconfig.format_value()))
                      fd.write(xm.stopit())
  
          fd.write(xm.end(self.xmltag, indent))
function_tokens: def write_xml ( self , fd , indent = 0 ) : print 'Simplaconfig.write_xml' fd . write ( xm . begin ( self . xmltag , indent ) ) attrsman = self . get_attrsman ( ) vtypes = self . parent . get_scenario ( ) . demand . vtypes ids_sumo_vtypes = vtypes . ids_sumo # <controlRate value="0.5" /> # <maxPlatoonGap value="15.0" /> # <catchupDist value="100.0" /> # <switchImpatienceFactor value="0.1" /> # <platoonSplitTime value="3.0" /> # <lcMode original="597" leader="597" follower="514" catchup="514" catchupFollower="514" /> # <speedFactor original="1.0" leader="1.0" follower="2.0" catchup="2.5" catchupFollower="3.0" /> # <verbosity value="1" /> # <vTypeMap original="passenger1" leader="leaderVTypeID" follower="followerVTypeID" catchup="catchupVTypeID" catchupFollower="catchupFollowerVTypeID" /> #ids_plattypes = ['catchup','follower','original'] #ids_plattypes = self._typemap.keys() #ids_vtypes_plat_sumo = [] # for id_mode in self.ids_platoonmodes: #    ids_vtype_sumo= ids_sumo_vtypes[vtypes.select_by_mode(id_mode=id_mode)] #    #print '  id_mode',id_mode,'ids_vtype',ids_vtype.tolist() #    for id_vtype_sumo in ids_vtype_sumo: #        if id_vtype in ids_plattypes #            #if id_vtype_sumo.split('_')[-1] not in plattypes: #            ids_vtypes_plat_sumo.append(id_vtype_sumo) ids_vtypes_plat_sumo = ids_sumo_vtypes [ self . _typemap . keys ( ) ] fd . write ( xm . start ( 'vehicleSelectors' , indent + 2 ) ) fd . write ( xm . arr ( 'value' , ids_vtypes_plat_sumo , sep = ',' ) ) fd . write ( xm . stopit ( ) ) fd . write ( xm . start ( 'lcMode' , indent + 2 ) ) fd . write ( xm . num ( 'leader' , self . lanechangemode_leader ) ) fd . write ( xm . num ( 'follower' , self . lanechangemode_follower ) ) fd . write ( xm . num ( 'catchup' , self . lanechangemode_catchup ) ) fd . write ( xm . num ( 'catchupFollower' , self . lanechangemode_catchup_follower ) ) fd . write ( xm . stopit ( ) ) fd . write ( xm . start ( 'speedFactor' , indent + 2 ) ) fd . write ( xm . num ( 'original' , 1.0 ) ) fd . write ( xm . num ( 'leader' , self . speedfactor_leader ) ) fd . write ( xm . num ( 'follower' , self . speedfactor_follower ) ) fd . write ( xm . num ( 'catchup' , self . speedfactor_catchup ) ) fd . write ( xm . num ( 'catchupFollower' , self . speedfactor_catchup_follower ) ) fd . write ( xm . stopit ( ) ) for plattypes in self . _typemap . values ( ) : fd . write ( xm . start ( 'vTypeMap' , indent + 2 ) ) for plattype , id_vtype in plattypes . iteritems ( ) : fd . write ( xm . num ( plattype , ids_sumo_vtypes [ id_vtype ] ) ) fd . write ( xm . stopit ( ) ) for attrconfig in attrsman . get_configs ( ) : if attrconfig . xmltag is not None : if ( attrconfig . xmltag == 'switchImpatienceFactor' ) & ( attrconfig . get_value ( ) < 0 ) : pass else : fd . write ( xm . start ( attrconfig . xmltag , indent + 2 ) ) fd . write ( xm . num ( 'value' , attrconfig . format_value ( ) ) ) fd . write ( xm . stopit ( ) ) fd . write ( xm . end ( self . xmltag , indent ) )