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: Union[str, MissionDefinition], *, propulsion: Optional[IPropulsion] = None, reference_area: Optional[float] = None)[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 calling build()

  • reference_area – if not provided, the property reference_area must be set before calling build()

property definition: MissionDefinition

The mission definition instance.

If it is set as a file path, then the matching file will be read and interpreted.

property propulsion: IPropulsion

Propulsion model for performance computation.

property reference_area: float

Reference area for aerodynamic polar.

build(inputs: Optional[Mapping] = None, mission_name: Optional[str] = None) 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: 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) VariableList[source]

Identify variables for a defined mission.

Parameters

mission_name – mission name (can be omitted if only one mission is 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) Optional[str][source]

Search the mission structure for a segment that has a target absolute mass defined and returns the associated variable name.

Parameters

mission_name

Returns

The variable name, or None if no target mass found.

get_mission_start_mass_input(mission_name: str) Optional[str][source]
Parameters

mission_name

Returns

Target mass variable of first segment, if any.

get_mission_part_names(mission_name: str) List[str][source]
Parameters

mission_name

Returns

list of names of parts (phase or route) for specified mission.