CombineCropRowsFromConnections

Qualified name: crop_row_connector.combine_crop_rows_from_connections.CombineCropRowsFromConnections

class CombineCropRowsFromConnections[source]

Bases: object

Combine crop rows from connections.

Methods

add_connection

Add connection between rows.

add_unused_rows

Add the unused rows to the connected crop rows.

check_dublicates

Check for duplicates in the connected crop rows.

connect_crop_row_to_existing_crop_row

Connect a crop row to an existing crop row.

connect_crop_rows_of_2_tiles

Connect the crop rows of 2 tiles based on the connections.

connect_two_existing_full_crop_rows

Connect two existing full crop rows.

move_row_and_adjust_indexes

Move rows together and adjust the indexes of all rows with a larger index.

sort_connected_crop_rows

Sort the connected crop rows based on the tile number and then the row number.

add_connection(tile_number, row, index)[source]

Add connection between rows.

Parameters:
Return type:

None

add_unused_rows(tiles)[source]

Add the unused rows to the connected crop rows.

Parameters:

tiles (dict[int, Tile])

Return type:

None

check_dublicates()[source]

Check for duplicates in the connected crop rows.

Return type:

None

connect_crop_row_to_existing_crop_row(new_tile_number, new_row, existing_tile_number, existing_row, index)[source]

Connect a crop row to an existing crop row.

Parameters:
Return type:

None

connect_crop_rows_of_2_tiles(tile_1_number, tile_2_number, connections)[source]

Connect the crop rows of 2 tiles based on the connections. The rows are connected to existing rows if any, otherwise new rows are added.

Parameters:
  • connections (ndarray) – Connection matrix from Hungarian algorithm

  • tile_1_number (int)

  • tile_2_number (int)

Return type:

None

connect_two_existing_full_crop_rows(index_row_1, tile_number_1, row_1, index_row_2, tile_number_2, row_2)[source]

Connect two existing full crop rows.

Parameters:
Return type:

None

move_row_and_adjust_indexes(smallest_row_index, largest_row_index)[source]

Move rows together and adjust the indexes of all rows with a larger index.

Parameters:
Return type:

None

sort_connected_crop_rows()[source]

Sort the connected crop rows based on the tile number and then the row number.

Return type:

None