Inserting actions into the IM stack through an internal action?

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Inserting actions into the IM stack through an internal action?

Alan Gordon White
I've been using an internal action that does some A* based
routefinding; at the 'end' of execution, a plan object is passed into
agent plan library and then triggered (I've tried doing this in two
ways; the first is adding the trigger goal - 'doRoute' - using
ts.getC().addAchvGoal(); the second is to directly push() the plan
body, formed into an IntendedMeans object, onto the IMs stack of the
current intention -

The asl entry is very simple (the agent just runs from A to B, then
adds a goal to go in the reverse direction), i.e.;
+!moveTo(J):         J="J8" & not at(J) & not busy & not stuck <-
.print("Do plan to move to J8"); agent.internalAction.PlanRoute(J);
+!moveTo(J): J="J7" & not at(J) & not busy & not stuck <- .print("Do
plan to move to J7"); agent.internalAction.PlanRoute(J);

Both work fine in terms of getting my little agent(s) moving.

However, I'm running into a problem in that my GoalListener methods
are only returning a failure for the triggering goal (doRoute) - not
the 'parent' goal (moveTo).  As my overall work relies on tracking
the success of plan executions, this is pretty crucial; if/when an
agent fails at some point along the route, I need to have a similar
failure recorded for the moveTo goal.

I'm trying to understand how I can solve this; unfortunately my code
is a bit too unwieldy to post in full, but this is the pertinent
//take route and parse into a Plan object
Plan plan = getPlanFromRoute(from, to, route, startOnRoad);

//add new plan... can't iterate through list under modification, so  
need to copy/clone
//into unmodifiable 'read' list for this... avoid  
insertIntoPlanLib(plan, ts);

//invoke plan execution
Intention in = ts.getC().getSelectedIntention();
Option o = new Option(plan, new Unifier());
IntendedMeans im = new IntendedMeans(o, plan.getTrigger());

return true;

I *think* I may be able to get this working by changing the Trigger  
object passed into the IntendedMeans constructor - but how would I get  
the trigger for the current intention?

(and, of course, is this even the right approach to take?)

Thanks in advance,

NB1: I hope the following makes sense...
NB2: It would be remiss that I've been aided by looking at Meneguzzis  
Peleus code for dynamic plan generation  

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

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
Jason-users mailing list
[hidden email]