Ship pipeline arrangement method based on improved snake optimization algorithm
By improving the snake optimization algorithm, sinusoidal chaos mapping, two-way search strategy, population evolution dynamic mechanism and elite opposition learning are introduced, which solves the problem of slow convergence speed and easy to fall into local optimality in ship pipeline path planning, and achieves more efficient and better pipeline layout.
Patent Information
- Application Number
- CN202411516740.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-29
- Publication Date
- 2025-03-25
AI Technical Summary
The prior art has problems such as slow convergence speed and easy to fall into local optimality in ship pipeline path planning, making it difficult to achieve efficient and optimized pipeline layout.
The diversity of initial populations is improved by introducing sinusoidal chaos mapping, the two-way search strategy is added to accelerate convergence, and the population evolution dynamic mechanism is proposed based on variation operations and evolutionary population dynamics, and the elite opposition learning is used to expand the search range to avoid local optimum.
The quality of the algorithm's convergence speed and solution is improved, and a better ship pipeline path solution is provided, which enhances the efficiency and effect of pipeline design.
Smart Images

Figure CN119691943A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to a ship piping arrangement method based on an improved snake optimization algorithm, and belongs to the technical field of ship and ocean engineering manufacturing. Background Art
[0002] Ship pipelines are a kind of pipeline system distributed in various cabins and decks of ships for transporting gas or liquid. It is mainly composed of pipelines, pipeline brackets, pipeline joints, etc. Pipeline design is one of the important steps in the entire ship design process. Well-designed pipelines not only improve the safety of the entire ship, but also facilitate maintenance and modification by maintenance personnel, and play a huge role in the safety of the ship. At the same time, good pipeline design will greatly reduce the cost of the ship. In the international market, with the increasingly fierce market competition, low-cost, high-performance ships that meet the constraints of manufacturing, installation and maintenance have become the goals of major shipyards. Therefore, the optimization design of pipelines is an issue that needs to be paid attention to in ship production. Due to the complex constraints of the internal environment of the ship and the diversity of the pipeline system, the traditional pipeline design completely relies on the designers, resulting in low efficiency. At present, with the rapid development of intelligent optimization algorithms, more and more relevant personnel have begun to study the application of algorithms in pipeline path planning, and intelligent pipeline layout is an inevitable trend. Therefore, combining artificial experience knowledge with intelligent optimization algorithms to form algorithms suitable for the field of ships has a significant impact on pipeline design, as well as the performance and cost of ships.
[0003] As algorithms emerge in an endless stream, more and more scholars have conducted in-depth research on path planning problems. Heuristic algorithms have strong optimization capabilities, but they also have problems such as easy to fall into local optimality and low search efficiency. Inspired by the mating behavior of snakes, Hashim et al. proposed the snake optimization algorithm in 2022. It has the advantages of simple calculation and high efficiency. However, like most optimization algorithms, SO also has problems such as slow convergence and easy to fall into local optimality. Summary of the invention
[0004] In order to solve the problems existing in the prior art, the present invention provides a ship piping layout method based on an improved snake optimization algorithm. First, the diversity of the initial population is improved by introducing a sinusoidal chaos map. Secondly, a two-way search strategy is added in the exploration phase to accelerate the convergence of the algorithm. Then, a population evolution dynamic mechanism is proposed by combining the mutation operation with the evolutionary population dynamics, thereby improving the quality of the solution. Finally, the neighborhood space of the elite individuals is fully utilized by the guidance of elite adversarial learning, which expands the search range of the snake optimization algorithm and avoids falling into the local optimum, thereby providing a better solution for the ship piping path.
[0005] The technical solution adopted by the present invention is: a ship piping layout method based on an improved snake optimization algorithm, comprising the following steps:
[0006] S1. The single pipeline objective function is as follows:
[0007]
[0008] Among them, F represents the objective function of single pipeline layout; L represents the length of the pipeline; R represents the sum of the number of elbows in a single pipeline;
[0009] S2. Establish the environment, set the starting and ending points, initialize the parameters, and use sinusoidal chaos to generate the population;
[0010] The initialization process is expressed as:
[0011]
[0012] Where: Refers to the coordinate vector of the i-th individual in a population of dimension d and size N; are the lower and upper limits; r is a random constant in [0,1];
[0013] The population consists of females and males, assuming that females and males each account for 50%; before iteration, the population of size N is divided into two subgroups as follows:
[0014]
[0015] Where: For the male subgroup; For the female subgroup;
[0016] The introduction of sinusoidal chaotic mapping makes the population distribution uniform and diverse. The specific expression is as follows:
[0017]
[0018] Where: k is the number of iterations; is a constant, ranging from (0,4]; set the initial value, when =4, the sequence has the best distribution and the highest population randomness; select =4 to initialize the population. The specific expression is as follows:
[0019]
[0020] S3. Calculate the food quality and current ambient temperature to determine which stage to enter;
[0021] Food quality determines whether to enter the exploration phase or the exploitation phase, and whether to engage in mating behavior is determined by temperature; food quality Q and temperature T are defined as follows:
[0022]
[0023] Where: g and G are the current and maximum number of iterations respectively; is a constant, take 0.5;
[0024] S4. If Q and T are less than the set conditions, the algorithm enters the search phase, otherwise it enters the local optimization phase;
[0025] Entering the search phase, each individual randomly updates the position within the search area; for the male population, the position update is expressed as follows:
[0026]
[0027] Where: is a random male; rand is a randomly generated number in [0,1]; Take 0.5 as a constant; is the mating ability of male snakes, and its expression is:
[0028]
[0029] Where: F() is the fitness value;
[0030] For the female subgroup, the position update during the exploration phase is as follows:
[0031]
[0032] In the formula, is a random male; rand is a randomly generated number in [0,1]; Take 0.5 as a constant; The ability to mate with the i-th female snake;
[0033] The best and worst individuals are used to explore the search area, so that the algorithm can stay away from the worst individuals and approach the best individuals. The specific expression is:
[0034] (10)
[0035] (11)
[0036] Where: and the best and worst females, respectively; and for the best and worst females; and is a uniformly generated random number;
[0037] S4. Guided by the cooperation of the best and worst individuals, the population approaches the optimal solution; when the algorithm triggers the mating mode, the population evolution dynamic mechanism will be executed;
[0038] A mutation operation is introduced into the population evolution dynamics mechanism to calculate new positions to replace half of the worse individuals; the specific expression is as follows:
[0039]
[0040]
[0041] Where: i=1,2,…,N / 2, is a new position randomly searched around the historical individual;
[0042] In addition to replacing the worst individual, the mutation operator is applied to the first 50% of individuals to generate mutant individuals and perform greedy operations as follows:
[0043]
[0044] Where: It is the population individual after greedy operation; Individuals in the original population;
[0045] F is the proportional factor, which is expressed as follows:
[0046]
[0047] Where: is the vibration frequency of the sine function;
[0048]
[0049] Searching around the best individual improves the median population size; when the quality of the new solution is not as good as the original solution, the search area will be searched again;
[0050] Use elite individuals to calculate the opposing solution, and then select the current solution and its elite opposing solution for the next iteration based on the fitness value;
[0051] Elite IndividualEy nrefers to the individual with the highest EN in the population, where EN is the number of elite solutions; for the current solution , whose elite opposite solution is calculated as follows:
[0052]
[0053] Where: n=1,2,…,EN, EN takes 0.1*N as the dynamic boundary, and are the minimum and maximum values of the j-th dimension in the elite population, respectively;
[0054] S5. Current number of iterations t and maximum number of iterations T max For comparison, if t>T max Then exit the iteration if t<T max Then return to continue iteration;
[0055] S6. The algorithm ends and the optimal result is output.
[0056] The beneficial effects of the present invention are as follows: the method adopts the snake optimization algorithm as the basic algorithm for pipeline layout, and on this basis, improves the algorithm to make it more suitable for ship pipeline layout. First, the diversity of the initial population is improved by introducing the sinusoidal chaos map. Secondly, a two-way search strategy is added in the exploration phase to accelerate the convergence of the algorithm. Then, by combining the mutation operation with the evolutionary population dynamics, a population evolution dynamic mechanism is proposed to improve the quality of the solution. Finally, the neighborhood space of the elite individuals is fully utilized by the guidance of elite adversarial learning, which expands the search range of the snake optimization algorithm and avoids falling into the local optimum, thereby providing a better solution for the ship pipeline path.
[0057] At the same time, combined with the actual process of ship pipeline layout, according to the rules and methods of ship pipeline layout, a mathematical model of ship pipeline path planning problem is reasonably built. For the equipment that needs to pass through in the pipeline layout, appropriate simplification strategies are adopted, and the equipment is modeled in combination with the "virtual obstacle" method. Based on the above method, a spatial simulation model is constructed, and then the pipeline path is optimized. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] Figure 1 It is a simplified schematic diagram of the equipment in the ship.
[0059] Figure 2 It is a simplified schematic diagram of the pipeline.
[0060] Figure 3 It is the distribution diagram of the sinusoidal chaotic sequence x changing with α.
[0061] Figure 4 It is the flowchart of improved snake optimization algorithm. DETAILED DESCRIPTION
[0062] Ship pipeline layout space construction
[0063] (1) Equipment model simplification
[0064] The ship itself is a huge machine. The laying of a certain pipeline may not be affected by other equipment, and the layout of the pipeline is mostly along the length of the ship or perpendicular to the length of the ship, and there are very few complex situations. Therefore, in the ship pipeline planning problem discussed in the present invention, it is only necessary to ensure that the simplified equipment model has similar appearance attributes. Among the currently proposed model simplification methods, the axis-parallel bounding box method is more widely used, which can simplify the model to the greatest extent and reduce the number of grids required. However, this method also has disadvantages. Some feasible path planning spaces are occupied by the simplified model, resulting in a reduction in feasible solutions for the algorithm to run, thereby reducing the diversity of the results finally searched out, and it is difficult to ensure the generation of the optimal solution.
[0065] In this regard, the present invention improves the simplification method and proposes a device model simplification strategy suitable for ships based on the idea of "virtual space". First, the equipment model is established according to the drawings, and the non-simplifiable information of the model is extracted, such as pipeline interfaces, parts that often need maintenance, etc.; then the model is decomposed, and the decomposition principle is: mainly based on the geometric parameters of the equipment, the pipeline interface is connected to the equipment body as much as possible. Subsequently, each sub-equipment is simplified using the axis-parallel bounding box method, and then each sub-equipment is recombined according to the original equipment. The new model is a simplified model of the original equipment. Through this simplification method, the original geometric parameters and interface information of the equipment are retained, and the storage volume of model data is also reduced.
[0066] (2) Pipeline simplification
[0067] Compared with ship equipment and cabins, the model structure of the pipeline is simpler, so it is appropriately simplified. Ship pipelines mainly involve inner and outer diameters and lengths. In computer design, users will select a suitable grid size to evenly divide it according to the size of the simplified equipment model. During the division process, the connection port of the pipeline may become a point. Therefore, for the pipeline model, the present invention reduces the diameter of the pipeline to a point, and the complete ship pipeline is simplified to the center line. In the actual ship pipeline layout, the pipeline is restored to the normal diameter. This not only ensures the efficiency of the algorithm optimization search, but also ensures that the layout of the pipeline is not affected during the actual layout.
[0068] (3) Layout space expression
[0069] Generally speaking, the spatial expression of ship layout is defined as the process of converting the cabin layout and equipment inside the ship into a mathematical model. In the conversion process, in order to accurately express the ship layout space, the model simplification strategy proposed in the previous section is combined with the grid division technology in computer design to describe the expression of the layout space.
[0070] The specific process of layout space expression is as follows:
[0071] A. Build a model for existing ship equipment, divide the space where the model is located, and correspond to the location of the equipment;
[0072] B. Simplify the model and layout space, and divide the simplified model and space evenly using the grid method. For devices, since they cannot be set as entities, the space can be divided by blank grids;
[0073] C. Assign coordinates to the divided grids, and the divided grids and grid connections are nodes, which is convenient for describing the specific positions of each model and pipeline in space. The position description of the layout space can adopt the coordinate system establishment method in mathematics, that is, select any point in the processed layout space as the origin, and the positions of other divided grids are determined with reference to this point. In the layout of ship pipelines, the row, column, and layer of the grid can be considered as the coordinate value of the grid.
[0074] As for the definition of the boundary range of the layout environment, since the shape of the ship is not standardized, it is too complicated to establish the layout space completely according to its shape. Therefore, the method adopted by the present invention is to take the maximum length, width and height of the space where the ship needs to be laid out, and establish the corresponding square space according to these dimensions. In the subsequent pipeline optimization, no pipeline optimization design is performed for the extra layout space.
[0075] Improved snake optimization algorithm solution
[0076] The optimized design of ship piping layout must meet the requirements of various specifications and standards, as follows:
[0077] (1) Physical rules: rules that require the spatial location of pipelines in the layout environment
[0078] a. The pipeline must be connected to the specified location, including multiple branch points and endpoints;
[0079] b. The connecting pipelines do not interfere with the cabin equipment;
[0080] c. Laying pipelines in the layout environment;
[0081] (2) Installation and production constraints: Requirements and rules for pipelines during ship production and installation
[0082] a. Pipelines should be arranged parallel or vertically along the bottom edge of the equipment or the bulkhead as much as possible;
[0083] b. Pipeline layout cannot obstruct aisle space;
[0084] c. Pipeline layout should reserve space for equipment maintenance;
[0085] d. For long pipelines, it is necessary to add pipeline brackets;
[0086] e. Reserve as much working space as possible for sports accessories;
[0087] f. Avoid cross layout of large diameter pipelines;
[0088] (3) Safety constraints: rules for safe ship operation requirements
[0089] a. Minimum safe distance needs to be maintained between pipelines;
[0090] b. There should be no potential safety hazard between the pipeline and the equipment (keep a safe distance from special equipment such as high-temperature components and fuel tanks);
[0091] c. The fuel pipeline should not be installed above the main engine or exhaust pipe;
[0092] d. Pipelines should be arranged below the layout environment as much as possible;
[0093] (4) Order constraint: The general arrangement order of pipelines determined based on actual production experience
[0094] a. Arrange the thick tubes first, then the thin tubes;
[0095] b. Heat pipes, fluid pipes, and power pipes should be laid out first;
[0096] c. Lay out the pipelines from inside to outside and from low to high;
[0097] d. When the pipeline is long, it can be laid out in sections and connected with joints in the middle;
[0098] (5) Economic constraints: rules that can save costs
[0099] a. The pipeline length should be as short as possible;
[0100] b. Avoid turning the pipeline as much as possible;
[0101] (6) Aesthetic constraints: The piping layout needs to ensure the cleanliness of the cabin.
[0102] a. The pipelines should be laid out along the horizontal and vertical directions of the accessories as much as possible;
[0103] b. The pipeline structure should be as compact as possible;
[0104] c. Parallel pipelines should share the same pipeline bracket as much as possible;
[0105] The above rules are general ship pipeline laying rules. In the specific pipeline laying process, the above engineering rules should be screened according to the specific equipment and pipeline accessories, and the engineering rules suitable for the current pipeline layout environment should be selected and applied to the algorithm.
[0106] The economy and safety of pipelines are used as evaluation indicators. Therefore, in the mathematical model of a single pipeline, other engineering rules are implemented in the algorithm search and pipeline optimization. When arranging a single pipeline in the cabin, the engineering rules in the pipeline layout are mainly referred to, and the economy and safety of the pipeline are maximized as evaluation indicators.
[0107] A ship piping layout scheme based on the improved snake optimization algorithm adopts the following steps:
[0108] The single-pipeline objective function is as follows:
[0109]
[0110] Wherein, F represents the objective function of single pipeline layout; L represents the length of the pipeline; R represents the sum of the number of elbows in a single pipeline.
[0111] The present invention selects the snake optimization algorithm to optimize the pipeline path. The SO algorithm is inspired by the mating behavior of snakes. The mathematical model is described as follows: Refers to the coordinate vector of the i-th individual in a population of dimension d and size N. The initialization process is expressed as:
[0112]
[0113] Where: are the lower and upper limits; r is a random constant in [0,1]. The population consists of females and males, assuming that females and males account for 50% each. Before iteration, the population of size N is divided into two subgroups as follows:
[0114]
[0115] Where: For the male subgroup; For the female subgroup.
[0116] Food quality determines whether SO enters the exploration phase or the exploitation phase, and whether to engage in mating behavior is determined by temperature. Food quality Q and temperature T are defined as follows:
[0117]
[0118] Where: g and G are the current and maximum number of iterations respectively; is a constant, and this invention takes 0.5.
[0119] When snakes are in an unsuitable environment (no food), they will only look for food around them. Therefore, when the food quality is less than a certain range, they enter the search phase, and each individual randomly updates the position within the search area. For the male group, the position update is expressed as follows:
[0120]
[0121] Where: is a random male; rand is a randomly generated number in [0,1]; is a constant, and this invention takes 0.5. is the mating ability of male snakes, and its expression is:
[0122]
[0123] Where: F() is the fitness value.
[0124] For the female subgroup, the position update during the exploration phase is similar to that of the male subgroup as follows:
[0125]
[0126] In the formula, is the mating ability of the i-th female snake.
[0127] The traditional SO algorithm randomly generates individuals in the population, which is prone to problems of low quality and uneven distribution of individuals. This invention introduces sinusoidal chaos mapping to improve the overall quality of the population, making the population distribution uniform and diverse, and improving the convergence speed and accuracy of the algorithm. The specific expression is as follows:
[0128]
[0129] Where: k is the number of iterations; A is the bifurcation parameter; is a constant, ranging from (0,4). Set the initial value, and the sinusoidal chaotic sequence x The distribution of changes such as Figure 3 As shown. =4, the sequence has the best distribution and the highest population randomness. Therefore, choose =4 to initialize the population. The specific expression is as follows:
[0130]
[0131] The bidirectional search strategy is a strategy that uses the best and worst individuals to explore in the search area. Its design goal is to keep the algorithm away from the worst individual and close to the best individual. The specific expression is:
[0132]
[0133]
[0134] Where: and the best and worst females, respectively; and for the best and worst females; and is a uniformly generated random number.
[0135] Traditional SO algorithm searches for the optimal region through random search, which has low randomness and high uncertainty, and the search range is very narrow. BDS enables the algorithm to approach the optimal value while making full use of the search area, thus accelerating the convergence speed.
[0136] The population evolution dynamic mechanism aims to improve the quality of the solution by eliminating inferior individuals. In order to increase population diversity, the mutation operation is introduced into the population evolution dynamic mechanism. The specific expression is as follows:
[0137]
[0138]
[0139] Where: i=1,2,…,N / 2, is a new position randomly searched around the historical individual.
[0140] The mutation operation in the population evolution dynamic mechanism will be performed on individuals with better quality. In addition to replacing the worst individuals, the mutation operator is applied to the first 50% of individuals to generate mutant individuals and perform greedy operations, as follows:
[0141]
[0142] Where: It is the population individual after greedy operation; is the individual in the original population. F is the proportional factor, which is expressed as follows:
[0143]
[0144] Where: is the vibration frequency of the sine function.
[0145]
[0146] Searching around the best individual can improve the median population size. When the quality of the new solution is not as good as the original solution, the search area will be searched again.
[0147] The elite adversarial learning strategy is essentially a greedy operation. First, the elite individual is used to calculate the opposing solution, and then the current solution and its elite opposing solution are selected for the next iteration according to the fitness value. n refers to the individual with the highest EN in the population, where EN is the number of elite solutions. , whose elite opposite solution is calculated as follows:
[0148]
[0149] Where: n=1,2,…,EN, EN is 0.1*N. As the dynamic boundary, and are the minimum and maximum values of the j-th dimension in the elite population, respectively.
[0150] The above strategies are improvements to the SO algorithm. The introduction of bidirectional search in exploration is to accelerate convergence. Under the cooperative guidance of the best and worst individuals, the population is brought close to the optimal solution. When the algorithm triggers the mating mode, the population evolution dynamics mechanism is executed. First, it is used to calculate new positions to replace the worse half of the individuals. This operation can effectively utilize the search area and improve the quality of the population. Secondly, the better half is mutated to increase the diversity of the population, so that the algorithm approaches the optimal value with a greater probability. In addition, elite adversarial learning can obtain the opposite solution of the current feasible solution, which is not only conducive to the use of the neighborhood space of elite individuals, but also enhances the local development ability of the algorithm. The general process of the implementation of the invented algorithm is as follows:
[0151] (1) Establish the environment, set the starting and ending points, initialize the parameters, and use sinusoidal chaos to generate the population;
[0152] (2) Calculate the food mass and current ambient temperature to determine which stage to enter;
[0153] (3) If Q and T are less than the set conditions, the algorithm enters the search phase, otherwise it enters the local optimization phase;
[0154] (4) Current number of iterations t and maximum number of iterations T max For comparison, if i>T max Then exit the iteration if i<T max Then return to continue iteration;
[0155] (5) The algorithm ends and the optimal result is output.
Claims
1. A ship piping layout method based on an improved snake optimization algorithm, characterized in that: The following steps are involved: S1. The single pipeline objective function is as follows: ; Among them, F represents the objective function of single pipeline layout; L represents the length of the pipeline; R represents the sum of the number of elbows in a single pipeline; S2. Establish the environment, set the starting and ending points, initialize the parameters, and use sinusoidal chaos to generate the population; The initialization process is expressed as: ; Where: Refers to the coordinate vector of the i-th individual in a population of dimension d and size N; are the lower and upper limits; r is a random constant in [0,1]; The population consists of females and males, assuming that females and males each account for 50%; before iteration, the population of size N is divided into two subgroups as follows: ; Where: For the male subgroup; For the female subgroup; The introduction of sinusoidal chaotic mapping makes the population distribution uniform and diverse. The specific expression is as follows: ; Where: k is the number of iterations; is a constant, ranging from (0,4]; set the initial value, when =4, the sequence has the best distribution and the highest population randomness; select =4 to initialize the population. The specific expression is as follows: ; S3. Calculate the food quality and current ambient temperature to determine which stage to enter; Food quality determines whether to enter the exploration phase or the exploitation phase, and whether to engage in mating behavior is determined by temperature; food quality Q and temperature T are defined as follows: ; Where: g and G are the current and maximum number of iterations respectively; is a constant, take 0.5; S4. If Q and T are less than the set conditions, the algorithm enters the search phase, otherwise it enters the local optimization phase; Entering the search phase, each individual randomly updates the position within the search area; for the male population, the position update is expressed as follows: ; Where: is a random male; rand is a randomly generated number in [0,1]; Take 0.5 as a constant; is the mating ability of male snakes, and its expression is: ; Where: F() is the fitness value; For the female subgroup, the position update during the exploration phase is as follows: ; In the formula, is a random male; rand is a randomly generated number in [0,1]; Take 0.5 as a constant; The ability to mate with the i-th female snake; The best and worst individuals are used to explore the search area, so that the algorithm can stay away from the worst individuals and approach the best individuals. The specific expression is: (10); (11); Where: and the best and worst females, respectively; and for the best and worst females; and is a uniformly generated random number; S4. Guided by the cooperation of the best and worst individuals, the population approaches the optimal solution; when the algorithm triggers the mating mode, the population evolution dynamic mechanism will be executed; A mutation operation is introduced into the population evolution dynamics mechanism to calculate new positions to replace half of the worse individuals; the specific expression is as follows: ; ; Where: i=1,2,…,N / 2, is a new position randomly searched around the historical individual; In addition to replacing the worst individual, the mutation operator is applied to the first 50% of individuals to generate mutant individuals and perform greedy operations as follows: ; Where: It is the population individual after greedy operation; Individuals in the original population; F is the proportional factor, which is expressed as follows: ; Where: is the vibration frequency of the sine function; ; Searching around the best individual improves the median population size; when the quality of the new solution is not as good as the original solution, the search area will be searched again; Use elite individuals to calculate the opposing solution, and then select the current solution and its elite opposing solution for the next iteration based on the fitness value; Elite IndividualEy n refers to the individual with the highest EN in the population, where EN is the number of elite solutions; for the current solution , whose elite opposite solution is calculated as follows: ; Where: n=1,2,…,EN, EN takes 0.1*N as the dynamic boundary, and are the minimum and maximum values of the j-th dimension in the elite population, respectively; S5. Current number of iterations t and maximum number of iterations T max For comparison, if t>T max Then exit the iteration if t<T max Then return to continue iteration; S6. The algorithm ends and the optimal result is output.