Warehouse#

class automatic_warehouse.warehouse.Warehouse#

Representation of the real warehouse. It contains all the information about the warehouse and the methods for calculating the internal movements of its components.

add_column(col: Column)#

Add a column to the warehouse column container.

Parameters:

col (Column) – the column to add.

Raises:

ValueError – if the column x_offset is not unique.

choice_random_tray() Tray#

Pick a random tray from the columns in the warehouse.

Return type:

Tray

Returns:

the random tray chosen from the columns in the warehouse.

Raises:

AssertionError – if each column doesn’t have a tray.

cleanup()#

Cleanup the warehouse (columns and carousel). Each Entry will be EmptyEntry.

Cleanup the carousel of the warehouse. Each Entry will be EmptyEntry.

cleanup_columns()#

Cleanup the columns of the warehouse. Each Entry will be EmptyEntry.

gen_rand(gen_bay: bool, gen_buffer: bool, num_trays: int, num_materials: int)#

Generate a random warehouse. Be careful! Every entry in the warehouse will be reset!

Parameters:
  • gen_bay (bool) – True generate a Tray in the bay, otherwise generate an EmptyEntry.

  • gen_buffer (bool) – True generate a Tray in the buffer, otherwise generate an EmptyEntry.

  • num_trays (int) – numbers of trays.

  • num_materials (int) – numbers of materials.

Get the carousel of the warehouse.

Return type:

Carousel

Returns:

the carousel of the warehouse.

get_cols_container() list[Column]#

Get all the columns of the warehouse.

Return type:

list[Column]

Returns:

the columns of the warehouse.

get_column(index: int) Column#

Get the (i-)column of the warehouse.

Return type:

Column

Parameters:

index (int) – the index of the column.

Returns:

get the column of the warehouse with the given index.

Raises:

IndexError – list index out of range.

get_def_space() int#

Get the height (distance) between two trays (config value).

Return type:

int

Returns:

the height (distance) between two trays (config value).

get_height() int#

Get the height of the warehouse.

Return type:

int

Returns:

the height of the warehouse.

get_max_height_material() int#

Get the maximum height of a Material. It’s the value calculated by dividing the buffer height by the return value of get_def_space method.

Return type:

int

Returns:

the maximum height of a material.

get_minimum_offset() MinimumOffsetReturns#

Calculate the minimum offset between the columns of the warehouse.

Return type:

MinimumOffsetReturns

Returns:

the index of the list and the offset.

get_num_columns() int#

Get the number of columns in the warehouse.

Return type:

int

Returns:

the number of columns in the warehouse.

get_num_trays() int#

Get the number of trays in the warehouse.

Return type:

int

Returns:

the number of trays in the warehouse.

get_pos_y_floor() int#

Get the y-position of the floor. It is used by the simulator to calculate the time it takes to move between columns and up and down.

Return type:

int

Returns:

the y-position of the floor.

get_speed_per_sec() int#

Get the speed of the platform (config value). It’s used by the simulator to calculate the time it takes to move between columns and up and down.

Return type:

int

Returns:

the speed of the platform (config value).

is_full() bool#

Verify if there is a space inside the warehouse.

Return type:

bool

Returns:

True if there is a space inside the warehouse, otherwise False.

pop_column(index: int = -1) Column#

Remove a Column from the column container in the warehouse. If no index is given, the last column of the container is removed by default.

Return type:

Column

Parameters:

index (int) – the index of the column to pop.

Raises:

IndexError – if the index is out of range or the column is empty.

Returns:

the column of the warehouse removed.

remove_column(value: Column)#

Remove a column from the container of the warehouse. If two or more values are the same, remove the first one found.

Parameters:

value (Column) – the column to remove.

Raises:

ValueError – if the column is not in a container.

set_pos_y_floor(pos: int)#

Set the y-position of the floor.

Parameters:

pos – new position of the floor.

Raises:

AssertionError – if the pos parameter is not greater than or equal to zero.

class automatic_warehouse.warehouse.MinimumOffsetReturns(index: int, offset: int)#

Python Dataclass - Values returned by the Warehouse.get_minimum_offset method.

index: int#

Index of the minimum offset found.

offset: int#

Offset found.