A method for optimizing inbound transportation cost based on double-layer improved genetic algorithm

By adopting the two-layer improved genetic algorithm and spatial segmentation method in prefabricated buildings, the problem of excessive internal transportation costs caused by component storage and transportation allocation is solved, and more efficient internal transportation costs are achieved.

CN115081734BActive Publication Date: 2025-05-06ANHUI WATER RESOURCES DEV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210835893.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-15
Publication Date
2025-05-06
Estimated Expiration
2042-07-15

AI Technical Summary

Technical Problem

In prefabricated buildings, the unreasonable storage and transportation allocation of components lead to excessive internal transportation costs, and traditional genetic algorithms are too slow in the three-dimensional space optimization problem, making it difficult to meet real-time requirements.

Method used

The internal transport cost optimization method based on the double-layer improved genetic algorithm is adopted. The first layer improves the genetic algorithm through the particle swarm algorithm to improve the optimization speed in three-dimensional space. The second layer uses the spatial segmentation method to simplify the workshop layout steps and optimize the temporary storage area storage and vehicle loading rate.

Benefits of technology

It effectively reduces internal transportation costs, and achieves more efficient component allocation and transportation plans by improving the storage capacity of temporary storage areas and vehicle loading rates.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115081734B_ABST
    Figure CN115081734B_ABST
Patent Text Reader

Abstract

The present invention discloses an internal transportation cost optimization method based on a double-layer improved genetic algorithm, comprising the following steps: the first layer abstracts the temporary storage area into a cuboid, establishes a double coordinate axis system, and obtains a scheme for components to enter the temporary storage area; one-dimensional genetic coding is performed on the loadable components and an initial population is generated, the population is updated based on a particle swarm algorithm, the fitness value is calculated and it is continuously iterated, and the optimal component layout scheme is output; the second layer selects the components that need to be transported internally based on the optimal component layout scheme and numbers them in sequence, and the idle vehicles are numbered in sequence; the maximum component number is used as the chromosome gene number, and the vehicle number is used as the gene for one-dimensional genetic coding and an initial population is generated, and the layout scheme of each vehicle is quickly solved based on the space segmentation method for each vehicle loading scheme, and the vehicle allocation and loading layout scheme with the lowest internal transportation cost value is continuously iterated. The present invention can solve the problem of excessively high internal transportation costs caused by unreasonable storage and transportation allocation of components.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of prefabricated buildings, and in particular to an internal transportation cost optimization method based on a double-layer improved genetic algorithm. Background Art

[0002] Prefabricated buildings have become a green and environmentally friendly building model that has attracted much attention in recent years. With the strong call of government departments, the rapid development of prefabricated buildings has brought about a continuous increase in the types of components. During the component production process, components that are not needed at the project site will be stacked in the temporary storage area of ​​the workshop. If they are full, they will be transported to the yard, which will incur an internal transportation fee. Due to the large size of the components, professionals are required to formulate a transportation plan, which undoubtedly increases the transportation cost. Workers cannot maximize the use of the temporary storage area space, cannot reasonably allocate components to vehicles, and cannot reasonably formulate a layout plan for each vehicle component based on manual experience. The high frequency of internal transportation leads to excessively high internal transportation costs. Genetic algorithms are intelligent algorithms commonly used by researchers to solve spatial loading problems. However, for the optimization problem of three-dimensional space, genetic algorithms have obvious disadvantages, that is, the algorithm speed is too slow, and the formulation of transportation plans has high real-time requirements. Therefore, the steps of traditional genetic algorithms are not completely applicable. Summary of the invention

[0003] The purpose of the present invention is to provide an internal transportation cost optimization method based on a double-layer improved genetic algorithm, which can solve the problem of excessively high internal transportation costs caused by unreasonable storage and transportation allocation of components.

[0004] The present invention proposes a method for optimizing inbound transportation costs based on a double-layer improved genetic algorithm. According to an embodiment of the present invention, the method comprises the following steps:

[0005] (1) In the first layer, the temporary storage area is abstracted as a cuboid, and the left rear and right front of the cuboid are set as the coordinate origins. A double coordinate axis system is established. In addition to the top surface of the cuboid, the other five surfaces of the cuboid are numbered to obtain a plan for the components to enter the temporary storage area.

[0006] (2) Perform one-dimensional genetic coding on the loadable components and generate an initial population. The one-dimensional genetic coding results in a one-dimensional matrix, which is a chromosome. The population is updated based on the particle swarm algorithm, the fitness value is calculated and iterated continuously, and the optimal component layout scheme is output;

[0007] (3) The second layer selects the components that need to be transported based on the optimal component layout scheme obtained in step (2) and numbers them in sequence, and numbers the existing idle vehicles in sequence;

[0008] (4) The maximum component number is used as the chromosome gene number, and the vehicle number is used as the gene for one-dimensional genetic encoding and an initial population is generated. The layout plan of each vehicle is quickly solved based on the spatial segmentation method for each vehicle loading plan. The fitness value is calculated through continuous iteration and reproduction, and the vehicle allocation and loading layout plan with the lowest internal transportation cost is output.

[0009] In addition, the internal transportation cost optimization method based on the double-layer improved genetic algorithm according to the above embodiment of the present invention may also have the following additional technical features:

[0010] In some embodiments of the present invention, in the step (1), the method for establishing the dual coordinate axis system is specifically as follows: the temporary storage area is abstracted as a cuboid, the left rear side of the cuboid is set as the coordinate origin O, and the X, Y, and Z axes are established with the length, width, and height close to the origin O; the right front side of the cuboid is set as the coordinate origin O', and the X', Y', and Z' axes are established with the length, width, and height close to the origin O';

[0011] The faces of the cuboid are numbered as follows: except for the top face of the cuboid, the other five faces are numbered 1, 2, 3, 4, and 5 in order. The longer side of the cuboid is the length, the shorter side is the width, and the shortest side is the height. The face formed by the length and width is placed on a horizontal plane as the bottom face. The front of the cuboid is numbered 1, the back is numbered 2, the left side is numbered 3, the right side is numbered 4, and the bottom face is numbered 5.

[0012] The scheme for components to enter the temporary storage area is expressed in the following manner: [a, b, c], where a represents the scheme number, b represents the number of the cuboid surface, c represents the coordinate axis in the dual coordinate axis system, and the symbols in [] mean that the scheme numbered a represents that the surface of the component numbered b enters the temporary storage area parallel to the c axis.

[0013] In some embodiments of the present invention, in step (2), the one-dimensional genetic encoding method is as follows:

[0014] The encoding is performed according to [N1 N2 N3 N4 N5 N6], where [N1 N2 N3 N4 N5 N6] represents an element, an element represents a component, N1, N2, and N3 represent the length, width, and height of the component respectively; the six faces of the component, namely, top, bottom, left, right, front, and back, are numbered 1, 2, 3, 4, 5, and 6 respectively, and N4 represents the number of the component face; N6 represents the sequence number of the component entering the temporary storage area; if N5 is 0, it means that the longer side of the component enters in parallel with the solution represented by N6, and if it is 1, it means that the shorter side of the component enters in parallel with the solution represented by N6.

[0015] In some embodiments of the present invention, in step (2), a one-dimensional matrix [[N1 N2N3 N4 N5 N6] ... [N1 N2 N3 N4 N5 N6]] is obtained by one-dimensional genetic coding, and a method for updating the population based on a particle swarm algorithm is as follows:

[0016] The update formula for all elements in a one-dimensional matrix is ​​as follows:

[0017]

[0018] Where Math.random() represents the random function random() in the Math library in the computer programming language JAVA; the k value determines the component number; X ij Represents any element in a one-dimensional matrix, X ij The corresponding six elements in [] are [N1 N2 N3N4 N5 N6]; S represents the component, l represents the length of the component, w represents the width of the component, and h represents the height of the component. They are just an identifier and do not represent any value; random.nextInt(0,6)+1, where 0 and 6 are fixed values, this formula represents the random generation of integers between 1 and 6, because the component is abstracted as a rectangular parallelepiped with six faces; random.nextInt()%2, this formula represents the random generation of an integer and then the modulus operation, so the result can only be 0 or 1, because the result of N5 can only be 0 or 1; random.nextInt()(1,21)-1, where 1 and 21 are fixed values, this formula represents the random generation of integers between 0 and 19, because the sequence number of the scheme entering the temporary storage area is 0 to 19.

[0019] In some embodiments of the present invention, in step (2), the fitness value is calculated using a fitness function, and the fitness function formula is as follows:

[0020]

[0021] Where K represents the number of components that can be loaded in the temporary storage area; V represents the total volume of the temporary storage area; L, W, and H represent the length, width, and height of each component, respectively.

[0022] In some embodiments of the present invention, in step (2), the iteration method is as follows:

[0023] Step 1: Each chromosome represents a temporary storage area storage scheme;

[0024] Step 2: Update each chromosome in the population according to the update formula;

[0025] Step 3: Calculate the fitness value of each chromosome based on the fitness function;

[0026] Step 4: Save and update the chromosome with the largest fitness value;

[0027] Step 5: Determine whether the maximum number of iterations of the algorithm has been reached. If so, the algorithm ends and outputs the chromosome with the largest fitness value, that is, the component layout plan in the optimal temporary storage area; if not, jump to step 2.

[0028] In some embodiments of the present invention, in step (4), one-dimensional genetic encoding and generating an initial population are specifically as follows:

[0029] The number of components that can be loaded is the number of chromosome genes, and the vehicle numbers are used as genes to disperse on the chromosomes. The initial population is represented as follows: [ABCDEF …], where the number of values ​​in [] represents the number of components, i.e., the length of the chromosome, ABCDEF … respectively refer to the vehicle numbers, and the component numbers are the position order corresponding to the vehicle numbers.

[0030] In some embodiments of the present invention, in step (4), solving the layout scheme of each vehicle component based on the space segmentation method is specifically as follows:

[0031] 1) Label each surface of the component

[0032] Take the longest side of the component as the length, the second longest side as the width, and the shortest side as the height, and place the surface formed by the length and width as the front face on a horizontal plane. The front face is labeled 1, the back face is labeled 2, the left face is labeled 3, the right face is labeled 4, the top face is labeled 5, and the bottom face is labeled 6;

[0033] 2) Component placement method

[0034] Set the vehicle loading space component coordinate system, set the left rear of the vehicle loading space as the coordinate origin O, and establish the X, Y, and Z axes with the length, width, and height close to the origin O. The plane formed by the X axis and the Y axis is the bottom surface for component placement. The bottom surface is composed of multiple placement surfaces. The space above the placement surface is the placement space. The component placement method is as follows: first finish stacking one of the placement spaces. The stacking order in the placement space is from bottom to top along the Z axis, and then select the next placement space for re-stacking. The order of placing components on the bottom surface is from left to right along the X axis and from back to front along the Y axis;

[0035] 3) Determine which side of all components to be loaded on each vehicle should enter parallel to the x-axis:

[0036] Determined by the formula: x = random.nextInt(0,6)+1, where 0 and 6 are fixed values, this formula represents the random generation of integers between 1 and 6;

[0037] 4) Determine the bottom area of ​​the component according to the direction in which the component enters the vehicle loading space. Sort all components that need to be loaded on each vehicle from large to small according to the bottom area, and mark all components as not put in. Secondly, redefine the length and width of the component, with the length of the side parallel to the X-axis of the bottom surface of the component entering the vehicle loading space as the length, the length of the side parallel to the Y-axis as the width, and the side parallel to the Z-axis as the height;

[0038] 5) Arrange each vehicle component according to the component placement method

[0039] A. Under the premise of not exceeding the vehicle height limit, select the components that have not been placed according to the component bottom area sorting in step 4);

[0040] B. First, select a placement space according to the component placement method. In the same placement space, if the length and width of the selected component after redefinition are both less than or equal to the length and width of the base component, and the height is less than or equal to the height in the placement space minus the total height of the components already placed in the placement space, the component is marked as already placed, and the component is placed according to the component placement method;

[0041] C. If any of the length and width of the selected component is larger than the length and width of the base component, it is marked as not placed. If the height of the selected component is larger than the height in the placement space minus the total height of the components already placed in the placement space, it is marked as not placed.

[0042] D. Select the next component in the order of base area and jump to step B;

[0043] E. When one placement space is completed, select the next placement space according to the component placement method, jump to step B, and place the components that have not been placed until all components are in the placed state, and step 5) ends.

[0044] In some embodiments of the present invention, in step (4), the fitness function formula is as follows:

[0045]

[0046] Where N is the number of assigned vehicles, p is the unit price per ton of components transported by the vehicle, and w is the number of tons of components carried by the vehicle.

[0047] Compared with the prior art, the present invention has the following beneficial effects:

[0048] The present invention aims to solve the problem of excessively high internal transportation costs caused by unreasonable storage and transportation allocation of components. In the first layer, the particle swarm algorithm is used to improve the genetic algorithm to improve the optimization speed of the algorithm in three-dimensional space; in the second layer, the space segmentation method is used to improve the genetic algorithm to simplify the workshop layout steps. The storage capacity of the temporary storage area is increased from the source, and the vehicle loading rate is increased from the end to control the vehicle allocation. The two complement each other and can effectively reduce the internal transportation costs. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] Figure 1 The present invention is a flowchart of an internal transportation cost optimization method based on a double-layer improved genetic algorithm in an embodiment of the present invention.

[0050] Figure 2 The present invention is a loading layout flow chart based on the space segmentation method in an embodiment of the present invention. DETAILED DESCRIPTION

[0051] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0052] like Figure 1 As shown, this embodiment discloses a method for optimizing internal transportation costs based on a double-layer improved genetic algorithm, comprising the following steps:

[0053] 101. The first layer abstracts the temporary storage area into a cuboid, sets the left rear and right front of the cuboid as the coordinate origin, and establishes a double coordinate axis system; except for the upper surface of the cuboid, the five faces of the cuboid are numbered.

[0054] 1011. Establish a dual coordinate axis system: abstract the temporary storage area into a cuboid, set the left rear side of the cuboid as the coordinate origin O, and establish the X, Y, and Z axes with the length, width, and height close to the origin O; set the right front side of the cuboid as the coordinate origin O', and establish the X', Y', and Z' axes with the length, width, and height close to the origin O'.

[0055] 1012. Rectangular prism face numbering: A rectangular prism has 6 faces. According to actual conditions, components can be entered from 5 of the following faces: bottom, left, right, front and back. It is impossible to enter from the top and place them in mid-air. Therefore, except for the top surface of the rectangular prism, the other 5 faces are numbered 1, 2, 3, 4 and 5 in sequence. The specific face numbering of the rectangular prism is as follows: the longer side of the rectangular prism is taken as the length, the shorter side as the width, and the shortest side as the height. The face formed by the length and width is placed on a horizontal plane as the bottom. The front of the rectangular prism is numbered 1, the back is numbered 2, the left side is numbered 3, the right side is numbered 4, and the bottom is numbered 5.

[0056] 1013. Scheme type: The scheme for components to enter the temporary storage area is expressed in the following manner: [a, b, c], where a represents the scheme number, b represents the number of the cuboid surface, and c represents the coordinate axis in the dual coordinate axis system. The symbols in [] mean that the scheme with sequence number a represents that the surface of the component with sequence number b enters the temporary storage area parallel to the c axis.

[0057] Specifically, there are several possibilities for the component to enter the cuboid: [0,1,X], [1,1,Y], [2,1,X'], [3,1,Y'], [4,2,Y], [5,2,Y'], [6,2,Z], [7,2,Z'], [8,3,Y], [9,3,Y'], [10,3,Z], [11,3,Z'], [12,4,X], [13,4,X'], [14,4,Z], [15,4,Z'], [16,5,X], [17,5,X'], [18,5,Z], [19,5,Z'].

[0058] Take [0, 1, X] as an example: the scheme with serial number 0 means that the surface of the component numbered 1 enters the temporary storage area parallel to the X-axis.

[0059] The dual coordinate axis system is used here due to the constraints of delivery time. The manufacturer hopes that components with later delivery times can be placed at the bottom as much as possible. If a single coordinate axis is stacked only from one corner, components with later delivery dates can choose a smaller space. If a dual coordinate axis is stacked divergently from the four corners, there will be more space to accommodate components with later delivery dates at the bottom.

[0060] 102. Perform one-dimensional genetic coding on the [rotated cuboid with length, width, height and surface] of the loadable component and generate the initial population. The one-dimensional matrix is ​​obtained from the one-dimensional genetic coding. The one-dimensional matrix is ​​a chromosome. The population is updated based on the particle swarm algorithm, the fitness value is calculated and iterated continuously, and the optimal component layout plan is output;

[0061] 1021. The form of one-dimensional genetic coding is as follows:

[0062] [[70 50 20 4 0 14][90 65 25 2 1 12]…[85 55 25 3 0 12]]

[0063] Take the element [N1 N2 N3 N4 N5 N6] as an example to illustrate its physical meaning. One element represents a component, and N1, N2, and N3 represent the length, width, and height of the component respectively. The six faces of the component, namely, top, bottom, left, right, front, and back, are numbered 1, 2, 3, 4, 5, and 6 respectively, and N4 represents the number of the component face. N6 represents the sequence number of the scheme in step 1013. If N5 is 0, it means that the longer side of the component enters in parallel with the scheme represented by N6, and if it is 1, it means that the shorter side of the component enters in parallel with the scheme represented by N6.

[0064] 1022. Given that the particle swarm algorithm updates the population:

[0065] The temporary storage area in the first layer is large in size, can load a large number of components, and takes a long time to find the optimal solution. Therefore, the particle swarm algorithm is used to replace the crossover and mutation operations of the genetic algorithm with the update operation.

[0066] The one-dimensional matrix [[N1 N2 N3 N4 N5 N6]…[N1 N2 N3 N4 N5 N6]] is obtained from the one-dimensional genetic coding. The method of updating the population based on the particle swarm algorithm is as follows:

[0067] The update formula for all elements in a one-dimensional matrix is ​​as follows:

[0068]

[0069] Where Math.random() represents the random function random() in the Math library in the computer programming language JAVA; the k value determines the component number; X ij Represents any element in a one-dimensional matrix, X ij The corresponding six elements in [] are [N1 N2 N3N4 N5 N6]; S represents the component, l represents the length of the component, w represents the width of the component, and h represents the height of the component. They are just an identifier and do not represent any value; random.nextInt(0,6)+1, where 0 and 6 are fixed values, this formula represents the random generation of integers between 1 and 6, because the component is abstracted as a rectangular parallelepiped with six faces; random.nextInt()%2, this formula represents the random generation of an integer and then the modulus operation, so the result can only be 0 or 1, because the result of N5 can only be 0 or 1; random.nextInt(1,21)-1, where 1 and 21 are fixed values, this formula represents the random generation of integers between 0 and 19, because the sequence number of the scheme entering the temporary storage area is 0 to 19.

[0070] 1023. The fitness value is calculated using the fitness function. The fitness function formula is as follows:

[0071]

[0072] Where K represents the number of components that can be loaded in the temporary storage area; V represents the total volume of the temporary storage area; L, W, and H represent the length, width, and height of each component, respectively; the objective function f indicates that the larger the loadable volume, the higher the loading rate.

[0073] 1024. Calculate the fitness value and iterate continuously. The iterative process is as follows:

[0074] Step 1: Assume that the first generation of the population is M=0, and each chromosome in the population represents a temporary storage area storage scheme;

[0075] Step 2: Update each chromosome in the population according to the update formula;

[0076] Step 3: Calculate the fitness value of each chromosome based on the fitness function;

[0077] Step 4: Save and update the chromosome with the largest fitness value, M = M + 1;

[0078] Step 5: Determine whether M has reached the maximum number of iterations of the algorithm. If so, the algorithm ends and outputs the chromosome with the largest fitness value, which is the temporary storage area storage plan; otherwise, jump to step 2.

[0079] 1025. Output the optimal component layout plan, including the following information:

[0080] The optimal component layout plan will clearly specify which surface and direction the components enter the temporary storage area from and how they are placed.

[0081] 103. The second layer selects the components that need to be transported in accordance with the optimal component layout plan and numbers them in sequence, and numbers the existing idle vehicles in sequence;

[0082] 104. The maximum component number is used as the chromosome gene number, and the vehicle number is used as the gene for one-dimensional genetic coding and generating the initial population. For each vehicle loading plan, the layout plan of each vehicle is quickly solved based on the space segmentation method, and the fitness value is calculated by continuous iteration and reproduction, and the vehicle allocation and loading layout plan with the lowest internal transportation cost is output;

[0083] 1041. The one-dimensional genetic coding method using the maximum component number as the chromosome gene number and the vehicle number as the gene is as follows:

[0084] The initial population is expressed as follows: [ABCDEF …], where the number of values ​​in [] represents the number of components, i.e., the length of the chromosome, ABCDEF … refer to the vehicle numbers, and the component numbers are the positional order corresponding to the vehicle numbers.

[0085] Here is an example:

[0086] [1 1 12 12 14 12 4 … 13 12 4 3 2 2 3]

[0087] The length of each chromosome in the population is determined by the total number of components that need to be loaded. If there are 16 components that need to be loaded, the length of the chromosome is 16 and the components are numbered in sequence from 1 to 16. Then [11121214...] means: the component numbered 1 is loaded into the vehicle numbered 1, the component numbered 2 is loaded into the vehicle numbered 1, the component numbered 3 is loaded into the vehicle numbered 12, the component numbered 4 is loaded into the vehicle numbered 12, the component numbered 5 is loaded into the vehicle numbered 14, and so on.

[0088] 1042. Each chromosome can determine the components that need to be loaded on each vehicle. Then, each vehicle uses the space segmentation method to determine how to place the components in each vehicle. For each vehicle loading plan, the layout plan of each vehicle is quickly solved based on the space segmentation method, including the following steps:

[0089] The components in the second layer are larger in size and the vehicle space is smaller. Therefore, compared with the particle swarm algorithm used in the first layer, the space segmentation method with simple algorithm steps and easy implementation is more appropriate.

[0090] The layout scheme of each vehicle component based on the space segmentation method is as follows:

[0091] 1) Label each surface of the component

[0092] Take the longest side of the component as the length, the second longest side as the width, and the shortest side as the height, and place the surface formed by the length and width as the front face on a horizontal plane. The front face is labeled 1, the back face is labeled 2, the left face is labeled 3, the right face is labeled 4, the top face is labeled 5, and the bottom face is labeled 6;

[0093] 2) Component placement method

[0094] Set the vehicle loading space component coordinate system, set the left rear of the vehicle loading space as the coordinate origin O, and establish the X, Y, and Z axes with the length, width, and height close to the origin O. The plane formed by the X axis and the Y axis is the bottom surface for component placement. The bottom surface is composed of multiple placement surfaces. The space above the placement surface is the placement space. The component placement method is as follows: first finish stacking one of the placement spaces. The stacking order in the placement space is from bottom to top along the Z axis, and then select the next placement space for re-stacking. The order of placing components on the bottom surface is from left to right along the X axis and from back to front along the Y axis;

[0095] 3) Determine which side of all components to be loaded on each vehicle should enter parallel to the x-axis:

[0096] Determined by the formula: x = random.nextInt(0,6)+1, where 0 and 6 are fixed values, this formula represents the random generation of integers between 1 and 6;

[0097] 4) Determine the bottom area of ​​the component according to the direction in which the component enters the vehicle loading space. Sort all components that need to be loaded on each vehicle from large to small according to the bottom area, and mark all components as not put in. Secondly, redefine the length and width of the component, with the length of the side parallel to the X-axis of the bottom surface of the component entering the vehicle loading space as the length, the length of the side parallel to the Y-axis as the width, and the side parallel to the Z-axis as the height;

[0098] 5) Arrange each vehicle component according to the component placement method

[0099] A. Under the premise of not exceeding the vehicle height limit, select the components that have not been placed according to the component bottom area sorting in step 4);

[0100] B. First, select a placement space according to the component placement method. In the same placement space, if the length and width of the selected component after redefinition are both less than or equal to the length and width of the base component, and the height is less than or equal to the height in the placement space minus the total height of the components already placed in the placement space, the component is marked as already placed, and the component is placed according to the component placement method;

[0101] C. If any of the length and width of the selected component is larger than the length and width of the base component, it is marked as not placed. If the height of the selected component is larger than the height in the placement space minus the total height of the components already placed in the placement space, it is marked as not placed.

[0102] D. Select the next component in the order of base area and jump to step B;

[0103] E. When one placement space is completed, select the next placement space according to the component placement method, jump to step B, and place the components that have not been placed until all components are in the placed state, and step 5) ends.

[0104] like Figure 2 As shown, there are three components that need to be placed in the vehicle loading space. After determining which face of the component is parallel to the x-axis to enter the loading space, redefine the length, width and height of the component. The length, width and height of the first component is [l1 w1 h1], the length, width and height of the second component is [l2 w2 h2], and the length, width and height of the third component is [l3 w3 h3]. Now it is necessary to place a vehicle space with a length, width and height of [LWH]. The steps are as follows:

[0105] Assume that the results of sorting the three components according to different attributes are as follows:

[0106] Bottom area: the first component > the third component > the second component;

[0107] Length: the third component > the first component > the second component;

[0108] Width: first component > third component > second component.

[0109] The first component is selected according to the bottom area attribute. The first component [l1 w1 h1] enters the vehicle loading space. If H>h1, it is directly placed in and marked as placed in the vehicle loading space. After the first component is placed in the vehicle loading space, the bottom area of ​​the first component constitutes the placement surface, and the space above the placement surface constitutes the placement space.

[0110] The third component is selected according to the bottom area attribute. The third component [l3 w3 h3] enters the vehicle loading space. H>(h1+h3), but l3>l1, so the third component is skipped and marked as not placed.

[0111] The second component is selected according to the bottom area attribute. The second component [l2 w2 h2] enters the vehicle loading space. If H>(h1+h2), l1>l2, w1>w2, the second component is placed and marked as placed.

[0112] Continue to select components according to the bottom area attribute. If the third component is not placed, select the third component and continue to stack components along the z-axis according to the component placement method. Then mark the components as placed. The third component constitutes the second placement space. At this point, all components are marked as placed, and the layout process of the vehicle components is completed.

[0113] 1043. Calculate the fitness value according to the fitness function. The fitness function formula is as follows:

[0114]

[0115] In the formula, N represents the number of assigned vehicles; p represents the unit price of each ton of components transported by the vehicle; w represents the tonnage of components carried by the vehicle; the formula calculates the required internal transportation cost based on the tonnage of components.

[0116] 1044. The algorithm iteration process is as follows:

[0117] Step 1: Assume the first generation of the population M1 = 0, perform one-dimensional genetic encoding on each vehicle and generate the initial population;

[0118] Step 2: Determine whether M1 has reached the maximum number of iterations of the algorithm. If so, the algorithm ends and jumps to step 9; otherwise, jumps to step 3;

[0119] Step 3: Parent generation crossover mutation generates offspring;

[0120] Step 4: Assume that all offspring in the population have a total of NM chromosomes and N = 0;

[0121] Step 5: Determine whether N is less than or equal to NM. If so, jump to step 6; otherwise, jump to step 2;

[0122] Step 6: Select a chromosome from the offspring. A chromosome represents a component allocation scheme. The component allocation scheme will specify the component set allocated to each vehicle.

[0123] Step 7: Use the space segmentation method to determine the layout of each vehicle's components. The layout of the components will specify how to place the components in the vehicle.

[0124] Step 8: Calculate the fitness value according to the fitness function;

[0125] Step 9: Save and update the global optimal solution, N=N+1, and jump to step 5.

[0126] 1045. Output the vehicle allocation and loading layout plan with the lowest internal transportation cost, including:

[0127] The vehicle allocation plan will specify the component sets assigned to each vehicle, and the loading layout plan will specify how the components in each vehicle will be placed.

[0128] The above contents are merely examples and explanations of the structure of the present invention. The technicians in this technical field may make various modifications or additions to the specific embodiments described or replace them in a similar manner. As long as they do not deviate from the structure of the present invention or exceed the scope defined by the claims, they should all fall within the protection scope of the present invention.

Claims

1. A method for optimizing inbound transportation costs based on a two-layer improved genetic algorithm, characterized in that: The following steps are involved: (1) In the first layer, the temporary storage area is abstracted as a cuboid, and the left rear and right front of the cuboid are set as the coordinate origins. A double coordinate axis system is established. In addition to the top surface of the cuboid, the other five surfaces of the cuboid are numbered to obtain a plan for the components to enter the temporary storage area. (2) Perform one-dimensional genetic coding on the loadable components and generate an initial population. The one-dimensional genetic coding results in a one-dimensional matrix, which is a chromosome. The population is updated based on the particle swarm algorithm, the fitness value is calculated and iterated continuously, and the optimal component layout scheme is output; Among them, the one-dimensional genetic encoding method is as follows: Encode according to [N1 N2 N3 N4 N5 N6], [N1 N2 N3 N4 N5 N6] represents an element, an element represents a component, N1, N2, N3 represent the length, width, and height of the component respectively; the six faces of the component, top, bottom, left, right, front, and back are numbered 1, 2, 3, 4, 5, and 6 respectively, and N4 represents the number of the face of the component; N6 represents the sequence number of the plan for the component to enter the temporary storage area; if N5 is 0, it means that the longer side of the component enters in parallel with the plan represented by N6, and if it is 1, it means that the shorter side of the component enters in parallel with the plan represented by N6; The one-dimensional matrix [[N1 N2 N3 N4 N5 N6]…[N1 N2 N3 N4N5 N6]] is obtained from the one-dimensional genetic coding. The method of updating the population based on the particle swarm algorithm is as follows: The update formula for all elements in a one-dimensional matrix is ​​as follows: Where K represents the number of components that can be loaded in the temporary storage area, Math.random() represents the random function random() in the Math library in the computer programming language JAVA; the k value determines the component number; X ij Represents any element in a one-dimensional matrix; S represents a component, l represents the length of the component, w represents the width of the component, and h represents the height of the component; random.nextInt(0,6)+1, where 0 and 6 are fixed values, this formula represents randomly generating an integer between 1 and 6; random.nextInt()%2, this formula represents randomly generating an integer and then performing a modulo operation; random.nextInt(1,21)-1, where 1 and 21 are fixed values, this formula represents randomly generating an integer between 0 and 19, because the program numbers entering the temporary storage area are 0 to 19; (3) The second layer selects the components that need to be transported based on the optimal component layout scheme obtained in step (2) and numbers them in sequence, and numbers the existing idle vehicles in sequence; (4) The maximum component number is used as the chromosome gene number, and the vehicle number is used as the gene for one-dimensional genetic encoding and an initial population is generated. The layout plan of each vehicle is quickly solved based on the spatial segmentation method for each vehicle loading plan. The fitness value is calculated through continuous iteration and reproduction, and the vehicle allocation and loading layout plan with the lowest internal transportation cost is output.

2. The method for optimizing inbound transportation costs based on a double-layer improved genetic algorithm according to claim 1, characterized in that: In the step (1), the method for establishing the dual coordinate axis system is as follows: the temporary storage area is abstracted as a cuboid, the left rear side of the cuboid is set as the coordinate origin O, and the X, Y, and Z axes are established with the length, width, and height close to the origin O; the right front side of the cuboid is set as the coordinate origin O', and the X', Y', and Z' axes are established with the length, width, and height close to the origin O'; The faces of the cuboid are numbered as follows. Except for the top face of the cuboid, the other five faces are numbered 1, 2, 3, 4, and 5 in sequence. The scheme for components to enter the temporary storage area is expressed in the following manner: [a, b, c], where a represents the scheme number, b represents the number of the cuboid surface, c represents the coordinate axis in the dual coordinate axis system, and the symbols in [] mean that the scheme numbered a represents that the surface of the component numbered b enters the temporary storage area parallel to the c axis.

3. The method for optimizing inbound transportation cost based on a double-layer improved genetic algorithm according to claim 1, characterized in that: In step (2), the fitness value is calculated using a fitness function, and the fitness function formula is as follows: Where K represents the number of components that can be loaded in the temporary storage area; V represents the total volume of the temporary storage area; L, W, and H represent the length, width, and height of each component, respectively.

4. The method for optimizing inbound transportation cost based on a double-layer improved genetic algorithm according to claim 1, characterized in that: In step (2), the iteration method is as follows: Step 1: Each chromosome represents a temporary storage area storage scheme; Step 2: Update each chromosome in the population according to the update formula; Step 3: Calculate the fitness value of each chromosome based on the fitness function; Step 4: Save and update the chromosome with the largest fitness value; Step 5: Determine whether the maximum number of iterations of the algorithm has been reached. If so, the algorithm ends and outputs the chromosome with the largest fitness value, that is, the component layout plan in the optimal temporary storage area; if not, jump to step 2.

5. The method for optimizing inbound transportation cost based on a double-layer improved genetic algorithm according to claim 1, characterized in that: In step (4), one-dimensional genetic encoding and generating the initial population are specifically as follows: The number of loadable components is taken as the number of chromosome genes, and the vehicle numbers are scattered on the chromosomes as genes. The initial population is expressed as follows: [ABCDEF...], where the number of values ​​in [] represents the number of components, that is, the length of the chromosome, ABCDEF... respectively refer to the vehicle numbers, and the component numbers are the position order corresponding to the vehicle numbers. By analogy, a genetic code can be mapped to a component-vehicle allocation plan.

6. The method for optimizing inbound transportation cost based on a double-layer improved genetic algorithm according to claim 1, characterized in that: In step (4), the layout scheme of each vehicle component is solved based on the space segmentation method as follows: 1) Label each surface of the component Take the longest side of the component as the length, the second longest side as the width, and the shortest side as the height, and place the surface formed by the length and width as the front face on a horizontal plane. The front face is labeled 1, the back face is labeled 2, the left face is labeled 3, the right face is labeled 4, the top face is labeled 5, and the bottom face is labeled 6; 2) Component placement method Set the vehicle loading space component coordinate system, set the left rear of the vehicle loading space as the coordinate origin O, and establish the X, Y, and Z axes with the length, width, and height close to the origin O. The plane formed by the X axis and the Y axis is the bottom surface for component placement. The bottom surface is composed of multiple placement surfaces. The space above the placement surface is the placement space. The component placement method is as follows: first finish stacking one of the placement spaces. The stacking order in the placement space is from bottom to top along the Z axis, and then select the next placement space for re-stacking. The order of placing components on the bottom surface is from left to right along the X axis and from back to front along the Y axis; 3) Determine which side of all components to be loaded on each vehicle should enter parallel to the x-axis: Determined by the formula: x = random.nextInt(0,6)+1, where 0 and 6 are fixed values, this formula represents the random generation of integers between 1 and 6; 4) Determine the bottom area of ​​the component according to the direction in which the component enters the vehicle loading space. Sort all components that need to be loaded on each vehicle from large to small according to the bottom area, and mark all components as not put in. Secondly, redefine the length and width of the component, with the length of the side parallel to the X-axis of the bottom surface of the component entering the vehicle loading space as the length, the length of the side parallel to the Y-axis as the width, and the side parallel to the Z-axis as the height; 5) Arrange each vehicle component according to the component placement method A. Under the premise of not exceeding the vehicle height limit, select the components that have not been placed according to the component bottom area sorting in step 4); B. First, select a placement space according to the component placement method. In the same placement space, if the length and width of the selected component after redefinition are both less than or equal to the length and width of the base component, and the height is less than or equal to the height in the placement space minus the total height of the components already placed in the placement space, the component is marked as already placed, and the component is placed according to the component placement method; C. If any of the length and width of the selected component is larger than the length and width of the base component, it is marked as not placed. If the height of the selected component is larger than the height in the placement space minus the total height of the components already placed in the placement space, it is marked as not placed. D. Select the next component in the order of base area and jump to step B; E. When one placement space is completed, select the next placement space according to the component placement method, jump to step B, and place the components that have not been placed until all components are in the placed state, and step 5) ends.

7. The method for optimizing inbound transportation cost based on a double-layer improved genetic algorithm according to claim 1, characterized in that: In step (4), the fitness function formula is as follows: Where N is the number of assigned vehicles, p is the unit price per ton of components transported by the vehicle, and w is the number of tons of components carried by the vehicle.

Citation Information

Patent Citations

  • Rectangular part optimal layout method based on adaptive genetic algorithm

    CN111260062A

  • Emergency material transportation and loading collaborative optimization method based on double-layer genetic coding

    CN113222272A