A method for scheduling ship block yards based on layout optimization
By adopting a segmented yard scheduling method based on layout optimization in ship construction, and using deep reinforcement learning algorithms to optimize the yard layout and movement strategy, the problems of low space utilization and difficult movement in the segmented yard are solved, and more efficient is achieved. yard transportation.
Patent Information
- Application Number
- CN202410091018.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-23
- Publication Date
- 2024-09-27
- Estimated Expiration
- 2044-01-23
AI Technical Summary
Unreasonable scheduling of the staging yard during ship construction results in low utilization of the yard space and difficulty in moving in and out of the staging, which affects the production schedule.
The segmented yard scheduling method based on layout optimization is adopted, and the segmented scheduling strategy is adaptively selected through the deep reinforcement learning algorithm to optimize the yard layout and movement strategy, reduce the number of interference segment moves, and improve the yard transportation efficiency.
It improves the space utilization rate of the segmented yard, reduces the number of interference movements in the segmented dispatching process, improves the transportation efficiency of the yard and reduces the scheduling cost.
Smart Images

Figure CN118013641B
Abstract
Description
Technical Field
[0001] The invention belongs to the field of shipbuilding, relates to a block yard scheduling technology, and specifically relates to a ship block yard scheduling method based on layout optimization. Background Art
[0002] In the modern shipbuilding model, shipbuilding uses the intermediate product "section" as the basic operation unit. Therefore, the section construction of the hull is the core of the entire shipbuilding. The sections are formed in the assembly workshop and then removed. They need to go through a series of process flows. The whole process is affected by uncertain factors such as weather and production management. The flow of sections between processes is not seamless. At this time, the yard is used as a temporary storage place for sections to alleviate the demand for production workshop resources. However, due to unreasonable yard scheduling and chaotic management, the sections are stacked in disorder on the yard, resulting in low utilization of yard space and difficulty in moving sections in and out of the yard, which seriously affects the progress of production. Therefore, optimizing the scheduling of section yards is an urgent problem that shipyards need to solve. Summary of the invention
[0003] Purpose of the invention: In order to overcome the shortcomings of the prior art, a method for scheduling ship block yards based on layout optimization is provided, which is suitable for block scheduling under different specifications of yard layouts. By designing and optimizing the block yard layout, the space utilization rate of the block yard can be improved; at the same time, based on the optimal yard layout, a block movement strategy is designed, and the scheduling strategy of the block in the yard is adaptively selected through a deep reinforcement learning algorithm, which can greatly reduce the number of movements of the interference block in the block scheduling process and improve the transportation efficiency of the yard.
[0004] Technical solution: To achieve the above purpose, the present invention provides a ship segmentation yard scheduling method based on layout optimization, comprising the following steps:
[0005] S1: Initialize the segmented yard layout and check the initial layout status;
[0006] S2: Design the priority rules for yard layout;
[0007] S3: Based on the yard layout priority rule, adjust the block yard layout and determine the optimal block yard layout;
[0008] S4: Taking the segmented yard under the optimal layout as the current environment, design the movement strategy of the segments entering and leaving the yard and the movement strategy of the interfering segments;
[0009] S5: Based on the Markov decision process (MDP), the deep Q network algorithm (DQN) is used to design the algorithm's operating environment, including states, actions, rewards, etc.
[0010] S6: Set the parameters and model of the deep Q-network algorithm agent, including state size, action size, memory, discount factor, exploration rate, etc.
[0011] S7: Build a neural network model;
[0012] S8: Select an action based on the current state, randomly select an action based on the exploration rate, or select the best action based on the Q value;
[0013] S9: Store the state, action, reward, next state, and completion flag in the agent's memory;
[0014] S10: The neural network model of the training agent is trained by randomly sampling the experience in memory to maximize the cumulative reward and reduce the number of interfering segment moves.
[0015] Furthermore, the specific process of the method for initializing the segmented storage yard layout and checking the initial layout state in step S1 is as follows:
[0016] The segments that have not been stored in the yard are divided into x groups according to their lengths, and the yard with known specifications is temporarily divided into x rows according to the groups. At this time, the row width of each row corresponds to the segment length of each group after the segments are grouped; then the rows divided in the yard are sorted in order from large to small, and the length and width information of the current yard is compared with the length and width information of the original yard. If the length and width of the current yard are within the length and width constraints of the original yard, the layout utilization rate of the yard divided by rows is directly calculated; if it is not within the range, the layout of the segmented yard needs to be further adjusted.
[0017] Furthermore, the yard layout priority rules in step S2 include priority rule 1 and priority rule 2, which are as follows:
[0018] Priority rule 1: When the provisional yard length of x rows exceeds the original yard length, check for a row with only one or two segments, and check whether the row above the current row can add a segment of this row within the yard width. If so, the placement of the row with only one segment is preferred;
[0019] Priority rule 2: When the updated yard length still exceeds the original yard length after executing priority rule 1, check a row with three or fewer segments, and check whether the two rows above the row can add segments to this row within the yard width. If both can be done, the placement of the row with only one segment is given priority, followed by the placement of two segments, and finally the placement of three segments;
[0020] The interval between rows is (0.5-1) m, which is conducive to the subsequent scheduling of segments entering and leaving the yard, and reduces the close-range interference between segments. In addition, the sum of the widths of the segments placed in each row shall not exceed the width of the yard. If it exceeds, a new row must be added to the next row to place the excess segments that exceed the width of the yard.
[0021] Furthermore, in step S3, the method for adjusting the layout of the segmented storage yard and determining the optimal layout of the segmented storage yard is:
[0022] Select the layout optimization function based on priority rule 1, and iterate it in a loop to update the yard layout. If the requirements are still not met after the optimization function of priority rule 1 is iterated, use the layout optimization function based on priority rule 2 to continue updating the layout until the optimized layout result is within the actual specification range of the segmented yard, and the yard under the best optimized layout can be obtained.
[0023] Furthermore, the specific content of the moving strategy of entering and exiting the yard in sections in step S4 is:
[0024] For the target segment to be moved in: place the segment at the outermost side of the row where it needs to be placed, without interfering with the movement;
[0025] For moving out of the target segment:
[0026] Method 1: First move the interference segments out of the field. After the target segments are moved out, arrange the interference segments in descending order according to the time of appearance and put them back into the field;
[0027] Method 2: If there is space in the upper / lower row, move the interfering segment to the adjacent upper / lower row, and do not put it back to the original row after the target segment is moved out. If the interfering segment that has not been put back becomes an interfering segment again in the current row, move it back to the original row;
[0028] The specific content of the mobile strategy of interference segmentation is:
[0029] The goal to be optimized is to minimize the number of movements of the interfering segments. The segments have different movement strategies in different situations in the yard, and the number of movements of the interfering segments will also be different. For the target segment to enter the yard, the non-interference segmentation strategy is adopted, so the number of interference movements of the entry segment is 0; for the target segment to leave the yard, first determine whether the h-th segment at time t has a target segment to move out of the yard. If and the upper or lower row of the location where the segment is located can be moved out and there is no interfering segment, then the number of interferences is 1; if there is an interfering segment, the exiting segment is moved out in the same row at its location. At this time, if there are fewer interfering segments in this row, the waiting entry segment will not be put back to its original position after being moved out. At this time, the number of interferences for each interfering segment is recorded as 1; if there are more interfering segments, the interfering segment will not be put back to its original position after being moved out. At this time, the number of interferences for each interfering segment is recorded as 2;
[0030] The number of segmented movement of the objective function interference is expressed as:
[0031]
[0032] Where T is the block yard scheduling cycle; t is the time unit (day); n is the total number of blocks; i is the block number in the scheduling cycle, i∈{1,2,…,n}, and the same time segment may have two tasks: entry and exit; H t The number of tasks that enter and exit the stage in time t; or i The number of blocking segments encountered when segment i exits; Is the h-th segment task at time t to store segment i in the storage yard? If yes, it is 1; otherwise, it is 0; The hth segment i at time t cannot be moved out of the previous or next row, which is 1 if it is, and 0 if it is not; Whether the transport interference segment can be put back to its original position, if not, it is 1, if yes, it is 0;
[0033] The constraints are:
[0034] Due to the limited space of the yard, the segments with similar lengths are classified. Considering the case of similar lengths, suppose that a certain length l a The length is approximately 0.1 to 0.5 m and is used uniformly in sections. a The same row, now given the candidate length, let the length be l a There are x rows in total, so there should be:
[0035]
[0036] in,
[0037]
[0038] For every x, we have
[0039] X={x 1 ,x 2 ,…,x c},0≤x c ≤x m
[0040] Where c refers to the candidate line width excluding the segments with lengths approximately within 0.1 to 0.5 m, and m refers to all candidate line widths;
[0041] Each segment contains the time t of moving into the yard si , time to move out of the yard t ri , length l i and width w i4 types of information:
[0042] b i =(t si ,t ri ,l i ,w i )
[0043] The entry time t of the segment of the planned entry is specified si and appearance time t ri During the scheduling cycle:
[0044] 0≤t s ≤t si ≤t e
[0045] 0≤t s ≤t ri ≤t e
[0046] Among them, t e It is the last day of the scheduling cycle;
[0047] In order to improve the utilization rate of the yard space, it is necessary not only to consider that each segment has a place to store, but also to consider the extreme case, that is, the segment length is much longer than the ordinary segment length or the segment length is much longer than the ordinary segment length. Therefore, at least one row of positions should be set separately for the long-length segments to be placed. The short-length segments are not set up separately, but are merged into the short-length rows of the ordinary segments. The maximum length is l 1 , the minimum length is l 2 , then the constraints can be written as:
[0048]
[0049]
[0050] x a ≥0,a≤(i={3,...,c})
[0051] Ensure that each mission can only perform one operation on a segment, including entry or exit operations:
[0052]
[0053] in, Whether the h-th segment task at time t is to move segment i out of the storage yard;
[0054] Each segment can only enter and exit the yard once, and it is executed during its entry and exit time respectively. The following formula indicates that the segment is stored in the yard during its entry time:
[0055]
[0056] Among them, st i is the entry time of segment i;
[0057] The segments are taken out of the yard at their departure time:
[0058]
[0059] Among them, rt i is the appearance time of segment i;
[0060] Establish a mapping relationship between flatbed truck operations and the yard to ensure that each segment must be in a designated row on the segment yard from the time it enters the yard to the time it leaves the yard:
[0061]
[0062]
[0063] in, The h-th segment task at time t is to move segment i out of the yard.
[0064] Furthermore, the step S5 is specifically as follows:
[0065] A1: In a certain time step, the agent (referring to the entity involved in the learning and decision-making process) observes the state of the environment, which includes the state of the segmented stacking in the yard and the direction of the road. The agent adaptively selects one of the segmented movement strategies based on the current state of the segments in the yard when the yard state is updated next time, so as to minimize the number of interfering segmented movements. The yard in this paper is a rectangular field with m cells in the horizontal direction and only 1 cell in the vertical direction. Only the right side in the vertical direction is used as the entrance / exit, so it is defined in the form of m horizontal cells and 2 vertical cells. Its state expression is as follows:
[0066] S t =[s ij ]∈R m×2
[0067] In addition, the intelligence must be able to identify the location information of the segments being stored and the location where the segments that are about to enter the yard should be placed in the yard, and must also be able to identify the exit time of the segments in the yard. Therefore, assuming that a row of the segment yard already has segments placed in the yard, when a new segment needs to enter the row, the segment will adapt to its position in the yard, that is, it will be automatically placed 0.1 meters away from the segments in the yard according to the location of the segments already stored in the yard, and the segments will be placed 0.1 meters apart to prevent unnecessary interference between segments; in addition, the intelligent agent identifies the exit time of the segments in the yard, thereby locking the target segment, and identifies whether there are interfering segments based on the location of the segment in the yard. If so, it will self-determine the most suitable method for scheduling based on the designed mobile strategy;
[0068] A2: When the agent obtains the environment state S, it will give an action A, which includes the transport target segment and the moving interference segment. During the transport segment, the agent mainly decides an action from five actions: moving up, down, left or right, or loading / unloading a segment. The expression is as follows:
[0069] a t ∈A=[a 1 ,a 2 ,a 3 ,a 4 ,a 5 ]
[0070] A3: The traditional Markov model predicts the future state through the state transition matrix, but when the state space is high-dimensional and continuous, the state transition probability can be used for prediction:
[0071]
[0072] The state transition probability can be learned through neural network;
[0073] A4: At time t, the agent is in state S t Next, select Execute Action a t After executing the segmented movement action, the agent receives the reward and punishment value r t and transfer to the yard state S at the next time t+1 with probability P t+1 ; The agent is in the yard state S t+1 Select and execute segmented move action a t+1 , and obtain the penalty value r at that moment t+1 and transfer to the yard state S at the next time t+2 with probability p t+2 This process will continue until the final target yard state S is reached. t+n ; The reward values are set as follows:
[0074] 1) When the agent robot approaches the target segment, it will be rewarded according to the distance between it and the target segment. The closer the distance, the higher the reward, which is 300 to 500;
[0075] 2) When the agent robot reaches the target segment, it will be given an additional reward of 500 to 1000, indicating that it has successfully reached the target segment;
[0076] 3) If the agent robot successfully moves a segment, it will be given an additional reward of 800 to 1200;
[0077] 4) When all segment tasks are completed, all target segments are correctly moved and placed, and the environment state reaches a "terminated" or "successful" state, a reward of 10,000 to 15,000 will be given;
[0078] 5) Select the correct segmented movement action, i.e. up / down / left / right movement. If the action selected by the agent is not among the above actions, the reward value will be deducted by 100-500;
[0079] 6) When there is an interference segment in the target segment during the transportation process, the interference may lead to mission failure, resource waste or environmental instability. Therefore, in this case, in order to punish the behavior of the agent robot, the reward is reduced by 2000-2500 to prevent the agent robot from performing actions that may cause interference again;
[0080] The goal of reinforcement learning is to maximize the long-term reward and penalty values in the MDP, so as to learn a strategy for selecting the optimal action. The reward and penalty in the MDP can be expressed as:
[0081]
[0082] Where n represents the number of steps from the current state to the target state in the MDP;
[0083] Reinforcement learning is the process of finding the optimal strategy for a given MDP; the strategy π in the MDP defines the mapping relationship between the agent's actions under the state S. From the above formula, we can see that the acquisition of long-term punishment must wait until the entire MDP process is completed. If the state set is too large, the storage capacity of the entire reinforcement learning system is too large and the operation is too slow. Therefore, in order to learn the optimal strategy, a feasible modeling method is to use the value function approximation. Reinforcement learning introduces two types of value functions: state value function V π (S) and the action-value function Q π (S, a), where the state value function represents the expected return obtained in state S, and its Bellman equation form is defined as:
[0084] V(S)=E(r t +γV(S t+1 ))
[0085] The action value function represents the expected return after executing action a in state S. The learning goal of the agent in reinforcement learning is to maximize the action value function, and its Bellman equation is expressed as:
[0086] V(S)=E(r t +γV(S t+1 ))
[0087] In the formula, S′ is the next state corresponding to taking action a in state S; a′ is the action that can obtain the maximum action value function value in state S′;
[0088] According to the Markov characteristic, the relationship between the state value function and the action value function is as follows:
[0089] Q π (S,a)=E[r t+1 +γV π (S t+1 )]
[0090]
[0091] Furthermore, the step S6 is specifically as follows:
[0092] The state of the environment is the optimized yard information; the action size is set to 4, representing four actions: up, down, left, and right; the experience pool uses a double-ended queue with a maximum length of 2000 to store the experience replay of the agent program; the discount factor is 0.95, which is used when calculating expected future rewards;
[0093] The initial exploration rate is 1.0, which will gradually decay during the training process. The probability of randomly selecting an action during the initial exploration is 100%;
[0094] Among them, the number of characteristics of the environment state is obtained dynamically, and the actual value may vary depending on the state information of the specific environment.
[0095] Furthermore, the neural network model constructed in step S7 includes an input layer, a hidden layer, an output layer, and an output layer activation function, which are as follows:
[0096] Input layer: The number of features of the environment state is used as neurons;
[0097] Hidden layers: Two hidden layers with 24 neurons, both using ReLU (rectified linear unit) as the activation function;
[0098] Output layer: The number of actions is regarded as neurons, that is, the number of neurons is set to 4, corresponding to the four actions of up, down, left, and right;
[0099] Output layer activation function: The output layer uses a linear activation function because DQN aims to output the Q value of each action in order to select the optimal action;
[0100] The model uses mean squared error (MSE) as the loss function and uses the Adam optimizer (an adaptive learning rate optimizer based on the gradient descent algorithm) to optimize the network parameters. This structure allows the agent to predict the Q value of each action based on the current state and select the best action based on these values.
[0101] Furthermore, the step S8 is specifically as follows:
[0102] Use the ε-greedy strategy (a common reinforcement learning strategy for selecting the next action so that the agent balances learning and exploitation) to balance exploration and exploitation, helping the agent to increase exploration in the early stages of learning, and gradually reduce the exploration rate as training progresses, relying more on Q-values to select actions. The specific steps are:
[0103] B1: Randomly select actions based on the exploration rate. When the random number is less than or equal to the exploration rate and the count is greater than 0, the agent will randomly select actions. This is to increase exploration in the initial training stage, explore the environment and learn new experiences by randomly selecting actions;
[0104] B2: Select the best action based on Q value: If the random number is not less than the exploration rate or the count is not greater than 0, the agent will select the best action based on the Q value of the current state, including obtaining the Q value of the current state, each action corresponds to a Q, and selecting the best action based on the Q value, that is, comparing the distances in the horizontal and vertical directions, and selecting the action with a larger Q value, that is, selecting the action with the highest Q value;
[0105] Among them, "count" is a variable used in the loop in each Episode (a complete training cycle), initially set to 5. In the loop of each Episode, "count" is used to control the number of actions that can be taken when the agent interacts with the environment. In each loop iteration, the agent selects an action and executes it, and then "count" is reduced by 1 until "count" drops to 0, at which time the agent has completed the execution of a series of actions.
[0106] Furthermore, the step S9 is specifically as follows:
[0107] The current state state, the selected action action, the reward reward, the next state next_state and the completion flag done are taken as parameters, and this information is packaged into a tuple (state, action, reward, next_state, done) and added to the agent's memory. By continuously adding these tuples to the queue, the agent accumulates a series of experience samples during the training process for subsequent experience playback and neural network training.
[0108] Furthermore, the step S10 is specifically as follows:
[0109] First, check whether there is enough experience in the memory. If the number of experiences in the memory is sufficient, randomly extract samples from the memory for each update to facilitate training. For each sample of experience sampled, first calculate the target Q value. If the current state is not the final state, the target Q value is the current reward plus the discount factor multiplied by the maximum Q value corresponding to the next state. If the current state is the final state, the target Q value is only the current reward. Use the Q value of the current state to predict the target Q value array, and assign the calculated target Q value to the Q value of the corresponding selected action. Train the updated target Q value array with the current state to adjust the parameters of the neural network model. Finally, if the exploration rate is greater than the minimum exploration rate, gradually reduce the exploration rate so that the agent program gradually reduces exploration and makes more use of the learned experience during training.
[0110] The present invention first optimizes the layout of the segmented yard by dividing the yard into rows and segments and adjusting the segments entering the yard; then, taking the yard under the optimal layout as the current environment, the movement strategy of the segments entering and exiting the yard and the movement strategy of the interfering segments are designed, wherein the scheduling strategy for the segments is not limited to one; finally, a deep reinforcement learning algorithm is designed to adaptively select the segment movement strategy under different situations in the yard, thereby training the model data and obtaining the result of the scheduling of the segments in the yard.
[0111] The present invention aims at the problems of disorderly stacking of segments on the segment yard, resulting in low space utilization of the yard and difficulty in moving segments in and out of the yard. The invention is mainly divided into two parts: optimizing the space utilization of the segment yard and reducing the number of interfering segment movements in the yard. The former mainly includes three parts: initializing the segment yard layout and checking the initial layout state; designing the yard layout priority rules; adjusting the segment yard layout and determining the optimal segment yard layout. The latter mainly includes seven parts: taking the yard under the optimal layout as the current environment, designing the movement strategy of the segmented entry and exit of the yard and the movement strategy of the interfering segment; based on the Markov decision process, using the deep Q network algorithm, designing the algorithm's operating environment, including state, action, reward, etc.; setting the parameters and model of the deep Q network algorithm agent, including state size, action size, memory, discount factor, exploration rate, etc.; building a model based on a neural network; selecting an action according to the current state, randomly selecting an action according to the exploration rate or selecting the best action according to the Q value; storing the state, action, reward, next state and completion flag in the memory of the agent; training the neural network model of the agent, training by randomly sampling the experience in the memory, obtaining the maximum cumulative reward, and reducing the number of interfering segment movements. Therefore, the present invention proposes a ship segmented yard scheduling method based on layout optimization, which is suitable for segmented scheduling under different specifications of yard layouts.
[0112] Beneficial effects: Compared with the prior art, the present invention is suitable for segmented scheduling under different specifications of yard layouts. By designing and optimizing the segmented yard layout, the space utilization rate of the segmented yard can be improved. At the same time, based on the optimal yard layout, a segmented movement strategy is designed. The scheduling strategy of the segment in the yard is adaptively selected through a deep reinforcement learning algorithm, which can greatly reduce the number of movements of the segment that interferes with the segment scheduling process, improve the transportation efficiency of the yard, and reduce the scheduling cost. BRIEF DESCRIPTION OF THE DRAWINGS
[0113] Figure 1 It is a schematic diagram of the framework of the method of the present invention;
[0114] Figure 2 Before and after comparison diagram for optimizing yard layout;
[0115] Figure 3 This is the yard occupancy diagram after optimizing the layout;
[0116] Figure 4 A comparison chart of reward values between the present invention and the random strategy scheduling of segmented movement on a data set;
[0117] Figure 5 A time comparison diagram of the present invention and the random strategy of segmented movement scheduling on a data set;
[0118] Figure 6A comparison chart of the number of interference moves on a data set between the present invention and the random strategy for segmented movement scheduling. DETAILED DESCRIPTION
[0119] The present invention is further explained below in conjunction with the accompanying drawings and specific embodiments. It should be understood that these embodiments are only used to illustrate the present invention and are not used to limit the scope of the present invention. After reading the present invention, various equivalent forms of modifications to the present invention by those skilled in the art all fall within the scope defined by the claims attached to this application.
[0120] like Figure 1 As shown, the present invention provides a ship segment yard scheduling method based on layout optimization, comprising the following steps:
[0121] S1: Initialize the segmented yard layout and check the initial layout status;
[0122] S2: Design the priority rules for yard layout;
[0123] S3: Based on the yard layout priority rule, adjust the block yard layout and determine the optimal block yard layout;
[0124] S4: Taking the segmented yard under the optimal layout as the current environment, design the movement strategy of the segments entering and leaving the yard and the movement strategy of the interfering segments;
[0125] S5: Based on the Markov decision process (MDP), the deep Q network algorithm (DQN) is used to design the algorithm's operating environment, including states, actions, rewards, etc.
[0126] S6: Set the parameters and model of the deep Q-network algorithm agent, including state size, action size, memory, discount factor, exploration rate, etc.
[0127] S7: Build a neural network model;
[0128] S8: Select an action based on the current state, randomly select an action based on the exploration rate, or select the best action based on the Q value;
[0129] S9: Store the state, action, reward, next state, and completion flag in the agent's memory;
[0130] S10: The neural network model of the training agent is trained by randomly sampling the experience in memory to maximize the cumulative reward and reduce the number of interfering segment moves.
[0131] Based on the above scheme, the above segmented yard scheduling method is applied as an example in this embodiment, as follows:
[0132] In this example, the actual yard information of a shipyard is selected for simulation analysis. The yard information is shown in Table 1. For each simulation, 50 segments are randomly generated to test the effect of the segmented yard optimization layout. The length of these segments is [9, 25], and the width is a random integer of [9, 15]. In addition, based on the optimized yard layout, a 160×75 yard is used as the research environment. The experimental data of this example is from public data, with a total of 50 task segments.
[0133] Table 1 Actual yard information of a shipyard
[0134]
[0135] The overall framework is as follows Figure 1 As shown, the specific process is:
[0136] 1) Initialize the segmented yard layout and check the initial layout status:
[0137] The segments that have not been stored in the yard are divided into 13 groups according to their lengths, and the yard with known specifications is temporarily divided into 13 rows according to the groups. At this time, the width of each row corresponds to the length of each group after the segments are grouped. Then, the rows divided in the yard are sorted in order from large to small, and the length and width information of the current yard is compared with the length and width information of the original yard. If the length and width of the current yard are within the length and width constraints of the original yard, the layout utilization rate of the yard divided by rows is directly calculated; if it is not within the range, the layout of the segmented yard needs to be further adjusted.
[0138] 2) Design yard layout priority rules:
[0139] Priority rule 1: When the provisional yard length of 13 rows exceeds the original yard length, check for a row with only one or two segments, and check whether the row above the current row can add segments of this row within the yard width. If both are possible, the placement of the row with only one segment is given priority.
[0140] Priority rule 2: When the updated yard length still exceeds the original yard length after executing priority rule 1, check a row with only three or fewer segments, and search the two rows above the row to see whether the segments of this row can be added within the yard width. If both can be done, the placement of the row with only one segment is given priority, followed by two segments, and finally the placement of three segments.
[0141] The interval between rows is 0.5m, which is conducive to the subsequent scheduling of segments entering and leaving the yard, and reduces the close-range interference between segments. In addition, the sum of the widths of the segments placed in each row shall not exceed the width of the yard. If it exceeds, a new row must be added to the next row to place the excess segments that exceed the width of the yard.
[0142] 3) Adjust the layout of the segmented yard and determine the optimal layout of the segmented yard:
[0143] Select the layout optimization function based on priority rule 1, and iterate it in a loop to update the yard layout. If the requirements are still not met after the optimization function of priority rule 1 is iterated, use the layout optimization function based on priority rule 2 to continue updating the layout until the optimized layout result is within the actual specification range of the segmented yard, and the yard under the best optimized layout can be obtained.
[0144] 4) Taking the yard under the optimal layout as the current environment, design the movement strategy of the segmented entry and exit of the yard and the movement strategy of the interfering segment:
[0145] Movement strategy for entering and exiting the yard in stages
[0146] For the target segment to be moved in: place the segment at the outermost side of the row where it needs to be placed, without interfering with the movement;
[0147] For moving out of the target segment:
[0148] Method 1: First move the interference segments out of the field. After the target segments are moved out, arrange the interference segments in descending order according to the time of appearance and put them back into the field;
[0149] Method 2: If there is room in the upper / lower row, move the interfering segment to the adjacent upper / lower row. After the target segment is moved out, do not put it back to the original row. If the interfering segment that has not been put back becomes an interfering segment again in the current row, move it back to the original row.
[0150] Movement strategy for interference segments
[0151] The goal to be optimized is to minimize the number of movements of the interfering segments. The segments have different movement strategies in different situations in the yard, and the number of movements of the interfering segments will also be different. For the target segment to enter the yard, the non-interference segmentation strategy is adopted, so the number of interference movements of the entry segment is 0; for the target segment to leave the yard, first determine whether the hth segment at time t has a target segment to move out of the yard. If and the upper or lower row of the location where the segment is located can be moved out and there is no interfering segment, then the number of interferences is 1; if there is an interfering segment, the exiting segment is moved out in the same row at the location. At this time, if there are fewer interfering segments in this row, the waiting entry segment will not be put back to its original position after being moved out. At this time, the number of interferences for each interfering segment is recorded as 1; if there are more interfering segments, the interfering segment will not be put back to its original position after being moved out. At this time, the number of interferences for each interfering segment is recorded as 2. The objective function of the number of interfering segment movements is expressed as:
[0152]
[0153] Where T is the block yard scheduling cycle; t is the time unit (day); n is the total number of blocks; i is the block number in the scheduling cycle, i∈{1,2,…,n}, and the same time segment may have two tasks: entry and exit; H t The number of tasks that enter and exit the stage in time t; or i The number of blocking segments encountered when segment i exits; Is the h-th segment task at time t to store segment i in the storage yard? If yes, it is 1; otherwise, it is 0; The hth segment i at time t cannot be moved out of the previous or next row, which is 1 if it is, and 0 if it is not; Indicates whether the transport interference segment can be put back to its original position, if not, it is 1, if yes, it is 0.
[0154] The constraints are:
[0155] Due to the limited space of the yard, the segments with similar lengths are classified. Considering the case of similar lengths, suppose that a certain length l a As the standard, the length is approximately 0.5m and is used uniformly in sections. a The same row, now given the candidate length, let the length be l a There are x rows in total, so there should be:
[0156]
[0157] in,
[0158]
[0159] For every x, we have
[0160] X={x 1 ,x 2 ,…,x c},0≤x c ≤x m
[0161] Wherein, c refers to the candidate line width excluding the segments with a length of approximately 0.5 m, and m refers to all candidate line widths.
[0162] Each segment contains the time t of moving into the yard si , time to move out of the yard t ri , length l i and width w i 4 types of information:
[0163] b i =(t si ,t ri ,l i ,w i )
[0164] The arrival time (t si ) and appearance time (t ri )During the scheduling cycle:
[0165] 0≤t s ≤t si ≤t e
[0166] 0≤t s ≤t ri ≤t e
[0167] Among them, t e This is the last day of the scheduling cycle.
[0168] In order to improve the utilization rate of the yard space, it is necessary not only to consider that each segment has a place to store, but also to consider the extreme case, that is, the segment length is much longer than the ordinary segment length or the segment length is much longer than the ordinary segment length. Therefore, at least one row of positions should be set separately for the long segment. The short segment is not set up separately, but merged into the short length row of the ordinary segment. The maximum length is l 1 , the minimum length is l 2 , then the constraints can be written as:
[0169]
[0170]
[0171] x a ≥0,a≤(i={3,...,c})
[0172] Ensure that each mission can only perform one operation on a segment, including entry or exit operations:
[0173]
[0174] in, Whether the h-th segment task at time t is to move segment i out of the yard.
[0175] Each segment can only enter and exit the yard once, and it is executed during its entry and exit time respectively. This formula means that the segment is stored in the yard during its entry time:
[0176]
[0177] Among them, st i is the entry time of segment i.
[0178] The segments are taken out of the yard at their departure time:
[0179]
[0180] Among them, rt i is the appearance time of segment i.
[0181] Establish the mapping relationship between flatbed truck operation and the yard. Ensure that each segment must be in a designated row on the segment yard from the time it enters the yard to the time it leaves the yard:
[0182]
[0183]
[0184] in, The h-th segment task at time t is to move segment i out of the yard.
[0185] 5) Based on the Markov decision process, the deep Q network algorithm (DQN) is used to design the algorithm's operating environment, including states, actions, rewards, etc.:
[0186] A1: In a certain time step, the agent (referring to the entity involved in the learning and decision-making process) will observe the state of the environment, which includes the state of the segmented stacking in the yard and the direction of the road. According to the current state of the segments in the yard, the agent adaptively selects one of the segment movement strategies when updating the yard state next time, so as to minimize the number of interfering segment movements. In this embodiment, the yard is a rectangular site with m cells in the horizontal direction and only 1 cell in the vertical direction, and only the right side in the vertical direction is used as the entrance / exit, so it is defined in the form of m horizontal cells and 2 vertical cells. Its state expression is as follows:
[0187] S t =[s ij ]∈R m×2
[0188] In addition, the intelligence must be able to identify the location information of the segments being stored and the location where the segments that are about to enter the yard should be placed in the yard, and must also be able to identify the exit time of the segments in the yard. Therefore, assuming that a row of the segment yard already has segments placed in the yard, when a new segment needs to enter the row, the segment will adapt to the position in the yard, that is, it will be automatically placed 0.1 meters away from the segments in the yard according to the location of the segments already stored in the yard, and the segments will be placed 0.1 meters apart to prevent unnecessary interference between segments. In addition, the intelligent agent identifies the exit time of the segments in the yard, thereby locking the target segment, and identifies whether there is an interfering segment based on the location of the segment in the yard. If so, it will automatically decide on a most suitable method for scheduling based on the designed mobile strategy.
[0189] A2: When the agent obtains the environment state S, it will give an action A, which includes the transport target segment and the moving interference segment. In the process of transporting the segment, the agent mainly decides an action from five actions: moving up, down, left or right, or loading / unloading a segment. The expression is as follows:
[0190] a t ∈A=[a 1 ,a 2 ,a 3 ,a 4 ,a 5 ]
[0191] A3: The traditional Markov model predicts the future state through the state transition matrix, but when the state space is high-dimensional and continuous, the state transition probability can be used for prediction:
[0192]
[0193] The state transition probability can be learned through neural network.
[0194] A4: At time t, the agent is in state S t Next, select Execute Action a t After executing the segmented movement action, the agent receives the reward and punishment value r t and transfer to the yard state S at the next time t+1 with probability P t+1 ; The agent is in the yard state S t+1 Select and execute segmented move action a t+1 , and obtain the penalty value r at that moment t+1 and transfer to the yard state S at the next time t+2 with probability p t+2 This process will continue until the final target yard state S is reached. t+n The reward values are set as follows:
[0195] (1) When the agent robot approaches the target segment, it is rewarded according to the distance between it and the target segment. The closer the distance, the higher the reward, which is 300.
[0196] (2) When the agent robot reaches the target segment, it will be given an additional reward of 500, indicating that it has successfully reached the target segment.
[0197] (3) If the agent robot successfully moves the segment, it will be given an additional reward of 800.
[0198] (4) A reward of 10,000 is given when all segment tasks are completed, all target segments are correctly moved and placed, and the environment state reaches a "terminated" or "successful" state.
[0199] (5) Select the correct segmented movement action, i.e., up / down / left / right movement. If the action selected by the agent is not among the above actions, the reward value of 100 is deducted.
[0200] (6) When there is an interference segment during the transportation process of the target segment, the interference may lead to mission failure, waste of resources or environmental instability. Therefore, in this case, in order to punish the behavior of the agent robot, the reward is reduced by 2000 to prevent the agent robot from performing actions that may cause interference again.
[0201] The goal of reinforcement learning is to maximize the long-term reward and penalty values in the MDP, so as to learn a strategy for selecting the optimal action. The reward and penalty in the MDP can be expressed as:
[0202]
[0203] Where n represents the number of steps from the current state to the target state in the MDP.
[0204] Reinforcement learning is the process of finding the optimal strategy for a given MDP. The strategy π in the MDP defines the mapping relationship between the agent's actions under the state S. From the above formula, we can see that the acquisition of long-term punishment must wait until the entire MDP process is completed. If the state set is too large, the storage capacity of the entire reinforcement learning system is too large and the operation is too slow. Therefore, in order to learn the optimal strategy, a feasible modeling method is to use the value function approximation. Reinforcement learning introduces two types of value functions: state value function V π (S) and the action-value function Q π (S, a). The state value function represents the expected return obtained in state S, and its Bellman equation form is defined as:
[0205] V(S)=E(r t +γV(S t+1 ))
[0206] The action value function represents the expected return after executing action a in state S. The learning goal of the agent in reinforcement learning is to maximize the action value function. Its Bellman equation is expressed as:
[0207] V(S)=E(r t +γV(S t+1 ))
[0208] Where S′ is the next state corresponding to taking action a in state S; a′ is the action that can obtain the maximum action value function value in state S′.
[0209] According to the Markov characteristic, the relationship between the state value function and the action value function is as follows:
[0210] Q π (S,a)=E[r t+1 +γV π (S t+1 )]
[0211] V π (S) = E a~π(a|S) [Q π (S,a)]
[0212] 6) Set the parameters and model of the Deep Q Network algorithm agent, including state size, action size, memory, discount factor, exploration rate, etc.:
[0213] The state of the environment is the optimized yard information; the action size is set to 4, representing four actions: up, down, left, and right; the experience pool uses a double-ended queue with a maximum length of 2000 to store the experience replay of the agent program; the discount factor is 0.95, which is used when calculating expected future rewards;
[0214] The initial exploration rate is 1.0, which will gradually decay during the training process. The probability of randomly selecting an action during the initial exploration is 100%.
[0215] Among them, the number of characteristics of the environment state is obtained dynamically, and the actual value may vary depending on the state information of the specific environment.
[0216] 7) Build a neural network model:
[0217] Input layer: The number of features of the environment state is used as neurons;
[0218] Hidden layers: Two hidden layers with 24 neurons, both using ReLU (Rectified Linear Unit) as the activation function.
[0219] Output layer: The number of actions is regarded as neurons, that is, the number of neurons is set to 4, corresponding to the four actions of up, down, left, and right.
[0220] Output layer activation function: The output layer uses a linear activation function because DQN aims to output the Q value of each action in order to select the optimal action.
[0221] The model uses mean squared error (MSE) as the loss function and uses the Adam optimizer (an adaptive learning rate optimizer based on the gradient descent algorithm) to optimize the network parameters. This structure allows the agent to predict the Q value of each action based on the current state and select the best action based on these values.
[0222] 8) Select an action based on the current state, randomly select an action based on the exploration rate, or select the best action based on the Q value;
[0223] Use the ε-greedy strategy (a common reinforcement learning strategy for selecting the next action so that the agent balances learning and exploitation) to balance exploration and exploitation, helping the agent to increase exploration in the early stages of learning, and gradually reduce the exploration rate as training progresses, relying more on Q-values to select actions. The specific steps are:
[0224] B1: Randomly select actions based on the exploration rate. When the random number is less than or equal to the exploration rate and the count is greater than 0, the agent will randomly select actions. This is to increase exploration in the initial training stage, explore the environment and learn new experiences by randomly selecting actions;
[0225] B2: Select the best action based on Q value: If the random number is not less than the exploration rate or the count is not greater than 0, the agent will select the best action based on the Q value of the current state. Specifically, it includes obtaining the Q value of the current state, each action corresponds to a Q, and selecting the best action based on the Q value, that is, comparing the distances in the horizontal and vertical directions, and selecting the action with a larger Q value, that is, selecting the action with the highest Q value;
[0226] Among them, "count" is a variable used in the loop in each Episode (a complete training cycle), which is initially set to 5. In the loop of each Episode, "count" is used to control the number of actions that can be taken when the agent interacts with the environment. In each loop iteration, the agent chooses an action and executes it, and then "count" is reduced by 1 until "count" drops to 0, at which time the agent has completed the execution of a series of actions.
[0227] 9) Store the state, action, reward, next state, and completion flag in the agent’s memory:
[0228] The current state, the selected action, the reward, the next state, and the completion flag are taken as parameters. This information is packaged into a tuple (state, action, reward, next_state, done) and added to the agent's memory. By continuously adding these tuples to the queue, the agent accumulates a series of experience samples during the training process for subsequent experience playback and neural network training.
[0229] 10) Train the agent’s neural network model by randomly sampling the experience in memory to maximize the cumulative reward and reduce the number of interfering segment moves:
[0230] First, check whether there is enough experience in the memory. If the number of experiences in the memory is sufficient, randomly extract samples from the memory for each update to facilitate training; for each sample of experience sampled, first calculate the target Q value. If the current state is not the final state, the target Q value is the current reward plus the discount factor multiplied by the maximum Q value corresponding to the next state. If the current state is the final state, the target Q value is only the current reward; use the Q value of the current state to predict the target Q value array, and assign the calculated target Q value to the Q value of the corresponding selected action; train the updated target Q value array with the current state to adjust the parameters of the neural network model; finally, if the exploration rate is greater than the minimum exploration rate, gradually reduce the exploration rate so that the agent gradually reduces exploration and makes more use of the learned experience during training.
[0231] In order to verify the effectiveness of the present invention in optimizing the layout of the yard, this case selected the actual yard information of a shipyard for simulation analysis. The yard information is shown in Table 1. For each simulation, 50 segments are randomly generated to test the effect of the segmented yard optimization layout. The length of these segments is [9,25], and the width is a random integer of [9,15]. Table 2 lists the optimal row number division and yard occupancy rate of the 5 yards in the algorithm scheduling table 1. In this embodiment, a group of segments are grouped according to the same length, and the number of groups is used as the number of rows set in the yard. The length of each group after grouping corresponds to the row width of the yard, and the yard row number division is constrained, that is, it cannot exceed the specifications of the yard itself. The optimization rules of the present invention are used for adjustment to obtain the latest yard optimization results.
[0232] Figure 3 The length occupancy of the yards is obtained by scheduling 10 sets of data for 5 yards. It can be seen from the figure that the yard occupancy of the 5 yards after 10 schedulings is within the range of 90%-100%. The results show that this method can greatly improve the space utilization of the yard. The optimized yard layout is better than most yard layout models. Figure 2 As shown, Figure 2 The left figure in the figure is a layout diagram of a common yard scheduling without optimization. The yard is divided into a grid shape, and the size of the cell is determined by the maximum length and width of the segment specification. Therefore, the available space for placing the segments in the yard is greatly reduced. After the layout optimization scheme of the present invention, Figure 2 As shown in the right figure, the yard can be divided into several rows according to the length of the segment groups, so that segments of different lengths can be placed in different rows, thereby greatly improving the space utilization of the yard.
[0233] Table 2 Optimization results of yard row width division
[0234]
[0235] In order to verify the effectiveness of the segmented scheduling strategy in the present invention, the present invention is based on the optimized yard layout, takes the 160×75 yard as the research environment, uses public data, and has a total of 50 task segments. The present invention also uses the same deep reinforcement learning algorithm, through the random strategy scheduling method (that is, the yard is divided into grids, and the segments are placed arbitrarily in the yard without special preferences, and when the target segment is moved out, if there is interference, the interfering segment is randomly selected to be moved to other cells that do not affect the moving out of the target segment or temporarily moved out of the yard, and the interfering segment is put back into the yard after the target segment is moved out) to compare the strategy scheduling of the present invention with the random scheduling strategy in terms of reward value, time, and the number of times the interfering segment moves;
[0236] like Figure 4 As shown in the figure, a) represents the total reward value obtained by completing a task, and b) refers to the average of the rewards of each step of the task, that is, the average reward of each step of a task. It can be seen from the figure that the reward value obtained by the strategy adopted by the present invention is much greater than the reward value obtained by the random strategy, and there are only a few penalty values. The penalty value of the random strategy is much greater than the reward value.
[0237] like Figure 5 As shown in the figure, a) represents the time taken to complete each task, and b) refers to the time taken to complete each step of a task. As can be seen from the figure, the time taken for each task scheduled by the strategy of the present invention is within 7 seconds, and the time taken for each step of the task is within 4 seconds. The time taken for a task scheduled from start to finish by the random strategy is up to 20 seconds, and the time taken for a step in a task from start to finish is up to 10.5 seconds. That is, the time taken for the segmented tasks scheduled by the random strategy is also much greater than the time taken for the segmented tasks scheduled by the strategy of this paper.
[0238] like Figure 6 As shown in the figure, through the scheduling strategy of the present invention, the number of interfering movements of 50 segments in the yard is at most 4 times, and 21 segments can avoid interference with other segments in the yard, that is, the strategy adopted by the present invention can make the target segment avoid 42% of interfering segments in the process of moving out of the yard, and also greatly reduce the number of movements of interfering segments in the yard; while in the segment scheduling of the random strategy, the number of interfering movements of 50 segments in the yard is at most 32 times, and 14 segments can avoid interference with other segments in the yard, that is, only 28% of interfering segments can be avoided in the process of moving the target segment out of the yard. In addition, the number of times the proxy moves the interfering segments is much greater than the number of mobile interference segments obtained by the strategy designed by the present invention. It can be seen that the yard optimization layout rules and segment movement strategies designed by the present invention not only improve the utilization rate of the yard space, but also greatly reduce the number of movements of the interfering segments in the segment scheduling process, and improve the transportation efficiency of the yard.
Claims
1. A ship block yard scheduling method based on layout optimization, characterized in that: The steps include: S1: Initialize the segmented yard layout and check the initial layout status; S2: Design the priority rules for yard layout; S3: Based on the yard layout priority rule, adjust the block yard layout and determine the optimal block yard layout; S4: Taking the segmented yard under the optimal layout as the current environment, design the movement strategy of the segments entering and leaving the yard and the movement strategy of the interfering segments; S5: Based on the Markov decision process, the deep Q network algorithm is used to design the algorithm's operating environment; S6: Setting parameters and models of the deep Q-network algorithm agent; S7: Build a neural network model; S8: Select an action based on the current state, randomly select an action based on the exploration rate, or select the best action based on the Q value; S9: Store the state, action, reward, next state, and completion flag in the agent's memory; S10: The neural network model of the training agent is trained by randomly sampling the experience in the memory to maximize the cumulative reward and reduce the number of interfering segment moves; The specific process of the method for initializing the segmented storage yard layout and checking the initial layout state in step S1 is as follows: The segments that have not been stored in the yard are divided into x groups according to their lengths, and the yard with known specifications is temporarily divided into x rows according to the groups. At this time, the row width of each row corresponds to the length of each group after the segments are grouped; then the rows divided in the yard are sorted in order from large to small, and the length and width information of the current yard is compared with the length and width information of the current yard. If the length and width of the current yard are within the length and width constraints of the original yard, the layout utilization rate of the yard divided by rows is directly calculated; if it is not within the range, the layout of the segmented yard needs to be further adjusted; The yard layout priority rules in step S2 include priority rule 1 and priority rule 2, which are as follows: Priority rule 1: When the provisional yard length of x rows exceeds the original yard length, check for a row with only one or two segments, and check whether the row above the current row can add a segment of this row within the yard width. If so, the placement of the row with only one segment is preferred; Priority rule 2: When the updated yard length still exceeds the original yard length after executing priority rule 1, check a row with three or fewer segments, and check whether the two rows above the row can add segments to this row within the yard width. If both can be done, the placement of the row with only one segment is given priority, followed by the placement of two segments, and finally the placement of three segments; The interval between rows is (0.5-1) m, which is conducive to the subsequent scheduling of the segments entering and leaving the yard, and reduces the close-range interference between the segments. In addition, the sum of the widths of the segments placed in each row shall not exceed the width of the yard. If it exceeds, a new row shall be added to the next row to place the extra segments exceeding the width of the yard. The method for adjusting the layout of the segmented storage yard and determining the optimal layout of the segmented storage yard in step S3 is: Select the layout optimization function based on priority rule 1, and iterate it in a loop to update the yard layout. If the demand is still not met after the optimization function of priority rule 1 is iterated, the layout optimization function based on priority rule 2 is used to continue updating the layout until the optimized layout result is within the actual specification range of the segmented yard, and the yard under the best optimized layout can be obtained; The specific content of the moving strategy of entering and exiting the yard in sections in step S4 is: For the target segment to be moved in: place the segment at the outermost side of the row where it needs to be placed, without interfering with the movement; For moving out of the target segment: Method 1: First move the interference segments out of the field. After the target segments are moved out, arrange the interference segments in descending order according to the time of appearance and put them back into the field; Method 2: If there is space in the upper / lower row, move the interfering segment to the adjacent upper / lower row, and do not put it back to the original row after the target segment is moved out. If the interfering segment that has not been put back becomes an interfering segment again in the current row, move it back to the original row; The specific content of the movement strategy of the interference segment is: For the target segment to enter the yard, the non-interference segmentation strategy is adopted, so the number of interference moves of the entry segment task is 0; for the target segment to exit the yard, first determine whether the h-th segment at time t has a target segment to move out of the yard. If the upper or lower row of the segment's location is available for it to move out and there is no interfering segment, the number of interferences is 1; if there is an interfering segment, the exit segment is moved out of the same row at its location. At this time, if there are fewer interfering segments in this row, the waiting entry segment will not be put back to its original position after being moved out, and the number of interferences for each interfering segment is recorded as 1; if there are more interfering segments, the interfering segment will not be put back to its original position after being moved out, and the number of interferences for each interfering segment is recorded as 2; The number of segmented movement of the objective function interference is expressed as: Where T is the block yard scheduling cycle; t is the time unit; n is the total number of blocks; i is the block number in the scheduling cycle, i∈{1,2,…,n}, and the same time segment may have two tasks: entry and exit; H t The number of tasks that enter and exit the stage in time t; or i The number of blocking segments encountered when segment i exits; Is the h-th segment task at time t to store segment i in the storage yard? If yes, it is 1; otherwise, it is 0; The hth segment i at time t cannot be moved out of the previous or next row, which is 1 if it is, and 0 if it is not; Whether the transport interference segment can be put back to its original position, if not, it is 1, if yes, it is 0; The constraints are: Due to the limited space of the yard, the segments with similar lengths are classified. Considering the case of similar lengths, suppose that a certain length l a The length is approximately 0.1 to 0.5 m and is used uniformly in sections. a The same row, now given the candidate length, let the length be l a There are x rows in total, so there should be: in, For every x, we have X={x1,x2,…,x c },0≤x c ≤x m Where c refers to the candidate line width excluding the segments with lengths approximately within 0.1 to 0.5 m, and m refers to all candidate line widths; Each segment contains the time t of moving into the yard si , time to move out of the yard t ri , length l i and width w i 4 types of information: b i =(t si ,t ri ,l i ,w i ) The entry time t of the segment of the planned entry is specified si and appearance time t ri During the scheduling cycle: 0≤t s ≤t si ≤t e 0≤t s ≤t ri ≤t e Among them, t e It is the last day of the scheduling cycle; At least one row is set separately for the placement of the long-length segments. The short-length segments are not set separately, but are merged into the short-length rows of the common segments. Assuming the maximum length is l1 and the minimum length is l2, the constraint condition can be written as: x a ≥0,a≤(i={3,...,c}) Ensure that each mission can only perform one operation on a segment, including entry or exit operations: in, Whether the h-th segment task at time t is to move segment i out of the storage yard; Each segment can only enter and exit the yard once, and it is executed during its entry and exit time respectively. The following formula indicates that the segment is stored in the yard during its entry time: Among them, st i is the entry time of segment i; The segments are taken out of the yard at their departure time: Among them, rt i is the appearance time of segment i; Establish a mapping relationship between flatbed truck operations and the yard to ensure that each segment must be in a designated row on the segment yard from the time it enters the yard to the time it leaves the yard: in, The h-th segment task at time t is to move segment i out of the yard; The step S5 is specifically as follows: A1: In a certain time step, the agent will observe the state of the environment, which includes the state of the segment stacking in the yard and the direction of the road. The agent will adaptively select one of the segment movement strategies based on the current state of the segments in the yard when the yard state is updated next time, so as to minimize the number of interfering segment movements. The yard is a rectangular site with m cells in the horizontal direction and only 1 cell in the vertical direction. Only the right side in the vertical direction is used as the entrance / exit, so it is defined in the form of m horizontal cells and 2 vertical cells. Its state expression is as follows: S t =[s ij ]∈R m×2 Assuming that a row of the segment yard already has segments placed in the yard, when a new segment needs to enter the row, the segment will adapt to its position in the yard, that is, it will be automatically placed 0.1 meters away from the segments in the yard according to the positions of the segments already stored in the yard, and the segments will be placed 0.1 meters apart to prevent unnecessary interference between segments; in addition, the agent identifies the exit time of the segments in the yard, thereby locking the target segment, and identifies whether there are interfering segments based on the location of the segment in the yard. If so, it will automatically decide on a most suitable method for scheduling based on the designed mobile strategy; A2: When the agent obtains the environment state S, it will give an action A, which includes the transport target segment and the moving interference segment. The agent decides an action from five actions during the transport segment: move up, down, left or right, or load / unload a segment. The expression is as follows: <h2 style=";text-align:left;direction:ltr">a<h2 style=";text-align:left;direction:ltr"> t <h2 style=";text-align:left;direction:ltr"> ∈A = [a1,a2,a3,a4,a5] A3: The traditional Markov model predicts the future state through the state transition matrix, but when the state space is high-dimensional and continuous, the state transition probability is used for prediction: The state transition probability can be learned through neural network; A4: At time t, the agent is in state S t Next, select Execute Action a t After executing the segmented movement action, the agent receives the reward and punishment value r t and transfer to the yard state S at the next time t+1 with probability P t+1 ; The agent is in the yard state S t+1 Select and execute segmented move action a t+1 , and obtain the penalty value r at that moment t+1 and transfer to the yard state S at the next time t+2 with probability p t+2 This process will continue until the final target yard state S is reached. t+n ; The reward values are set as follows: 1) When the agent robot approaches the target segment, it will be rewarded according to the distance between it and the target segment; the closer the distance, the higher the reward, which is 300 to 500; 2) When the agent robot reaches the target segment, it will be given an additional reward of 500 to 1000, indicating that it has successfully reached the target segment; 3) If the agent robot successfully moves a segment, it will be given an additional reward of 800 to 1200; 4) When all segment tasks are completed, all target segments are correctly moved and placed, and the environment state reaches a "terminated" or "successful" state, a reward of 10,000 to 15,000 will be given; 5) Select the correct segmented movement action, i.e. up / down / left / right movement. If the action selected by the agent is not among the above actions, the reward value will be deducted by 100-500; 6) When there is an interference segment in the target segment during the transport process, in order to punish the agent robot's behavior, the reward will be reduced by 2000-2500 to prevent the agent robot from performing actions that may cause interference again; The goal of reinforcement learning is to maximize the long-term reward and penalty value in the Markov decision process, where the Markov decision process is represented as MDP, so as to learn a strategy for selecting the optimal action, where the reward and penalty in MDP are represented as: Where n represents the number of steps from the current state to the target state in the MDP; Reinforcement learning is the process of finding the optimal strategy for a given MDP; the strategy π in the MDP defines the mapping relationship between the agent's actions under the state S. From the above formula, we can see that the acquisition of long-term punishment must wait until the entire MDP process is completed. If the state set is too large, the storage capacity of the entire reinforcement learning system is too large and the operation is too slow. Therefore, in order to learn the optimal strategy, a feasible modeling method is to use the value function approximation. Reinforcement learning introduces two types of value functions: state value function V π (S) and the action-value function Q π (S, a), where the state value function represents the expected return obtained in state S, and its Bellman equation form is defined as: V(S)=E(r t +γV(S t+1 )) The action value function represents the expected return after executing action a in state S. The learning goal of the agent in reinforcement learning is to maximize the action value function, and its Bellman equation is expressed as: V(S)=E(r t +γV(S t+1 )) In the formula, S′ is the next state corresponding to taking action a in state S; a′ is the action that can obtain the maximum action value function value in state S′; According to the Markov characteristic, the relationship between the state value function and the action value function is as follows: Q π (S,a)=E[r t+1 +γV π (S t+1 )] 2. A method for scheduling ship staging yards based on layout optimization according to claim 1, characterized in that: The neural network model constructed in step S7 includes an input layer, a hidden layer, an output layer, and an output layer activation function, which are specifically as follows: Input layer: The number of features of the environment state is used as neurons; Hidden layers: Two hidden layers with 24 neurons, both using ReLU as the activation function; Output layer: The number of actions is regarded as neurons, that is, the number of neurons is set to 4, corresponding to the four actions of up, down, left, and right; Output layer activation function: The output layer uses a linear activation function because DQN aims to output the Q value of each action in order to select the optimal action; The model uses mean squared error (MSE) as the loss function and uses the Adam optimizer to optimize the network parameters. This structure allows the agent to predict the Q value of each action based on the current state and choose the best action based on these values.
3. The method for scheduling ship staging yards based on layout optimization according to claim 1 is characterized in that: The step S8 is specifically as follows: B1: Randomly select actions based on the exploration rate. When the random number is less than or equal to the exploration rate and the count is greater than 0, the agent will randomly select actions. This is to increase exploration in the initial training stage, explore the environment and learn new experiences by randomly selecting actions; B2: Select the best action based on Q value: If the random number is not less than the exploration rate or the count is not greater than 0, the agent will select the best action based on the Q value of the current state, including obtaining the Q value of the current state, each action corresponds to a Q, and selecting the best action based on the Q value, that is, comparing the distances in the horizontal and vertical directions, and selecting the action with a larger Q value, that is, selecting the action with the highest Q value; Among them, "Count" is a variable used in the loop in each Episode. In the loop of each Episode, "Count" is used to control the number of actions performed when the agent interacts with the environment. In each loop iteration, the agent selects an action and executes it, and then "Count" is reduced by 1 until "Count" drops to 0, at which time the agent has completed the execution of a series of actions.
4. The method for scheduling ship staging yards based on layout optimization according to claim 1 is characterized in that: The step S9 is specifically as follows: The current state state, the selected action action, the reward reward, the next state next_state and the completion flag done are taken as parameters, and this information is packaged into a tuple (state, action, reward, next_state, done) and added to the agent's memory. By continuously adding these tuples to the queue, the agent accumulates a series of experience samples during the training process for subsequent experience playback and neural network training.
5. The method for scheduling ship staging yards based on layout optimization according to claim 3 is characterized in that: The step S10 is specifically as follows: First, check whether there is enough experience in the memory. If the number of experiences in the memory is sufficient, randomly extract samples from the memory for each update to facilitate training. For each sample of experience sampled, first calculate the target Q value. If the current state is not the final state, the target Q value is the current reward plus the discount factor multiplied by the maximum Q value corresponding to the next state. If the current state is the final state, the target Q value is only the current reward. Use the Q value of the current state to predict the target Q value array, and assign the calculated target Q value to the Q value of the corresponding selected action. Train the updated target Q value array with the current state to adjust the parameters of the neural network model. Finally, if the exploration rate is greater than the minimum exploration rate, gradually reduce the exploration rate so that the agent program gradually reduces exploration and makes more use of the learned experience during training.
Citation Information
Patent Citations
Modeling approach for shipbuilding enterprise subsection workshop spatial scheduling model based on cellular machine
CN102968523A
An unmanned ship path planning method based on a Q learning neural network
CN109726866A
Intelligent fault diagnosis and reconstruction method for ship area distribution power system
CN112733962A
Multi-target dynamic flexible job shop scheduling method about energy consumption based on deep reinforcement learning
CN116644902A
Sectional type semi-active heave compensation system and compensation method for ship
CN117087811A
Cited By
Simulation measurement and calculation method for ship block tire position space arrangement based on resource constraint
CN122113412A
