segment
Segment(start_wp, end_wp)
¶
Class that represents a portion of the route from a start to an end waypoint and encapsulates metrics related to this portion (e.g. distance, travel time, fuel)
Attributes:
start_wp (Waypoint): a waypoint object that represents the start location of this segment
end_wp (Waypoint): a waypoint object that represents the end location of this segment
distance (float): the distance between segment's start and end waypoints
traveltime (float): the time needed to travel from a segment's start to its end waypoint
fuel (float): the amount of fuel needed to travel from a segment's start to its end waypoint
battery (float): the amount of battery power needed to travel from a segment's start to its end waypoint
get_battery()
¶
Returning the segment battery consumption
get_distance()
¶
Returning the segment distance
get_fuel()
¶
Returning the segment fuel
get_points()
¶
Returning the points of the segments
get_travel_time()
¶
Returning the segment travel time
get_variable(variable)
¶
Returns the value of the specified variable for the segment Args: variable (str): the name of the variable to get the value of
Returns:
| Name | Type | Description |
|---|---|---|
val |
the value of the input variable |
set_battery(battery)
¶
Setting the segment battery consumption
set_distance(distance)
¶
Setting the segment distance
set_fuel(fuel)
¶
Setting the segment fuel
set_travel_time(tt)
¶
Setting the segment travel time