Types#

Abstract simulation type class#

class automatic_warehouse.simulation.simulation.Simulation#

The abstract simulation class.

get_environment() Environment#

Get the environment (see SimPy environment) of SimPy.

Return type:

simpy.Environment

Returns:

the environment of SimPy.

get_events_to_simulate() list[str]#

Get the list of events to simulate.

Return type:

list[str]

Returns:

a list of events to simulate.

get_sim_num_actions() int#

Get the number of actions taken by the simulation (config value).

Return type:

int

Returns:

the number of actions taken by the simulation.

get_sim_time() int | None#

The maximum time of the simulation (config value).

Return type:

int | None

Returns:

time of the simulation or None if it isn’t specified.

get_store_history() Store#

Get the SimPy store (see SimPy store) of the simulation.

It is used to store the simulation history.

Return type:

simpy.Store

Returns:

the store of the simulation history.

get_store_history_dataframe() DataFrame#

Get the SimPy store of the simulation as DataFrame object.

Return type:

pandas.DataFrame

Returns:

the store of the simulation history as pandas DataFrame

abstract run_simulation()#

Run a new simulation.

Note: the simulation will create a new sequence of actions.

Warehouse simulation type#

class automatic_warehouse.simulation.simulation_type.warehouse_simulation.WarehouseSimulation(warehouse: Warehouse)#

The warehouse simulation class.

Parameters:

warehouse (Warehouse) – the warehouse used to perform the simulation.

allocate_best_pos(tray: Tray)#

Simulation method used to allocate the best position of the tray in the warehouse.

Parameters:

tray (Tray) – tray to allocate.

get_res_bay() Resource#

Get the resource of the bay. It can be thought of as a resource lock (see SimPy resource).

Return type:

simpy.Resource

Returns:

the resource of the bay.

get_res_buffer() Resource#

Get the resource of the buffer. It can be thought of as a resource lock (see SimPy resource).

Return type:

simpy.Resource

Returns:

the resource of the buffer.

get_warehouse() Warehouse#

Get the Warehouse used to perform the simulation.

Return type:

Warehouse

Returns:

the Warehouse used to perform the simulation.

go_to_bay()#

Simulation method used to go to bay.

go_to_buffer()#

Simulation method used to go to buffer.

horiz_move(offset_x: int) float#

Search in the column/carousel where is the tray.

Return type:

float | None

Parameters:

offset_x (int) – offset of the tray to search.

Returns:

the time estimated or None if not found.

Raises:

ValueError – if the offset is not valid.

load(tray: Tray, destination: EnumContainer)#

Simulation method used to load the tray into the warehouse.

Parameters:
  • tray (Tray) – tray to load.

  • destination (EnumContainer) – destination of the tray.

Raises:

ValueError – if the offset of the tray is not equal to any column in the warehouse.

Simulation method used to load the carousel into the warehouse.

Parameters:
  • tray_to_insert (Tray) – tray that will be inserted into the warehouse.

  • destination (EnumContainer) – destination of the tray.

  • load_in_buffer (bool) – True to load the carousel into the buffer, otherwise into the bay.

loading_buffer_and_remove()#

Vertical movement of carousel loading from buffer to bay.

new_simulation(num_actions: int, num_gen_trays: int, num_gen_materials: int, gen_bay: bool, gen_buffer: bool, time: int = None)#

Run a new simulation using custom parameters.

Parameters:
  • num_actions (int) – number of actions to simulate.

  • num_gen_trays (int) – number of trays to generate in the warehouse.

  • num_gen_materials (int) – number of materials to generate in the warehouse.

  • gen_bay (bool) – True to generate a tray in the bay, False otherwise.

  • gen_buffer (bool) – True to generate a tray in the buffer, False otherwise.

  • time (int or None) – the maximum time of the simulation, otherwise None to remove the limit.

reach_tray_height(tray: Tray)#

Simulation method used to reach the height of the tray in the warehouse.

Parameters:

tray (Tray) – tray to reach.

run_simulation()#

Run a simulation.

unload(tray: Tray, rmv_from_cols: bool)#

Simulation method used to unload a tray from the carousel or from the columns.

Parameters:
  • tray (Tray) – tray to unload.

  • rmv_from_cols (bool) – True to unload the tray from the columns, otherwise unload from the carousel.

vertical_move(start_pos: int, end_pos: int) float#

A simple vertical movement of the floor or the tray inside the carousel (buffer to bay).

Return type:

float

Parameters:
  • start_pos (int) – starting position.

  • end_pos (int) – ending position.

Returns:

distance travelled divided by speed per second.