Loading Bay

Last updated on 22nd April 2024

Introduction

The LoadingBay class provides the user with a useful structure for representing a loading docks (both inbound & outbound) with a transport queue that can hole TransportMessage messages and can be initialized with a capacity.

Users can add as many loading bays as they require to represent different types of docks, whether they be inbound docks, outbound docks, etc.

Loading Bay Class

The LoadingBay class contains 3 fields:

int capacity;
Map<Long, TransportMessage> transportQueue;
Map<Integer, TransportMessage> loadingDocks;

The capacity parameter is used to initialize the size of the loadingDock creating a loadingDock Map of size capacity.

The 'transportQueue' can either be initialized as an empty Map or initialized with a starting set of TransportMessage messages for creating an initial state of the system.

A LoadingBay can be initialized using two constructors seen below:

new LoadingBay(int capacity)
        
new LoadingBay(int capacity, List<TransportMessage> initialTransportQueue)

When creating your LoadingBay classes in your Facility agent, custom logic can be implemented for how TransportMessage priority is handled. An example can be found in the sample code provided.