A Cloudware Architecture for Collaboration of Multiple AGVs in Indoor Logistics: Case Study in Fabric Manufacturing Enterprises

: In Industry 4.0 compatible workshops, the demand for Automated Guided Vehicles (AGVs) used in indoor logistics systems has increased remarkably. In these indoor logistics systems, it may be necessary to execute multiple transport tasks simultaneously using multiple AGVs. However, some challenges require special solutions for AGVs to be used in industrial autonomous transportation. These challenges can be addressed under four main headings: positioning, optimum path planning, collision avoidance and optimum task allocation. The solutions produced for these challenges may require special studies that vary depending on the type of tasks and the working environment in which AGVs are used. This study focuses on the problem of automated indoor logistics carried out in the simultaneous production of textile ﬁnishing enterprises. In the study, a centralized cloud system that enables multiple AGVs to work in collaboration has been developed. The ﬁnishing enterprise of a denim manufacturing factory was handled as a case study and modelling of mapping-planning processes was carried out using the developed cloud system. In the cloud system, RestFul APIs, for mapping the environment, and WebSocket methods, to track the locations of AGVs, have been developed. A collaboration module in harmony with the working model has been developed for AGVs to be used for fabric transportation. The collaboration module consists of task deﬁnition, battery management-optimization, selection of the most suitable batch trolleys (provides mobility of fabrics for the ﬁnishing mills), optimum task distribution and collision avoidance stages. In the collaboration module, all the ﬁnishing processes until the product arrives the delivery point are deﬁned as tasks. A task allocation algorithm has been developed for the optimum performance of these tasks. The multi-ﬁtness function that optimizes the total path of the AGVs, the elapsed time and the energy spent while performing the tasks have been determined. An assignment matrix based on K nearest neighbor (k-NN) and permutation possibilities was created for the optimal task allocation, and the most appropriate row was selected according to the optimal path totals of each row in the matrix. The D* Lite algorithm has been used to calculate the optimum path between AGVs and goals by avoiding static obstacles. By developing simulation software, the problem model was adapted and the operation of the cloud system was tested. Simulation results showed that the developed cloud system was successfully implemented. Although the developed cloud system has been applied as a case study in fabric ﬁnishing workshops with a complex structure, it can be used in di ﬀ erent sectors as its logistic processes are similar.


Introduction
With Industry 4.0 becoming widespread, the use of autonomous systems in manufacturing enterprises has become inevitable [1][2][3]. AGVs (Automated Guided Vehicles) that are frequently used in indoor autonomous transportation provide important advantages in performing tasks that are time-consuming, costly and risky for human health. In addition to features such as environmental perception, path planning, and behavior modelling, their adaptation to production environments compared to rail or wire guide tools is highly flexible and cost-effective [4].
In human-powered indoor logistics processes, transport tasks are assigned to any employee; however, this assignment is not based on the principles of optimizing important resources such as path, energy or time. These transport tasks can be multiple and need to be run simultaneously. Thus, for autonomous logistics, there is a need for multiple AGVs. For the multiple AGVs to work autonomously and simultaneously in collaboration, basic problems such as optimized multitasking allocation, path planning, collision avoidance, mapping, and positioning need to be solved. In traditional applications, collaboration is achieved through the principle of communicating with each other using the hardware and sensors owned by AGVs. As an alternative to traditional solutions, collaboration implemented with cloud architecture allows most of AGVs to be controlled by a central unit (cloud server). Thus, transactions that require high processing can be performed by the cloud server instead of AGVs. With a system designed in this way, multiple object control can be applied to multiple areas, even if they are in different locations.
One of the most important challenges for multiple AGVs to cooperate simultaneously is the multi-task allocation problem. The multi-task allocation has advantages such as solving complex tasks, high performance, reliability and low cost with simply designed robots [5]. In multi-task allocation, it is aimed to improve components such as cost, time, energy and security depending on parameters such as the number of goals, the priority of tasks and the position of obstacles. Multipurpose optimization approaches can be used to improve the multiple components. It is important to design this multi-purpose optimization in a form whereby tasks and other components are not independent of each other [6]. Many parameters such as the number of AGVs, their location, charge status, the weight of the load to be transported, the number of stations to be visited and the distances of these stations should be evaluated at the task allocation. Studies on multi-task allocation can be handled under two headings: exact solutions [7][8][9] and heuristic approach. Studies with exact solutions produce optimal results, but they do not work as fast as heuristic approaches [10]. Heuristic algorithms are frequently used to multi-task allocation such as particle swarm optimization [11][12][13][14][15][16], genetic algorithm [17][18][19][20][21], k-WTA [22], Hungarian method [23].
The multi-task allocation problem is related to the path planning problem. If the path planning step is to be performed after the task allocation step, this will affect the benefit of optimal task allocation [24]. The main purpose when assigning tasks is to minimize the total length of the paths travelled by all AGVs. When this is considered as a constraint, it turns out that path planning should also be made while assigning tasks. Path planning is calculated based on establishing a suitable path between a starting position and one or more goals. Among the studies in the field of path planning, in addition to traditional studies based on cell decomposition, potential field, and road map, there are also heuristic approaches [25][26][27][28][29]. Although heuristic approaches work much faster than other solution methods, they are not stable in achieving a globally optimum solution [30]. Algorithms such as A*, D*, Dijkstra, K nearest neighbor (k-NN), Genetic Algorithm, Artificial Potential Field, PSO, and their derivatives were used in the literature for path planning. In this study, the D* Lite algorithm is used in path planning. D* Lite implements D*'s strategy while looking for the most suitable path, but it works with a simple method and higher efficiency [31].
In this study, a cloud system was developed for the collaboration of AGVs used in indoor logistics. In the developed cloud system, a new method that provides optimum task allocation has been proposed. The method firstly calculates the optimum paths between AGVs and goals by avoiding static obstacles. Then, an assignment matrix based on permutation possibilities is created and the optimal combination of assignments is determined according to the minimum total path. Assignment combinations are divided into 2-dimensional pieces according to the nearest neighborhood principle to solve the problem of the increased complexity of permutation calculation in environments with many AGVs and goals. Since the computational complexity of these two-dimensional pieces of the matrix is low, the cost of the assignment is reduced and the processing speed is increased. In the selection of the most suitable assignment combinations, one-to-one assignment and battery levels of AGVs are determined as constraints. A safe area approach has been proposed to prevent the robots from colliding with each other. When another AGV enters this safe area, new local paths have been created dynamically.
The cloud system was developed by modelling the fabric finishing enterprise of Çalık Denim R&D Center within the scope of a university-industry cooperation project. Simulation software has been developed and assets within the enterprise are simulated in accordance with the real map. As a result of simulation experiments, it has been observed that the system works correctly and stably.
Related studies examined within the scope of the study are given in Section 2. In Section 3, the case study is introduced and the problem is described. In Section 4, materials and methods developed within the scope of the study are given. Simulation results and observations are explained in Section 5. In the Section 6, discussion and results are mentioned.

Related Works
Schillinger et al. [32] presented a framework that optimizes autonomous action behavior for a group of robots. In their study, it was stated that they allocated separable tasks to the existing robots in the most appropriate behavior, without requiring a clear representation of tasks or the calculation of all task execution costs. Turner et al. [33] focused on the problem of maximizing task allocation in time-limited scenarios of multi-robot systems. They claimed that with the PI-MaxAss (their proposed method for the solution of this problem), they effectively reduced costs by changing task assignments. They tested their method with simulation and stated that there was a noticeable increase in performance measured as the total number of assigned tasks. Du et al. [34] used Warshall-Floyd to search for the most convenient route between two random points in their application for textile workshops. By using the genetic particle swarm optimization algorithm (GA-PSO), they accelerated the convergence rate of the algorithm with the time-based particle iteration mechanism by creating the mathematical model of the path planning problem. Afrin et al. [35] proposed a cloud architecture for managing multiple robots, which are frequently used in the industry. With an Edge Cloud-based system, they focus on the solution of simultaneous production, energy consumption, and cost optimization problems. For the multitasking problem, they used the redesigned NSGA-II algorithm working on the cloud. Liu et al. [36] pointed out the impact of cloud computing capability on the management of multiple robots in their work. They enabled the management of multiple robots integrated into the cloud system developed by a task assignment algorithm based on reinforcement learning (RL). They showed the benefit of the method they proposed by comparing it with the Greedy Search algorithm. Chowdhury and Maier [37] have proposed a task allocation strategy based on parameters such as the robot's position, remaining energy, and task execution time. They have established this strategy based on data from a cloud system and neighboring robot. Yan et al. [38] stated that the basis of intelligent production environments is the integration of cloud computing and industrial robots. However, they considered the lack of flexible load sharing and excessive resource consumption of existing algorithms in these environments. In their study, they developed a cloud architecture for group learning and shared their results. Wang and Liu [39], stated that collaboration is achieved by interaction between robots instead of a central operator in many multi-robotic applications, and cloud robotic applications offer an alternative approach focused on central control. They stated that a resource distribution strategy is required for such a central application to use resources effectively, and they proposed the link quality matrix (LQM) method for this problem. They stated that this method performed better than the recent algorithms of resource allocation. Clark [40] presented a Probability Roadmap (PRM) motion planning algorithm based on Dynamic Robotic Networks, a multi-robot coordination platform that works with limited sensing and Electronics 2020, 9, 2023 4 of 24 communication between robots. According to their results, it is stated that the DRN platform shows that it works well even if the network becomes complex or broken. Solovey and Halperin [41] present a simple and natural extension of the multi-robot motion planning problem in which robots are divided into groups (colors), thus expressing that robots are interchangeable in each group. In the developed algorithm, there is a new approach wherein the k-color problem is reduced to a large number of discrete multiple robot motion planning problems. Ma et al. [42] present a decentralized multi-agent motion planning method for air robots moving between 3D polygonal obstacles. The algorithm combines a method based on barrier functions (for low level (local) coordination and control) and the priority A* algorithm (for high level (global) planning). With the algorithm, they calculated the paths by redefining the waypoints when appropriate, while ensuring the collision-free movements of the agents. Draganjac et al. [43] provide an algorithm for the decentralized control of multiple automated guided vehicles used for transportation in industrial operations and warehouse environments. It is stated in their studies that the proposed control strategy is not only limited to multiple AGV systems but is also applicable for decentralized coordination of mobile robots in various other multi-robot applications. Mousavi et al. [17] developed a mathematical model and integrated it with evolutionary algorithms (Genetic Algorithm-GA, Particle Swarm Optimization-PSO and hybrid GA-PSO) to optimize AGVs' task planning to minimize the completing time. According to their results, they claimed that the three algorithms have proven their applicability in completing time and reducing AGV numbers. It is emphasized that the best result is obtained with the hybrid system. Dewangan et al. [44] investigate some of the methods that determine the choice of multi-robot priority path planning techniques. They have analyzed the changes in the path planning approach according to various configurations by addressing the difficulties existing in multiple robot systems. Digani et al. [27] provide an optimization strategy to coordinate an AGV fleet travelling on predefined temporary road maps. It is stated that the specific aim of the study is to maximize traffic flow in an automatic warehouse by minimizing the time spent. They also focused on preventing AGVs from colliding with each other and overcoming complex traffic models. Oh et al. [45] proposed a system to work with multiple agents for collaboration in scheduling tasks using an optimal task allocation algorithm based on particle swarm optimization (PSO). In their work, they changed the conventional PSO-based algorithm using graph theory infrastructure. They showed the performance of the proposed algorithm in simulation. Guerrero et al. [46] state that choosing the best task to perform (task assignment problem) is one of the main problems in multi-robot systems. In their work, they show that, concerning a task assignment problem, fuzzy Markov chains can reach a stationary stage in a limited number of steps. They say that fuzzy Markov chains are better at modelling motion prediction. Trigui et al. [47] address the problem of assigning a team of autonomous robots to goal areas in the context of a disaster management scenario. It has been stated that this problem may arise as more than one travelling salesman problem (GSP), which several robots must visit at designated locations. The researchers stated that by providing an analytical hierarchy process (AHP)-based approach to this problem, they minimize three goals: total travel distance, maximum tour, and deviation rate.
Existing multiple robot planners are typically based on disaggregated planning or the unified search approach in the common status area of all robots. Combined approaches can find the optimal solution [48,49], but the worst time complexity increases exponentially with the number of robots with potential conflict in the environment. In this case, if there are more than a few robots, coordination between robots becomes difficult. In this study, a cloud-based system was developed for multiple AGV collaboration, taking into account the approaches in existing related works. The modular features in the system are quite high. These modular features are compared with prominent related works and the results of the comparison are given in Table 1.

Case Definition
Indoor logistics refers to the process of transporting products or other materials to maintain the supply chain within the enterprise building. In some industrial enterprises, the products to be delivered are subjected to some sequential processes before obtaining their final form. The transportation of semi-manufactured fabrics can be complex due to the increase in the number of products in the case of simultaneous production in these enterprises. In fabric finishing enterprises, fabrics are subjected to some processes such as pre-finishing, coloring, dyeing, printing, and sanforizing processes on finishing machines. Batch trolleys, which allow mobility and can be easily connected to the finishing machines, are used to transmit the fabrics to these machines. The fabrics are wrapped in rolls in this transfer vehicle and transported using towing tractors and placed in the finishing machine to be processed. In Figure 1, a sample fabric loaded batch trolley and towing tractors are shown. Batch trolleys are moved on the flat floor corridors within the enterprise and are navigated to the in-port/out-port of finishing machines. An example navigation corridor is shown in Figure 2a and finishing machine is shown in Figure 2b. A typical fabric finishing enterprise can have multiple finishing machines within multiple corridors. Batch trolleys are moved on the flat floor corridors within the enterprise and are navigated to the in-port/out-port of finishing machines. An example navigation corridor is shown in Figure 2a and finishing machine is shown in Figure 2b. A typical fabric finishing enterprise can have multiple finishing machines within multiple corridors. Batch trolleys are moved on the flat floor corridors within the enterprise and are navigated to the in-port/out-port of finishing machines. An example navigation corridor is shown in Figure 2a and finishing machine is shown in Figure 2b. A typical fabric finishing enterprise can have multiple finishing machines within multiple corridors. In many finishing enterprises, batch trolleys are generally used by human operators. Multiple productions are carried out in these enterprises and multiple batch trolleys are navigated simultaneously. The fact that the logistics operators leave these fabrics to the faulty machine has the potential to cause serious damage to the manufacturing enterprises. Besides, accidents during transfer also threaten the health of employees. In this study, it is aimed to control the disruptions in orders and increase work-time efficiency by carrying out these processes using AGVs.

Enterprise Assets and Working Model
To carry out indoor logistics activities autonomously, assets directly affecting logistics within the facility have been identified and a working model that uses these assets in harmony has been created. Thus, the decision mechanism of the autonomous system has been determined according to this model. Çalık Denim factory finishing facility operating in Malatya 2nd Organized Industrial Zone was used for the modelling of the working environment. The working environment is modelled by using the 2-dimensional real map and assets of the finishing enterprise. According to the working model, the assets in the environment are: • Ki: Semi-manufactured fabrics to be processed • Mi: Machines which fabrics are subjected to specific finishing processes In many finishing enterprises, batch trolleys are generally used by human operators. Multiple productions are carried out in these enterprises and multiple batch trolleys are navigated simultaneously. The fact that the logistics operators leave these fabrics to the faulty machine has the potential to cause serious damage to the manufacturing enterprises. Besides, accidents during transfer also threaten the health of employees. In this study, it is aimed to control the disruptions in orders and increase work-time efficiency by carrying out these processes using AGVs.

Enterprise Assets and Working Model
To carry out indoor logistics activities autonomously, assets directly affecting logistics within the facility have been identified and a working model that uses these assets in harmony has been created. Thus, the decision mechanism of the autonomous system has been determined according to this model. Çalık Denim factory finishing facility operating in Malatya 2nd Organized Industrial Zone was used for the modelling of the working environment. The working environment is modelled by using the 2-dimensional real map and assets of the finishing enterprise. According to the working model, the assets in the environment are: Depending on the fabric type, the processing time (t m ) in any finishing machine can vary. The length of the fabric (l k ) is also effective in calculating the time spent in the finishing machine. Batch trolleys provide mobility in transporting the fabrics to the target machine and provide flexibility for the finishing process with its rotating structure. If the machine in which a fabric is to be processed is busy, the batch trolley is taken to the waiting station. Batch trolleys waiting in the queue according to the order priority are moved back to their goals when the machines become available. During the processing, the parts of the fabric that are finished should be wrapped in another empty batch trolley at the out-port of the machine. Therefore, if a batch trolley is directed to the in-port of a machine, an empty batch trolley should be directed to the out-port of the machine at the same time.
In the study, modelling was made on the use of AGVs instead of batch trolley towing tractors. Charging units have been designed in the working environment for the energy needs of AGVs. Starting ports are created for the new fabrics and delivery ports for finished fabrics. Figure 3 shows a minimized part of the modelled fabric finishing enterprise. As can be seen in the Figure 3, K 1 and K 2 are new fabrics. T 1 , T 3 , and T 5 are batch trolleys that unload fabric at the in-port of finishing machines. T 2 , T 4 , and T 5 are batch trolleys whose fabric is loaded up from the out-port of the machines. T 7 and T 8 are batch trolleys taken to the destination by AGVs. T 9 and T 10 are fabric-loaded or empty batch trolleys at the waiting station. While AGV 1 and AGV 2 take batch trolleys to the destination, other AGVs are charging. busy, the batch trolley is taken to the waiting station. Batch trolleys waiting in the queue according to the order priority are moved back to their goals when the machines become available. During the processing, the parts of the fabric that are finished should be wrapped in another empty batch trolley at the out-port of the machine. Therefore, if a batch trolley is directed to the in-port of a machine, an empty batch trolley should be directed to the out-port of the machine at the same time.
In the study, modelling was made on the use of AGVs instead of batch trolley towing tractors. Charging units have been designed in the working environment for the energy needs of AGVs. Starting ports are created for the new fabrics and delivery ports for finished fabrics. Figure 3 shows a minimized part of the modelled fabric finishing enterprise. As can be seen in the Figure 3, K1 and K2 are new fabrics. T1, T3, and T5 are batch trolleys that unload fabric at the in-port of finishing machines. T2, T4, and T5 are batch trolleys whose fabric is loaded up from the out-port of the machines. T7 and T8 are batch trolleys taken to the destination by AGVs. T9 and T10 are fabric-loaded or empty batch trolleys at the waiting station. While AGV1 and AGV2 take batch trolleys to the destination, other AGVs are charging. When the finishing process is started for fabric, the machines to be processed and the orders of these machines are determined. An example study scenario for this situation is shown in Figure 4. This example shows the machines and sequencing where K1 and K2 fabrics will be processed simultaneously until they reach the delivery point. According to the scenario stated in Figure 4: The When the finishing process is started for fabric, the machines to be processed and the orders of these machines are determined. An example study scenario for this situation is shown in Figure 4. This example shows the machines and sequencing where K 1 and K 2 fabrics will be processed simultaneously until they reach the delivery point. According to the scenario stated in Figure

Developed Cloud Robotic Architecture
There are two different approaches, central and decentralized control, to ensure collaboration in multiple robot systems. In the decentralized collaboration approach, a robot in the environment is identified as the leader and this leader robot ensures coordination based on sensor data from other

Developed Cloud Robotic Architecture
There are two different approaches, central and decentralized control, to ensure collaboration in multiple robot systems. In the decentralized collaboration approach, a robot in the environment is identified as the leader and this leader robot ensures coordination based on sensor data from other robots. In the central approach, servers in different locations from robots provide coordination. An application running on the server accesses and assigns tasks to AGVs via the wireless network or the internet. In this study, a cloud system application based on the central collaboration approach has been realized for the control of the logistics assets in the environment. The advantages of the central collaboration over the decentralized collaboration are as follows: • The leader robot that provides coordination in a decentralized collaboration approach must have high computational ability. High hardware capacity is also required for high computation. However, since the computation unit is not a robot in the central collaboration approach, high-capacity hardware is not required for the robots.

•
In decentralized collaboration, it is necessary to choose a new leader robot when the leader robot is out of charge or fails to operate. For the collaboration algorithms to be executed stably, the hardware properties of the new leader must be the same as the previous one. In this case, it reveals the necessity for all robots in the environment to have the same high capacity hardware.

•
In the decentralized collaboration approach, communication is only within the limits of the robot's hardware. The robot can send signals to other robots in the environment, depending on the power of the communication technology used, within a certain region. However, in the cloud-based central collaboration approach, even the AGVs in many different locations can interact by dint of the internet infrastructure.
The cloud system was developed using the Django web framework by Python language. Data was stored in relational tables using PostgreSQL. Communication between the cloud server and client robots has been provided by WebSocket and Restful APIs. AGVs must be Robot Operating System (ROS)-enabled to be able to execute commands sent by the cloud server. ROS is a Linux-based and open source middleware software with a large library that can run all the functions of the robots it supports. Minicomputers with ROS libraries (Raspberry Pi, etc.) can be used for AGVs that do not have a Linux operating system.
The cloud system consists of mapping, position tracking, multiple AGV collaboration, web-based management and monitoring stages. The developed cloud robotic architecture is shown in Figure 5. In the developed cloud robotic architecture, the map of the environment in which the robot moves must be known in advance. This is important for the path planning and multi-task allocation stages to work. During the map creation process, the locations of static assets in the environment can be transmitted to the cloud system according to the type of asset. Restful APIs have been created in  In the developed cloud robotic architecture, the map of the environment in which the robot moves must be known in advance. This is important for the path planning and multi-task allocation stages to work. During the map creation process, the locations of static assets in the environment can be transmitted to the cloud system according to the type of asset. Restful APIs have been created in the cloud robotic architecture for the transmission of these data. REST or RESTful web services are among the most common web services used today due to their simplicity. REST services are robust, use minimal bandwidth and are suitable for connecting to cloud services. Similar to HTTP, the device can handle server requests with four request methods (GET, PUT, POST and DELETE). In the study, RESTful web services were used to perform the following operations: • Saving, updating, listing and deleting of geographic information of assets in a selected map environment, • Adding fabric orders to the cloud system with its processes, • Listing of fabrics transferred to the delivery point through all processes.

•
Receiving statistical data on fabrics and orders daily, weekly, monthly and yearly.

Position Tracking
To correctly direct AGVs in the working environment, its current position has to be known. There are many studies suggested in the literature to detect the current position of AGVs. In these studies, RFID, QR-code, 3-colors, Bluetooth and Wi-Fi-based technologies have been used. In the position tracking module, standard data structures that can be integrated into all positioning systems have been created. This data structure includes the 2D location information and qualitative features of the AGV on the known map. In addition, by creating grid-shaped nodes on the map, position information is matched with the position of these nodes. The number of nodes for each map can be determined dynamically. These nodes are used in path planning and multitasking algorithms. Figure 6 shows the path planning simulation in an environment with an area of 20 × 14 m 2 and 280 nodes. Position information is small size data, and the transmission of this data should be triggered as soon as the position of the AGV changes. The most suitable technology for this process is WebSocket that provides a two-way communication channel between clients and servers via the internet or local network. This channel is established on a TCP socket and remains open for the uninterrupted exchange of data between endpoints. WebSockets use their own protocols that were standardized by Internet Engineering Task Force (IETF) [RFC 6455] in 2011. When a WebSocket request is sent to the server, the client requests to change the protocol from HTTP to WS, and if the server supports it, this change will be made. Thus, a two-way WebSocket connection is created that allows real-time messages to be sent between the client and the server. These messages have been stored on REDIS, so clients on all terminals of the WebSocket channels could access these messages at the same time. The copies of the messages have also been stored to the relational database simultaneously. REDIS is an open-source key-value-based NoSQL storage software developed and growing in popularity. It Position information is small size data, and the transmission of this data should be triggered as soon as the position of the AGV changes. The most suitable technology for this process is WebSocket that provides a two-way communication channel between clients and servers via the internet or local network. This channel is established on a TCP socket and remains open for the uninterrupted exchange of data between endpoints. WebSockets use their own protocols that were standardized by Internet Engineering Task Force (IETF) [RFC 6455] in 2011. When a WebSocket request is sent to the server, the client requests to change the protocol from HTTP to WS, and if the server supports it, this change will be made. Thus, a two-way WebSocket connection is created that allows real-time messages to be sent between the client and the server. These messages have been stored on REDIS, so clients on all terminals of the WebSocket channels could access these messages at the same time. The copies of the messages have also been stored to the relational database simultaneously. REDIS is an open-source key-value-based NoSQL storage software developed and growing in popularity. It provides great advantages in CPU and memory usage as it stores data in JSON format in the memory instead of the disk. When the channel is closed, the messages created on REDIS are automatically deleted.

Collaboration Module for Multi-AGVs and Multi-Tasks
The collaboration of multiple AGVs is one of the major challenges to making indoor logistics as autonomous as possible. The proposed working model plays an important role in the healthy implementation of the collaboration module. The collaboration module consists of task definition, battery management and optimization, path planning, selection of the most suitable batch trolley, optimum task allocation, and collision avoidance stages.

Task Definition
To make the task allocation properly, the behavior patterns of the tasks must be defined properly. The making ready of the fabrics by processing them on multiple machines requires multiple tasks. The types of these multiple tasks are as follows and illustrated in Figure 7: • When a fabric is included in the system, the process of transmitting an empty batch trolley to this fabric: starting-task.

•
The process of transmitting the fabric to the input port of any machine where it will be treated: input-task.

•
When the fabric enters the finishing machine and starts to process it, the fabric sections that are finished should be wrapped in another batch trolley at the exit of the machine. The process of transmitting an empty batch trolley simultaneously to the output port of the machine when an input task begins: output-task.

•
When the machine to which the fabric will be transmitted is busy, the process of transmitting the batch trolley to the nearest waiting station: waiting-task • The process of transmitting the product from the last machine to the delivery point after all processes are finished: delivery-task.

•
When an AGV's battery drops below the critical level, the transmission process of the AGV to the nearest charging station: charging-task Electronics 2020, 9, x FOR PEER REVIEW 11 of 24 • When the machine to which the fabric will be transmitted is busy, the process of transmitting the batch trolley to the nearest waiting station: waiting-task • The process of transmitting the product from the last machine to the delivery point after all processes are finished: delivery-task.

•
When an AGV's battery drops below the critical level, the transmission process of the AGV to the nearest charging station: charging-task

Battery Management and Optimization
The battery state information of AGVs was sent to the cloud robotic system by using WebSockets. Thus, when the battery state of AGV drops below a critical level ( ), AGV is closed to assignments of tasks and navigated to the nearest charging station. If this situation happens when AGV performs a task, the task is assigned to another AGV and discharged AGV is navigated to the

Battery Management and Optimization
The battery state information of AGVs was sent to the cloud robotic system by using WebSockets. Thus, when the battery state of AGV drops below a critical level (l c ), AGV is closed to assignments of tasks and navigated to the nearest charging station. If this situation happens when AGV performs a task, the task is assigned to another AGV and discharged AGV is navigated to the nearest charging station. The l c critical battery level is the minimum amount of energy that will allow an AGV to move along the maximum unobstructed path between the two furthest locations in the environment with the maximum amount of load it can carry. If new static obstacles are added to the environment, this changes the length of the maximum path, and l c also changes. Thus, critical battery level is determined automatically according to the map status and is used in the optimum task allocation. The l c critical battery level is calculated as in Equation (1).
In Equation (1), δ is the amount of energy that an AGV spends at a distance of 1 m. µ indicates the amount of energy that an AGV needs to spend to carry a 1 kg weight at a distance of 1 m. W max is the maximum weight a batch trolley can transfer. µ and W max values are defined as parametrically in the cloud system. P max represents the maximum length path on the environment map and is obtained by summing the Euclidean distances between two furthest points in Equation (2).
In Equation (2), k is the number of elements of the [(x, y)] array in the 2-dimensional plane of the optimum path, which is determined by the path planning algorithm. The array [(x, y)] is created with the longest collision-free path plan in the environment.

Path Planning with D* Lite
In this study, the D* Lite algorithm, which is widely used in robotic applications, one of the effective methods in this field and derived from the D* algorithm, was used to solve the path planning problem. D* Lite is an incremental heuristic algorithm, which combines A* and Dynamic SWSF-FP ideas by Sven Koenig and Maxim Likhachev and it uses LPA* to find a new best path of a unit as the graph changes [50]. D* Lite searches for the collision-free path, starting from the goal node s goal to the start corner s start . The algorithm stores the estimated distances between each vertex to the g(s) and rhs(s) values. The rhs values are estimated by the correlation in Equation (3).
In Equation (3), s is the neighbor of s and the Succ(s) set is the vertex formed by expanding from s. c(s, s ) is the cost of the transfer from s to s . D* Lite uses a priority queue (U) structure to store all inconsistent vertices. The algorithm performs the following steps to achieve the optimal path plan: • Initially, all values of g and rhs parameters are set to infinite, and s goal with rhs = 0 is put in U.
• First, u vertex with the least priority k value is selected from U.

•
If g(u) > rhs(u), the rhs-value of u is set as g-value and u is removed from U.

•
Then all rhs values of the precursors of u are changed and added to U if locally inconsistent.

•
If g(u) ≤ rhs(u), u is set to infinite and inserted into U if they are locally inconsistent.
• These steps continue until the s start point is locally consistent and the k value of all the vertexes remaining in U is greater than the s start value.
The flowchart of D* Lite algorithm is shown in Figure 8.

plan:
• Initially, all values of and ℎ parameters are set to infinite, and with ℎ = 0 is put in .
• First, vertex with the least priority value is selected from . • If ( ) > ℎ ( ), the ℎ -value of is set as -value and is removed from . • Then all ℎ values of the precursors of are changed and added to if locally inconsistent.

•
If ( ) ≤ ℎ ( ), is set to infinite and inserted into if they are locally inconsistent. • These steps continue until the point is locally consistent and the value of all the vertexes remaining in is greater than the value.
The flowchart of D* Lite algorithm is shown in Figure 8.

Choosing the Most Suitable Batch Trolley
When choosing a batch trolley to be assigned to a task, the one closest to the location where this task will begin should be preferred. However, the busy state of this batch trolley should also be

Choosing the Most Suitable Batch Trolley
When choosing a batch trolley to be assigned to a task, the one closest to the location where this task will begin should be preferred. However, the busy state of this batch trolley should also be checked. If the selected batch trolley is busy, it may be necessary to choose another one, but if the busy time is short, choosing the first batch trolley can produce an optimal result. In this case, the busy time must be calculated. The busy time (t m ) is calculated in seconds by the Equation (4).
In Equation (4), w is the length of the fabric on the busy batch trolley that is processed in the machine m. The parameter h m is the length of the fabric processed in the machine m in 1 s. t c is the current time and t s is the time when the m machine starts to become busy. t m is also used when a fabric is transmitted to the machine to be processed. In this case, if the machine's busy time is more than the transmit time, the fabric is transmitted to the nearest waiting station.
While selecting the batch trolley to be assigned to task i , only the empty ones were not selected. It may be more advantageous to select any batch trolley that already performs another task if its deadline is short. Therefore, the transmit times of all batch trolleys to the start position of task i should Electronics 2020, 9, 2023 13 of 24 be calculated. T i , the time that batch trolley will transmit to the start position of task i is calculated by the Equation (5).
In Equation (5), s current is the current position of the i th batch trolley. s goal old is the arrival position of the task c (the current task of bach trolley that it has not yet completed). Len(s current , s goal old ) is the length of the optimum path plan from the s current to the s goal old . Using the [(x, y)] points from the path plan created with D* Lite, v is the speed of the AGV. t m is the time that the batch trolley will spend in the finishing machine of the task c it is completing and is calculated as in Equation (4). s goal is the starting position of task i .
If the batch trolley is busy for task i ; then s start = s goal old . If the transfer tool is not busy, s start is the current position of the batch trolley, as is Len(s current , s goal old ) = t m = 0. This selection method is given in Algorithm 1. B v ← ∅ 04: if v is busy then 08: s local ← position(v) 09: //Calculate path from current position to the end point of task (s task ) 10: time ← GetOptimumPath (s local , s task ) * v 11: if v have a work station task then time ← time + t m 12: s start ← s task 13: else 14: s start ← position(v) 15:

Optimum Multi-Task Allocation
To optimally assign AGVs to multi-tasks, the total cost of all assignments must be minimal. This cost is calculated with a multi-fitness function that minimizes total path and time. Usually, minimizing the path also minimizes time in multi-task robot allocation. However, in some cases, minimizing the path may increase the time. For example, when assigning a task, the AGV in the most suitable position may be performing another task at that moment. In this study, a multi-fitness function is presented, in which both the total path and the total time are minimized. This multi-fitness function is shown in Equation (6). The function has a significance coefficient (λ) that can be determined dynamically for path and time.
In Equation (6), R = {r 1 , r 2 , r 3 , . . . , r n } and it is the array of AGVs. G = g 1 , g 2 , g 3 , . . . , g m and it is the array of goals that consist of the start positions of tasks. The sum of λ significance coefficients equals 1 and can be defined parametrically in the cloud system. a is the number of task assignments of AGVs. Len s r i , s g i is the length of the optimum path between the AGV and the start position of the task. T i is the time AGV spends to arrive at the starting position of the task and is calculated as in Equation (5).
For the optimum allocation of multi-AGVs to multi-tasks simultaneously, the value of f (R, G) should be minimal. To minimize f , an assignment matrix was created, containing all possible mappings of AGVs and goals. The purpose of this matrix is to detect the row with minimum cost and suitable match. Before matching between R and G, these two sets were kept in C le f t and C right intermediate sets as follows: R = {r 1 , r 2 , r 3 , . . . , r n }, G = g 1 , g 2 , g 3 , . . . , g m If n ≥ m then C le f t = R, and C right = G Else C le f t = G, and C right = R Since the C le f t determines the number of assignments that can be made simultaneously, the above operations have been performed. This means: If the number of AGVs is lower than the number of goals, the number of matching sets can be as many as the number of AGVs, otherwise it can be as much as the number of goals. Thus, a combination matrix was created with the C le f t to the left of the matching and the C right to the right of the matching. Then, a permutation matrix was created using all matches with unique assignments in each row. Figure 9 shows the creation of the permutation matrix for the R = {r 1 , r 2 , r 3 , r 4 } and G = g 1 , g 2 , g 3 given as examples.
In Equation (6), = , , , … , and it is the array of AGVs. = , , , … , and it is the array of goals that consist of the start positions of tasks. The sum of significance coefficients equals 1 and can be defined parametrically in the cloud system. is the number of task assignments of AGVs.
, is the length of the optimum path between the AGV and the start position of the task.
is the time AGV spends to arrive at the starting position of the task and is calculated as in Equation (5).
For the optimum allocation of multi-AGVs to multi-tasks simultaneously, the value of ( , ) should be minimal. To minimize , an assignment matrix was created, containing all possible mappings of AGVs and goals. The purpose of this matrix is to detect the row with minimum cost and suitable match. Before matching between and , these two sets were kept in and intermediate sets as follows: Since the determines the number of assignments that can be made simultaneously, the above operations have been performed. This means: If the number of AGVs is lower than the number of goals, the number of matching sets can be as many as the number of AGVs, otherwise it can be as much as the number of goals. Thus, a combination matrix was created with the to the left of the matching and the to the right of the matching. Then, a permutation matrix was created using all matches with unique assignments in each row. Figure 9 shows the creation of the permutation matrix for the = , , , and = , , given as examples. Along with the permutation matrix, all matching possibilities for and are also determined. Thus, the row with the minimum sum of the lengths of each matching can be selected. However, as Figure 9. Creating permutation matrix for R = {r 1 , r 2 , r 3 , r 4 } and G = g 1 , g 2 , g 3 .
Along with the permutation matrix, all matching possibilities for R and G are also determined. Thus, the row with the minimum sum of the lengths of each matching can be selected. However, as the number of AGVs and goals increases, the computational complexity of the permutation matrix also increases. To overcome this problem, AGVs and goals were classified into ϕ element clusters using the k-NN method. When the ϕ value is kept too high, the assignment time may be longer depending on the computing ability of the computer. When this value is too low, the optimum solution is avoided. Therefore, it is necessary to keep this value at an optimum level. ϕ value can be changed dynamically in the cloud system since the calculation times are variable in computers with different hardware. As can be seen in the graph in Figure 10, assignment time increases exponentially when AGVs and goals are not classified. However, when they are classified with k-NN, the assignment time is much shorter. In Figure 10, the number of matching indicates the number of AGVs and goals. For example, if the number of matching is 5, the assignment time was calculated in the environment with 5 AGVs and 5 goals. changed dynamically in the cloud system since the calculation times are variable in computers with different hardware. As can be seen in the graph in Figure 10, assignment time increases exponentially when AGVs and goals are not classified. However, when they are classified with k-NN, the assignment time is much shorter. In Figure 10, the number of matching indicates the number of AGVs and goals. For example, if the number of matching is 5, the assignment time was calculated in the environment with 5 AGVs and 5 goals. Choosing the row with the minimum total path in the assignment matrix is not sufficient alone for optimum task allocation. Whether the energy that the AGVs will spend along the path to the goal they match is sufficient is also checked. If any row in the assignment matrix has an AGV whose battery level is not sufficient for the distance it matches, this row is deleted from the assignment matrix. Thus, the allocation of tasks is realized by searching at the minimum one among the remaining rows. The pseudo-code of the optimum multi-task allocation is presented in Algorithm 2. For the collaboration of multi-AGVs according to the working model, it is necessary to determine the task states first. These task states play an important role in the collaboration of AGVs. Task states are as follows: • S1: Task created • S2: First task for initializing Choosing the row with the minimum total path in the assignment matrix is not sufficient alone for optimum task allocation. Whether the energy that the AGVs will spend along the path to the goal they match is sufficient is also checked. If any row in the assignment matrix has an AGV whose battery level is not sufficient for the distance it matches, this row is deleted from the assignment matrix. Thus, the allocation of tasks is realized by searching at the minimum one among the remaining rows. The pseudo-code of the optimum multi-task allocation is presented in Algorithm 2.

Algorithm 2 Optimum Multi-Task Allocation
else C le f t ← R, C right ← G 05: D ← Create sub-matrices with length ϕ according to nearest neighborhoods 06: for d in D do 07: C ← Create a combination matrix from d le f t and d right 08: P d ← Create a permutation matrix from C 09: P.Append(P d ) 10: Remove rows from P if energy level does not meet the cost 11: Calculate the total cost of each row of P by summing the costs of each assignment in rows.

12:
Return first row with the lowest total cost in matrix P For the collaboration of multi-AGVs according to the working model, it is necessary to determine the task states first. These task states play an important role in the collaboration of AGVs. Task states are as follows: When a fabric is registered in the cloud system and a motion plan like in Figure 4 is created, a task is defined for each part of the motion and their status is set to S 1 . A sequence number is given for each task. Then the status of the first task is set to S 2 . When the status of this task is S 9 , the status of the next task is set to S 2 . This process continues until all the tasks are completed. For tasks with a status S 2 , the "choosing the most suitable batch trolley" algorithm is run. When the nearest batch trolley is assigned to the fabric, the status of the task is changed to S 3 . To transmit the fabrics in the S 3 state towards the goal, the most suitable AGV is selected. If there is more than one S 3 task at the same time, the optimum multi-tasks allocation algorithm ensures that the most suitable AGVs are selected for all tasks. When the most suitable AGV for the task is selected, the status of the task is updated to S 4 . The path plan is sent to the selected AGVs via WebSockets. If the AGV transmits a batch trolley to a finishing machine and this machine is busy, it must be transmitted to the nearest empty waiting station. In this case, the status of the current task is updated to S 1 , and a new task is created to take the AGV to the nearest waiting station, and the status of this task is set to S 4 . When the batch trolley reaches the waiting station by AGV, the status of the previous task is updated to S 3 . The pseudocode of this module that provides this collaboration is given in Algorithm 3.

Algorithm 3
The Collaboration of Multi-AGVs and Multi-Tasks 01: function main () 02: F ← task list of status is S 2 03: for all t ∈ F do 04: v ← FindMostSuitableVehicle (position(t)) 05: Create a new task for taking transport vehicle to task point and set status S 3 06: Update v as busy 07: Update status of t to S 1 08: W ← Task list that status field is S 3 09: R ← AGV list which is not busy and the battery level is above the critical value 10: L ← ∅ //Allocation list 11: for all t ∈ W do 12: for all r ∈ R do 13: if the type of task is "transfer" then 14: v ← FindMostSuitableVehicle (position(output port o f workstation)) 15: assign v to t 16: update v as busy 17: path ← GetOptimumPath (position(r), position(v)) 18: L.Insert(r, t, path) 19: A ← getOptimumAllocation(L) 20: for all a ∈ A do 21: if the goal of a is a busy work station then 22: p ← find nearest waiting station to the position of the batch trolley 23: Update goal position as p 24: a.path ← GetOptimumPath (position(vehicle), p) 25: Update status of the task as S 3 26: Update start position of the task 27: Increase the priority level of the task

Collision Avoidance
One of the biggest challenges in mobile robots is the problem of avoiding collisions with these obstacles. Static obstacles can be registered to map in the cloud system with their location and size. Active obstacles are defined/undefined moving objects for the cloud system. An active obstacle can be an employee, a vehicle or another AGV. Since the positions of static obstacles in the environment are known by the cloud system, a collision-free path can be created before the task execution. However, moving obstacles are unexpectedly included in the path during task execution. If this moving obstacle is an AGV, then the collision can be prevented automatically. Thus, when more than one AGV faces at the same time, the collision avoidance module is activated. When they enter a secure circular area with a radius r, which can be defined dynamically, a new local path is created for AGVs. If the moving obstacle is not an AGV, it waits for the obstacle to disappear within a default time. When the obstacle does not disappear after this period, it sends an alarm message to the cloud system via WebSockets. In Figure 11, an example of the collision avoidance system is given.

Collision Avoidance
One of the biggest challenges in mobile robots is the problem of avoiding collisions with these obstacles. Static obstacles can be registered to map in the cloud system with their location and size. Active obstacles are defined/undefined moving objects for the cloud system. An active obstacle can be an employee, a vehicle or another AGV. Since the positions of static obstacles in the environment are known by the cloud system, a collision-free path can be created before the task execution. However, moving obstacles are unexpectedly included in the path during task execution. If this moving obstacle is an AGV, then the collision can be prevented automatically. Thus, when more than one AGV faces at the same time, the collision avoidance module is activated. When they enter a secure circular area with a radius r, which can be defined dynamically, a new local path is created for AGVs. If the moving obstacle is not an AGV, it waits for the obstacle to disappear within a default time. When the obstacle does not disappear after this period, it sends an alarm message to the cloud system via WebSockets. In Figure 11, an example of the collision avoidance system is given.
(a) (b) Figure 11. Collision avoidance for Automated Guided Vehicle (AGV)1 and AGV2 moving towards each other in the same direction by the cloud system (a) Detecting AGVs entering the same radius, (b) Creating a local path and re-entering the old path when it leaves the circle.

Simulation Results and Analysis
The simulation environment was carried out using C# language. By adding mapping features to the simulation software, it was provided to add the finishing machines, the waiting stations, the charging stations, starting and delivery ports to this map. These added static assets were uploaded to the cloud system using Restful APIs with their polygonal dimensions and their positions on the map. More than one map can be added to the simulation environment. A map environment similar to the map in the case study was created and experimental results on this map were observed. When simulated AGVs were added to the system and on the move, their positions were instantly transmitted to the cloud system using WebSockets. The dynamic parameters required for the initialization of the simulation were defined as follows: • It was assumed that all AGVs have the same model and features. Batch trolleys were also considered to have the same features.

•
The ẟ parameter, which is the amount of energy an AGV spends in 1 m, was set to 1 joule.

•
The μ parameter, which determines the effect of the weight carried by the AGV over 1 m on energy consumption, was set to 0.001.

•
The used to calculate the critical battery level was set to 1000 kg.

•
The energy spent when AGVs turns were set to * 0.01. is the amount of rotation angle of AGV.

•
The connection of an AGV to batch trolley was set to spend 2 joules of energy.

Simulation Results and Analysis
The simulation environment was carried out using C# language. By adding mapping features to the simulation software, it was provided to add the finishing machines, the waiting stations, the charging stations, starting and delivery ports to this map. These added static assets were uploaded to the cloud system using Restful APIs with their polygonal dimensions and their positions on the map. More than one map can be added to the simulation environment. A map environment similar to the map in the case study was created and experimental results on this map were observed. When simulated AGVs were added to the system and on the move, their positions were instantly transmitted to the cloud system using WebSockets. The dynamic parameters required for the initialization of the simulation were defined as follows: • It was assumed that all AGVs have the same model and features. Batch trolleys were also considered to have the same features.

•
The δ parameter, which is the amount of energy an AGV spends in 1 m, was set to 1 joule.

•
The µ parameter, which determines the effect of the weight carried by the AGV over 1 m on energy consumption, was set to 0.001.

•
The W max used to calculate the critical battery level was set to 1000 kg.

•
The energy spent when AGVs turns were set to c * 0.01. c is the amount of rotation angle of AGV.

•
The connection of an AGV to batch trolley was set to spend 2 joules of energy.

•
The wrapping time of the fabric to an empty batch trolley at the starting ports was set to 60 s.

•
In each machine, 1 m of fabric was adjusted to be processed in 1 s.

•
The weight of 1-m fabric was assumed to be 1 kg.

•
It was assumed that an AGV battery has 250 joules while it is full.

•
The radius of the safety area used for collision avoidance was set at 5 m.

•
The ϕ value used in the classification of the assignment matrix was set to 8.
An example study for the simulation test is shown in Figure 12. In this example, a map with 9 finishing machines, 20 AGVs, and 30 batch trolleys was simulated and 10 fabrics were placed to the starting ports. AGVs were randomly located at the charging stations. Empty batch trolleys were also located randomly in the waiting stations.

•
The wrapping time of the fabric to an empty batch trolley at the starting ports was set to 60 s.

•
In each machine, 1 m of fabric was adjusted to be processed in 1 s.

•
The weight of 1-m fabric was assumed to be 1 kg.

•
It was assumed that an AGV battery has 250 joules while it is full.

•
The radius of the safety area used for collision avoidance was set at 5 m.

•
The value used in the classification of the assignment matrix was set to 8.
An example study for the simulation test is shown in Figure 12. In this example, a map with 9 finishing machines, 20 AGVs, and 30 batch trolleys was simulated and 10 fabrics were placed to the starting ports. AGVs were randomly located at the charging stations. Empty batch trolleys were also located randomly in the waiting stations. Machines for processing each fabric in the example given in Figure 12 are defined as tasks, sequentially as in Table 2. For example, the K1 fabric will depart from the S1 starting port, will be processed on M1, M4, M5, and M8 machines sequentially and then will transmit to the D1 delivery port.

Fabric
Sequential Tasks Machines for processing each fabric in the example given in Figure 12 are defined as tasks, sequentially as in Table 2. For example, the K 1 fabric will depart from the S 1 starting port, will be processed on M 1 , M 4 , M 5 , and M 8 machines sequentially and then will transmit to the D 1 delivery port.

Fabric
Sequential Tasks According to the working model, when a fabric is transmitted to the input port of a finishing machine, a batch trolley must also be transmitted to the output port of the machine simultaneously. According to this rule, one output-task has been created for each input-task. Therefore, the number of tasks determined for this fabric is increased by as many as the number of machines. If the machine to which the batch trolley is to be transmitted is busy, it is transmitted to the waiting stations as a rule. In this case, a waiting-task is created to transmit the batch trolley to the waiting station. This means that the number of tasks created for the fabric increases again. The results of the sample study above can be seen in Table 3. In Table 3, the length of each fabric is indicated in the "Length" column. In the "Machine Count" column, there is information on the number of machines by which the fabric is processed. There is the total number of tasks created to transmit the fabric to the delivery point in the "Tasks" column. These task numbers refer to the sum of the starting-tasks, input-tasks, output-tasks, waiting-tasks and delivery-tasks created for the fabrics. For example, it is seen that 10 tasks were created for product K 1 and it was formed as in Figure 13. "Waiting Tasks" is the number of batch trolleys being transmitted to the waiting station when the machine to which the fabric is transmitted is busy. The "Collision Avoidance" column is the number of encounters and collision avoidance with other AGVs on the path during the total time. In the "Total Path" column, there is the total distance in meters travelled for the fabric to be processed on all machines and delivered to the delivery point. In the "Time" column, there is the total duration of all processes for the fabric. In the "Energy" column, the total energy spent is given in joules.
K1 and it was formed as in Figure 13. "Waiting Tasks" is the number of batch trolleys being transmitted to the waiting station when the machine to which the fabric is transmitted is busy. The "Collision Avoidance" column is the number of encounters and collision avoidance with other AGVs on the path during the total time. In the "Total Path" column, there is the total distance in meters travelled for the fabric to be processed on all machines and delivered to the delivery point. In the "Time" column, there is the total duration of all processes for the fabric. In the "Energy" column, the total energy spent is given in joules. In the simulation example, it was seen that all the fabrics started processing simultaneously. Table 3 shows that the fabric with the longest delivery time is K8. In this case, K8 is the last fabric to reach the delivery point. The running time of the simulation is also equivalent to the delivery time of K8. In Figure 14, the timelines of the delivery time of 10 fabrics, which are given in the simulation example, are shown. As can be seen from Figure 14, all tasks are completed at the end of 516 s. In the simulation example, it was observed that the batteries belonging to 12 of the AGVs used fell below the critical level. The charging tasks were created for these AGVs and forwarded to the nearest charging station. The total energy spent to take all the fabrics to the delivery point was 5658.87 joules.
All the tests, including the above example carried out in the simulation, have shown that all tasks created in the cloud system have been successfully fulfilled and the fabrics have been transmitted to the delivery point after all finishing processes.

Discussions and Conclusions
In this study, a cloud-based collaboration system that autonomously controls AGVs used in In the simulation example, it was seen that all the fabrics started processing simultaneously. Table 3 shows that the fabric with the longest delivery time is K 8 . In this case, K 8 is the last fabric to reach the delivery point. The running time of the simulation is also equivalent to the delivery time of K 8 . In Figure 14, the timelines of the delivery time of 10 fabrics, which are given in the simulation example, are shown. As can be seen from Figure 14, all tasks are completed at the end of 516 s. In the simulation example, it was seen that all the fabrics started processing simultaneously. Table 3 shows that the fabric with the longest delivery time is K8. In this case, K8 is the last fabric to reach the delivery point. The running time of the simulation is also equivalent to the delivery time of K8. In Figure 14, the timelines of the delivery time of 10 fabrics, which are given in the simulation example, are shown. As can be seen from Figure 14, all tasks are completed at the end of 516 s. In the simulation example, it was observed that the batteries belonging to 12 of the AGVs used fell below the critical level. The charging tasks were created for these AGVs and forwarded to the nearest charging station. The total energy spent to take all the fabrics to the delivery point was 5658.87 joules.
All the tests, including the above example carried out in the simulation, have shown that all tasks created in the cloud system have been successfully fulfilled and the fabrics have been transmitted to the delivery point after all finishing processes. In the simulation example, it was observed that the batteries belonging to 12 of the AGVs used fell below the critical level. The charging tasks were created for these AGVs and forwarded to the nearest charging station. The total energy spent to take all the fabrics to the delivery point was 5658.87 joules.

Discussions and Conclusions
All the tests, including the above example carried out in the simulation, have shown that all tasks created in the cloud system have been successfully fulfilled and the fabrics have been transmitted to the delivery point after all finishing processes.

Discussions and Conclusions
In this study, a cloud-based collaboration system that autonomously controls AGVs used in industrial indoor logistics is proposed. As a case study, indoor logistics in fabric finishing enterprises have been considered. In the study, firstly, all the assets in the environment were defined and a working model was created and the role of each asset in the environment was described. It was observed that the created model also affected the working strategy of the optimum multi-task allocation and path planning algorithms.
AGVs are used in the transportation of batch trolleys, which are specified in the "Case Definition" section and provide mobility to the fabrics. In the study, a cloud system was developed that provides centralized control of the collaboration of these AGVs. The cloud system is compatible with the proposed working model for the case study. In the cloud system, communication and coordination between AGVs were ensured by using WebSocket and Restful technologies. The developed cloud system has a collaboration module that moves AGVs within the lowest-cost principle and can complete tasks successfully. This lowest-cost principle is based on a multi-fitness function that minimizes the total path and time. The collaboration module consists of task definition, battery management-optimization, choosing the most suitable batch trolley, optimum multi-task allocation and collision avoidance stages.
At the task definition stage all operations to be performed on the fabric are defined. These operations are the tasks that take the fabrics from their location and transmit them to the machines which will be processed sequentially, and finally, transmit them to the delivery port.
In the battery management and optimization stage, the critical battery level is calculated and tracked for each AGV. When the occupancy of the batteries drops below this level, the task assigned to the AGV is cancelled and assigned to another one. The AGV which is running out of battery is navigated to the nearest charging station.
At the stage of choosing the most suitable batch trolley, an algorithm that finds the closest batch trolley, taking into account its occupancy, was developed. In this algorithm, the D* Lite was used to calculate the shortest path between fabrics and batch trolleys, avoiding obstacles.
In the optimum multi-task allocation stage, an algorithm with a multi-fitness function was developed based on the minimum path to reduce the total energy cost and time to increase the number of daily production. The algorithm firstly creates a combination matrix between AGVs and positions of tasks and calculates the minimum paths between them. After calculating the minimum paths, a permutational assignment matrix was created, covering one-to-one assignment possibilities for each AGV and task. By calculating the total paths for each row in the matrix, the lowest cost row was selected. Since the assignment matrix is permutational, it has been observed that the computational complexity increased as the AGVs and tasks increased. To solve this problem, combinations classified by k-NN, according to their closest neighborhood were divided into ϕ number parts. Permutation calculation was calculated separately with these classified data and combined into a final matrix. When choosing the most appropriate row in the final assignment matrix, not only path lengths were taken into account, but also the level of energy to fulfil the task assigned to AGVs. If there was an AGV that did not have enough energy for the task it was assigned in any row, and this row was removed from the assignment matrix. Thus, the allocation of tasks was carried out by selecting the lowest total path among the remaining rows in the assignment matrix.
The path plan was created by avoiding the static obstacles known by the cloud system using D* Lite algorithm. However, moving obstacles are not included in the formation of the path plan.
A mobile obstacle can be a human, any object or an AGV. In the collision avoidance stage, a safe area was created to address this problem and a local and collision-free path plan was created when AGVs encountered this safe area.
Simulation software was developed to test the cloud system. It was observed that the cloud system has successfully organized and completed all the tasks created by simulation. High efficiency was achieved in total path, energy and delivery times. The developed system presents solutions for many industrial indoor logistics systems with complex structures. The modular features in the system are quite promising. These modular features were compared with prominent related works and the results of the comparison are given in Table 1.
The theoretical applicability of the system has been proven by simulation tests. We think that the study will inspire other studies in similar fields with similar processes. In addition, we are currently working on a highly accurate positioning and navigation system to create a practically applicable system. Laboratory experiments of the positioning and navigation system will be conducted in integration with the proposed cloud system and will be published in the future.