Skip to content

Reproducing AnyLogic Engine Errors

Edward Junprung edited this page Sep 20, 2022 · 2 revisions

During policy training, the AnyLogic engine may return an error, causing training to fail. This can occur when extremely rare logical errors exist in your AnyLogic simulation. As a rule of thumb, if there's a bug in your model, the policy will find it and exploit it.

To fix the problem, try to reproduce the error back in AnyLogic.

Step 1

Create a brand new CustomExperiment.

reproducing-errors

Step 2

Add a for loop to the prefilled CustomExperiment code to test every seed. Make sure you also print the seed after each loop (traceln(seed);).

reproducing-errors

In most cases, testing seeds 0 - 10,000 is enough to find the error. However, if no errors are uncovered, try testing 100,000 seeds for(int seed = 0; seed < 100000; seed++).

Step 3

Run the CustomExperiment. Once an error appears, check your AnyLogic console to see which seed caused the problem.

reproducing-errors

Step 4

In your Simulation Experiment, set the seed to the value found in Step 3 and run the simulation.

reproducing-errors

This should allow you to reproduce the error.

Clone this wiki locally