SOLVED

AnyLogic 8.6 - the brain only performs the first action

%3CLINGO-SUB%20id%3D%22lingo-sub-1966955%22%20slang%3D%22en-US%22%3EAnyLogic%208.6%20-%20the%20brain%20only%20performs%20the%20first%20action%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1966955%22%20slang%3D%22en-US%22%3E%3CP%3EI%20exported%20a%20brain%20and%20used%20the%20url%20from%20azure%20to%20use%20the%20playback%20option.%20Since%20I'm%20using%20AnyLogic%208.6%20I%20use%20pauseSimulation()%3B%20to%20let%20the%20brain%20execute%20actions.%20I%20have%20an%20event%20that%20runs%20every%201%20second.%3CBR%20%2F%3E%3CBR%20%2F%3EI%20tested%20the%20behavior%20using%20the%20curl%20-X%20GET%20in%20my%20console%20and%20i%20get%20a%20policy%20decision%20based%20on%20the%20observations%20I%20have%20so%20everything%20good.%3CBR%20%2F%3E%3CBR%20%2F%3EAfter%20the%20first%20second%20the%20simulation%20is%20paused%20and%20then%20the%20brain%20takes%20an%20action...%20all%20good...%20then%20the%20next%20second%2C%20the%20simulation%20pauses%20and%20no%20action%20is%20taken...%20the%20pause%20remains%20forever.%3CBR%20%2F%3E%3CBR%20%2F%3EWhat%20am%20I%20missing%20here%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1968919%22%20slang%3D%22en-US%22%3ERe%3A%20AnyLogic%208.6%20-%20the%20brain%20only%20performs%20the%20first%20action%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1968919%22%20slang%3D%22en-US%22%3EI%20would%20make%20sure%20you're%20running%20the%20experiment%20with%20Wrapper%20as%20your%20top-level%20agent%20and%20have%20it%20set%20to%20'playback'%20with%20your%20URL%20pasted%20in.%3CBR%20%2F%3E%3CBR%20%2F%3EIf%20that%20doesn't%20appear%20to%20do%20the%20trick%2C%20I%20would%20add%20%60traceln%60%20statements%20to%20your%20episode%20start%2Fstep%20events%20(to%20make%20sure%20they're%20firing)%20and%20enable%20the%20logging%20checkbox%20as%20well.%20Feel%20free%20to%20paste%20the%20console%20text%20here%20and%20it%20might%20help%20in%20interpreting%20what's%20going%20on.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1969144%22%20slang%3D%22en-US%22%3ERe%3A%20AnyLogic%208.6%20-%20the%20brain%20only%20performs%20the%20first%20action%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1969144%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F895359%22%20target%3D%22_blank%22%3E%40TWolfeAdam%3C%2FA%3E%26nbsp%3B%3CBR%20%2F%3Ethe%20wrapper%20is%20my%20top-level%20agent%3C%2FP%3E%3CP%3Eplayback%20is%20on%20and%20url%20pasted%3CBR%20%2F%3EThe%20start%20event%20is%20triggered%20and%20the%20step%20even%20is%20also%20trigger%20but%20only%20once%3CBR%20%2F%3E%3CBR%20%2F%3EThis%20is%20the%20log%3A%3CBR%20%2F%3EDec%2009%2C%202020%201%3A09%3A02%20AM%20com.anylogic.sdk3.connector.SimulatorSession%20startSession%3CBR%20%2F%3EINFO%3A%20Starting%20playback%3CBR%20%2F%3EDec%2009%2C%202020%201%3A09%3A02%20AM%20com.anylogic.sdk3.connector.SimulatorSession%20getPlaybackAction%3CBR%20%2F%3EINFO%3A%20%7B%22RacketState%22%3A0.0%2C%22ballPositionX%22%3A0.16%2C%22ballPositionY%22%3A0.2%2C%22racketPositionX%22%3A0.6%2C%22ballSpeedX%22%3A1.45%2C%22ballSpeedY%22%3A1.5%2C%22miss%22%3A0.0%2C%22hit%22%3A0.0%2C%22time%22%3A1.0%7D%3CBR%20%2F%3EDec%2009%2C%202020%201%3A09%3A03%20AM%20com.anylogic.sdk3.connector.SimulatorSession%20getPlaybackAction%3CBR%20%2F%3EINFO%3A%20%7B%22direction%22%3A3.5710349082946779%7D%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1969906%22%20slang%3D%22en-US%22%3ERe%3A%20AnyLogic%208.6%20-%20the%20brain%20only%20performs%20the%20first%20action%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1969906%22%20slang%3D%22en-US%22%3E%3CP%3Esometimes%20it%20takes%202%20actions%20and%20then%20stops%3CBR%20%2F%3EDec%2009%2C%202020%208%3A37%3A48%20AM%20com.anylogic.sdk3.connector.SimulatorSession%20startSession%3CBR%20%2F%3EINFO%3A%20Starting%20playback%3CBR%20%2F%3EDec%2009%2C%202020%208%3A37%3A49%20AM%20com.anylogic.sdk3.connector.SimulatorSession%20getPlaybackAction%3CBR%20%2F%3EINFO%3A%20%7B%22RacketState%22%3A0.0%2C%22ballPositionX%22%3A0.42%2C%22ballPositionY%22%3A0.32%2C%22racketPositionX%22%3A0.6%2C%22ballSpeedX%22%3A1.1%2C%22ballSpeedY%22%3A2.12%2C%22miss%22%3A0.0%2C%22hit%22%3A0.0%2C%22time%22%3A1.0%7D%3CBR%20%2F%3EDec%2009%2C%202020%208%3A37%3A50%20AM%20com.anylogic.sdk3.connector.SimulatorSession%20getPlaybackAction%3CBR%20%2F%3EINFO%3A%20%7B%22direction%22%3A5.892263412475586%7D%3CBR%20%2F%3E%3CBR%20%2F%3EDec%2009%2C%202020%208%3A37%3A51%20AM%20com.anylogic.sdk3.connector.SimulatorSession%20getPlaybackAction%3CBR%20%2F%3EINFO%3A%20%7B%22RacketState%22%3A0.0%2C%22ballPositionX%22%3A0.54%2C%22ballPositionY%22%3A0.65%2C%22racketPositionX%22%3A0.76%2C%22ballSpeedX%22%3A1.1%2C%22ballSpeedY%22%3A2.12%2C%22miss%22%3A0.0%2C%22hit%22%3A0.0%2C%22time%22%3A2.0%7D%3CBR%20%2F%3EDec%2009%2C%202020%208%3A37%3A51%20AM%20com.anylogic.sdk3.connector.SimulatorSession%20getPlaybackAction%3CBR%20%2F%3EINFO%3A%20%7B%22direction%22%3A6.230897903442383%7D%3C%2FP%3E%3C%2FLINGO-BODY%3E
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