I'm using EnvSupport and BDI agents. I'm trying to get percepts going from the environment to agents.
The error I am seeing is that all agents (of the affected type) receive the percept event not just the particular agent (of the type) that is affected by the change.
Let me explain. I have
- A space object type (train) with a property that has event=true in the application xml
- The space objects (of type train) are avatars for agents (of type Train)
- A space task updates a property (with event=true) of a single, train space object (chosen arbitrarily at this stage)
- This generates the necessary EnvironmentEvent which is specific to the individual space object/related agent
- I process this environment event with a variant of DefaultVisionGenerator()
- Within DefaultVisionGenerator(), I call AbstractEnvironmentSpace.createPercept()
- This seems to create the relevant percept
- I process this percept using a variant of DefaultVisionProcessor() to update the belief of the affected agent
- I have confirmed that only the single, affected Train agent has the belief changed
- The Train agent type has a plan that is triggered by a "factchanged" eg (@Plan(trigger=@Trigger(factchanged="numberCarriages"), body=@Body(BeliefChangedPlan.class))
The BeliefChangedPlan.class plan body starts with ...
@PlanBody
public void body(ChangeEvent changeEvent) {
What I see happening is that all the Train agents receive the change event. That is, this plan is triggered for all the Train agents. Not just the Train agent that had its' belief changed.
I would expect that only the agent for whom the belief has actually changed would have this plan triggered.
Is this the expected behaviour? Or, do I have an error?
Thanks.
Kevin.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I'm using EnvSupport and BDI agents. I'm trying to get percepts going from the environment to agents.
The error I am seeing is that all agents (of the affected type) receive the percept event not just the particular agent (of the type) that is affected by the change.
Let me explain. I have
- A space object type (train) with a property that has event=true in the application xml
- The space objects (of type train) are avatars for agents (of type Train)
- A space task updates a property (with event=true) of a single, train space object (chosen arbitrarily at this stage)
- This generates the necessary EnvironmentEvent which is specific to the individual space object/related agent
- I process this environment event with a variant of DefaultVisionGenerator()
- Within DefaultVisionGenerator(), I call AbstractEnvironmentSpace.createPercept()
- This seems to create the relevant percept
- I process this percept using a variant of DefaultVisionProcessor() to update the belief of the affected agent
- I have confirmed that only the single, affected Train agent has the belief changed
- The Train agent type has a plan that is triggered by a "factchanged" eg (@Plan(trigger=@Trigger(factchanged="numberCarriages"), body=@Body(BeliefChangedPlan.class))
The BeliefChangedPlan.class plan body starts with ...
@PlanBody
public void body(ChangeEvent changeEvent) {
What I see happening is that all the Train agents receive the change event. That is, this plan is triggered for all the Train agents. Not just the Train agent that had its' belief changed.
I would expect that only the agent for whom the belief has actually changed would have this plan triggered.
Is this the expected behaviour? Or, do I have an error?
Thanks.
Kevin.
Hi again,
I'm wondering if there is an error as well. When I display the ChangeInfo component of the ChangeEvent, I get
ChangeInfo(value=8, old=null, info=null)
But, based on jadex.rules.eca,ChangeInfo.java, I think value is supposed to be the new value and old the old value. In my case, value=4 and old=8.
Regards.
Kevin.