source_waypoint
SourceWaypoint(source, end_wps)
¶
Bases: Waypoint
Class derived from Waypoint that contains extra information for any source waypoint (routing information to other cellboxes and any visited cellboxes)
Attributes:
| Name | Type | Description |
|---|---|---|
visited_nodes |
set |
|
routing_table |
dict |
Initializes a SourceWaypoint object from a Waypoint object
Args:
source(Waypoint): an object that encapsulates the latitude, longitude, name and cellbox_id information
end_wps (list
get_obj(node_indx, obj)
¶
Get the value of the objective function up to the specified node index Args: node_indx (str): the index along the path to calculate the value up to obj (str): the variable name corresponding to the objective function
Returns:
| Name | Type | Description |
|---|---|---|
obj_value |
float
|
the value of the objective function at the specified index along the route |
get_path_nodes(_id)
¶
Gets all nodes on the path from the source waypoint to the node at _id
is_all_cells_visited(cells)
¶
Check if all cells have been visited Args: cells (list): List of cellbox id's to check against Returns: True if all have been visited and False if not
is_all_visited()
¶
Check if all associated destination waypoints have been visited Returns: True if all have been visited and False if not
is_visited(indx)
¶
Check if the node with the given index has been visited Args: indx (int): the index of the node to check
update_routing_table(indx, routing_info)
¶
Updates the source waypoint's routing table for a particular node with the given routing info Args: indx (str): the index of the cell to update routing_info (RoutingInfo): the routing info to be added
visit(cellbox_indx)
¶
Marks the input cellbox as visited by adding its index to the set of visited nodes Args: cellbox_indx (str): the index of the visited cellbox