- class airlift.envs.agents.EnvAgent(start_airport, routemap=None, plane_type=None, max_loaded_weight=None, malfunction_generator=None)
Represents an individual agent (airplane) in an environment.
- property current_cargo_weight: float
Gets the total current cargo weight on an airplane
current cargo weight on an airplane
- load_cargo(cargo_to_load: Collection[airlift.envs.cargo.Cargo], elapsed_steps, warnings: List[str])
Checks to make sure airplane can load cargo and loads the cargo. Also checks to ensure that cargo is assigned to that airplane
cargo_to_load – A list that contains the Cargo to load
warnings – List of warnings issued by the environment. Ex: If an action is given to an unavailable route
- step(action, cargo_by_id: Dict[int, airlift.envs.cargo.Cargo], elapsed_time) Tuple[dict, List[str]]
Updates the agent’s state.
action – A dictionary of actions that contains ‘process’, ‘cargo_to_load’, ‘cargo_to_unload’ and ‘destination’
cargo_by_id – Dictionary containing the Cargo and CargoID
Tuple containing updated_action and warnings. The updated action contains any updated events to the action dict that occurred during the time step. The warnings list contains any issues with the current actions given.
- try_to_process(cargo_to_load: Collection[airlift.envs.cargo.Cargo], cargo_to_unload: Collection[airlift.envs.cargo.Cargo], elapsed_time, warnings: List[str]) bool
Checks to see if the current airport has capacity. If there is capacity the agent will go into the PROCESSING state and the processing timer will be updated. The agent is added to the airports capacity.
cargo_to_load – A set that contains cargo to load
cargo_to_unload – A set that contains cargo to unload
Boolean, if successfully load or unloaded cargo
- unload_cargo(cargo_to_unload: Collection[airlift.envs.cargo.Cargo], warnings: List[str])
Does a check to ensure the correct cargo is being unloaded and removes the cargo from the airplane.
cargo_to_unload – A list that contains the Cargo to unload
- class airlift.envs.agents.PlaneState(value)
Enumeration that defines the states an agent can be in
Waiting - airplane is waiting to process at an airport
Processing - airplane is refueling and loading/unloading cargo
Moving - Airplane is in flight to its destination
Ready for takeoff - airplane is ready for takeoff once it is given a destination