Counter type percepts?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Counter type percepts?

Alan Gordon White
Quick question wrt Environment coding.

I have an environment that is laid out a bit like a graph/map.  Each  
junction can generate a cargo request; that is, requesting 1 or more  
pieces of cargo.

I want to have each new request trigger an agent to act.  However, I'm  
hitting a little problem;

If I don't use a counter and just add a percept like  
(needsCargo("loc1")) then I can't really represent multiple requests -  
i.e. if loc1 needs 5 pieces of cargo, then it won't generate 5  
needsCargo percepts this way.

If I put an int value in the percept (needsCargo("loc1", 5)) then it  
triggers too many responses; as each individual piece of cargo is  
delivered, the percept is decremented and re-posted as a new event.  
i.e. for the example percept, the agent may dispatch 5 pieces of  
cargo, one after the other.  But after the first cargo arrives, a new  
percept (needsCargo("loc1", 4)) would be created and serve to trigger  
further actions.

Ideally, I want to update the percept in the agent BB without  
triggering a new event unless it's an increment. Is there a good way  
to go about this?

--
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.



------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnnow-d2d
_______________________________________________
Jason-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jason-users
Reply | Threaded
Open this post in threaded view
|

Re: Counter type percepts?

Rafael H Bordini-2
Hi Alan,

Sorry for the delay, your messages were received while we were on holidays.

I can think of two ways of handling this. First is to write your own
Java code for belief update which keeps track of when something really
is an event at the right level of abstraction for your agent (i.e., only
when it really needs a cargo at a location a belief and event are added)
-- or you might be able to put this code in your environment and update
the percepts more carefully, I think. This is a bit more complicated to
do. The other thing that you can try, but I'll need to test if it works
is to let the events happen but ignore them if they are no longer
relevant, something like:

+needsCargo("loc1",X) : !getCargo("loc1",X).

+!getCargo("loc1",X) : .desire(getCargo("loc1",X)). // do nothing
+!getCargo("loc1",X) : otherwise <- do something else to get X cargos.

HTH

Rafael



On 28/01/2013 17:24, Alan Gordon White wrote:

> Quick question wrt Environment coding.
>
> I have an environment that is laid out a bit like a graph/map.  Each
> junction can generate a cargo request; that is, requesting 1 or more
> pieces of cargo.
>
> I want to have each new request trigger an agent to act.  However, I'm
> hitting a little problem;
>
> If I don't use a counter and just add a percept like
> (needsCargo("loc1")) then I can't really represent multiple requests -
> i.e. if loc1 needs 5 pieces of cargo, then it won't generate 5
> needsCargo percepts this way.
>
> If I put an int value in the percept (needsCargo("loc1", 5)) then it
> triggers too many responses; as each individual piece of cargo is
> delivered, the percept is decremented and re-posted as a new event.
> i.e. for the example percept, the agent may dispatch 5 pieces of
> cargo, one after the other.  But after the first cargo arrives, a new
> percept (needsCargo("loc1", 4)) would be created and serve to trigger
> further actions.
>
> Ideally, I want to update the percept in the agent BB without
> triggering a new event unless it's an increment. Is there a good way
> to go about this?
>


------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_jan
_______________________________________________
Jason-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jason-users