Pipeline path automatic planning method for multiple pipelines in building
By using probabilistic selection and improved artificial bee colony algorithm in architectural design, combined with the idea of co-evolution, pipeline path generation is optimized, solving the problems of too long path length and too many elbows in traditional design, and achieving a more reasonable pipeline layout. and space utilization.
Patent Information
- Application Number
- CN202410905876.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-08
- Publication Date
- 2024-10-29
AI Technical Summary
Traditional construction pipeline path planning and design takes a long time, relies on experience, is prone to cross collisions, and the generated pipeline paths are too long and have too many elbows, which cannot meet the layout requirements of the actual building environment.
Using an initial path generation method based on probability selection, combined with an improved artificial bee colony algorithm and co-evolutionary ideas, by dividing the grid in the three-dimensional building space and assigning energy values, the pipeline path generation is optimized, reducing the number of elbows and energy consumption, and ensuring Paths are laid along the walls.
The generated pipeline paths are more reasonable, reduce design complexity, improve the quality of path generation, meet the layout requirements in the real building environment, and optimize the utilization rate of building space and human resource allocation.
Smart Images

Figure CN118863199A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of building intelligence, and in particular to a method for automatically planning pipeline paths of multiple pipelines in a building. Background Art
[0002] The planning of pipelines in buildings is affected by electromechanical installation projects, which cover a wide range, mainly including power supply systems, communication systems, signal systems, integrated monitoring, environmental control, ventilation and air conditioning, water supply and drainage, low-voltage power distribution, access control, etc. Among them, ventilation and air conditioning, water supply and drainage, and low-voltage power distribution are greatly affected by other majors during the design and construction process. They belong to terminal majors and are changed very frequently. Frequent changes will cause waste of human resources and funds for the entire project and delay the progress of the entire project. Therefore, the layout of wind, water, and electricity pipelines in actual buildings is extremely important. The layout of air ducts directly affects the overall layout of ventilation and air conditioning systems. In the layout, the air ducts should occupy less building space and do not hinder production operations. They are often laid along walls, columns, floor beams or roof trusses and installed on brackets or hangers. The layout of water supply pipelines is affected by factors such as building structure, water use requirements, the location of water distribution points and outdoor water supply pipelines, and the layout of other building equipment engineering pipelines such as heating, ventilation, air conditioning and power supply. The layout of electrical pipes must comply with relevant safety standards and specifications to ensure the transmission efficiency and reliability of the power system and the normal operation of various electrical equipment in the building.
[0003] There are many drawbacks in the traditional planning and design of building pipeline paths. The design time is long, it relies heavily on the experience of designers, the pipelines designed by various professionals are prone to cross collision, and the use space in the building space is reused. In order to solve such problems, the study of automatic planning methods for multiple pipeline paths has been put on the agenda. Scientific and reasonable pipeline path planning in buildings can greatly improve the quality of pipeline design layout, optimize the utilization rate in building space, and better allocate human resources in the construction process. At present, the widely used initial pipeline path generation method based on the midpoint method combined with the method of solving the optimal pipeline path using the traditional artificial bee colony algorithm can realize the automatic planning of multiple pipeline paths in the building to a certain extent, but the initial pipeline path generation method based on the midpoint method combined with the method of solving the optimal pipeline path using the traditional artificial bee colony algorithm has some shortcomings. The initial pipeline path generation method based on the intermediate point method first determines the endpoints of the pipeline path, then randomly generates key points in the solution space, determines the insertion points according to the positions of the key points, and finally connects the key points to obtain the complete pipeline path. The key points generated by this method are too discrete, resulting in the automatically generated pipeline being too long, too many elbows, too high energy values, and the pipeline not being laid along the wall and other reasonable locations, which does not meet the layout requirements in the actual building environment. Secondly, the traditional artificial bee colony algorithm uses fixed parameters when solving the optimal pipeline path. This results in insufficient search capability in the later stages of the algorithm, which results in the inability to obtain the optimal pipeline path. Summary of the invention
[0004] In view of the above-mentioned deficiencies in the prior art, an object of the present invention is to provide a method for automatically planning pipeline paths of multiple pipelines in a building.
[0005] The technical solution of the present invention is:
[0006] A method for automatically planning pipeline paths of multiple pipelines in a building, the method comprising the following steps:
[0007] Step 1: Divide the three-dimensional building space into grids of equal size, and assign corresponding energy values to each grid according to the attributes of the three-dimensional building space area to which it belongs; establish a coordinate system for the three-dimensional building space, and set the starting point coordinates and end point coordinates of each pipeline of the pipeline path to be planned in the three-dimensional building space;
[0008] Step 2: With the goal of minimizing the path length, the number of elbows and the energy consumption, and with the constraint of avoiding collision with obstacles, an initial pipeline path is generated for each of the multiple pipelines in the pipeline path to be planned based on probability selection;
[0009] Step 3: Improve the artificial bee colony algorithm, and based on the initial pipeline path of each pipeline, use the improved artificial bee colony algorithm to find the optimal pipeline path of each pipeline;
[0010] Step 4: Introduce the idea of co-evolution to adjust and update the optimal pipeline paths of multiple pipelines obtained in step 3 to obtain the final pipeline paths of all pipelines.
[0011] Furthermore, the rule for assigning corresponding energy values according to the attributes of the area to which each grid belongs is: assigning high energy values to grids in areas where pipelines cannot be laid, and assigning low energy values to grids in areas where pipelines can be laid.
[0012] Furthermore, generating an initial pipeline path for each pipeline based on probability selection includes the following steps:
[0013] Step 2.1: First, randomly generate a key point in the three-dimensional building space;
[0014] Step 2.2: Generate the next pre-arranged key point according to the current key point until all pre-arranged key points are generated;
[0015] Step 2.3: Connect the starting point, key point and end point to obtain a complete pipeline path, and assign the energy value corresponding to the grid reached by the pipeline path to the path;
[0016] Step 2.4: Repeat steps 2.1-2.3 to generate multiple initial pipeline paths with pipeline energy values.
[0017] Furthermore, the step 2.2 of generating the next pre-arranged key point according to the current key point includes the following steps:
[0018] Step 2.2.1: Determine the direction selection probability value PD of the key point n : Taking the current key point as the coordinate zero point, assign the selection probability values of the next pre-arranged key point in the positive and negative directions of the x-axis, the positive and negative directions of the y-axis, and the positive and negative directions of the z-axis in the three-dimensional building space;
[0019] Step 2.2.2: Determine the elbow selection probability value PW of the key point n : Assign high selection probability values to pre-arrangement key points that do not produce elbows, and assign low selection probability values to pre-arrangement key points that produce elbows;
[0020] Step 2.2.3: Determine the straight line segment selection probability value PL of the key point n According to formula (1), the distance between the end point of the straight line segment barrier-free path formed by the pre-arranged key points and the current key points in the six directions of the positive and negative directions of the x-axis, the positive and negative directions of the y-axis, and the positive and negative directions of the z-axis in the three-dimensional building space and the end point of the current pipeline of the pipeline path to be planned is calculated respectively, and the straight line segment selection probability value PL of the key point in each direction is determined n ;
[0021]
[0022] Where n represents the direction, n = 1, 2, .., 6; PL n Indicates the probability value of the straight line segment selection in the direction n of the pre-arranged key point; (a, b, c) are the end point coordinates of the straight line segment obstacle-free path, and (d, e, f) are the end point coordinates of the current pipeline of the pipeline path to be planned;
[0023] Step 2.2.4: Determine the energy value of the key point and select the probability value PE n : Calculate the probability value of energy value selection of the pre-arranged key point in direction n according to formula (2);
[0024]
[0025] Where n represents the direction, n = 1, 2, .., 6; PE n represents the probability value of energy value selection of pre-arranged key points in direction n; L n represents the length of the straight line segment obstacle-free path in direction n; E nThe energy value of the straight line segment obstacle-free path in direction n is the energy value of the grid reached by the straight line segment obstacle-free path;
[0026] Step 2.2.5: Select the probability value PD according to the direction n , elbow selection probability value PW n , straight line segment selection probability value PL n and energy value selection probability value PE n , calculate the initial pipeline path selection probability cost P of the pre-arranged key point selection direction n according to formula (3) n ;
[0027] P n =r1×PD n +r2×PW n +r3×PL n +r4×PE n (3)
[0028] Among them, r1, r2, r3, and r4 represent weights, r1+r2+r3+r4=1;
[0029] Step 2.2.6: According to the ratio of the initial pipeline path selection probability cost in each direction to the sum of the initial pipeline path selection probability costs in all directions, the roulette method is used to select the required key points from the pre-arranged candidate key points.
[0030] Furthermore, in step 2.2.1, the size of the selection probability value of the pre-arranged key points in each direction is determined by the vector direction between the current key point and the pre-arranged key points: calculate the vector directions between the current key point and the six pre-arranged key points respectively, and select the vector direction with the smallest angle with the end point direction of the pipeline as the direction pointing to the end point, and the other three vector directions are directions away from the end point. A high selection probability value is assigned to the direction pointing to the end point, and a low selection probability value is assigned to the direction away from the end point.
[0031] Furthermore, the improvement of the artificial bee colony algorithm is to improve the search formula of the employed bee stage, and the improved search formula is:
[0032]
[0033] in,
[0034]
[0035] Among them, V i The new candidate pipeline path searched for the hired bee stage; x i represents the i-th initial pipeline path, i∈{1,2,...,SN}; x krepresents the kth initial pipeline path, k∈{1,2,...,SN} and k≠i; SN is the total number of initial pipeline paths; C max is the maximum number of iterations of the artificial bee colony algorithm; C is the current number of iterations of the artificial bee colony algorithm; A random number in the range [-1, 1].
[0036] Furthermore, step 4 comprises the following steps:
[0037] Step 4.1: Based on the evolutionary environment formed by the original three-dimensional building space and the optimal pipeline paths of other pipelines except the current pipeline obtained in step 3, the optimal pipeline path of the current pipeline is searched again by using the improved artificial bee colony algorithm based on the optimal pipeline path of the current pipeline obtained in step 3 according to the method in step 3;
[0038] Step 4.2: Determine whether there is overlap in the optimal pipeline paths between pipelines based on the key points and straight line segments on the pipeline path. If so, return to step 2 to recalculate the paths of the relevant pipelines. If not, obtain the final pipeline paths of all pipelines to complete the pipeline path planning for multiple pipelines in the building.
[0039] Furthermore, the method for judging whether there is overlap of optimal pipeline paths between pipelines based on key points and straight line segments on pipeline paths includes: (a) traversing the key points on the optimal pipeline paths of all pipelines, if the coordinates of the key points on the optimal pipeline paths of different pipelines are repeated, it is considered that the corresponding optimal pipeline paths overlap; (b) calculating the parametric equation of the straight line segment based on the starting point coordinates and the end point coordinates of the straight line segment on the pipeline path, and based on geometric knowledge, combining the parametric equations of the straight line segments on the two pipeline paths to obtain the intersection point, and checking whether the straight line segments on the optimal pipeline paths of different pipelines have any intersection point, and if there is an intersection point, it is considered that the corresponding optimal pipeline paths overlap.
[0040] Compared with the prior art, the present invention has the following beneficial effects:
[0041] (1) A probability-based initial path generation method was designed, which took into account evaluation indicators such as direction, elbows, straight segments, and energy values. This made the generated pipeline path more reasonable, reduced the complexity of the solution, and improved the quality of the initial pipeline path generation.
[0042] (2) In view of the shortcomings of the traditional artificial bee colony algorithm in terms of search ability, it is possible to fall into local extreme values when solving the optimal path of the pipeline, and the accuracy of the solution is not enough. The present invention finds that in the period of employed bees, the search formula Parameters in When it is large, the search capability is high in the early stage of the algorithm, but the search accuracy is not enough in the later stage of the algorithm. When the value is small, the initial search speed is reduced, and the search accuracy of the later algorithm is improved. In order to better balance the search ability in the entire bee colony algorithm, the present invention considers adjusting the parameters in the bee colony algorithm in real time according to the search process. Adjustments are made so that the algorithm can adjust parameters in real time according to the search process. Larger, later Small, maintain a high level of search capability, and thus obtain the optimal pipeline path for all pipelines in the building space.
[0043] (3) The idea of collaborative evolution was introduced to improve the artificial bee colony algorithm. Each pipeline was regarded as an independently evolving population. The optimal solution of each population was selected at the same time. After receiving the optimal solution of other populations, the optimal solution of the current population was updated to achieve synchronous evolution. This realized the search for pipeline paths in the entire building space and finally obtained the optimal pipeline path of all pipelines in the building.
[0044] (4) The pipeline path obtained by the present invention through an improved path generation method and the introduction of a co-evolutionary search algorithm is superior to the traditional method in terms of path length, number of elbows and wall laying, and fully meets the requirements of automatic planning of ideal pipeline paths in real building environments. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Figure 1 A schematic diagram of automatic pipeline path planning for multiple pipelines in this embodiment;
[0046] Figure 2 This is a flow chart of a method for generating an initial pipeline path based on probability selection in this embodiment;
[0047] Figure 3 This is a schematic diagram of the key point direction selection of this implementation method;
[0048] Figure 4 This is a flow chart of searching for the optimal pipeline path using the improved bee colony algorithm in this embodiment;
[0049] Figure 5 The optimal pipeline path diagram is obtained by combining the initial pipeline path generation method based on the midpoint method with the traditional artificial bee colony algorithm;
[0050] Figure 6 The optimal pipeline path diagram is solved by combining the initial pipeline path generation method based on probability selection with the traditional artificial bee colony algorithm;
[0051] Figure 7 The optimal pipeline path diagram is solved by combining the initial pipeline path generation method based on probability selection with the improved artificial bee colony algorithm; DETAILED DESCRIPTION
[0052] To facilitate understanding of the present application, the present application will be described more comprehensively below with reference to the relevant drawings.
[0053] In order to solve the many drawbacks in traditional building pipeline design, such as long design time, heavy reliance on designer experience, easy cross-collision of pipelines designed by different professions, and repeated use of space in building space, the solution provided by this application is: a method for automatic planning of pipeline paths for multiple pipelines in a building.
[0054] like Figure 1 As shown, the method for automatically planning pipeline paths of multiple pipelines in a building in this embodiment includes the following steps:
[0055] Step 1: Divide the three-dimensional building space into grids of equal size, and assign corresponding energy values to each grid according to the attributes of the three-dimensional building space area to which it belongs; establish a coordinate system for the three-dimensional building space, and set the starting point coordinates and the end point coordinates of each pipeline of the pipeline path to be planned in the three-dimensional building space;
[0056] In this embodiment, Revit is used to perform grid preprocessing on the three-dimensional building space. Considering accuracy, calculation time and resource consumption, the three-dimensional building space is divided into grids of equal size, and then the grid is assigned a corresponding energy value according to the regional attributes of each grid. A high energy value is set for grids in areas where pipelines cannot be laid, such as obstacles and equipment, and a low energy value is set for grids in areas where pipelines can be laid, such as walls, so that the automatically planned pipeline path can be laid along places with low energy values. This embodiment is verified by multiple experiments to determine the energy values corresponding to different regional attributes in the three-dimensional building space as shown in Table 1.
[0057] Table 1 Energy values corresponding to different regional attributes in three-dimensional building space
[0058]
[0059] In this embodiment, a coordinate system (x, y, z) is established for the three-dimensional building space and a coordinate origin is set, and the starting point coordinates and the end point coordinates of each pipeline of the pipeline path to be planned in the three-dimensional building space are set.
[0060] Step 2: With the goal of minimizing the path length, the number of elbows and the energy consumption, and with the constraint of avoiding collision with obstacles, an initial pipeline path is generated for each of the multiple pipelines in the pipeline path to be planned based on probability selection;
[0061] In the initial pipeline path generation method based on probability selection, key points refer to important locations used to determine the path direction during the pipeline path generation process. They can be pipeline nodes that have been determined or pipeline nodes that are to be determined. Key points play a role in guiding and determining the path direction in path planning.
[0062] The specific process of generating the initial pipeline path for each pipeline is as follows: Figure 2 As shown, the following steps are included:
[0063] Step 2.1: First, randomly generate a key point in the three-dimensional building space;
[0064] Step 2.2: Generate the next pre-arranged key point according to the current key point until all pre-arranged key points are generated;
[0065] The positions of the pre-arranged key points need to be calculated and generated with reference to the positions of the current key points that have been determined, such as Figure 3 The solid circle in the middle represents the current key point that has been determined, and the hollow circle represents the next pre-arranged key point.
[0066] The process of generating the next pre-arranged key point according to the current key point includes the following steps:
[0067] Step 2.2.1: Determine the direction selection probability value PD of the key point n : Taking the current key point as the coordinate zero point, the next pre-arranged key point is assigned a selection probability value in the six directions of the positive and negative directions of the x-axis, the positive and negative directions of the y-axis, and the positive and negative directions of the z-axis in the three-dimensional building space.
[0068] The size of the selection probability value of the pre-arranged key point in each direction is determined by the vector direction between the current key point and the pre-arranged key point. The vector directions between the current key point and the six pre-arranged key points are calculated, and the vector direction with the smallest angle with the end point direction is selected as the direction pointing to the end point. The other three vector directions are directions away from the end point. A high selection probability value is assigned to the direction pointing to the end point, and a low selection probability value is assigned to the direction away from the end point. In the selection probability design of this embodiment, the selection probability value of the pre-arranged key point in the direction pointing to the end point is set to 2 / 9, and the selection probability value of the pre-arranged key point in the direction away from the end point is set to 1 / 9. The sum of the selection probability values of the pre-arranged key point in the above 6 directions is 1.
[0069] The selection probability of the pre-arranged key points in the direction pointing to the end point is set to 2 / 9, and the selection probability of the pre-arranged key points in the direction away from the end point is set to 1 / 9 to balance the search ability of the algorithm, making it more inclined to move in the direction of the target, while retaining a certain degree of randomness to prevent falling into the local optimal solution. It ensures that the algorithm has a higher probability of heading in the target direction when exploring the space, but still has the opportunity to explore other directions, enhancing the global search ability. The direction pointing to the end point is determined by calculating the vector difference between the coordinates of the end point of the pipeline and the coordinates of the current key point.
[0070] Step 2.2.2: Determine the elbow selection probability value PW of the key point n : Assign high selection probability values to pre-arrangement key points that do not produce elbows, and assign low selection probability values to pre-arrangement key points that produce elbows;
[0071] On the pipeline path to be generated, the pre-arranged key points that do not produce elbows are assigned high selection probability values, and the pre-arranged key points that produce elbows are assigned low selection probability values. In the positive and negative directions of the x-axis, the positive and negative directions of the y-axis, and the positive and negative directions of the z-axis of the current key point, the pre-arranged key points are assigned a selection probability value of 3 / 13 in the direction that will not produce elbows, and the pre-arranged key points are assigned a selection probability value of 2 / 13 in the remaining 5 directions that will produce elbows, that is, the sum of the selection probability values of the pre-arranged key points in the 6 directions is 1. Determining the selection probability values of 3 / 13 and 2 / 13 ensures a uniform probability distribution, the sum of the selection probabilities of all directions is 1, and ensures that the direction that will not produce elbows has a higher selection probability value. In specific implementations, these probability values can ensure that the algorithm has sufficient exploration capabilities and does not fall into local optimality.
[0072] Step 2.2.3: Probability value PL of straight line segment selection of key points n : Calculate the distance between the end point of the straight line barrier-free path formed by the pre-arranged key points and the current key points in the six directions of the positive and negative directions of the x-axis, the positive and negative directions of the y-axis, and the positive and negative directions of the z-axis in the three-dimensional building space and the end point of the current pipeline of the pipeline path to be planned, and determine the straight line segment selection probability value PL of the key point n .
[0073] The straight line segment selection probability value PL of the key point n According to formula (1), it can be known from formula (1) that the direction whose straight-line obstacle-free path is close to the end point of the pipeline is given a high selection probability value.
[0074]
[0075] Where n represents the direction, n = 1, 2, .., 6; PL nIndicates the probability value of the straight line segment selection in the direction n of the pre-arranged key point; (a, b, c) are the end point coordinates of the straight line segment obstacle-free path, and (d, e, f) are the end point coordinates of the current pipeline of the pipeline path to be planned;
[0076] Step 2.2.4: The energy value of the key point selects the probability value PE n :The energy mean represents the energy value per unit length on the straight segment obstacle-free path. The energy mean is the energy consumption per unit length on the pipeline path. The probability value PE of the energy value evaluation index n The calculation formula is shown in (2).
[0077]
[0078] Where n represents the direction, n = 1, 2, .., 6; PE n represents the probability value of energy value selection of pre-arranged key points in direction n; L n represents the length of the straight line segment obstacle-free path in direction n; E n The energy value of the straight line segment obstacle-free path in direction n is the energy value of the grid reached by the straight line segment obstacle-free path;
[0079] Step 2.2.5: Select the probability value PD according to the direction n , elbow selection probability value PW n , straight line segment selection probability value L n and energy value selection probability value PE n Calculate the initial pipeline path selection probability cost as shown in formula (3).
[0080] P n =r1×PD n +r2×PW n +r3×PL n +r4×PE n (3)
[0081] Among them, P n represents the probability cost of the initial pipeline path selection in the direction n of the pre-arranged key point selection, and r1, r2, r3, and r4 represent weights. In the planning of the pipeline path, the goal is to minimize the path length, minimize the number of elbows, and minimize energy consumption. Based on experience and experiments, this embodiment uses the following weight coefficients as initial values: r1=0.4, r2=0.3, r3=0.2, r4=0.1. Those skilled in the art should know that these weight coefficients can be adjusted according to the actual application scenario.
[0082] Step 2.2.6: According to the ratio of the initial pipeline path selection probability cost value in each direction to the initial pipeline path selection probability cost value in all directions, a roulette wheel method is used to select a suitable key point from the candidate pre-arranged key points. The specific steps are as follows.
[0083] Step 2.2.6.1: Calculate the cumulative selection probability: To facilitate path selection, calculate the cumulative direction selection probability of each pre-arranged candidate key point.
[0084] Assume that there are three pre-arranged candidate key points A, B, and C, and their initial pipeline path selection probability costs are P A , P B , P C , then the cumulative direction selection probability F of key point A can be calculated by formula (4): A , the cumulative direction selection probability F of key point B is calculated by formula (5) B , the cumulative direction selection probability F of the key point C is calculated by formula (6) C .
[0085]
[0086] Step 2.2.6.2: Generate random numbers and select key points: Generate a random number μ between 0 and 1, if μ ≤ F A , then select key point A; if F A ≤μ≤F B , then select key point B; if F B <μ <F C =1, select key point C.
[0087] Step 2.3: Connect the starting point, key point and end point to obtain a complete pipeline path, and assign the energy value corresponding to the grid reached by the pipeline path to the path.
[0088] Step 2.4: Repeat steps 2.1-2.3 to generate multiple initial pipeline paths with pipeline energy values;
[0089] In this embodiment, a total of 40 initial pipeline paths with pipeline energy values are generated.
[0090] Step 3: Improve the artificial bee colony algorithm, and based on the initial pipeline path of each pipeline, use the improved artificial bee colony algorithm to find the optimal pipeline path of each pipeline;
[0091] First, set the algorithm parameters and initialize the number of honey sources and scout bees. Second, design the fitness function. During the algorithm execution, the employed bee stage is responsible for selecting paths and exploring new solutions, the follower bee stage further explores according to the path quality, and the scout bee stage searches for new possible paths globally. The improved artificial bee colony algorithm stops when the predetermined number of iterations is reached or the fitness value is stable, and returns the optimal pipeline path as the final result. The specific process is as follows: Figure 4 As shown, the following steps are included:
[0092] Step 3.1: Define each honey source as a pipeline path and set the relevant parameters of the artificial bee colony algorithm, including the population size NP and the number of iterations C. max , the number of scout bees s and the given number of times l.
[0093] In this embodiment, the population size NP is set to 80, the number of iterations C max =50, number of scout bees s=10, given number of times l=10.
[0094] Step 3.2: Hired bee stage: Improve the search formula for this stage; for each initial pipeline path obtained in step 2, use the improved search formula to explore new pipeline paths from the adjacent positions of the nectar source, and select the optimal pipeline path for the hired bee stage from the initial pipeline path and the new pipeline path;
[0095] The parameters in the search formula (7) at the peak hiring stage When it is large, the search capability is high in the early stage of the algorithm, but the search accuracy is not enough in the later stage of the algorithm. When it is small, the search speed of the algorithm in the early stage is reduced, and the search accuracy of the algorithm in the later stage is improved. In order to better balance the search ability of the entire bee colony algorithm, the parameters in the search formula (7) are Improved to the parameters shown in formula (8) In order to make the algorithm Larger, later in the algorithm Small, so that the algorithm always maintains a high search capability, and can obtain the ideal pipeline path that fully meets the real building environment.
[0096]
[0097] Among them, V i is the new candidate pipeline path found; x i represents the i-th initial pipeline path, i∈{1,2,...,SN}; x k represents the kth initial pipeline path, k∈{1,2,...,SN} and k≠i; SN is the total number of initial pipeline paths, and in this embodiment, SN=40; A random number in the range [-1, 1].
[0098]
[0099] Among them, C max is the maximum number of iterations, and C is the current number of iterations. Formula (7) is improved as follows:
[0100]
[0101] For each initial pipeline path x i :Use this pipeline path as the current optimal pipeline path, calculate its fitness value according to formula (10) and use its fitness value as the current minimum fitness value; the hired bee will randomly select another initial pipeline path x k , and use formula (9) to search for a new candidate pipeline path V i ; The fitness value of the new candidate pipeline path is calculated by formula (10). If the fitness value of the new candidate pipeline path is smaller than the current minimum fitness value, the new candidate pipeline path is set as the current optimal pipeline path, and the current minimum fitness value is updated; when the minimum fitness value does not change during the update process of a preset number of times, such as 5 times, the next initial pipeline path is randomly selected and the above process is repeated. When all initial pipeline paths are traversed, the iteration is stopped. The current optimal pipeline path at this time is the optimal pipeline path finally selected in the employment peak stage.
[0102] f(p)=α×L(p)+β×B(p)+γ×E(p) (10)
[0103] Wherein, f(p) is the fitness value of the pipeline path p; α, β, and γ are weight coefficients. In this implementation, α=0.5, β=0.3, and γ=0.2 are determined through experimental verification; L(p), B(p), and E(p) are defined as follows:
[0104] represents the total length of the pipeline path p, l h,h+1 Represents the distance between adjacent key points, and m represents the number of key points in the path.
[0105] B(p) represents the total number of elbows in the pipe path p.
[0106] represents the total energy value of pipeline path p, E h Indicates the energy value of the grid to which the hth key point on the pipeline path belongs.
[0107] Step 3.3: Follow-the-bee stage: explore new pipeline paths based on the optimal pipeline path obtained in the hired bee stage, and select the optimal pipeline path in the follow-the-bee stage from the optimal pipeline path in the hired bee stage and the new pipeline path;
[0108] Calculate the selection probability of the optimal pipeline path obtained in the hired bee stage, and use roulette to select a pipeline path from it: Convert equation (10) into general equation (11) to solve the minimum problem. Then calculate the probability of the pipeline path being selected by equation (12). Equation (12) can ensure that the pipeline path with a lower fitness value has a higher probability of being selected, thereby promoting the algorithm to search for a better solution.
[0109]
[0110] Construct the cumulative selection probability array c k , where C k represents the cumulative probability of the first k paths being selected. The cumulative probability is calculated by adding the selection probabilities:
[0111]
[0112] Generate a random number r, ranging from [0,1]. Use the generated random number r to select a path. Traverse the cumulative probability array C k , find the first one that satisfies r≤C k That is, choose a path k that satisfies r falling on C k The path k in the interval.
[0113] Then, for the pipeline path selected by roulette: the pipeline path is taken as the current optimal pipeline path, and its fitness value is calculated according to formula (10) and its fitness value is taken as the current minimum fitness value; the follower bee will randomly select a pipeline path from the optimal pipeline path of the employed bee stage, and use formula (9) to search for a new candidate pipeline path; the fitness value of the new candidate pipeline path is calculated by formula (10), and if the fitness value of the new candidate pipeline path is smaller than the current minimum fitness value, the new candidate pipeline path is set as the current optimal pipeline path, and the current minimum fitness value is updated. At this time, the current optimal pipeline path is the optimal pipeline path finally selected by the follower bee stage.
[0114] Step 3.4: Scouting peak stage: When the employed bees reach the given number of times l = 10 times, the minimum fitness value does not change, and the employed bees are transformed into scout bees to explore new possible paths in the global scope to prevent the algorithm from falling into the local optimum. In each round of iteration, the currently found optimal pipeline path is recorded and compared with the optimal pipeline path in the global scope. If the fitness value of the currently found optimal pipeline path is lower than the fitness value of the optimal pipeline path in the global scope, the global optimal solution is updated to the currently found optimal pipeline path.
[0115] Step 3.5: When the set number of iterations C is reached max=50 or when the fitness value of the optimal pipeline path does not change after several consecutive iterations, the search stops and the current optimal pipeline path is returned as the result.
[0116] Step 4: Introduce the idea of co-evolution to adjust and update the optimal pipeline paths of multiple pipelines obtained in step 3 to obtain the final pipeline paths of all pipelines.
[0117] In the actual building environment, the pipeline system cannot have only one pipeline, but has pipelines of various types, specifications, and layout requirements. All the initial pipeline paths generated in step 2 are regarded as an independently evolving population. The optimal solution of each population is selected through step 3. After receiving the optimal solutions of other populations, the optimal solution of the current population is updated. The overall optimal solution of all pipeline paths is obtained by synchronous evolution, so that multiple pipelines in the building can achieve a reasonable planning effect.
[0118] The specific process includes the following steps:
[0119] Step 4.1: Based on the evolutionary environment formed by the original three-dimensional building space and the optimal pipeline paths of other pipelines except the current pipeline obtained in step 3, the optimal pipeline path of the current pipeline is searched again by using the improved artificial bee colony algorithm based on the optimal pipeline path of the current pipeline obtained in step 3 according to the method in step 3;
[0120] The evolutionary environment of any population is the superposition of the original three-dimensional building space and the optimal pipeline path of other current populations. The evolutionary environment of different populations is different, and the fitness value of the population will be affected by the evolutionary environment in which the population is located.
[0121] While different pipelines adjust and update their optimal pipeline paths, they use fitness values to communicate information. Based on the evolutionary environment consisting of the original three-dimensional building space and the optimal pipeline paths of other pipelines except the current pipeline obtained in step 3, the optimal pipeline path of the pipeline in the current evolutionary environment is recalculated according to the method in step 3. The above process is repeated until all pipelines find their respective optimal pipeline paths in their respective evolutionary environments.
[0122] Step 4.2: Determine whether there is overlap in the optimal pipeline paths between pipelines based on the key points and straight line segments on the pipeline path. If so, return to step 2 to recalculate the paths of the relevant pipelines. If not, obtain the final pipeline paths of all pipelines to complete the pipeline path planning for multiple pipelines in the building.
[0123] The method for judging whether there is overlap of optimal pipeline paths between pipelines based on key points and straight line segments on pipeline paths includes: (a) traversing the key points on the optimal pipeline paths of all pipelines, if the key point coordinates on the optimal pipeline paths of different pipelines are repeated, it is considered that the corresponding optimal pipeline paths overlap; (b) calculating the parametric equation of the straight line segment based on the starting point coordinates and the end point coordinates of the straight line segment on the pipeline path, and according to geometric knowledge, combining the parametric equations of the straight line segments on the two pipeline paths to find the intersection point, and checking whether the straight line segments on the optimal pipeline paths of different pipelines have an intersection point, if there is an intersection point, it is considered that the corresponding optimal pipeline paths overlap. In three-dimensional space, a straight line segment can be expressed by a parametric equation as:
[0124]
[0125] Among them, (x1, y1, z1) are the coordinates of the starting point of the straight line segment; (x2, y2, z2) are the coordinates of the end point of the straight line segment; t is a parameter with a value range of [0, 1], representing all points on the line segment.
[0126] Figure 5 The initial pipeline path generation method based on the midpoint method is combined with the traditional artificial bee colony algorithm to solve the optimal pipeline path diagram. Figure 6 The initial pipeline path generation method based on probability selection is combined with the traditional artificial bee colony algorithm to solve the optimal pipeline path diagram. Figure 7 The initial pipeline path generation method based on probability selection is combined with an improved artificial bee colony algorithm to solve the optimal pipeline path graph.
[0127] Depend on Figure 5 It can be seen that the initial pipeline path generation method based on the midpoint method combined with the optimal pipeline path orthogonal laying solved by the traditional artificial bee colony algorithm can reasonably avoid obstacles and meet the basic requirements of three-dimensional pipeline automatic planning. However, due to the excessive discreteness of key point generation, the automatically generated pipeline has too many elbows, the energy value is too high, and the pipeline is not laid along the wall, which does not meet the layout requirements in the actual building environment. Figure 6 It can be seen that the initial pipeline path generation method based on probability selection combined with the optimal pipeline path solved by the traditional artificial bee colony algorithm effectively improves the quality of the automatically planned pipeline, but the search ability is insufficient during the algorithm solution process, resulting in a suboptimal solution. Figure 7 As shown in Table 2, the optimal pipeline path solved by the initial pipeline path generation method based on probability selection combined with the improved artificial bee colony algorithm is shorter, has fewer elbows, lower energy value, and is laid along the wall, which fully meets the requirements of ideal pipeline automatic planning in a real building environment.
[0128] Table 2 Experimental comparison analysis
[0129]
[0130] It should be understood that, inspired by the technical concept of the present invention, those skilled in the art may make various improvements or changes based on the above content without departing from the content of the present invention, which still fall within the protection scope of the present invention.
Claims
1. A method for automatically planning pipeline paths for multiple pipelines in a building, It is characterized in that The method comprises the following steps: Step 1: Divide the three-dimensional building space into grids of equal size, and assign corresponding energy values to each grid according to the attributes of the three-dimensional building space area to which it belongs; establish a coordinate system for the three-dimensional building space, and set the starting point coordinates and end point coordinates of each pipeline of the pipeline path to be planned in the three-dimensional building space; Step 2: With the goal of minimizing the path length, the number of elbows and the energy consumption, and with the constraint of avoiding collision with obstacles, an initial pipeline path is generated for each of the multiple pipelines in the pipeline path to be planned based on probability selection; Step 3: Improve the artificial bee colony algorithm, and based on the initial pipeline path of each pipeline, use the improved artificial bee colony algorithm to find the optimal pipeline path of each pipeline; Step 4: Introduce the idea of co-evolution to adjust and update the optimal pipeline paths of multiple pipelines obtained in step 3 to obtain the final pipeline paths of all pipelines.
2. The method for automatically planning pipeline paths of multiple pipelines in a building according to claim 1, It is characterized in that The rule for assigning corresponding energy values according to the attributes of the area to which each grid belongs is: assigning high energy values to grids in areas where pipelines cannot be laid, and assigning low energy values to grids in areas where pipelines can be laid.
3. The method for automatically planning pipeline paths of multiple pipelines in a building according to claim 1, It is characterized in that Generating an initial pipeline path for each pipeline based on probability selection includes the following steps: Step 2.1: First, randomly generate a key point in the three-dimensional building space; Step 2.2: Generate the next pre-arranged key point according to the current key point until all pre-arranged key points are generated; Step 2.3: Connect the starting point, key point and end point to obtain a complete pipeline path, and assign the energy value corresponding to the grid reached by the pipeline path to the path; Step 2.4: Repeat steps 2.1-2.3 to generate multiple initial pipeline paths with pipeline energy values.
4. The method for automatically planning pipeline paths of multiple pipelines in a building according to claim 3, It is characterized in that The step 2.2 of generating the next pre-arranged key point according to the current key point comprises the following steps: Step 2.2.1: Determine the direction selection probability value PD of the key point n : Taking the current key point as the coordinate zero point, assign the selection probability values of the next pre-arranged key point in the positive and negative directions of the x-axis, the positive and negative directions of the y-axis, and the positive and negative directions of the z-axis in the three-dimensional building space; Step 2.2.2: Determine the elbow selection probability value PW of the key point n : Assign high selection probability values to pre-arrangement key points that do not produce elbows, and assign low selection probability values to pre-arrangement key points that produce elbows; Step 2.2.3: Determine the straight line segment selection probability value PL of the key point n According to formula (1), the distance between the end point of the straight line segment barrier-free path formed by the pre-arranged key points and the current key points in the six directions of the positive and negative directions of the x-axis, the positive and negative directions of the y-axis, and the positive and negative directions of the z-axis in the three-dimensional building space and the end point of the current pipeline of the pipeline path to be planned is calculated respectively, and the straight line segment selection probability value PL of the key point in each direction is determined n ; Where n represents the direction, n = 1, 2, .., 6; PL n Indicates the probability value of selecting a straight line segment in direction n for the pre-arranged key point; (a, b, c) are the coordinates of the end point of the straight line segment obstacle-free path, and (d, e, f) are the coordinates of the end point of the current pipeline of the pipeline path to be planned; Step 2.2.4: Determine the energy value of the key point and select the probability value PE n : Calculate the energy value selection probability value of the pre-arranged key point in direction n according to formula (2); Where n represents the direction, n = 1, 2, .., 6; PE n represents the probability value of energy value selection of pre-arranged key points in direction n; L n represents the length of the obstacle-free path of the straight line segment in direction n; E n The energy value of the straight line segment obstacle-free path in direction n is the energy value of the grid reached by the straight line segment obstacle-free path; Step 2.2.5: Select the probability value PD according to the direction n , elbow selection probability value PW n , straight line segment selection probability value PL n and energy value selection probability value PE n , calculate the initial pipeline path selection probability cost P of the pre-arranged key point selection direction n according to formula (3) n ; P n =r 1 ×PD n +r 2 ×PW n +r 3 ×PL n +r 4 ×PE n (3) Among them, r 1 、r 2 、r 3 、r 4 represents the weight, r 1 +r 2 +r 3 +r 4 =1; Step 2.2.6: According to the ratio of the initial pipeline path selection probability cost in each direction to the sum of the initial pipeline path selection probability costs in all directions, the roulette method is used to select the required key points from the pre-arranged candidate key points.
5. The method for automatically planning pipeline paths of multiple pipelines in a building according to claim 1, It is characterized in that In step 2.2.1, the selection probability values of the pre-arranged key points in each direction are determined by the vector direction between the current key point and the pre-arranged key points: calculate the vector directions between the current key point and the six pre-arranged key points respectively, select the vector direction with the smallest angle with the end point direction of the pipeline as the direction pointing to the end point, and the other three vector directions are directions away from the end point. A high selection probability value is assigned to the direction pointing to the end point, and a low selection probability value is assigned to the direction away from the end point.
6. The method for automatically planning pipeline paths of multiple pipelines in a building according to claim 1, It is characterized in that The improvement of the artificial bee colony algorithm is to improve the search formula of the employed bee stage. The improved search formula is: in, Among them, V i The new candidate pipeline path searched for the hired bee stage; x i represents the i-th initial pipeline path, i∈{1,2,...,SN}; x k represents the kth initial pipeline path, k∈{1,2,...,SN} and k≠i; SN is the total number of initial pipeline paths; C max is the maximum number of iterations of the artificial bee colony algorithm; C is the current number of iterations of the artificial bee colony algorithm; A random number in the range [-1, 1].
7. The method for automatically planning pipeline paths of multiple pipelines in a building according to claim 1, It is characterized in that The step 4 comprises the following steps: Step 4.1: Based on the evolutionary environment formed by the original three-dimensional building space and the optimal pipeline paths of other pipelines except the current pipeline obtained in step 3, the optimal pipeline path of the current pipeline is searched again by using the improved artificial bee colony algorithm based on the optimal pipeline path of the current pipeline obtained in step 3 according to the method in step 3; Step 4.2: Determine whether there is overlap in the optimal pipeline paths between pipelines based on the key points and straight line segments on the pipeline path. If so, return to step 2 to recalculate the paths of the relevant pipelines. If not, obtain the final pipeline paths of all pipelines to complete the pipeline path planning for multiple pipelines in the building.
8. The method for automatically planning pipeline paths of multiple pipelines in a building according to claim 7, It is characterized in that The method for judging whether there is overlap of optimal pipeline paths between pipelines based on key points and straight line segments on pipeline paths includes: (a) traversing the key points on the optimal pipeline paths of all pipelines, if the coordinates of the key points on the optimal pipeline paths of different pipelines are repeated, it is considered that the corresponding optimal pipeline paths overlap; (b) calculating the parametric equation of the straight line segment based on the starting point coordinates and the end point coordinates of the straight line segment on the pipeline path, and according to geometric knowledge, combining the parametric equations of the straight line segments on the two pipeline paths to obtain the intersection point, and checking whether the straight line segments on the optimal pipeline paths of different pipelines have an intersection point, if there is an intersection point, it is considered that the corresponding optimal pipeline paths overlap.
Citation Information
Cited By
Pipeline design method and device, computer equipment, storage medium and program product
CN119783471A
