SOLVED

AnyLogic 8.6 - the brain only performs the first action

Occasional Contributor

I exported a brain and used the url from azure to use the playback option. Since I'm using AnyLogic 8.6 I use pauseSimulation(); to let the brain execute actions. I have an event that runs every 1 second.

I tested the behavior using the curl -X GET in my console and i get a policy decision based on the observations I have so everything good.

After the first second the simulation is paused and then the brain takes an action... all good... then the next second, the simulation pauses and no action is taken... the pause remains forever.

What am I missing here?

 

 

4 Replies
I would make sure you're running the experiment with Wrapper as your top-level agent and have it set to 'playback' with your URL pasted in.

If that doesn't appear to do the trick, I would add `traceln` statements to your episode start/step events (to make sure they're firing) and enable the logging checkbox as well. Feel free to paste the console text here and it might help in interpreting what's going on.

@TWolfeAdam 
the wrapper is my top-level agent

playback is on and url pasted
The start event is triggered and the step even is also trigger but only once

This is the log:
Dec 09, 2020 1:09:02 AM com.anylogic.sdk3.connector.SimulatorSession startSession
INFO: Starting playback
Dec 09, 2020 1:09:02 AM com.anylogic.sdk3.connector.SimulatorSession getPlaybackAction
INFO: {"RacketState":0.0,"ballPositionX":0.16,"ballPositionY":0.2,"racketPositionX":0.6,"ballSpeedX":1.45,"ballSpeedY":1.5,"miss":0.0,"hit":0.0,"time":1.0}
Dec 09, 2020 1:09:03 AM com.anylogic.sdk3.connector.SimulatorSession getPlaybackAction
INFO: {"direction":3.5710349082946779}

sometimes it takes 2 actions and then stops
Dec 09, 2020 8:37:48 AM com.anylogic.sdk3.connector.SimulatorSession startSession
INFO: Starting playback
Dec 09, 2020 8:37:49 AM com.anylogic.sdk3.connector.SimulatorSession getPlaybackAction
INFO: {"RacketState":0.0,"ballPositionX":0.42,"ballPositionY":0.32,"racketPositionX":0.6,"ballSpeedX":1.1,"ballSpeedY":2.12,"miss":0.0,"hit":0.0,"time":1.0}
Dec 09, 2020 8:37:50 AM com.anylogic.sdk3.connector.SimulatorSession getPlaybackAction
INFO: {"direction":5.892263412475586}

Dec 09, 2020 8:37:51 AM com.anylogic.sdk3.connector.SimulatorSession getPlaybackAction
INFO: {"RacketState":0.0,"ballPositionX":0.54,"ballPositionY":0.65,"racketPositionX":0.76,"ballSpeedX":1.1,"ballSpeedY":2.12,"miss":0.0,"hit":0.0,"time":2.0}
Dec 09, 2020 8:37:51 AM com.anylogic.sdk3.connector.SimulatorSession getPlaybackAction
INFO: {"direction":6.230897903442383}

best response confirmed by transparencyvalue (Occasional Contributor)
Solution

Hi @transparencyvalue 

I had a similar issue.  I found that using v2.6 of the bonsai library solved the problem for me. See here

https://github.com/microsoft/bonsai-anylogic/tree/master/deprecated/connector