parameters: (self, id_edge, id_mode, length_min=15.0, priority_max=8, n_freelanes_min=1)
return_statement: return -1
docstring: Check if edge can have on-road parking.
          Returns lane ID if parking is possible and -1 otherwise.
docstring_summary: Check if edge can have on-road parking.
          Returns lane ID if parking is possible and -1 otherwise.
docstring_tokens: Check if edge can have on - road parking . Returns lane ID if parking is possible and - 1 otherwise .
function: def get_parkinglane_from_edge(self, id_edge, id_mode, length_min=15.0, priority_max=8, n_freelanes_min=1):
          """
          Check if edge can have on-road parking.
          Returns lane ID if parking is possible and -1 otherwise.
          """
          edges = self.edges.get_value()
          lanes = self.lanes.get_value()
          id_mode_ped = edges.parent.modes.get_id_mode('pedestrian')
          # check access
          ids_lane = edges.ids_lanes[id_edge]
          edgelength = edges.lengths[id_edge]
  
          if (len(ids_lane) >= 2):
              if (lanes.get_accesslevel([ids_lane[0]], id_mode_ped) > -1) & (lanes.get_accesslevel([ids_lane[1]], id_mode) > -1):
                  # check size
                  # laneindex =
                  # print 'get_parkinglane_from_edge',id_edge, id_mode,priority_max,length_min
                  # print '   check',(edges.priorities[id_edge]<=priority_max),(edges.lengths[id_edge]>length_min),(edges.widths_sidewalk[id_edge]>-1)
  
                  if (edges.priorities[id_edge] <= priority_max) & (edgelength > length_min) & (edges.widths_sidewalk[id_edge] > 0):
  
                      laneindex = 1
                      # print '  found',laneindex,edges.nums_lanes[id_edge]-laneindex > n_freelanes_min
                      if (len(ids_lane)-laneindex >= n_freelanes_min):
                          return ids_lane[laneindex]
                      else:
                          return -1
                  else:
                      return -1
              else:
                  return -1
  
          return -1
function_tokens: def get_parkinglane_from_edge ( self , id_edge , id_mode , length_min = 15.0 , priority_max = 8 , n_freelanes_min = 1 ) : edges = self . edges . get_value ( ) lanes = self . lanes . get_value ( ) id_mode_ped = edges . parent . modes . get_id_mode ( 'pedestrian' ) # check access ids_lane = edges . ids_lanes [ id_edge ] edgelength = edges . lengths [ id_edge ] if ( len ( ids_lane ) >= 2 ) : if ( lanes . get_accesslevel ( [ ids_lane [ 0 ] ] , id_mode_ped ) > - 1 ) & ( lanes . get_accesslevel ( [ ids_lane [ 1 ] ] , id_mode ) > - 1 ) : # check size # laneindex = # print 'get_parkinglane_from_edge',id_edge, id_mode,priority_max,length_min # print '   check',(edges.priorities[id_edge]<=priority_max),(edges.lengths[id_edge]>length_min),(edges.widths_sidewalk[id_edge]>-1) if ( edges . priorities [ id_edge ] <= priority_max ) & ( edgelength > length_min ) & ( edges . widths_sidewalk [ id_edge ] > 0 ) : laneindex = 1 # print '  found',laneindex,edges.nums_lanes[id_edge]-laneindex > n_freelanes_min if ( len ( ids_lane ) - laneindex >= n_freelanes_min ) : return ids_lane [ laneindex ] else : return - 1 else : return - 1 else : return - 1 return - 1