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_sim_num_actions() int#
Get the number of actions taken by the simulation (config value).
- Return type:
- 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:
- 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
Noneif 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.
- load_in_carousel(tray_to_insert: Tray, destination: EnumContainer, load_in_buffer: bool)#
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) –
Trueto 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) –
Trueto generate a tray in the bay,Falseotherwise.gen_buffer (bool) –
Trueto generate a tray in the buffer,Falseotherwise.time (int or None) – the maximum time of the simulation, otherwise
Noneto 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.