Fleet

Bases: Edge

Fleet class representing an AGV (Automated Guided Vehicle) or a group of transporters. Inherits from the Edge class. This fleet can have a single input edge and a single output edge.

Attributes:
  • state (str) –

    The current state of the fleet.

  • capacity (int) –

    The capacity of the fleet's internal storage.

  • delay ((int, float)) –

    Delay after which fleet activates to move items incase the target capacity is not reached. It Can be

    • int or float: Used as a constant delay.
  • transit_delay ((int, float)) –

    time to move the items after which the item becomes available (can be a constant, generator, or callable)

Behavior: The Fleet is a type of edge represents components that moves multiple items simulataneaously between nodes. User can specify a parameter capacity to specify how many items can be moved at once. Incoming edges can use reserve_get and reserve_put calls on the store in the fleet to reserve an item or space and after yielding the requests, an item can be put and obtained by using put and get methods.

Raises:
  • AssertionError

    If the fleet does not have at least one source node or one destination node.

Output performance metrics

The key performance metrics of the fleet edge are captured in the stats attribute (dict) during a simulation run.

last_state_change_time                      : Time when the state was last changed.
time_averaged_num_of_items_in_fleet        : Time-averaged number of items available in the fleet.
total_time_spent_in_states                  : Dictionary with total time spent in each state.

can_put()

Check if the fleet can accept an item.

Returns

bool True if the fleet can accept an item, False otherwise.

can_get()

Check if the fleet can accept an item.

Returns

bool True if the fleet can give an item, False otherwise.

get(event)

Get an item from the fleet.

Parameters

event : simpy.Event The event that was reserved for getting an item.

Returns

item : object The item retrieved from the fleet.

reserve_get_cancel(event)

Cancel a reserved get event.

Parameters

event : simpy.Event The event that was reserved for getting an item.

reserve_put_cancel(event)

Cancel a reserved put event.

Parameters

event : simpy.Event The event that was reserved for putting an item.