Search code examples
decision-treeanylogicevent-simulation

AnyLogic: Look ahead simulation


Is it possible to perform look ahead simulation in AnyLogic? Specifically:

  1. Simulate till time T.
  2. Using 2 values of a variable, simulate for both values till T+t in parallel.
  3. Evaluate the system state at T+t, choose the value of variable which leads to better performance.
  4. Continue simulating from T using the selected value for the variable.

This is the basic functionality I am trying to implement. The variable values can be taken from decision tree, which should not affect the implementation.

Please let me know if someone has done something like this.


Solution

  • Yes, it is possible with some Java code. You may:

    1. Pause parent experiment, save snapshot at time T;
    2. Create two new experiments from parent experiment;
    3. Load snapshots in two new experiments;
    4. Continue execution of both experiments till time T + t;
    5. Send notification to parent experiment, compare the results, assign the best value and continue simulation.

    Some points can be done manually with UI controls or by code, some — by code only.