fastoad.models.performances.mission.mission_definition.mission_builder.mission_builder module
Mission generator.
- class fastoad.models.performances.mission.mission_definition.mission_builder.mission_builder.MissionBuilder(mission_definition: str | PathLike | MissionDefinition, *, propulsion: IPropulsion = None, reference_area: float = None, mission_name: str | None = None, variable_prefix: str = 'data:mission')[source]
Bases:
object
This class builds and computes a mission from a provided definition.
- Parameters:
mission_definition – a file path or MissionDefinition instance
propulsion – if not provided, the property
propulsion
must be set before callingbuild()
reference_area – if not provided, the property
reference_area
must be set before callingbuild()
mission_name – name of chosen mission, if already decided.
variable_prefix – prefix for auto-generated variable names.
- property definition: MissionDefinition
The definition of missions as provided in input file.
- property propulsion: IPropulsion
Propulsion model for performance computation.
- property mission_name
The mission name, in case it has been specified, or if it is unique in the file.
- property variable_prefix
The prefix for auto-generated variable names.
- build(inputs: Mapping | None = None, mission_name: str = None) Mission [source]
Builds the flight sequence from definition file.
- Parameters:
inputs – if provided, any input parameter that is a string which matches a key of inputs will be replaced by the corresponding value
mission_name – mission name (can be omitted if only one mission is defined or if
mission
has been defined)
- Returns:
- get_route_names(mission_name: str = None) List[str] [source]
- Parameters:
mission_name –
- Returns:
a list with names of all routes in the mission, in order.
- get_route_ranges(inputs: Mapping | None = None, mission_name: str = None) List[float] [source]
- Parameters:
inputs – if provided, any input parameter that is a string which matches a key of inputs will be replaced by the corresponding value
mission_name – mission name (can be omitted if only one mission is defined or if
mission
has been defined)
- Returns:
list of flight ranges for each element of the flight sequence that is a route
- get_reserve(flight_points: DataFrame, mission_name: str = None) float [source]
Computes the reserve fuel according to definition in mission input file.
- Parameters:
flight_points – the dataframe returned by compute_from() method of the instance returned by
build()
mission_name – mission name (can be omitted if only one mission is defined or if
mission
has been defined)
- Returns:
the reserve fuel mass in kg, or 0.0 if no reserve is defined.
- get_input_variables(mission_name=None) VariableList [source]
Identify variables for a defined mission.
- Parameters:
mission_name – mission name (can be omitted if only one mission is defined or if
mission
has been defined)- Returns:
a VariableList instance.
- get_unique_mission_name() str [source]
Provides mission name if only one mission is defined in mission file.
- Returns:
the mission name, if only one mission is defined
- Raises:
FastMissionFileMissingMissionNameError – if several missions are defined in mission file
- get_input_weight_variable_name(mission_name: str = None) str | None [source]
Search the mission structure for a segment that has a target absolute mass defined and returns the associated variable name.
- Parameters:
mission_name – mission name (can be omitted if only one mission is defined or if
mission
has been defined)- Returns:
The variable name, or None if no target mass found.