Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

god view lag (shows old state from 1 tick ago) #238

Open
Wouter1 opened this issue Jan 13, 2021 · 6 comments
Open

god view lag (shows old state from 1 tick ago) #238

Wouter1 opened this issue Jan 13, 2021 · 6 comments
Labels
bug Something isn't working core Work related to the core functionality request A request for a new feature

Comments

@Wouter1
Copy link

Wouter1 commented Jan 13, 2021

Describe the bug
My agent (in python) receives a state where it is standing south of a door.
The python code is halted right there to debug.
But in the god view (probably in other views as well) the agent is shown southwest of the door, not south.
It seems the displayed position is lagging.

To Reproduce
Pause a simulation and compare the agent's position as reported in the state object with the god view in the browser window

Expected behavior
state object and god view match

Screenshots
na

Stacktrace
na

Additional context
Located when using the BW4T task.

@Wouter1 Wouter1 added the bug Something isn't working label Jan 13, 2021
@jwaa
Copy link
Member

jwaa commented Jan 13, 2021

@Wouter1 thanks for reporting.

This is not a bug, but an inherent result of how the inner loop of MATRX works and interacts with the default visualization that comes with MATRX. The visualization updates are always 1 tick behind that of the GridWorld (and thus every AgentBrain.state instance), because the visualization is updated when a tick is fully completed. This to prevent that the visualization shows intermediate states within ticks.

Practically this might results in cases such as you mention here.

Does this result in a problem when using MATRX for you?

@jwaa
Copy link
Member

jwaa commented Jan 13, 2021

@Wouter1 I added an additional context to refer that this was found when using the BW4T task.

@jwaa jwaa added the core Work related to the core functionality label Jan 13, 2021
@Wouter1
Copy link
Author

Wouter1 commented Jan 13, 2021

Yes this is a problem It is misleading while debugigng.

For example, suppose a door does not seem to open. So you place breakpt just where agent calls 'opendoor'. Then you see that you are not standing at the correct place on the map and you think that's the problem. However this conclusion is incorrect. In fact the door may be succesfully opened, the agent may be elsewhere, etc.

This problem , or maybe related , seems to occur if yoru agent crashes. The views don't update to the point where the agent crashed, agin it seems 1 tick behind. This causes you to search the wrong parts of your code

It seems that a single crashed agent blocks this whole system. This is also not what I expect. In the real world agents may crash all the time, it's up to the remaining agents to fix the problems.

@jwaa
Copy link
Member

jwaa commented Jan 13, 2021

Thank you for the elaboration. I believe we currently have sufficient to go on. I will label to require discussion, as I cannot promise you a quick fix. Because a fix for this would require an overhaul of a core component of MATRX.

Your last point seems to be a different issue and I advise you to create a separate issue for it to keep the issues clean and on topic. Thank you!

@jwaa jwaa added the request A request for a new feature label Jan 13, 2021
@Wouter1
Copy link
Author

Wouter1 commented Jan 13, 2021

ok i created the new ticket
I'm not sure though if it worked, I am getting a 404 page not found after I submitted it.

@jwaa
Copy link
Member

jwaa commented Jan 13, 2021

#239 is correctly created. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working core Work related to the core functionality request A request for a new feature
Projects
None yet
Development

No branches or pull requests

2 participants