Question on abolishing old beliefs and accessing info of child agents

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Question on abolishing old beliefs and accessing info of child agents

Vin Baines
Hi All,

Two somewhat related questions. The background is, I have a collection  
of agents representing a vehicle, where one 'control' agent is started  
initially, and then starts child agents as required (e.g. driver  
agent). The 'control' agent acts like an interface layer, responsible  
for send/receive of XMPP messages to a simulated vehicle. But, I have  
an issue where I am seeing a large number of XMPP messages becoming  
queued.

So, firstly, is there a good way to abolish old beliefs? Some sort of  
time decay / working memory capacity and old messages purged? It seems  
they all just stay; which I can see that's valid, but not so suitable  
for me. For example, I have incoming 'position' messages e.g.  
+position(PosX, PosY, PosZ) and every simulation heartbeat, a new  
position is received. But I think the agent still holds the previous  
belief of position. I thought of using .abolish(position(_,_,_)) on  
receipt of a new position, but then I lose the new position at the  
same time. And any plans triggered by +position will have no  
position(_,_,_) anymore. Even if this isn't responsible for the large  
message queue, if I start running the simulation frequency higher, the  
belief base will get huge!

The other question, is there some way for a 'parent' agent to access  
'child' agents belief base? I wanted to log what the total beliefs of  
the vehicle agent set is. So, in my customised agArch used by the  
'control' agent, I have getTS().getAg().getBB() and can get access the  
total number of beliefs (which I see increasing correctly for every  
new position() received. But, this can't show the beliefs total held  
by the driver agent. I thought of changing where I start the agent  
from .create_agent(DAgentName, "driver.asl") to include some  
customised class, but this would still need to have a handle back to  
the parent 'control' agent somehow. Or can I access this through the  
infra (centralised) somehow? I can't see anywhere at the moment where  
the notion of parent/child relationships between agents would be held.

Any thoughts appreciated!

Thanks

Vince



------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Jason-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jason-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Question on abolishing old beliefs and accessing info of child agents

Jomi Fred Hubner-4
Hi Vince,

I think the best solution for your first problem is conceive the interface between the agents and the simulator as an *environment* instead of an agent (your parent agent). The environment class can provide the suitable perception to the agents and the problem of belief update is naturally handled by the agent's perception mechanism (i.e., what is not seen anymore is removed from BB). For instance, take a look at the domestic robot example (explained in detail in the Jason book).

For the second issue (access all BBs), you can customise the agents class and access theirs BB from this class. If you are using the centralised infrastructure, you can code your own launcher based on the RunCentralisedMAS class, this class has a pointer to all agents.

HTH,

Jomi


On 22/07/2012, at 13:09, Vin Baines wrote:

> Hi All,
>
> Two somewhat related questions. The background is, I have a collection  
> of agents representing a vehicle, where one 'control' agent is started  
> initially, and then starts child agents as required (e.g. driver  
> agent). The 'control' agent acts like an interface layer, responsible  
> for send/receive of XMPP messages to a simulated vehicle. But, I have  
> an issue where I am seeing a large number of XMPP messages becoming  
> queued.
>
> So, firstly, is there a good way to abolish old beliefs? Some sort of  
> time decay / working memory capacity and old messages purged? It seems  
> they all just stay; which I can see that's valid, but not so suitable  
> for me. For example, I have incoming 'position' messages e.g.  
> +position(PosX, PosY, PosZ) and every simulation heartbeat, a new  
> position is received. But I think the agent still holds the previous  
> belief of position. I thought of using .abolish(position(_,_,_)) on  
> receipt of a new position, but then I lose the new position at the  
> same time. And any plans triggered by +position will have no  
> position(_,_,_) anymore. Even if this isn't responsible for the large  
> message queue, if I start running the simulation frequency higher, the  
> belief base will get huge!
>
> The other question, is there some way for a 'parent' agent to access  
> 'child' agents belief base? I wanted to log what the total beliefs of  
> the vehicle agent set is. So, in my customised agArch used by the  
> 'control' agent, I have getTS().getAg().getBB() and can get access the  
> total number of beliefs (which I see increasing correctly for every  
> new position() received. But, this can't show the beliefs total held  
> by the driver agent. I thought of changing where I start the agent  
> from .create_agent(DAgentName, "driver.asl") to include some  
> customised class, but this would still need to have a handle back to  
> the parent 'control' agent somehow. Or can I access this through the  
> infra (centralised) somehow? I can't see anywhere at the moment where  
> the notion of parent/child relationships between agents would be held.
>
> Any thoughts appreciated!
>
> Thanks
>
> Vince
>
>
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> Jason-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/jason-users

--
Jomi Fred Hubner
Federal University of Santa Catarina
Department of Automation and Systems Engineering
PO Box 476, Florianópolis, SC
88040-900 Brazil
http://www.das.ufsc.br/~jomi


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Jason-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jason-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Question on abolishing old beliefs and accessing info of child agents

Vin Baines
Hi Jomi,

OK, first problem solved :)

On the second problem of accessing BB, I was trying a different  
approach as I didn't fully understand your suggestion. So, I made a  
new action, monitorAgent, where if you are interested in monitoring  
that agent, after you've called .create_agent(agentName) you could  
monitorAgent(agentName) (so that it can be chosen whether to or not in  
the plan, rather than hardcoded).

In the custom AgArch, I thought I could then do something like go  
through from getFirstAgArch, getNextAgArch, looking at getAgName,  
until found 'agentName' or hit the end of all AgArchs.

But, this only seems to find custom AgArchs? If I call  
getArchInfraTier().getRuntimeServices().getAgentyQty() I get 3 (the  
expected value), but going through getting the AgArch loop, I only  
seem to get my own name each time in the loop looking at the next  
AgArch.getAgName().

Is there some way to access the other agents AgArch like that? As with  
the arch, I can use getTS().getAg().getBB(). Or should I think about  
extending at the infrastructure tier? I can see there is a startAgent,  
killAgent etc methods, all I need is a getAgent(String agentName)  
method? That seems closer to what you suggested initially?

Thanks!


Zitat von Jomi Fred Hubner <[hidden email]>:

> Hi Vince,
>
> I think the best solution for your first problem is conceive the  
> interface between the agents and the simulator as an *environment*  
> instead of an agent (your parent agent). The environment class can  
> provide the suitable perception to the agents and the problem of  
> belief update is naturally handled by the agent's perception  
> mechanism (i.e., what is not seen anymore is removed from BB). For  
> instance, take a look at the domestic robot example (explained in  
> detail in the Jason book).
>
> For the second issue (access all BBs), you can customise the agents  
> class and access theirs BB from this class. If you are using the  
> centralised infrastructure, you can code your own launcher based on  
> the RunCentralisedMAS class, this class has a pointer to all agents.
>
> HTH,
>
> Jomi
>
>
> On 22/07/2012, at 13:09, Vin Baines wrote:
>
>> Hi All,
>>
>> Two somewhat related questions. The background is, I have a collection
>> of agents representing a vehicle, where one 'control' agent is started
>> initially, and then starts child agents as required (e.g. driver
>> agent). The 'control' agent acts like an interface layer, responsible
>> for send/receive of XMPP messages to a simulated vehicle. But, I have
>> an issue where I am seeing a large number of XMPP messages becoming
>> queued.
>>
>> So, firstly, is there a good way to abolish old beliefs? Some sort of
>> time decay / working memory capacity and old messages purged? It seems
>> they all just stay; which I can see that's valid, but not so suitable
>> for me. For example, I have incoming 'position' messages e.g.
>> +position(PosX, PosY, PosZ) and every simulation heartbeat, a new
>> position is received. But I think the agent still holds the previous
>> belief of position. I thought of using .abolish(position(_,_,_)) on
>> receipt of a new position, but then I lose the new position at the
>> same time. And any plans triggered by +position will have no
>> position(_,_,_) anymore. Even if this isn't responsible for the large
>> message queue, if I start running the simulation frequency higher, the
>> belief base will get huge!
>>
>> The other question, is there some way for a 'parent' agent to access
>> 'child' agents belief base? I wanted to log what the total beliefs of
>> the vehicle agent set is. So, in my customised agArch used by the
>> 'control' agent, I have getTS().getAg().getBB() and can get access the
>> total number of beliefs (which I see increasing correctly for every
>> new position() received. But, this can't show the beliefs total held
>> by the driver agent. I thought of changing where I start the agent
>> from .create_agent(DAgentName, "driver.asl") to include some
>> customised class, but this would still need to have a handle back to
>> the parent 'control' agent somehow. Or can I access this through the
>> infra (centralised) somehow? I can't see anywhere at the moment where
>> the notion of parent/child relationships between agents would be held.
>>
>> Any thoughts appreciated!
>>
>> Thanks
>>
>> Vince
>>
>>
>>
>> ------------------------------------------------------------------------------
>> Live Security Virtual Conference
>> Exclusive live event will cover all the ways today's security and
>> threat landscape has changed and how IT managers can respond. Discussions
>> will include endpoint security, mobile security and the latest in malware
>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
>> _______________________________________________
>> Jason-users mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/jason-users
>
> --
> Jomi Fred Hubner
> Federal University of Santa Catarina
> Department of Automation and Systems Engineering
> PO Box 476, Florianópolis, SC
> 88040-900 Brazil
> http://www.das.ufsc.br/~jomi




------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Jason-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jason-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Question on abolishing old beliefs and accessing info of child agents

Jomi Fred Hubner-4

On 16/08/2012, at 10:38, Vin Baines wrote:

> Hi Jomi,
>
> OK, first problem solved :)

Good!

>
> On the second problem of accessing BB, I was trying a different  
> approach as I didn't fully understand your suggestion. So, I made a  
> new action, monitorAgent, where if you are interested in monitoring  
> that agent, after you've called .create_agent(agentName) you could  
> monitorAgent(agentName) (so that it can be chosen whether to or not in  
> the plan, rather than hardcoded).
>
> In the custom AgArch, I thought I could then do something like go  
> through from getFirstAgArch, getNextAgArch, looking at getAgName,  
> until found 'agentName' or hit the end of all AgArchs.
>
> But, this only seems to find custom AgArchs? If I call  
> getArchInfraTier().getRuntimeServices().getAgentyQty() I get 3 (the  
> expected value), but going through getting the AgArch loop, I only  
> seem to get my own name each time in the loop looking at the next  
> AgArch.getAgName().

The getAgName gets the name of the agent calling the method. You can have list of all names by calling getArchInfraTier().getRuntimeServices().getAgentsNames(). An agent may have several AgArchs, so the getNextAgArch method.


>
> Is there some way to access the other agents AgArch like that? As with  
> the arch, I can use getTS().getAg().getBB(). Or should I think about  
> extending at the infrastructure tier? I can see there is a startAgent,  
> killAgent etc methods, all I need is a getAgent(String agentName)  
> method? That seems closer to what you suggested initially?

Notice that AgArchs are java objects so you can have a reference to them only inside the same JVM. If you are using centralised infrastructure, all these  objects are available by
        RunCentralisedMAS.getRunner().getAgs()

HTH,

Jomi

>
> Thanks!
>
>
> Zitat von Jomi Fred Hubner <[hidden email]>:
>
>> Hi Vince,
>>
>> I think the best solution for your first problem is conceive the  
>> interface between the agents and the simulator as an *environment*  
>> instead of an agent (your parent agent). The environment class can  
>> provide the suitable perception to the agents and the problem of  
>> belief update is naturally handled by the agent's perception  
>> mechanism (i.e., what is not seen anymore is removed from BB). For  
>> instance, take a look at the domestic robot example (explained in  
>> detail in the Jason book).
>>
>> For the second issue (access all BBs), you can customise the agents  
>> class and access theirs BB from this class. If you are using the  
>> centralised infrastructure, you can code your own launcher based on  
>> the RunCentralisedMAS class, this class has a pointer to all agents.
>>
>> HTH,
>>
>> Jomi
>>
>>
>> On 22/07/2012, at 13:09, Vin Baines wrote:
>>
>>> Hi All,
>>>
>>> Two somewhat related questions. The background is, I have a collection
>>> of agents representing a vehicle, where one 'control' agent is started
>>> initially, and then starts child agents as required (e.g. driver
>>> agent). The 'control' agent acts like an interface layer, responsible
>>> for send/receive of XMPP messages to a simulated vehicle. But, I have
>>> an issue where I am seeing a large number of XMPP messages becoming
>>> queued.
>>>
>>> So, firstly, is there a good way to abolish old beliefs? Some sort of
>>> time decay / working memory capacity and old messages purged? It seems
>>> they all just stay; which I can see that's valid, but not so suitable
>>> for me. For example, I have incoming 'position' messages e.g.
>>> +position(PosX, PosY, PosZ) and every simulation heartbeat, a new
>>> position is received. But I think the agent still holds the previous
>>> belief of position. I thought of using .abolish(position(_,_,_)) on
>>> receipt of a new position, but then I lose the new position at the
>>> same time. And any plans triggered by +position will have no
>>> position(_,_,_) anymore. Even if this isn't responsible for the large
>>> message queue, if I start running the simulation frequency higher, the
>>> belief base will get huge!
>>>
>>> The other question, is there some way for a 'parent' agent to access
>>> 'child' agents belief base? I wanted to log what the total beliefs of
>>> the vehicle agent set is. So, in my customised agArch used by the
>>> 'control' agent, I have getTS().getAg().getBB() and can get access the
>>> total number of beliefs (which I see increasing correctly for every
>>> new position() received. But, this can't show the beliefs total held
>>> by the driver agent. I thought of changing where I start the agent
>>> from .create_agent(DAgentName, "driver.asl") to include some
>>> customised class, but this would still need to have a handle back to
>>> the parent 'control' agent somehow. Or can I access this through the
>>> infra (centralised) somehow? I can't see anywhere at the moment where
>>> the notion of parent/child relationships between agents would be held.
>>>
>>> Any thoughts appreciated!
>>>
>>> Thanks
>>>
>>> Vince
>>>
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> Live Security Virtual Conference
>>> Exclusive live event will cover all the ways today's security and
>>> threat landscape has changed and how IT managers can respond. Discussions
>>> will include endpoint security, mobile security and the latest in malware
>>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
>>> _______________________________________________
>>> Jason-users mailing list
>>> [hidden email]
>>> https://lists.sourceforge.net/lists/listinfo/jason-users
>>
>> --
>> Jomi Fred Hubner
>> Federal University of Santa Catarina
>> Department of Automation and Systems Engineering
>> PO Box 476, Florianópolis, SC
>> 88040-900 Brazil
>> http://www.das.ufsc.br/~jomi
>
>
>
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> Jason-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/jason-users

--
Jomi Fred Hubner
Federal University of Santa Catarina
Department of Automation and Systems Engineering
PO Box 476, Florianópolis, SC
88040-900 Brazil
http://www.das.ufsc.br/~jomi


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Jason-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jason-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Question on abolishing old beliefs and accessing info of child agents

Vin Baines
Back to the first problem again!

The environment receives a position report from a vehicle every 1  
second. In the environment class, to clear the old position info from  
the agent, I was doing:

Literal clearLit = Literal.parseLiteral("info(_,_,_,_,_,_,_)");
int numCleared = removePerceptsByUnif(agNameSend,clearLit);
addPercept(agNameSend, newLit);

That way, the agent only ever has 1 info belief of where it currently  
is in the world.

But, if it hasn't moved, i.e. containsPercept(agNameSend, newLit) will  
be true, then the percept gets deleted and added ok, but in the agent  
plan, +info isn't touched.

I can see how that could be intentional maybe, as no reasoning cycle  
has occurred, and so as the same percept is quickly deleted and the  
re-added, it seems nothing has changed to the agent?

But for me, even though the info percept is the same, I was expecting  
+info to be executed as other actions depend on that.

At the moment, if containsPercept(agNameSend, newLit) is true then I  
delete the belief and don't add the percept, then next update when the  
percept is added, it triggers +info. But, it's not great, as there is  
a time period where the agent has no info belief.

Is there a better way to get around the issue?

Thanks!


Quoting Jomi Fred Hubner <[hidden email]>:

> On 16/08/2012, at 10:38, Vin Baines wrote:
>
>> Hi Jomi,
>>
>> OK, first problem solved :)
>
> Good!
>
>>
>> On the second problem of accessing BB, I was trying a different
>> approach as I didn't fully understand your suggestion. So, I made a
>> new action, monitorAgent, where if you are interested in monitoring
>> that agent, after you've called .create_agent(agentName) you could
>> monitorAgent(agentName) (so that it can be chosen whether to or not in
>> the plan, rather than hardcoded).
>>
>> In the custom AgArch, I thought I could then do something like go
>> through from getFirstAgArch, getNextAgArch, looking at getAgName,
>> until found 'agentName' or hit the end of all AgArchs.
>>
>> But, this only seems to find custom AgArchs? If I call
>> getArchInfraTier().getRuntimeServices().getAgentyQty() I get 3 (the
>> expected value), but going through getting the AgArch loop, I only
>> seem to get my own name each time in the loop looking at the next
>> AgArch.getAgName().
>
> The getAgName gets the name of the agent calling the method. You can  
> have list of all names by calling  
> getArchInfraTier().getRuntimeServices().getAgentsNames(). An agent  
> may have several AgArchs, so the getNextAgArch method.
>
>
>>
>> Is there some way to access the other agents AgArch like that? As with
>> the arch, I can use getTS().getAg().getBB(). Or should I think about
>> extending at the infrastructure tier? I can see there is a startAgent,
>> killAgent etc methods, all I need is a getAgent(String agentName)
>> method? That seems closer to what you suggested initially?
>
> Notice that AgArchs are java objects so you can have a reference to  
> them only inside the same JVM. If you are using centralised  
> infrastructure, all these  objects are available by
> RunCentralisedMAS.getRunner().getAgs()
>
> HTH,
>
> Jomi
>
>>
>> Thanks!
>>
>>
>> Zitat von Jomi Fred Hubner <[hidden email]>:
>>
>>> Hi Vince,
>>>
>>> I think the best solution for your first problem is conceive the
>>> interface between the agents and the simulator as an *environment*
>>> instead of an agent (your parent agent). The environment class can
>>> provide the suitable perception to the agents and the problem of
>>> belief update is naturally handled by the agent's perception
>>> mechanism (i.e., what is not seen anymore is removed from BB). For
>>> instance, take a look at the domestic robot example (explained in
>>> detail in the Jason book).
>>>
>>> For the second issue (access all BBs), you can customise the agents
>>> class and access theirs BB from this class. If you are using the
>>> centralised infrastructure, you can code your own launcher based on
>>> the RunCentralisedMAS class, this class has a pointer to all agents.
>>>
>>> HTH,
>>>
>>> Jomi
>>>
>>>
>>> On 22/07/2012, at 13:09, Vin Baines wrote:
>>>
>>>> Hi All,
>>>>
>>>> Two somewhat related questions. The background is, I have a collection
>>>> of agents representing a vehicle, where one 'control' agent is started
>>>> initially, and then starts child agents as required (e.g. driver
>>>> agent). The 'control' agent acts like an interface layer, responsible
>>>> for send/receive of XMPP messages to a simulated vehicle. But, I have
>>>> an issue where I am seeing a large number of XMPP messages becoming
>>>> queued.
>>>>
>>>> So, firstly, is there a good way to abolish old beliefs? Some sort of
>>>> time decay / working memory capacity and old messages purged? It seems
>>>> they all just stay; which I can see that's valid, but not so suitable
>>>> for me. For example, I have incoming 'position' messages e.g.
>>>> +position(PosX, PosY, PosZ) and every simulation heartbeat, a new
>>>> position is received. But I think the agent still holds the previous
>>>> belief of position. I thought of using .abolish(position(_,_,_)) on
>>>> receipt of a new position, but then I lose the new position at the
>>>> same time. And any plans triggered by +position will have no
>>>> position(_,_,_) anymore. Even if this isn't responsible for the large
>>>> message queue, if I start running the simulation frequency higher, the
>>>> belief base will get huge!
>>>>
>>>> The other question, is there some way for a 'parent' agent to access
>>>> 'child' agents belief base? I wanted to log what the total beliefs of
>>>> the vehicle agent set is. So, in my customised agArch used by the
>>>> 'control' agent, I have getTS().getAg().getBB() and can get access the
>>>> total number of beliefs (which I see increasing correctly for every
>>>> new position() received. But, this can't show the beliefs total held
>>>> by the driver agent. I thought of changing where I start the agent
>>>> from .create_agent(DAgentName, "driver.asl") to include some
>>>> customised class, but this would still need to have a handle back to
>>>> the parent 'control' agent somehow. Or can I access this through the
>>>> infra (centralised) somehow? I can't see anywhere at the moment where
>>>> the notion of parent/child relationships between agents would be held.
>>>>
>>>> Any thoughts appreciated!
>>>>
>>>> Thanks
>>>>
>>>> Vince
>>>>
>>>>
>>>>
>>>> ------------------------------------------------------------------------------
>>>> Live Security Virtual Conference
>>>> Exclusive live event will cover all the ways today's security and
>>>> threat landscape has changed and how IT managers can respond. Discussions
>>>> will include endpoint security, mobile security and the latest in malware
>>>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
>>>> _______________________________________________
>>>> Jason-users mailing list
>>>> [hidden email]
>>>> https://lists.sourceforge.net/lists/listinfo/jason-users
>>>
>>> --
>>> Jomi Fred Hubner
>>> Federal University of Santa Catarina
>>> Department of Automation and Systems Engineering
>>> PO Box 476, Florianópolis, SC
>>> 88040-900 Brazil
>>> http://www.das.ufsc.br/~jomi
>>
>>
>>
>>
>> ------------------------------------------------------------------------------
>> Live Security Virtual Conference
>> Exclusive live event will cover all the ways today's security and
>> threat landscape has changed and how IT managers can respond. Discussions
>> will include endpoint security, mobile security and the latest in malware
>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
>> _______________________________________________
>> Jason-users mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/jason-users
>
> --
> Jomi Fred Hubner
> Federal University of Santa Catarina
> Department of Automation and Systems Engineering
> PO Box 476, Florianópolis, SC
> 88040-900 Brazil
> http://www.das.ufsc.br/~jomi




------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Jason-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jason-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Question on abolishing old beliefs and accessing info of child agents

Jomi Fred Hubner-4

On 27/08/2012, at 13:23, Vin Baines wrote:

> Back to the first problem again!
>
> The environment receives a position report from a vehicle every 1
> second. In the environment class, to clear the old position info from
> the agent, I was doing:
>
> Literal clearLit = Literal.parseLiteral("info(_,_,_,_,_,_,_)");
> int numCleared = removePerceptsByUnif(agNameSend,clearLit);
> addPercept(agNameSend, newLit);
>
> That way, the agent only ever has 1 info belief of where it currently
> is in the world.
>
> But, if it hasn't moved, i.e. containsPercept(agNameSend, newLit) will
> be true, then the percept gets deleted and added ok, but in the agent
> plan, +info isn't touched.

It is intended to be like that, +info means that the belief base of the agent was changed. Since the agent has perceived the same environment, there will be no event.

This issue is well discussed in sec 2.2 of the paper

        Alessandro Ricci, Andrea Santi and Michele Piunti: Action and Perception in Multi-Agent Programming Languages: From Exogenous to Endogenous Environments. ProMAS 2010.
        http://rd.springer.com/chapter/10.1007/978-3-642-28939-2_7

They propose a solution based on CArtAgO.

HTH,

Jomi

>
> I can see how that could be intentional maybe, as no reasoning cycle
> has occurred, and so as the same percept is quickly deleted and the
> re-added, it seems nothing has changed to the agent?
>
> But for me, even though the info percept is the same, I was expecting
> +info to be executed as other actions depend on that.
>
> At the moment, if containsPercept(agNameSend, newLit) is true then I
> delete the belief and don't add the percept, then next update when the
> percept is added, it triggers +info. But, it's not great, as there is
> a time period where the agent has no info belief.
>
> Is there a better way to get around the issue?





>
> Thanks!
>
>
> Quoting Jomi Fred Hubner <[hidden email]>:
>
>> On 16/08/2012, at 10:38, Vin Baines wrote:
>>
>>> Hi Jomi,
>>>
>>> OK, first problem solved :)
>>
>> Good!
>>
>>>
>>> On the second problem of accessing BB, I was trying a different
>>> approach as I didn't fully understand your suggestion. So, I made a
>>> new action, monitorAgent, where if you are interested in monitoring
>>> that agent, after you've called .create_agent(agentName) you could
>>> monitorAgent(agentName) (so that it can be chosen whether to or not in
>>> the plan, rather than hardcoded).
>>>
>>> In the custom AgArch, I thought I could then do something like go
>>> through from getFirstAgArch, getNextAgArch, looking at getAgName,
>>> until found 'agentName' or hit the end of all AgArchs.
>>>
>>> But, this only seems to find custom AgArchs? If I call
>>> getArchInfraTier().getRuntimeServices().getAgentyQty() I get 3 (the
>>> expected value), but going through getting the AgArch loop, I only
>>> seem to get my own name each time in the loop looking at the next
>>> AgArch.getAgName().
>>
>> The getAgName gets the name of the agent calling the method. You can
>> have list of all names by calling
>> getArchInfraTier().getRuntimeServices().getAgentsNames(). An agent
>> may have several AgArchs, so the getNextAgArch method.
>>
>>
>>>
>>> Is there some way to access the other agents AgArch like that? As with
>>> the arch, I can use getTS().getAg().getBB(). Or should I think about
>>> extending at the infrastructure tier? I can see there is a startAgent,
>>> killAgent etc methods, all I need is a getAgent(String agentName)
>>> method? That seems closer to what you suggested initially?
>>
>> Notice that AgArchs are java objects so you can have a reference to
>> them only inside the same JVM. If you are using centralised
>> infrastructure, all these  objects are available by
>> RunCentralisedMAS.getRunner().getAgs()
>>
>> HTH,
>>
>> Jomi
>>
>>>
>>> Thanks!
>>>
>>>
>>> Zitat von Jomi Fred Hubner <[hidden email]>:
>>>
>>>> Hi Vince,
>>>>
>>>> I think the best solution for your first problem is conceive the
>>>> interface between the agents and the simulator as an *environment*
>>>> instead of an agent (your parent agent). The environment class can
>>>> provide the suitable perception to the agents and the problem of
>>>> belief update is naturally handled by the agent's perception
>>>> mechanism (i.e., what is not seen anymore is removed from BB). For
>>>> instance, take a look at the domestic robot example (explained in
>>>> detail in the Jason book).
>>>>
>>>> For the second issue (access all BBs), you can customise the agents
>>>> class and access theirs BB from this class. If you are using the
>>>> centralised infrastructure, you can code your own launcher based on
>>>> the RunCentralisedMAS class, this class has a pointer to all agents.
>>>>
>>>> HTH,
>>>>
>>>> Jomi
>>>>
>>>>
>>>> On 22/07/2012, at 13:09, Vin Baines wrote:
>>>>
>>>>> Hi All,
>>>>>
>>>>> Two somewhat related questions. The background is, I have a collection
>>>>> of agents representing a vehicle, where one 'control' agent is started
>>>>> initially, and then starts child agents as required (e.g. driver
>>>>> agent). The 'control' agent acts like an interface layer, responsible
>>>>> for send/receive of XMPP messages to a simulated vehicle. But, I have
>>>>> an issue where I am seeing a large number of XMPP messages becoming
>>>>> queued.
>>>>>
>>>>> So, firstly, is there a good way to abolish old beliefs? Some sort of
>>>>> time decay / working memory capacity and old messages purged? It seems
>>>>> they all just stay; which I can see that's valid, but not so suitable
>>>>> for me. For example, I have incoming 'position' messages e.g.
>>>>> +position(PosX, PosY, PosZ) and every simulation heartbeat, a new
>>>>> position is received. But I think the agent still holds the previous
>>>>> belief of position. I thought of using .abolish(position(_,_,_)) on
>>>>> receipt of a new position, but then I lose the new position at the
>>>>> same time. And any plans triggered by +position will have no
>>>>> position(_,_,_) anymore. Even if this isn't responsible for the large
>>>>> message queue, if I start running the simulation frequency higher, the
>>>>> belief base will get huge!
>>>>>
>>>>> The other question, is there some way for a 'parent' agent to access
>>>>> 'child' agents belief base? I wanted to log what the total beliefs of
>>>>> the vehicle agent set is. So, in my customised agArch used by the
>>>>> 'control' agent, I have getTS().getAg().getBB() and can get access the
>>>>> total number of beliefs (which I see increasing correctly for every
>>>>> new position() received. But, this can't show the beliefs total held
>>>>> by the driver agent. I thought of changing where I start the agent
>>>>> from .create_agent(DAgentName, "driver.asl") to include some
>>>>> customised class, but this would still need to have a handle back to
>>>>> the parent 'control' agent somehow. Or can I access this through the
>>>>> infra (centralised) somehow? I can't see anywhere at the moment where
>>>>> the notion of parent/child relationships between agents would be held.
>>>>>
>>>>> Any thoughts appreciated!
>>>>>
>>>>> Thanks
>>>>>
>>>>> Vince
>>>>>
>>>>>
>>>>>
>>>>> ------------------------------------------------------------------------------
>>>>> Live Security Virtual Conference
>>>>> Exclusive live event will cover all the ways today's security and
>>>>> threat landscape has changed and how IT managers can respond. Discussions
>>>>> will include endpoint security, mobile security and the latest in malware
>>>>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
>>>>> _______________________________________________
>>>>> Jason-users mailing list
>>>>> [hidden email]
>>>>> https://lists.sourceforge.net/lists/listinfo/jason-users
>>>>
>>>> --
>>>> Jomi Fred Hubner
>>>> Federal University of Santa Catarina
>>>> Department of Automation and Systems Engineering
>>>> PO Box 476, Florianópolis, SC
>>>> 88040-900 Brazil
>>>> http://www.das.ufsc.br/~jomi
>>>
>>>
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> Live Security Virtual Conference
>>> Exclusive live event will cover all the ways today's security and
>>> threat landscape has changed and how IT managers can respond. Discussions
>>> will include endpoint security, mobile security and the latest in malware
>>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
>>> _______________________________________________
>>> Jason-users mailing list
>>> [hidden email]
>>> https://lists.sourceforge.net/lists/listinfo/jason-users
>>
>> --
>> Jomi Fred Hubner
>> Federal University of Santa Catarina
>> Department of Automation and Systems Engineering
>> PO Box 476, Florianópolis, SC
>> 88040-900 Brazil
>> http://www.das.ufsc.br/~jomi
>
>
>

--
Jomi Fred Hubner
Federal University of Santa Catarina
Department of Automation and Systems Engineering
PO Box 476, Florianópolis, SC
88040-900 Brazil
http://www.das.ufsc.br/~jomi


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Jason-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jason-users
Loading...