# A Dynamic Route-Planning System Based on Industry 4.0 Technology
## 4 Results  
Initially, the models in Section 3 were used to determine the solutions for a route-planning problem. For an optimization model, the solutions can be determined by using a mathematical solver such as CPLEX; for a heuristic method based on the A-star algorithm, the solution is generated by an installed executable module. This requires high-performance hardware with high computational capacity, where the computational runtime varies according to the dimension of input data instance. In order to utilize knowledge gained from previously solved data instances, the input data instances, as well as the generated routes, were collected and used to build an ANN model that can identify an optimal route. This process requires less computational effort and is suitable to implement on a mobile robot with limited computing capability. Having to execute a heuristic algorithm or a mathematical solver every time to generate a route is inefficient. This is because, once an ANN is trained, it can generate a route with minimal computational effort and runtime (less than a second). An ANN training process requires a server equipped with MATLAB, and it can be executed on a weekly basis or when the ANN needs an update. The structure of a feed-forward ANN model for a dynamic route-planning problem is shown in Figure 2. The inputs and outputs of the ANN were defined on the basis of a layout of the simulated transportation area, which was defined by a two-dimensional grid map. An example of a grid map is shown in Figure 3.  
Figure 2: A feed-forward ANN with a hidden layer. The size of the problem is defined by the number of rows and columns, which are then used to define a transportation area, represented by a rectangle. In Figure 3, an origin is represented by a pink square, and a destination is represented by a light green square. There are two types of obstacles considered in the route-planning problem. Fixed obstacles (or fixed blocks) are represented by blue rectangles, and dynamic obstacles are green squares. The number of dynamic obstacles can be specified, and they are generated at random locations within the transportation area. When the size of the transportation area increases, the complexity of the problem increases significantly, which requires impractical runtimes to determine a solution. For instance, there are three dynamic obstacles in Figure 3. The selected path is represented by a red (thick) line, which connects the starting point and the destination point. The shortest path can be generated on the basis of a shortest-path model or an A-star algorithm to avoid collision with all obstacles (fixed and dynamic) on the grid map. To remove irrelevant data from consideration, a data-encoding process is applied. A transportation area with 21 rows \(\times\) 21 columns is used in Figure 4 to illustrate the encoding scheme. To distinguish between different components within a transportation area, each cell is encoded using the following logic: a cell is encoded with \"1\" if it represents an origin, a destination, or an obstacle; and encoded with \"0\" otherwise. Note that fixed obstacles exist permanently and can be omitted from the model. Because a dynamic obstacle located on a line segment blocks the whole segment, an improved encoding scheme is proposed to remove noise from the input data. All cells from  
Figure 4: A grid map with encoded data. Figure 3: A grid map used for route planning. a blocked segment are encoded with \"1\". Each segment is named as shown in Figure 5. This encoding scheme reduces the combination of input data and greatly reduces the amount of computation required. The output of the ANN is the selected route, which consists of a series of cells from the origin to the destination. The selected route is encoded with a number (e.g., 0, 1, 2) that is used to represent a path identifier (ID). In Figures 4 and 5, the selected path is represented by a red (thick) line that connects the origin to the endpoint.