Setting an object parameters as an effect of an action

24 views
Skip to first unread message

Lenka Mudrová

unread,
Jun 18, 2015, 5:35:24 PM6/18/15
to europa...@googlegroups.com
Dear all,

first of all, thank you for providing EUROPA as an open-source! I am currently trying to understand how to model in NDDL and how the standard planners works in order to see if I can use it as temporal planner in my research.

I came to the problem, that I dont understand how the assigning to the varible/object should work. See what I am doing:


class Path extends Timeline{
 
Location start;
 
Location end;
 
int dur;
 
bool forward; //used to signal that a robot can tarvel from start to end
 
bool backward; //used to signal that a robot can travel in opposite direction too
 
bool mightBeBlocked; //to signal that something might cause that the path is unavailable, ie. closed doors
 
 
Path()
 
{
    start
= new Location("none", -1);
   
end = new Location("none", -1);
    dur
= -1;
    forward
= false;
    backward
= false;
    mightBeBlocked
= true;
 
}
   
 
Path(Location _start, Location _end, int _dur, bool _forward, bool _backward, bool _mightBeBlocked) //a user can specify only one-directional path
 
{
    start
= _start;
   
end = _end;
    dur
= _dur;
    forward
= _forward;
    backward
= _backward;
 
}  
 
  predicate
Obstructed {} //path is not possible
  predicate
Free {} //path is possible
  predicate
Unknown {} //it is unknown if path is possible or not
}

class Robot {
 
RobotLocation robot_location;
 
Path lastPath; //in order to dont allow cycling of a robot

 
Robot() {
    robot_location
= new RobotLocation();
    lastPath
= new Path();
 
}

 
//action Search {
 
//  Wheelchair wh;
 
//}
 
  action
Move {
   
Path takingpathGo;
 
}
 
}

// Define the rules for our actions:
Robot::Move {
 
 
//conditions
  met_by
(condition object.robot_location.At origin);
  eq
(takingpathGo.start, origin.loc);
 
  contained_by
(condition takingpathGo.Free pathFree);  
 
 
  equals
(effect object.robot_location.Moving moving);
  eq
(moving.takingpath, takingpathGo);
  eq
(moving.takingpath.start, takingpathGo.start);
  eq
(moving.takingpath.end, takingpathGo.end);
  eq
(moving.takingpath.dur, duration);
   
  meets
(effect object.robot_location.At destination);
  eq
(takingpathGo.end, destination.loc);
 
 
//TODO assign lastPath
 
//object.lastPath.start == takingpathGo.start;
  eq
(object.lastPath, takingpathGo);
 
 
}

with last line, I just want to save the path takingpathGo to lastPath.

The problem is, that when I start the planner, it creates 9 steps (only activating tokens) and then it ends without any detail why... and there are 4 open decisions. I am using Plugin to Eclipse and the planner configuration is this:
<Solver name="DefaultTestSolver">
 
<FlawFilter component="HorizonFilter" policy="PartiallyContained"/>

 
<ResourceThreatManager order="most,earliest,lower" defaultPriority="0">
   
<FlawHandler component="ResourceThreatHandler"/>
 
</ResourceThreatManager>

 
<ThreatManager defaultPriority="0">
   
<FlawHandler component="StandardThreatHandler"/>
   
<FlawFilter class-match="Reservoir"/>
   
<FlawFilter class-match="Reusable"/>
 
</ThreatManager>

 
<OpenConditionManager defaultPriority="0">
   
<FlawHandler component="StandardOpenConditionHandler"/>
 
</OpenConditionManager>

 
<UnboundVariableManager defaultPriority="0">
   
<FlawFilter var-match="start"/>
   
<FlawFilter var-match="end"/>
   
<FlawFilter var-match="duration"/>
   
<FlawFilter class-match="Resource" var-match="time"/>
   
<FlawFilter class-match="Resource" var-match="quantity"/>
   
<FlawFilter class-match="Reservoir" var-match="time"/>
   
<FlawFilter class-match="Reservoir" var-match="quantity"/>
   
<FlawFilter class-match="Reusable" var-match="quantity"/>
   
<FlawFilter component="InfiniteDynamicFilter"/>
   
<FlawHandler component="StandardVariableHandler"/>
 
</UnboundVariableManager>
</Solver>


Any advice will be great!

Michael J Iatauro

unread,
Jun 18, 2015, 6:18:02 PM6/18/15
to europa...@googlegroups.com
Lenka, thank you for your interest in Europa! I was just penning a response to your other
question, but this asks a more concrete question, so I can give a shorter answer =-).

In NDDL, object members are fixed at object instantiation time and are immutable. There's
nothing temporal about them. To an extent, this is a consequence of treating planning as
dynamic constraint satisfaction--a variable in Europa doesn't change value; it begins life
in planning-time (that is, the time you spend watching your screen, wondering what sort of
weird answer Europa is about to give you) with a domain of all possible values it can take
which is then restricted to the value the constraints and the planner says it must.
Values that are expected to change over plan-time (that is, the time that is represented
in the plan) need to be wrapped in a temporal thing: a token.*

You've already done that step with the takingpathGo parameter of the Move action. It
looks like you're trying to prevent the robot from going back and forth on a single path
by storing the previous path and then you would have said "object.lastPath !=
takingpathGo;" if NDDL let you (please correct me if I'm wrong!).

It doesn't, so you have to get the value of lastPath from earlier on the timeline, by
saying something like this:

after(condition object.Move m);
m.takingpathGo != takingPathGo;

That won't *quite* get what you want, because the planner could decide it's satisfied by a
much earlier move, but that should gesture in the right direction. There may be something
about your domain that would make it easy.

I failed to be brief, but I hope I was helpful!

~MJI

*That explains why variables aren't temporal, but it doesn't explain why object members
have to be fixed at instantiation. The very short answer to that is we didn't have the
time to figure out the semantics or even what it would be useful for.

On 06/17/2015 10:25 AM, Lenka Mudrová wrote:
> Dear all,
>
> first of all, thank you for providing EUROPA as an open-source! I am currently trying to
> understand how to model in NDDL and how the standard planners works in order to see if I
> can use it as temporal planner in my research.
>
> I came to the problem, that I dont understand how the assigning to the varible/object
> should work. See what I am doing:
>
> |
>
> classPathextendsTimeline{
> Locationstart;
> Locationend;
> intdur;
> boolforward;//used to signal that a robot can tarvel from start to end
> boolbackward;//used to signal that a robot can travel in opposite direction too
> boolmightBeBlocked;//to signal that something might cause that the path is unavailable,
> ie. closed doors
>
> Path()
> {
> start =newLocation("none",-1);
> end=newLocation("none",-1);
> dur =-1;
> forward =false;
> backward =false;
> mightBeBlocked =true;
> }
>
> Path(Location_start,Location_end,int_dur,bool_forward,bool_backward,bool_mightBeBlocked)//a user
> can specify only one-directional path
> {
> start =_start;
> end=_end;
> dur =_dur;
> forward =_forward;
> backward =_backward;
> }
>
> predicate Obstructed{}//path is not possible
> predicate Free{}//path is possible
> predicate Unknown{}//it is unknown if path is possible or not
> }
>
> classRobot{
> RobotLocationrobot_location;
> PathlastPath;//in order to dont allow cycling of a robot
> <FlawHandlercomponent="StandardVariableHandler"/>
> </UnboundVariableManager>
> </Solver>
>
> |
>
> Any advice will be great!
>
> --
> You received this message because you are subscribed to the Google Groups "europa-users"
> group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
> europa-users...@googlegroups.com <mailto:europa-users...@googlegroups.com>.
> To post to this group, send email to europa...@googlegroups.com
> <mailto:europa...@googlegroups.com>.
> Visit this group at http://groups.google.com/group/europa-users.
> For more options, visit https://groups.google.com/d/optout.


--
------------------
Michael J. Iatauro
Software Engineer
QTS, Inc.

NASA Ames Research Center
Office: 650-604-0662
Mail stop: 269-2
P.O. Box 1
Moffett Field, CA 94035-0001

Lenka Mudrová

unread,
Jun 22, 2015, 11:15:00 AM6/22/15
to europa...@googlegroups.com
Dear Michael,

thank you for the answer! Yes, I am trying to pretend the robot moving back and forward, as the planner now loops in it. Your explanation makes sense now. I kind of was thinking to model it as tokens, but it felt as incorrect/lazy approach to do it properly. But I see now that it is a thing to do!


Reply all
Reply to author
Forward
0 new messages