I am using the EnvSupport facilities to provide an environment for BDI agents to simulate a rail network. Thus far I have agents, an environment using the DeltaTimeExecutor() and I have a process implementing ISpaceProcess. This seems to be working fine with the space executor running and calling first the start() method in the process and subsequently calling the execute() method in the process.
However, I would like to be able to stop the process when certain conditions are met. The Environment Guide section (subsection Domain Model) suggests that this can be done by calling removeSpaceProcess() on the environment. I have done this but with no success in that I've made the call but the space executor keeps executing the process.
Secondly, I would like to be able to stop the space executor when certain conditions are met. It's not clear to me how I might do this and cannot find this in the examples. These will be either (i) when a certain amount of time has elapsed or when other conditions are met (most likely when all BDI agents have finished executing plans.
Any guidance or advice would be appreciated.
Thanks.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Currently you cannot stop or execute the executor by hand but what you could do is extending an existing executor and use that one via the space executor property. The extended executor could e.g. stop doing things in execute after some time has elapsed.
Remove space process requires to know an id of the process to remove. The id is set on the process at creation time as property. So what you should be able to do is checking in execute of the process if it is finished and then call remove on the space. Similar to this:
Thanks for your note. I did manage to work out how to stop the process ... just as you show above.
As for the space executor question, if I understand you, I should essentially take a copy of an existing space executor and make changes to get the behaviour I require? There is no other way at present.
Is that correct? Or, have I misunderstood you?
Thanks again.
Kevin.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
It is correct that the executor currently does not have built-in functionality for stopping after a time interval has elapsed. You can extend/rewrite the executor and plug it into your example by setting the spaceexecutor property to the new class.
Kind regards
Lars
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am using the EnvSupport facilities to provide an environment for BDI agents to simulate a rail network. Thus far I have agents, an environment using the DeltaTimeExecutor() and I have a process implementing ISpaceProcess. This seems to be working fine with the space executor running and calling first the start() method in the process and subsequently calling the execute() method in the process.
However, I would like to be able to stop the process when certain conditions are met. The Environment Guide section (subsection Domain Model) suggests that this can be done by calling removeSpaceProcess() on the environment. I have done this but with no success in that I've made the call but the space executor keeps executing the process.
Secondly, I would like to be able to stop the space executor when certain conditions are met. It's not clear to me how I might do this and cannot find this in the examples. These will be either (i) when a certain amount of time has elapsed or when other conditions are met (most likely when all BDI agents have finished executing plans.
Any guidance or advice would be appreciated.
Thanks.
I neglected to add a couple of artefacts. I've attached my application definition file and the process java.
... and the application definition file.
I have figured out how to stop an EnvSupport process.
Still would like help with my second question, that is, how to stop the Env space executor.
Thanks.
Currently you cannot stop or execute the executor by hand but what you could do is extending an existing executor and use that one via the space executor property. The extended executor could e.g. stop doing things in execute after some time has elapsed.
Remove space process requires to know an id of the process to remove. The id is set on the process at creation time as property. So what you should be able to do is checking in execute of the process if it is finished and then call remove on the space. Similar to this:
space.removeSpaceProcess(this.getProperty(PROPERTY_ID), obj.getId());
Hope that helps.
Lars
Hi Lars,
Thanks for your note. I did manage to work out how to stop the process ... just as you show above.
As for the space executor question, if I understand you, I should essentially take a copy of an existing space executor and make changes to get the behaviour I require? There is no other way at present.
Is that correct? Or, have I misunderstood you?
Thanks again.
Kevin.
It is correct that the executor currently does not have built-in functionality for stopping after a time interval has elapsed. You can extend/rewrite the executor and plug it into your example by setting the spaceexecutor property to the new class.
Kind regards
Lars
Thanks for your help Lars.
I'll try extending the existing class.
Regards.
Kevin.