The repository is for thesis code that I have made. The topic is 'An Artificial Neural Network-Based Method for the Container Relocation Problem'. Feel free to view the file 'Thesis' to check my thesis in this archive.
There are 3 parts of code in my thesis. First part is generating dataset for training Artificial Neural Network (ANN). Second part is the code of ANN. Including forward propagation, back propagation, and other optimizers for training ANN. I don't use testing set to evaluate the performance of ANN. Thus, the last part is verifying the performance of ANN.
There is a problem called Container Relocation Problem (CRP) when reshuffling containers. Assume there are couples of container on the bay. Each container is labeled with an integer. The crane needs to move out(retrieve) container by the order of integer. Containers are stacked on the bay. The crane only move container on the top of each column. If container 1 is under container 2, the crane has to move container 2 to other column that the crane can move container 1. The crane can move container from column to column which is called 'reshuffle'. The objective of CRP is minimizing the total moves (reshuffle + retrieve) that the crane empty the bay. Each container needs to be retrieved only once. Thus, the problem can be for minimizing the total reshuffles.
There are many heuristics helping to reduce total reshuffles. I pick three heuristics in my study: 'Look-ahead N Heuristic' and 'Min-Max Heuristic' and another one is 'Better-of-Two' which is choosing better reshuffle of Look-ahead N and Min-Max to form a new solution. The three heuristics use different ways to reshuffle containers. I want to make ANN learn the logic of the three heuristics. Min-Max and Look-ahead N heuristics are from literatures. The obejcetive of creating 'Better-of-Two' heuristic is to see whether the ANN-based can surpass the performance of Min-Max and Look-ahead N heuristics after learning the advantage of two heuristics. It's also the objecetive of my thesis.
With more containers on the bay, it needs more reshuffles to empty the bay. I turn every reshuffle as a data. The dataset is very large. It may not easy for an ANN model to learn all reshuffles that three heuristics do. Thus, I split the dataset accroding four features on the bay: present container on the bay, number of deadlocks, row of the bay and column of the bay. Here is the new term 'deadlock'. If container 2 is above container 1, container 2 is a 'deadlock'. The number of deadlock is calculated on the 'target container' which is the highest retrieving order of present container in the bay.
After deciding the features of dataset, I apply an ANN-based system which includes many ANN models to train different features of dataset, respectively. After training these ANN models, I take the parameters from these ANN models to empty the container bay. The program use different parameters to reshuffle container according to the situation of the container bay. Because there are many ANN models, I think it is unable to test the performance of each ANN by applying testing set. Thus, I evaluate all ANN models by reshuffling containers and comparing with three heuristics to understand whether the ANN can learn the logic of three heuristics.
The archive 'Create-Dataset' is the code of generating input-data and output-data of each dataset for training ANN. The integer of the file name shows the features of dataset: row_column_present-container-in-the-bay_deadlock. For example, 4_6_3_2 is the size of 4-row and 6-column container bay, 3 containers in the bay now and 1 deadlock. 4_6_4_4 is the size of 4-row and 6-column container bay, 4 containers in the bay now and 3 deadlocks. There is a sample code in the archive showing the idea of generating input-data and output-data.
The archive 'Artificial-Neural-Network' shows the code of each ANN. The integer of file name has the same meaning of last paragraph. ANN train these different datasets, respectively. There is a sample code in the 'Artificial-Neural-Network' explaining the concept of the code.
The archive 'Verify-performance' is the code of using the ANN-based system to reshuffle containers and compare the performance with three different heuristics. There is sample code explaining how the code evaluate the performance of the ANN-based system.