This invention belongs to the field of
simulation software secondary development and specifically provides a method for running
R language and deploying
machine learning algorithms in the AnyLogic
software environment. The method includes: creating a
Jar package that carries the method; constructing a project main
package, including two first-level subpackages, where the first first-level subpackage is composed of two second-level subpackages;
porting the constructed project code data into the AnyLogic
software environment, and using AnyLogic software to
package the active objects contained in the project into a plug-in
library that complies with AnyLogic software communication specifications; inserting the plug-in
library into the AnyLogic IDE for testing and use; bridging the AnyLogic environment with mainstream
R language machine learning packages through the plug-in
library, and calling the return values of the
R language machine learning in real time during
simulation experiments. This method overcomes the complexity and technical challenges of effectively integrating and using R language
machine learning methods in AnyLogic, improving the predictive capabilities and overall
simulation performance of the simulation model.