fastoad.models.performances.mission.mission_definition.mission_builder module¶
Mission generator.
-
class
fastoad.models.performances.mission.mission_definition.mission_builder.
MissionBuilder
(mission_definition: Union[str, fastoad.models.performances.mission.mission_definition.schema.MissionDefinition], *, propulsion: Optional[fastoad.model_base.propulsion.IPropulsion] = None, reference_area: Optional[float] = None)[source]¶ Bases:
object
This class builds and computes a mission from a provided definition.
- Parameters
mission_definition – as 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()
-
property
definition
¶ The mission definition instance.
If it is set as a file path, then the matching file will be read and interpreted.
-
property
propulsion
¶ Propulsion model for performance computation.
-
property
reference_area
¶ Reference area for aerodynamic polar.
-
build
(inputs: Optional[Mapping] = None, mission_name: Optional[str] = None) → fastoad.models.performances.mission.base.FlightSequence[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)
- Returns
-
get_route_ranges
(inputs: Optional[Mapping] = None, mission_name: Optional[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)
- Returns
list of flight ranges for each element of the flight sequence that is a route
-
get_reserve
(flight_points: pandas.core.frame.DataFrame, mission_name: Optional[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)
- Returns
the reserve fuel mass in kg, or 0.0 if no reserve is defined.
-
get_input_variables
(mission_name=None) → Dict[str, str][source]¶ Identify variables for a defined mission.
- Parameters
mission_name – mission name (can be omitted if only one mission is defined)
- Returns
a dict where key, values are names, units.
-
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