parameters: (self, is_return_lists=False, is_return_arrays=False,
                    is_ignor_connections=False,
                    id_mode=None
                    )
return_statement: return fstar
docstring: Returns the forward star graph of the network as dictionary:
              fstar[id_edge] = set([id_toedge1, id_toedge2,...])
  
              if is_return_lists = True then a list of edges is the value
              of fstar
  
              if is_return_arrays = True then a numpy array of edges is the value
              of fstar
  
              if is_ignor_connections = True then all possible successive edges
              are considered, disregarding the actual connections
docstring_summary: Returns the forward star graph of the network as dictionary:
              fstar[id_edge] = set([id_toedge1, id_toedge2,...])
docstring_tokens: Returns the forward star graph of the network as dictionary : fstar [ id_edge ] = set ( [ id_toedge1 id_toedge2 ... ] )
function: def get_fstar(self, is_return_lists=False, is_return_arrays=False,
                    is_ignor_connections=False,
                    id_mode=None
                    ):
          """
          Returns the forward star graph of the network as dictionary:
              fstar[id_edge] = set([id_toedge1, id_toedge2,...])
  
              if is_return_lists = True then a list of edges is the value
              of fstar
  
              if is_return_arrays = True then a numpy array of edges is the value
              of fstar
  
              if is_ignor_connections = True then all possible successive edges
              are considered, disregarding the actual connections
  
          """
          print 'get_fstar id_mode', id_mode, 'is_return_lists', is_return_lists, 'is_return_arrays', is_return_arrays
          #ids_edge = self.get_ids()
          #fstar = np.array(np.zeros(np.max(ids_edge)+1, np.obj))
          fstar = {}
          connections = self.parent.connections
          lanes = self.parent.lanes
          inds_con = connections.get_inds()
          if is_ignor_connections:
              # here we ignore connections and look at the
              # outgoing edges of node database
              if 1:  # id_mode is None:
                  # not even mode is checked
                  ids_outgoing = self.parent.nodes.ids_outgoing
                  ids = self.get_ids()
                  for id_edge, id_tonode in zip(ids, self.ids_tonode[ids]):
                      ids_edge_outgoing = ids_outgoing[id_tonode]
                      if ids_edge_outgoing is not None:
                          fstar[id_edge] = set(ids_edge_outgoing)
                      else:
                          fstar[id_edge] = set()
  
              # else:# actually the get_times or get_distance method should eliminate not accessible edges
                  # check also if id_mode has access at both ends of each connection
                  # ids_lane = lanes.get_ids()
                  # has_access = np.zeros(np.max(ids_lane)+1, dtype = np.bool)
                  # ids_fromedge = list(set(lanes.ids_edge[ids_lane[lanes.get_accesslevel_lanes(ids_lane, id_mode) > -1]]))
                  # for id_edge, id_tonode in zip(ids_fromedge,self.ids_tonode[ids_fromedge]):
                  #    ids_edge_outgoing = ids_outgoing[id_tonode]
                  #    if ids_edge_outgoing is not None:
                  #        fstar[id_edge] = set()
                  #        for id_edge in ids_edge_outgoing
                  #            if
                  #            fstar[id_edge].add(id_toedge)
                  #    else:
                  #        fstar[id_edge] = set()
  
          else:
              # here we check actual connections
              # this is important if correct turns are desired
              # for exampole in car routing
  
              if id_mode is None:
                  # check connection but do not check accessibility
  
                  ids_fromedge = lanes.ids_edge[connections.ids_fromlane.get_value()[inds_con]]
                  ids_toedge = lanes.ids_edge[connections.ids_tolane.get_value()[inds_con]]
  
              else:
                  # check also if id_mode has access at both ends of each connection
                  ids_lane = lanes.get_ids()
                  has_access = np.zeros(np.max(ids_lane)+1, dtype=np.bool)
                  # this is quite slow, because get_accesslevel is slow
                  # TODO: substitute by a simpler accesslevel checker
                  has_access[ids_lane] = lanes.get_accesslevel_lanes(ids_lane, id_mode) > -1
  
                  ids_fromlane_all = connections.ids_fromlane.get_value()[inds_con]
                  ids_tolane_all = connections.ids_tolane.get_value()[inds_con]
                  # if 1:# debug
                  #    id_edge_test = 48891
                  #    edges = self
                  #
                  #    for id_fromlane, id_tolane, has_access_fromlane, has_access_tolane in zip(ids_fromlane_all, ids_tolane_all, has_access[ids_fromlane_all], has_access[ids_tolane_all]):
                  #        is_valid = has_access_fromlane & has_access_tolane
                  #        print '    id_fromedge',edges.ids_sumo[lanes.ids_edge[id_fromlane]],has_access_fromlane,'id_toedge',edges.ids_sumo[lanes.ids_edge[id_tolane]],has_access_tolane,'valid',is_valid
  
                  inds_valid = np.flatnonzero(np.logical_and(has_access[ids_fromlane_all], has_access[ids_tolane_all]))
                  ids_fromedge = lanes.ids_edge[ids_fromlane_all[inds_valid]]
                  ids_toedge = lanes.ids_edge[ids_tolane_all[inds_valid]]
  
              for id_edge in self.get_ids():
                  fstar[id_edge] = set()
  
              for id_fromedge, id_toedge in zip(ids_fromedge, ids_toedge):
                  fstar[id_fromedge].add(id_toedge)
  
          if is_return_lists | is_return_arrays:
              for id_edge in self.get_ids():
                  ids_toedges = list(fstar[id_edge])
                  if is_return_arrays:
                      fstar[id_edge] = np.array(ids_toedges, dtype=np.int32)
                  else:
                      fstar[id_edge] = ids_toedges
          # print '  fstar',fstar
          return fstar
function_tokens: def get_fstar ( self , is_return_lists = False , is_return_arrays = False , is_ignor_connections = False , id_mode = None ) : print 'get_fstar id_mode' , id_mode , 'is_return_lists' , is_return_lists , 'is_return_arrays' , is_return_arrays #ids_edge = self.get_ids() #fstar = np.array(np.zeros(np.max(ids_edge)+1, np.obj)) fstar = { } connections = self . parent . connections lanes = self . parent . lanes inds_con = connections . get_inds ( ) if is_ignor_connections : # here we ignore connections and look at the # outgoing edges of node database if 1 : # id_mode is None: # not even mode is checked ids_outgoing = self . parent . nodes . ids_outgoing ids = self . get_ids ( ) for id_edge , id_tonode in zip ( ids , self . ids_tonode [ ids ] ) : ids_edge_outgoing = ids_outgoing [ id_tonode ] if ids_edge_outgoing is not None : fstar [ id_edge ] = set ( ids_edge_outgoing ) else : fstar [ id_edge ] = set ( ) # else:# actually the get_times or get_distance method should eliminate not accessible edges # check also if id_mode has access at both ends of each connection # ids_lane = lanes.get_ids() # has_access = np.zeros(np.max(ids_lane)+1, dtype = np.bool) # ids_fromedge = list(set(lanes.ids_edge[ids_lane[lanes.get_accesslevel_lanes(ids_lane, id_mode) > -1]])) # for id_edge, id_tonode in zip(ids_fromedge,self.ids_tonode[ids_fromedge]): #    ids_edge_outgoing = ids_outgoing[id_tonode] #    if ids_edge_outgoing is not None: #        fstar[id_edge] = set() #        for id_edge in ids_edge_outgoing #            if #            fstar[id_edge].add(id_toedge) #    else: #        fstar[id_edge] = set() else : # here we check actual connections # this is important if correct turns are desired # for exampole in car routing if id_mode is None : # check connection but do not check accessibility ids_fromedge = lanes . ids_edge [ connections . ids_fromlane . get_value ( ) [ inds_con ] ] ids_toedge = lanes . ids_edge [ connections . ids_tolane . get_value ( ) [ inds_con ] ] else : # check also if id_mode has access at both ends of each connection ids_lane = lanes . get_ids ( ) has_access = np . zeros ( np . max ( ids_lane ) + 1 , dtype = np . bool ) # this is quite slow, because get_accesslevel is slow # TODO: substitute by a simpler accesslevel checker has_access [ ids_lane ] = lanes . get_accesslevel_lanes ( ids_lane , id_mode ) > - 1 ids_fromlane_all = connections . ids_fromlane . get_value ( ) [ inds_con ] ids_tolane_all = connections . ids_tolane . get_value ( ) [ inds_con ] # if 1:# debug #    id_edge_test = 48891 #    edges = self # #    for id_fromlane, id_tolane, has_access_fromlane, has_access_tolane in zip(ids_fromlane_all, ids_tolane_all, has_access[ids_fromlane_all], has_access[ids_tolane_all]): #        is_valid = has_access_fromlane & has_access_tolane #        print '    id_fromedge',edges.ids_sumo[lanes.ids_edge[id_fromlane]],has_access_fromlane,'id_toedge',edges.ids_sumo[lanes.ids_edge[id_tolane]],has_access_tolane,'valid',is_valid inds_valid = np . flatnonzero ( np . logical_and ( has_access [ ids_fromlane_all ] , has_access [ ids_tolane_all ] ) ) ids_fromedge = lanes . ids_edge [ ids_fromlane_all [ inds_valid ] ] ids_toedge = lanes . ids_edge [ ids_tolane_all [ inds_valid ] ] for id_edge in self . get_ids ( ) : fstar [ id_edge ] = set ( ) for id_fromedge , id_toedge in zip ( ids_fromedge , ids_toedge ) : fstar [ id_fromedge ] . add ( id_toedge ) if is_return_lists | is_return_arrays : for id_edge in self . get_ids ( ) : ids_toedges = list ( fstar [ id_edge ] ) if is_return_arrays : fstar [ id_edge ] = np . array ( ids_toedges , dtype = np . int32 ) else : fstar [ id_edge ] = ids_toedges # print '  fstar',fstar return fstar