ix.iplan
Class PlanModelComparer

java.lang.Object
  extended by ix.iplan.PlanModelComparer

public class PlanModelComparer
extends java.lang.Object

Compares plans in-place: in their model-managers. Some differences are allowed on the assumption that the 'original' plan was produced directly by the automatic planner while the 'copy' was converted to a Plan object and then loaded into a new model. This class is intended primarily as a bug-finding aid.

See Also:
okMissingSuccessor(PNodeEnd, PNodeEnd)

Nested Class Summary
static class PlanModelComparer.PlanDifferenceException
           
 
Field Summary
(package private)  Ip2ModelManager copyMM
           
(package private)  java.util.Map<ActivityItem,ActivityItem> nodeMap
           
(package private)  Ip2ModelManager originalMM
           
 
Constructor Summary
PlanModelComparer(Ip2ModelManager original, Ip2ModelManager copy)
           
 
Method Summary
 void compare()
           
protected  boolean okMissingSuccessor(PNodeEnd copy, PNodeEnd missing)
          Decides whether it's ok for a node-end to be missing a successor in the copy.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

originalMM

Ip2ModelManager originalMM

copyMM

Ip2ModelManager copyMM

nodeMap

java.util.Map<ActivityItem,ActivityItem> nodeMap
Constructor Detail

PlanModelComparer

public PlanModelComparer(Ip2ModelManager original,
                         Ip2ModelManager copy)
Method Detail

compare

public void compare()
             throws PlanModelComparer.PlanDifferenceException
Throws:
PlanModelComparer.PlanDifferenceException

okMissingSuccessor

protected boolean okMissingSuccessor(PNodeEnd copy,
                                     PNodeEnd missing)
Decides whether it's ok for a node-end to be missing a successor in the copy. The idea here is (1) that in the original, a node was expanded, then ensureChildrenLinkedToParent was called, and then some planning was done, which could add more links which, if they'd beed there originally -- as they will be in the copy -- would have let ensureChildrenLinkedToParent add fewer links. So when ensureChildrenLinkedToParent is called by the PlanInstaller, it does in fact add fewer links. And (2) that begin_of parent --> end_of child links can be added because a precondition of the parent was affected by an effect of the child, or a begin_of child --> end_of parent might have been added because a precondition of the child was affected by one of the parent's effects, but those links are implied by the ensureChildrenLinkedToParent ones.