Ship electrical wiring method and system based on multistage Steiner tree

By applying a reinforcement learning method based on multi-level Steiner tree in ship electrical wiring, building an intelligent body model based on attention mechanism is solved, and the computational complexity and efficiency challenges in ship electrical wiring optimization is achieved, and efficient path planning and cost savings are achieved.

CN119577971AActive Publication Date: 2025-03-07CHINA SHIP DEV & DESIGN CENT

Patent Information

Application Number
CN202411730746.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-29
Publication Date
2025-03-07
Estimated Expiration
2044-11-29

AI Technical Summary

Technical Problem

The prior art faces the challenges of computing complexity and optimization efficiency in ship electrical wiring optimization, especially in the multi-stage distribution problem, which is difficult to effectively balance the optimization quality and calculation speed.

Method used

The multi-level Steiner tree-based marine electrical wiring method is adopted, and by combining a strategy-based reinforcement learning algorithm, an agent model is initialized and constructed based on attention mechanism, interact with the environment and obtain environmental feedback to adjust the agent model learning rate, train the agent model, optimize the training strategy and value network, and evaluate the agent model.

Benefits of technology

Effectively handle the complexity of multi-level Steiner Tree problems, optimize ship electrical wiring, improve path planning efficiency, reduce cable length, and achieve cost savings and efficiency improvements.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119577971A_ABST
    Figure CN119577971A_ABST
Patent Text Reader

Abstract

The invention provides a ship electrical wiring method and system based on a multistage Steiner tree, and the method comprises the steps: initializing and constructing an agent model based on an attention mechanism through combining a reinforcement learning algorithm based on a strategy, carrying out the interaction with an environment, obtaining environment feedback, adjusting the learning rate of the agent model, and training the agent model, according to the method, the training strategy and the value network are optimized, and the intelligent agent model is evaluated, so that the complexity of the multi-stage Steiner tree problem can be effectively processed, the multi-stage Steiner tree problem of ship electrical wiring is solved, ship electrical wiring is optimized, the path planning efficiency is improved, the cable length is reduced, and cost saving and efficiency improvement are realized. Aiming at the characteristics of the combinatorial optimization problem, training an intelligent agent through a simulation environment and a reward mechanism so as to optimize an electrical wiring path; according to the invention, an input data structure with good expandability is provided, wiring requirements of different scales and complexities can be met, automation and intelligentization of wiring optimization are realized, and the burden of manual design is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of electrical engineering and optimization algorithms, and in particular relates to a ship electrical wiring method and system based on a multi-level Steiner tree. Background Art

[0002] In the field of ship design and manufacturing, electrical wiring optimization is a key technical challenge, which not only affects the energy efficiency and functionality of the ship, but also directly involves cost and safety. Traditional electrical wiring methods rely on the designer's experience and intuitive judgment, which often leads to suboptimal cable wiring, increased material costs and energy consumption, and may also cause safety hazards.

[0003] With the development of computing technology, ship electrical wiring design has begun to use more advanced algorithms to seek optimization solutions. The Steiner tree problem, as a well-known combinatorial optimization problem, is applied to find the shortest network connecting multiple points. However, most Steiner tree algorithms are aimed at static and simple wiring problems, while the actual ship electrical wiring design is more complex and involves multi-level and multi-stage decision-making and optimization.

[0004] With the development of deep learning technology, the application of machine learning in the field of operations research and optimization is increasing. Yoshua Bengio and other scholars have explored the application of machine learning in solving combinatorial optimization problems, especially its role in imitating expert decision-making and combining traditional algorithms. Jin Chun and others studied the application of optimization algorithms based on heuristic Q learning in the optimization of automobile paint shop operations, showing the potential of machine learning in dealing with large-scale optimization problems.

[0005] In the field of electrical wiring optimization, especially in the field of ship electrical wiring, the multi-level Steiner tree problem provides an effective solution framework. Siqi Wang et al. introduced a deep reinforcement learning-based method, Deep-Steiner, to handle the complex search space in the Steiner tree problem. This shows that deep learning methods have significant potential in solving Steiner tree problems, especially in multi-level and complex environments.

[0006] The learning-based graph pruning method proposed by Jiwei Zhang et al. demonstrated the application effect of machine learning in complex combinatorial optimization problems through integer linear programming transformation and prediction. The research of Chenyang Xu et al. demonstrated the advantages of machine learning in dealing with online Steiner tree problems, especially in dynamic and uncertain environments.

[0007] Existing technologies face challenges in computational complexity and optimization efficiency in ship electrical wiring optimization, especially when dealing with multi-level power distribution problems. Traditional methods are often limited by high dimensions and dynamic changes when dealing with such problems, and it is difficult to effectively balance optimization quality and computational speed. Summary of the invention

[0008] The technical problem to be solved by the present invention is to provide a method and system for ship electrical wiring based on a multi-level Steiner tree, which are used to solve the multi-level Steiner tree problem of ship electrical wiring.

[0009] The technical solution adopted by the present invention to solve the above technical problems is: a ship electrical wiring method based on a multi-level Steiner tree, comprising the following steps: S1: Initialize and build an agent model based on the attention mechanism; S2: Train the agent model by adjusting the learning rate of the agent model by interacting with the environment and obtaining environmental feedback; S3: Optimize training strategies and value networks; S4: Evaluate the agent model.

[0010] According to the above scheme, in step S1, the specific steps are: S11: Set hyperparameters, including experiment name, seed, deterministic settings, usage of CUDA graphics processing core platform, monitoring, and project name; S12: Set up the environment, register and create multiple instances of the training environment and test environment; S13: Construct a neural network agent model based on attention mechanism.

[0011] Furthermore, in step S12, the training instances are used to train the intelligent agent model and learn parameters; the test instances are used to evaluate the performance of the intelligent agent model; and the test instances are generated from a fixed data set or a seed.

[0012] Furthermore, in step S13, the specific steps are: Determine whether there is a pre-trained model: if so, load the weights of the pre-trained model for continued training or use the pre-trained model for inference; if not, define a new neural network as an agent model and initialize the parameters; Determine the problem to be solved by the agent based on the experiment name parameter passed in when initializing the agent model; select the multi-level Steiner tree problem and adjust the internal network architecture and parameter settings of the agent model accordingly; Select the Adam optimizer to adjust the parameters of the agent model during training; set the optimizer parameters, including learning rate, epsilon value, and weight decay; Storage initialization, setting up data structures to record the execution process of the algorithm.

[0013] Furthermore, in step S13, the data structure includes the state of the environment, the action of the agent model, the logarithmic probability of the action, the immediate reward obtained at each step, the end state flag of each environment, and the value estimation of the agent model for each step of observation.

[0014] According to the above scheme, in step S3, the specific steps are: S31: Record parameter metrics, including learning rate, value loss, policy loss, and approximate KL divergence; batch process data including observations, actions, and rewards; S32: Calculate policy loss and value function loss; Optimize the policy loss through gradient ascent to improve the decision-making ability of the intelligent model; use historical data to calculate the advantage function and update the policy network of the intelligent model; The value loss is optimized by gradient descent to improve the accuracy of value estimation; the updated value function is used to estimate the expected return of each state.

[0015] S33: Clip and update gradients to prevent gradient explosion or vanishing; apply clipped gradients to update the neural network parameters of the agent model; S34: Regularly test the training policy in the test environment to monitor its performance on unseen data.

[0016] Furthermore, the step S3 further includes the following steps: S35: Perform KL divergence detection on the training strategy to monitor the distribution changes before and after the strategy update. If the change exceeds the set threshold, stop further updating to avoid excessive deviation from the original strategy.

[0017] According to the above scheme, in step S4, at the end of each update cycle, the performance indicators of the intelligent agent model are evaluated and recorded, and the state of the intelligent agent model is regularly saved and evaluated in the test environment to verify the training effect; the specific steps are: S41: Load the trained agent model; S42: Create an environment instance corresponding to the multi-level Steiner tree problem and including all information of the multi-level Steiner tree problem; S43: Obtain the initial observation or state of the agent model from the environment, including all the initial information required to solve the problem; S44: decide the next action of the agent model based on the current observation; S45: Execute the decision action and receive the response from the environment, including new observations, i.e., the next state, rewards, and information on whether the goal has been achieved; S46: constructing a path to solve the multi-level Steiner tree problem by repeating steps S44 and S45 until a certain termination condition is reached; S47: Output results, including the connection relationship and total length information of the multi-level Steiner tree graph of the multi-level Steiner tree problem.

[0018] A ship electrical wiring system based on a multi-level Steiner tree. Initialization submodule, used to initialize and build an agent model based on the attention mechanism; Model training submodule, used to train the agent model; Strategy optimization submodule, used to optimize training strategies and value networks; The model evaluation submodule is used to evaluate the intelligent agent model.

[0019] A computer memory stores a computer program executable by a computer processor, wherein the computer program executes a ship electrical wiring method based on a multi-level Steiner tree.

[0020] The beneficial effects of the present invention are: 1. The present invention provides a method and system for ship electrical wiring based on a multi-level Steiner tree. By combining a policy-based reinforcement learning algorithm, initializing and constructing an intelligent agent model based on an attention mechanism, interacting with the environment and obtaining environmental feedback to adjust the learning rate of the intelligent agent model to train the intelligent agent model, optimizing the training strategy and the value network, and evaluating the intelligent agent model, the method and system can effectively handle the complexity of the multi-level Steiner tree problem, solve the multi-level Steiner tree problem of ship electrical wiring, optimize ship electrical wiring, improve the efficiency of path planning and reduce cable length, thereby achieving cost savings and efficiency improvements.

[0021] 2. Aiming at the requirements of partitioning and hierarchical start and stop of electrical equipment in complex power distribution systems, the present invention expands the classic Steiner tree model into a multi-level Steiner tree model to adapt to the needs of electrical distribution; it greatly improves the efficiency of path planning, especially when dealing with complex multi-level Steiner tree problems.

[0022] 3. The present invention targets the characteristics of combinatorial optimization problems, trains intelligent agents through simulation environments and reward mechanisms to optimize electrical wiring paths, and uses advanced algorithms to achieve end-to-end learning of strategies and value networks, which has execution superiority over traditional algorithms, improves design efficiency and the economy of wiring solutions, and has good scalability and practicality.

[0023] 4. The computational design model of the objective function pre-designed by the present invention has strong adaptability and an input data structure with good scalability. It can be applied to wiring requirements of different scales and complexities, and realize automation and intelligence of wiring optimization, so as to perform adaptive and dynamic optimization according to different ship designs and electrical wiring requirements, greatly reducing the burden of manual design, and providing an efficient, economical and intelligent ship electrical wiring optimization solution.

[0024] Of course, any product implementing the present invention does not necessarily need to achieve all of the advantages described above at the same time. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0026] Figure 1 It is a flow chart of reinforcement learning agent training based on multi-level Steiner tree according to an embodiment of the present invention.

[0027] Figure 2 It is a flow chart of reinforcement learning agent evaluation based on a multi-level Steiner tree according to an embodiment of the present invention. DETAILED DESCRIPTION

[0028] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0029] Example 1 See also Figure 1 ,The specific steps of a ship electrical wiring method based on a multi-level Steiner tree are as follows: S1: Initialize and build an agent model based on the attention mechanism; S2: Train the agent model by adjusting the learning rate of the agent model by interacting with the environment and obtaining environmental feedback; S3: Optimize training strategies and value networks; S4: Evaluate the agent model.

[0030] Furthermore, in step S1, the specific steps are: S11: Set hyperparameters, including experiment name, seed, deterministic settings, usage of CUDA graphics processing core platform, monitoring, and project name; S12: Set up the environment, register and create multiple instances of the training environment and test environment; S13: Construct a neural network agent model based on attention mechanism.

[0031] Furthermore, in step S12, the training instances are used to train the intelligent agent model and learn parameters; the test instances are used to evaluate the performance of the intelligent agent model; and the test instances are generated from a fixed data set or a seed.

[0032] In step S13, it is determined whether there is a pre-trained model: if so, the weights of the pre-trained model are loaded for continued training or reasoning using the pre-trained model; if not, a new neural network is defined as an agent model and the parameters are initialized; Determine the problem to be solved by the agent based on the experiment name parameter passed in when initializing the agent model; select the multi-level Steiner tree problem and adjust the internal network architecture and parameter settings of the agent model accordingly; Select the Adam optimizer to adjust the parameters of the agent model during training; set the optimizer parameters, including learning rate, epsilon value, and weight decay; Initialize storage and set up data structures to record the execution of the algorithm. The data structures include the state of the environment, the actions of the agent model, the logarithmic probability of the actions, the immediate reward obtained at each step, the end state flag of each environment, and the value estimate of the agent model for each observation step.

[0033] In step S3, the specific steps are: S31: Record parameter metrics, including learning rate, value loss, policy loss, and approximate KL divergence; batch process data including observations, actions, and rewards; S32: Calculate policy loss and value function loss; Optimize the policy loss through gradient ascent to improve the decision-making ability of the intelligent model; use historical data to calculate the advantage function and update the policy network of the intelligent model; The value loss is optimized by gradient descent to improve the accuracy of value estimation; the updated value function is used to estimate the expected return of each state.

[0034] S33: Clip and update gradients to prevent gradient explosion or vanishing; apply clipped gradients to update the neural network parameters of the agent model; S34: Regularly test the training policy in the test environment to monitor its performance on unseen data.

[0035] Also includes the steps: S35: Perform KL divergence detection on the training strategy to monitor the distribution changes before and after the strategy update. If the change exceeds the set threshold, stop further updating to avoid excessive deviation from the original strategy.

[0036] In step S4, at the end of each update cycle, the performance indicators of the agent model are evaluated and recorded, and the state of the agent model is regularly saved and evaluated in the test environment to verify the training effect; the specific steps are: S41: Load the trained agent model; S42: Create an environment instance corresponding to the multi-level Steiner tree problem and including all information of the multi-level Steiner tree problem; S43: Obtain the initial observation or state of the agent model from the environment, including all the initial information required to solve the problem; S44: decide the next action of the agent model based on the current observation; S45: Execute the decision action and receive the response from the environment, including new observations, i.e., the next state, rewards, and information on whether the goal has been achieved; S46: constructing a path to solve the multi-level Steiner tree problem by repeating steps S44 and S45 until a certain termination condition is reached; S47: Output results, including the connection relationship and total length information of the multi-level Steiner tree graph of the multi-level Steiner tree problem.

[0037] This embodiment combines a policy-based reinforcement learning algorithm, initializes and constructs an intelligent agent model based on an attention mechanism, interacts with the environment and obtains environmental feedback to adjust the learning rate of the intelligent agent model to train the intelligent agent model, optimizes the training strategy and value network, and evaluates the intelligent agent model. It can effectively handle the complexity of the multi-level Steiner tree problem, solve the multi-level Steiner tree problem of ship electrical wiring, optimize ship electrical wiring, improve the efficiency of path planning and reduce cable length, thereby achieving cost savings and efficiency improvements.

[0038] Example 2 The steps of this embodiment are the same as those of embodiment 1, except that each step is applied to a specific example. Specifically, the following steps are included: The training process of reinforcement learning agents based on multi-level Steiner trees, such as Figure 1 As shown, the following steps are included: 1) Perform parameter analysis and initialization before running the algorithm, including setting hyperparameters, environment, and neural network agent. Hyperparameters include experiment name, seed, deterministic settings, CUDA usage, monitoring, project name, etc.

[0039] 2) Register and create multiple training and test environment instances. The training instances are used for learning, while the test instances (either from a fixed dataset or generated using a seed) are used to evaluate the performance of the agent.

[0040] 3) Create an attention-based model agent for subsequent learning and decision-making. The agent is initialized and specified to run on a specific GPU, where the initialization includes the following steps: (1) If there are pre-trained model weights, you can choose to load the previous model weights to continue the previous training or use the pre-trained model for inference; otherwise, you can choose to define a new neural network and initialize the parameters.

[0041] (2) The problem to be solved by the agent is determined by the problem name parameter passed in when the agent is initialized. Here, the multi-level Steiner tree problem is selected. The internal network architecture and parameter settings of the agent will be adjusted accordingly according to this problem type to adapt to the characteristics of the problem.

[0042] (3) Set an optimizer for the agent and select the Adam optimizer to adjust the agent's parameters during training to improve its performance in the environment. The optimizer settings include parameters such as learning rate, epsilon value, and weight decay.

[0043] 4) Initialize storage and set up data structures to record the execution process of the algorithm. This includes the environment state (observation), the agent's actions, the logarithmic probability of the action, the immediate reward obtained at each step, the end state flag of each environment, and the agent's value estimate of each observation step. The storage structure is continuously updated during the training process to record the agent's learning and decision-making process. These data are used to update the agent's strategy and value network in iterations to improve its problem-solving performance.

[0044] 5) Start training the agent. The training cycle includes the following steps: (1) Preparation phase: This includes training preparation and environment interaction. The agent is in training mode and the learning rate may be adjusted. Next, the agent interacts with the environment, receives observations, decides actions, and obtains environmental feedback. This phase is the beginning of the training process and the basis for interaction with the environment.

[0045] (2) Learning and updating phase: involves data recording, policy updating, and value function updating. This phase uses previously recorded data to calculate the advantage function and update the agent’s policy network. At the same time, the agent’s value function is also updated to better estimate the expected return of each state.

[0046] (3) Performance evaluation and testing: including performance evaluation, preservation, and testing. At the end of each update cycle, the performance indicators of the agent are evaluated and recorded. At the same time, the agent status is regularly saved and evaluated in the test environment to verify the training effect.

[0047] 6) Use the data collected from the environment to optimize strategies and value networks. The key steps include: (1) Data organization: Data batch processing, organizing observation, action, reward and other data into batches. This is crucial for subsequent optimization calculations.

[0048] (2) Policy and value network optimization: This step includes calculating the policy loss and value function loss. The policy loss is optimized by the gradient ascent method to improve the decision-making ability of the agent. The value loss is optimized by gradient descent to improve the accuracy of value estimation.

[0049] (3) Gradient Clipping and Update: To prevent gradients from exploding or disappearing, gradient clipping techniques are used. After clipping, these gradients are applied to update the neural network parameters of the agent.

[0050] (4) KL divergence detection: an optional step used to monitor the distribution changes before and after the policy update. If the change exceeds the set threshold, further updates may be stopped to avoid excessive deviation from the original policy.

[0051] 7) Log important metrics such as learning rate, value loss, policy loss, and approximate KL divergence to monitor performance.

[0052] 8) Periodically save the state of the trained model for later use or evaluation.

[0053] 9) Regularly test the training strategy on the test environment to monitor its performance on unseen data.

[0054] 10) When training is complete, close the environment properly and save the training log to end the training process.

[0055] The evaluation process of reinforcement learning agents based on multi-level Steiner trees, such as Figure 2 As shown, the following steps are included: 1) Model loading: First, the trained model is loaded into memory, ready for inference.

[0056] 2) Environment initialization: Create an environment instance corresponding to the multi-level Steiner tree problem. This environment contains all the information of the multi-level Steiner tree problem, such as the coordinates and requirements of the nodes.

[0057] 3) Observation acquisition: The agent obtains initial observations (or states) from the environment, which contain all the initial information needed to solve the problem.

[0058] 4) Action decision: The agent decides its next action based on the current observation. This usually involves querying a neural network to get the best action for the current state.

[0059] 5) Interaction with the environment: The agent performs the selected action and receives a response from the environment. The response includes new observations (next state), rewards, and information about whether the goal was achieved.

[0060] 6) Path construction: Repeat the steps of action decision and environment interaction until the goal is achieved or a termination condition is reached. This process constructs a path to solve the multi-level Steiner tree problem.

[0061] 7) Result output: Finally, the solution is output, that is, the multi-level Steiner tree graph connection relationship and total length and other related information of the multi-level Steiner tree problem.

[0062] Through the above steps, this embodiment not only realizes the optimization of the electrical wiring path, but also provides a new technical solution for the electrical wiring optimization in the field of future ship design and construction.

[0063] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0064] Aiming at the requirements of partitioning and hierarchical start and stop of electrical equipment in complex power distribution systems, the present invention expands the classic Steiner tree model into a multi-level Steiner tree model to adapt to the needs of electrical power distribution; the efficiency of path planning is greatly improved, especially when dealing with complex multi-level Steiner tree problems.

[0065] The present invention aims at the characteristics of combinatorial optimization problems, trains intelligent agents through simulation environment and reward mechanism to optimize electrical wiring paths, adopts advanced algorithms to realize end-to-end learning of strategies and value networks, has execution superiority over traditional algorithms, improves design efficiency and the economy of wiring solutions, and has good scalability and practicality.

[0066] Example 3 This embodiment is used to implement the principle of the above method embodiment to construct a ship electrical wiring system based on a multi-level Steiner tree, including an initialization submodule, a model training submodule, a strategy optimization submodule and a model evaluation submodule.

[0067] The initialization submodule is used to initialize and build an agent model based on the attention mechanism; The model training submodule is used to train the agent model; The strategy optimization submodule is used to optimize the training strategy and value network; The model evaluation submodule is used to evaluate the agent model.

[0068] Each sub-module is mainly used to implement each step of the method embodiment, which will not be described in detail here.

[0069] It should be pointed out that, according to the needs of implementation, the various steps / components described in this application can be split into more steps / components, and two or more steps / components or partial operations of steps / components can be combined into new steps / components to achieve the purpose of the present invention.

[0070] The computational design model of the objective function pre-designed by the present invention has strong adaptability and an input data structure with good scalability. It can be applicable to wiring requirements of different scales and complexities, and at the same time realizes automation and intelligence of wiring optimization, so as to perform adaptive and dynamic optimization according to different ship designs and electrical wiring requirements, greatly reducing the burden of manual design, and providing an efficient, economical and intelligent ship electrical wiring optimization solution.

[0071] The above embodiments are only used to illustrate the design ideas and features of the present invention, and their purpose is to enable those skilled in the art to understand the content of the present invention and implement it accordingly. The protection scope of the present invention is not limited to the above embodiments. Therefore, any equivalent changes or modifications made based on the principles and design ideas disclosed by the present invention are within the protection scope of the present invention.

Claims

1. A ship electrical wiring method based on a multi-level Steiner tree, characterized in that: The following steps are involved: S1: Initialize and build an agent model based on the attention mechanism; S2: Train the agent model by adjusting the learning rate of the agent model by interacting with the environment and obtaining environmental feedback; S3: Optimize training strategies and value networks; S4: Evaluate the agent model.

2. A ship electrical wiring method based on a multi-level Steiner tree according to claim 1, characterized in that: In the step S1, the specific steps are: S11: Set hyperparameters, including experiment name, seed, deterministic settings, usage of CUDA graphics processing core platform, monitoring, and project name; S12: Set up the environment, register and create multiple instances of the training environment and test environment; S13: Construct a neural network agent model based on attention mechanism.

3. A ship electrical wiring method based on a multi-level Steiner tree according to claim 2, characterized in that: In step S12, the training instance is used to train the intelligent agent model and learn parameters; the test instance is used to evaluate the performance of the intelligent agent model; and the test instance is generated from a fixed data set or seed.

4. A ship electrical wiring method based on a multi-level Steiner tree according to claim 2, characterized in that: In the step S13, the specific steps are: Determine whether there is a pre-trained model: if so, load the weights of the pre-trained model for continued training or use the pre-trained model for inference; if not, define a new neural network as an agent model and initialize the parameters; Determine the problem to be solved by the agent based on the experiment name parameter passed in when initializing the agent model; select the multi-level Steiner tree problem and adjust the internal network architecture and parameter settings of the agent model accordingly; Select the Adam optimizer to adjust the parameters of the agent model during training; set the optimizer parameters, including learning rate, epsilon value, and weight decay; Storage initialization, setting up data structures to record the execution process of the algorithm.

5. A ship electrical wiring method based on a multi-level Steiner tree according to claim 4, characterized in that: In step S13, the data structure includes the state of the environment, the action of the agent model, the logarithmic probability of the action, the immediate reward obtained at each step, the end state flag of each environment, and the value estimation of the agent model for each step of observation.

6. A ship electrical wiring method based on a multi-level Steiner tree according to claim 1, characterized in that: In the step S3, the specific steps are: S31: Record parameter metrics, including learning rate, value loss, policy loss, and approximate KL divergence; batch process data including observations, actions, and rewards; S32: Calculate policy loss and value function loss; Optimize the policy loss through gradient ascent to improve the decision-making ability of the intelligent model; use historical data to calculate the advantage function and update the policy network of the intelligent model; The value loss is optimized by gradient descent to improve the accuracy of value estimation; the updated value function is used to estimate the expected return of each state. S33: Clip and update gradients to prevent gradient explosion or vanishing; apply clipped gradients to update the neural network parameters of the agent model; S34: Regularly test the training policy in the test environment to monitor its performance on unseen data.

7. A ship electrical wiring method based on a multi-level Steiner tree according to claim 6, characterized in that: The step S3 further comprises the following steps: S35: Perform KL divergence detection on the training strategy to monitor the distribution changes before and after the strategy is updated. If the change exceeds the set threshold, stop further updating to avoid excessive deviation from the original strategy.

8. A ship electrical wiring method based on a multi-level Steiner tree according to claim 1, characterized in that: In step S4, at the end of each update cycle, the performance indicators of the intelligent agent model are evaluated and recorded, and the state of the intelligent agent model is regularly saved and evaluated in the test environment to verify the training effect; the specific steps are: S41: Load the trained agent model; S42: Create an environment instance corresponding to the multi-level Steiner tree problem and including all information of the multi-level Steiner tree problem; S43: Obtain the initial observation or state of the agent model from the environment, including all the initial information required to solve the problem; S44: decide the next action of the agent model based on the current observation; S45: Execute the decision action and receive the response from the environment, including new observations, i.e., the next state, rewards, and information on whether the goal has been achieved; S46: constructing a path to solve the multi-level Steiner tree problem by repeating steps S44 and S45 until a certain termination condition is reached; S47: Output results, including the connection relationship and total length information of the multi-level Steiner tree graph of the multi-level Steiner tree problem.

9. A ship electrical wiring system based on a multi-level Steiner tree, characterized in that: Initialization submodule, used to initialize and build an agent model based on the attention mechanism; Model training submodule, used to train the agent model; Strategy optimization submodule, used to optimize training strategies and value networks; The model evaluation submodule is used to evaluate the intelligent agent model.

10. A computer memory, characterized in that: A computer program executable by a computer processor is stored therein, and the computer program executes a ship electrical wiring method based on a multi-level Steiner tree as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Track allocation method based on deep reinforcement learning

    CN115719051A

  • Network analysis with steiner trees

    US20090222782A1

Cited By

  • Intelligent agent strategy updating method and system

    CN121615723A