The transformation of traditional vehicles in ports to autonomous ones is one of the trends that is observed to handle the increasing volumes of containers at terminals, which in some case are reaching their operational capacity. The LOGIMATIC project aims to fully automate port operations with the use of autonomous straddle carriers and to apply this approach to the 6th pier of the Port of Thessaloniki. To achieve such an objective there is the need to design and develop an algorithm that will have the following properties: optimize the number of straddle carriers that will be allocated, minimize the distance that they will cover, assure that collision avoidance is incorporated in the design and finally provide the necessary metrics to allow port authorities to compare the new paradigm with the existing system. The developed algorithm was implemented in Python and integrated into the Terminal Operating System of the port and constitutes a complete solution for small-medium sized ports. The algorithm serves also as a simulation model with which a wide variety of scenarios can be tested; for example, vary the crane productivity, introduce conditions of congestion to check the scheduling and movement of the automated straddle carriers under extreme conditions and finally, test the effectiveness of policies that could increase the efficiency of port operations. The following figure illustrates an example of such a test.