-
Notifications
You must be signed in to change notification settings - Fork 121
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
Different blocking behaviors of CSimulator::Execute #130
Comments
While I tend to agree that this behavior is inconsistent and that such behavior should be well defined for visualizations, there just isn't enough time available to fix these sorts of issues... Not to mention that such changes may break other people's code and scripts. If you want to use ARGoS in this way, I would suggest forking the repository and perhaps modifying |
I'm not sure I understand what you mean by 'blocking' in this request. Can you please elaborate? |
@allsey87 Ok I can understand that there isn't enough time available. Unfortunately, I have the same problem. But I found a solution for my specific problem, where I only call @ilpincy Using
Using
even if I hope this was more clear? |
I'm not sure I would call this an inconsistency. If I understand correctly, you would like to be able to call The main loop in The fact that the default visualization (a simple while loop) allows you to run the code you propose is just a mere consequence of that visualization being so simple. It's true your code works for it, but it's a hack - something that should not be done if you want your code to work as intended. If I needed to make things consistent, I would change the default visualization to prevent the code you're writing, not the other way around. The correct way to achieve what you need is to use the loop functions and the Qt user functions. Use |
@ilpincy Yes, you understand it correctly. Thank you, that responds my question. In my opinion, in this case it really would be better to change the behavior of the default visualization or at least add an information in the documentation about this behavior. |
If you use the
CSimulator::Execute
function, it has different blocking behaviors depending on the visualization method:Using the
CDefaultVisualization
, theExecute
function exits whenCSimulator::Terminate
gets called.Using the
CQTOpenGLRender
, theExecute
function keeps blocking whenCSimulator::Terminate
get called.This leads to the following problem for me:
I want to change the environment after a certain number of steps for reinforcement learning. With the
CDefaultVisualization
, I can have the following code:The second part gets executed when a callback is called. This causes the
Execute
function to exit and the environment gets changed in the main thread.Using the
CQTOpenGLRender
, this won't work, as theExecute
function keeps blocking after callingTerminate
. But it also isn't possible to callReset
orLoadExperiment
in the second thread, as this causes a segmenation fault. So I don't even see how to solve this in that case.So, the following questions arise for me:
CVisualization
must stick to?CQTOpenGLRender
stops blocking ifTerminate
gets called?CQTOpenGLRender
?The text was updated successfully, but these errors were encountered: