Improving the numerical method of fish autonomous swimming behavior in complex environments is of great significance to the optimization of bionic controller,the design of fish passing facilities and the study of fish behavior.This work has built a fish autonomous swimming simulation platform,which adapts the high-precision IB-LBM to simulate the dynamic process of the interaction between the fish and the flow field in real time,and realizes the fish brain motion control through the SAC deep reinforcement learning algorithm.More importantly,in view of the poor generalization of the existing simulation platform,a method to simulate the fish's lateral line function is proposed.By adding the Lateral-line machine and designing the Macro-action system,the intelligent fish has the ability to recognize,classify,memorize and transplant the corresponding swimming strategy in the unsteady field.Using this method,the training and simulation of point-to-point predation swimming and Kamangait test under different inlet velocities are carried out.In the example of point-to-point predation swimming,the fish in random position can adjust the swimming posture and speed autonomously to catch the fast moving food,and has a certain prediction ability on the movement trajectory of the food.In the Kaman-gait test,the trained fish are placed in three different Kamangait flow fields,to study its ability to recognize the flow field and select swimming strategies through experience.The results of numerical experiments show that,comparing with the other value function networks,the SAC algorithm based on maximum entropy has more advantages in convergence speed and training efficiency when simulating fish brain decision-making.The use of the Lateral line Machine and Macro-action system can avoid the waste of experience and improve the adaptability of intelligent fish in the new complex flow field environment.