parameters: (self)
return_statement: return fstar
docstring: Returns the forward star graph of the network as dictionary:
              fstar[id_fromedge] = set([id_toedge1, id_toedge2,...])
docstring_summary: Returns the forward star graph of the network as dictionary:
              fstar[id_fromedge] = set([id_toedge1, id_toedge2,...])
docstring_tokens: Returns the forward star graph of the network as dictionary : fstar [ id_fromedge ] = set ( [ id_toedge1 id_toedge2 ... ] )
function: def get_fstar(self):
          """
          Returns the forward star graph of the network as dictionary:
              fstar[id_fromedge] = set([id_toedge1, id_toedge2,...])
          """
          print 'get_fstar'
          net = self.get_scenario().net
          # prt mode
          id_mode = self.id_prtmode
  
          #ids_edge = self.get_ids()
          #fstar = np.array(np.zeros(np.max(ids_edge)+1, np.obj))
          fstar = {}
          connections = net.connections
          lanes = net.lanes
  
          #inds_con = connections.get_inds()
          #ids_fromlane = connections.ids_fromlane.get_value()[inds_con]
          #ids_tolane = connections.ids_tolane.get_value()[inds_con]
  
          ids_con = connections.get_ids()
          ids_fromlane = connections.ids_fromlane[ids_con]
          ids_tolane = connections.ids_tolane[ids_con]
  
          ids_mainmode_from = lanes.ids_mode[ids_fromlane]
          ids_mainmode_to = lanes.ids_mode[ids_tolane]
  
          #ids_modes_allow_from = lanes.ids_modes_allow[ids_fromlane]
          #ids_modes_allow_to = lanes.ids_modes_allow[ids_tolane]
  
          ids_fromedge = lanes.ids_edge[ids_fromlane]
          ids_toedge = lanes.ids_edge[ids_tolane]
          # print '  ids_fromedge',ids_fromedge
          # print '  ids_modes_allow',ids_modes_allow
  
          for id_fromedge, id_toedge, id_mode_allow_from, id_mode_allow_to, id_fromlane, id_tolane in\
              zip(ids_fromedge, ids_toedge, ids_mainmode_from, ids_mainmode_to,
                  ids_fromlane, ids_tolane):
  
              if id_mode_allow_from == id_mode:
                  if id_mode_allow_to == id_mode:
  
                      if fstar.has_key(id_fromedge):
                          fstar[id_fromedge].add(id_toedge)
                      else:
                          fstar[id_fromedge] = set([id_toedge])
              # if id_fromedge == 14048:
              #    print '  id_fromedge, id_toedge',id_fromedge, id_toedge,fstar.has_key(id_fromedge)
              #    print '  id_fromlane, id_tolane ',id_fromlane, id_tolane
              #    print '  id_mode_allow_from, id_mode_allow_to',id_mode_allow_from, id_mode_allow_to
  
          # for id_fromedge, id_toedge,ids_mode_allow_from,id_modes_allow_to  in\
          #                zip(ids_fromedge, ids_toedge, ids_modes_allow_from, ids_modes_allow_to):
          #    if len(ids_mode_allow_from)>0:
          #        if ids_mode_allow_from[-1] == id_mode:
          #            if len(id_modes_allow_to)>0:
          #                if id_modes_allow_to[-1] == id_mode:
          #
          #                    if fstar.has_key(id_fromedge):
          #                        fstar[id_fromedge].add(id_toedge)
          #                    else:
          #                        fstar[id_fromedge]=set([id_toedge])
  
          return fstar
function_tokens: def get_fstar ( self ) : print 'get_fstar' net = self . get_scenario ( ) . net # prt mode id_mode = self . id_prtmode #ids_edge = self.get_ids() #fstar = np.array(np.zeros(np.max(ids_edge)+1, np.obj)) fstar = { } connections = net . connections lanes = net . lanes #inds_con = connections.get_inds() #ids_fromlane = connections.ids_fromlane.get_value()[inds_con] #ids_tolane = connections.ids_tolane.get_value()[inds_con] ids_con = connections . get_ids ( ) ids_fromlane = connections . ids_fromlane [ ids_con ] ids_tolane = connections . ids_tolane [ ids_con ] ids_mainmode_from = lanes . ids_mode [ ids_fromlane ] ids_mainmode_to = lanes . ids_mode [ ids_tolane ] #ids_modes_allow_from = lanes.ids_modes_allow[ids_fromlane] #ids_modes_allow_to = lanes.ids_modes_allow[ids_tolane] ids_fromedge = lanes . ids_edge [ ids_fromlane ] ids_toedge = lanes . ids_edge [ ids_tolane ] # print '  ids_fromedge',ids_fromedge # print '  ids_modes_allow',ids_modes_allow for id_fromedge , id_toedge , id_mode_allow_from , id_mode_allow_to , id_fromlane , id_tolane in zip ( ids_fromedge , ids_toedge , ids_mainmode_from , ids_mainmode_to , ids_fromlane , ids_tolane ) : if id_mode_allow_from == id_mode : if id_mode_allow_to == id_mode : if fstar . has_key ( id_fromedge ) : fstar [ id_fromedge ] . add ( id_toedge ) else : fstar [ id_fromedge ] = set ( [ id_toedge ] ) # if id_fromedge == 14048: #    print '  id_fromedge, id_toedge',id_fromedge, id_toedge,fstar.has_key(id_fromedge) #    print '  id_fromlane, id_tolane ',id_fromlane, id_tolane #    print '  id_mode_allow_from, id_mode_allow_to',id_mode_allow_from, id_mode_allow_to # for id_fromedge, id_toedge,ids_mode_allow_from,id_modes_allow_to  in\ #                zip(ids_fromedge, ids_toedge, ids_modes_allow_from, ids_modes_allow_to): #    if len(ids_mode_allow_from)>0: #        if ids_mode_allow_from[-1] == id_mode: #            if len(id_modes_allow_to)>0: #                if id_modes_allow_to[-1] == id_mode: # #                    if fstar.has_key(id_fromedge): #                        fstar[id_fromedge].add(id_toedge) #                    else: #                        fstar[id_fromedge]=set([id_toedge]) return fstar