In this study, we present an artificial intelligence control method specifically designed for the Magnus anti-rolling device. The core of our approach is the development of a co-simulation framework that integrates an intelligent algorithm with a three-dimensional numerical computational programme within a complex hydrodynamic environment. This integration is achieved through the use of a deep reinforcement learning algorithm, which allows for intelligent adaptation of the anti-rolling device's rotating speed in real time. Our research focuses on evaluating the performance of the intelligent anti-rolling control algorithm under a variety of conditions, including different ship-model roll angles, column geometry models, and varying swinging or slewing speeds. Through numerical studies, we compare the effects of these variables on the effectiveness of the control method. The co-simulation technology provides a platform for testing the intelligent control method. It allows a detailed examination of how the intelligent algorithm interacts with the hydrodynamic responses of the Magnus anti-rolling device, ensuring that the control method can adapt to a wide range of operational scenarios. This adaptability is crucial for maintaining stability and improving the performance of the anti-rolling device in real maritime environments. This study highlights the potential for integrating artificial intelligence with traditional maritime engineering solutions.