Containers#

Containers abstract class#

class automatic_warehouse.status_warehouse.container.tray_container.TrayContainer(height: int, offset_x: int, width: int, length: int, warehouse)#

A superclass representing the tray container of a Column or Carousel.

Parameters:
  • height (int) – height of the container.

  • offset_x (int) – x offset of the container.

  • width (int) – width of the container.

  • width – length of the container.

  • warehouse (Warehouse) – warehouse where the container is stored.

create_new_space(element: EmptyEntry | TrayEntry)#

Create a new space inside the container.

Parameters:

element (EmptyEntry | TrayEntry) – entry of the new space to be created.

get_container() list[TrayEntry | EmptyEntry]#

Get the full list of entries for the container in the warehouse.

Return type:

list[TrayEntry | EmptyEntry]

Returns:

the full list of entries for the container in the warehouse.

get_def_space() int#

Get the default height space of the container.

Return type:

int

Returns:

the default height space of the container.

get_entries_occupied() list[TrayEntry]#

Get every TrayEntry in the container.

Return type:

list[TrayEntry]

Returns:

a list of TrayEntry in the container.

get_height_container() int#

Get the height of the container.

Return type:

int

Returns:

the height of the container.

get_height_warehouse() int#

Get the height of the warehouse.

Return type:

int

Returns:

the height of the warehouse.

get_length() int#

Get the length of the container.

Return type:

int

Returns:

the length of the container.

get_num_entries() int#

Get the number of entries (get_height_container // get_def_space).

Return type:

int

Returns:

the number of entries.

abstract get_num_entries_free() int#

Get how many seats are available.

Return type:

int

Returns:

how many seats are available.

get_num_entries_occupied() int#

Get how many entries occupied there are.

Return type:

int

Returns:

how many entries occupied there are.

get_num_materials() int#

Get how many materials there are.

Return type:

int

Returns:

how many materials there are.

get_num_trays() int#

Get how many trays there are in the container.

Return type:

int

Returns:

how many trays there are in the container.

get_offset_x() int#

Get the x offset of the container.

Return type:

int

Returns:

the x offset of the container.

get_trays() list[Tray]#

Get every Tray in the container.

Return type:

list[Tray]

Returns:

a list of Trays in the container.

get_warehouse()#

Get the warehouse where the container is stored.

Return type:

Warehouse

Returns:

the warehouse where the container is stored.

get_width() int#

Get the width of the container.

Return type:

int

Returns:

the width of the container.

abstract is_empty() bool#

Check if the container is empty.

Return type:

bool

Returns:

True if the container is empty, False otherwise.

abstract is_full() bool#

Check if the container is full.

Return type:

bool

Returns:

True if the container is full, False otherwise.

reset_container()#

Clean up the container using EmptyEntry instances.

set_warehouse(new_warehouse)#

Set a new warehouse where the container is stored.

Parameters:

new_warehouse (Warehouse) – a new warehouse where the container is stored.

class automatic_warehouse.status_warehouse.container.enum_container.EnumContainer(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)#

Enumerate of the containers implemented.

Carousel#

class automatic_warehouse.status_warehouse.container.carousel.Carousel(info: CarouselConfiguration, warehouse)#

The carousel represents the set of bay and the buffer (tray under the bay).

Parameters:
  • info (CarouselConfiguration) – class containing information about the carousel (config).

  • warehouse (Warehouse) – the warehouse where the carousel is located.

add_tray(tray: Tray)#

Add a tray in the buffer area or show as an output (bay).

Parameters:

tray (Tray) – to show or to save.

Raises:
  • RuntimeError – if the tray already exists.

  • ValueError – if the tray is longer or wider that the carousel.

get_bay() int#

Get the height of the bay of the carousel.

Return type:

int

Returns:

the height of the bay of the carousel.

get_bay_entry() TrayEntry | EmptyEntry#

Get the bay entry or an empty entry.

Return type:

TrayEntry | EmptyEntry

Returns:

the bay entry or an empty entry.

get_bay_tray() Tray#

Get the bay tray.

Return type:

Tray

Returns:

the Tray of the bay.

Raises:

AttributeError – when the bay is empty and there is no tray.

get_buffer() int#

Get the height of the buffer of the carousel.

Return type:

int

Returns:

the height of the buffer of the carousel.

get_buffer_entry() TrayEntry | EmptyEntry#

Get the buffer entry or an empty entry.

Return type:

TrayEntry | EmptyEntry

Returns:

the buffer entry or an empty entry.

get_buffer_tray() Tray#

Get the buffer entry or an empty entry.

Return type:

Tray

Returns:

the buffer entry or an empty entry.

Raises:

AttributeError – when the buffer is empty and there is no tray.

get_hole() int#

Get the height of the hole.

The hole is the height from the bay to the start of the column, it is the space where a person can place a material inside the warehouse.

Return type:

int

Returns:

the height of the hole.

get_num_entries_free() int#

Get how many seats are available.

Return type:

int

Returns:

how many seats are available.

get_num_trays() int#

Get how many trays there are.

Return type:

int

Returns:

the number of trays there are.

is_bay_full() bool#

Check if the bay is full.

Return type:

bool

Returns:

True if is full, False otherwise.

is_buffer_full() bool#

Check if the buffer is full.

Return type:

bool

Returns:

True if is full, False otherwise.

is_empty() bool#

Check if the container is empty.

Return type:

bool

Returns:

True if the container is empty, False otherwise.

is_full() bool#

Check if the container is full.

Return type:

bool

Returns:

True if the container is full, False otherwise.

remove_tray(tray: Tray) bool#

Remove a tray.

Return type:

bool

Parameters:

tray (Tray) – the tray to remove.

Returns:

True if the tray was removed, False otherwise.

Column#

class automatic_warehouse.status_warehouse.container.column.Column(info: ColumnConfiguration, warehouse)#

The column is a simple column of the warehouse. It can’t be where there is the bay and the buffer.

It is thought to store the trays.

Parameters:
add_tray(tray: Tray, index: int = 0)#

Add a tray to the column.

Parameters:
  • tray (Tray) – tray to be added.

  • index (int) – index of the entry inside the column where to add the tray.

Raises:

ValueError – if the tray is longer or wider that the column.

gen_materials_and_trays(num_trays: int, num_materials: int) GenMaterialsAndTraysReturns#

Generate random trays and materials.

Return type:

GenMaterialsAndTraysReturns

Parameters:
  • num_trays (int) – number of trays to create in the warehouse

  • num_materials (int) – number of materials to create in the trays

Returns:

a dataclass where we can find the trays_inserted and the materials_inserted

get_height_last_position() int#

Get the height of the last position.

Return type:

int

Returns:

the height of the last position.

get_num_entries_free() int#

Get how many seats are available.

Return type:

int

Returns:

how many seats are available.

is_empty() bool#

Check if the container is empty.

Return type:

bool

Returns:

True if the container is empty, False otherwise.

is_full() bool#

Check if the container is full.

Return type:

bool

Returns:

True if the container is full, False otherwise.

last_position_is_occupied() bool#

Check if the last position is occupied.

Return type:

bool

Returns:

True if the last position is occupied, False otherwise.

remove_tray(tray: Tray) bool#

Remove a tray from the column.

Return type:

bool

Parameters:

tray (Tray) – the tray to be removed.

Returns:

True if the tray was removed, False otherwise.

class automatic_warehouse.status_warehouse.container.column.GenMaterialsAndTraysReturns(trays_inserted: int, materials_inserted: int)#

Python Dataclass - Values returned by the gen_materials_and_trays method.

materials_inserted: int#

The number of materials inserted.

trays_inserted: int#

The number of trays inserted.