ix.test
Class SimpleRSim

java.lang.Object
  extended by ix.test.SimpleRSim

public class SimpleRSim
extends java.lang.Object

A simple plan-execution simulator that uses refinements for their preconditions and effects. It does not do expansion into subactivities.


Nested Class Summary
protected  class SimpleRSim.ExecOrderSorter
          Topological sort for node-ends to provide a total order that can be used to simulate execution.
(package private)  class SimpleRSim.RecordIfUnbound
           
 
Field Summary
protected  Ip2 ip2
           
protected  Ip2ModelManager modelManager
           
protected  boolean trace
           
protected  java.io.PrintStream traceOut
           
 
Constructor Summary
SimpleRSim(Ip2 ip2)
          Creates a simulator for the specified agent's current plan.
SimpleRSim(Plan plan, Domain domain)
          Creates a simulator for the specified plan and domain.
 
Method Summary
 void describeFinalWorldState()
           
 void describeFinalWorldState(java.io.PrintStream out)
           
protected  void describeState(java.io.PrintStream out, java.lang.String label, java.util.Map state)
           
(package private) static void getPatternsAndRun(SimpleRSim sim)
           
protected  java.util.List keepIf(Status status, java.util.List nodeEnds)
           
static void main(java.lang.String[] argv)
          Standalone main program for testing.
protected  java.util.List maybeShuffle(java.util.List list)
           
protected  void processCommandLineArguments()
           
protected  java.util.List removeIf(Status status, java.util.List nodeEnds)
           
 void setTrace(boolean trace)
          Tells this simulator whether or not it should produce trace output.
 void setTraceOutput(java.io.PrintStream ps)
          Sets the stream on which trace output appears.
protected  void simulateExecution(Activity act)
           
 void simulateExecution(java.util.List patterns)
           
protected  void traceln(java.lang.String message)
           
protected  void traceln(java.lang.String message, java.lang.Object obj)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ip2

protected Ip2 ip2

modelManager

protected Ip2ModelManager modelManager

trace

protected boolean trace

traceOut

protected java.io.PrintStream traceOut
Constructor Detail

SimpleRSim

public SimpleRSim(Ip2 ip2)
Creates a simulator for the specified agent's current plan.


SimpleRSim

public SimpleRSim(Plan plan,
                  Domain domain)
Creates a simulator for the specified plan and domain.

Method Detail

setTrace

public void setTrace(boolean trace)
Tells this simulator whether or not it should produce trace output. Trace output shows which node-end is being executed and when conditions and effects are eveluated.

See Also:
setTraceOutput(PrintStream)

setTraceOutput

public void setTraceOutput(java.io.PrintStream ps)
Sets the stream on which trace output appears. If this method is not called, the stream Debug.out will be used.

See Also:
setTrace(boolean)

simulateExecution

public void simulateExecution(java.util.List patterns)

simulateExecution

protected void simulateExecution(Activity act)

describeFinalWorldState

public void describeFinalWorldState()

describeFinalWorldState

public void describeFinalWorldState(java.io.PrintStream out)

describeState

protected void describeState(java.io.PrintStream out,
                             java.lang.String label,
                             java.util.Map state)

maybeShuffle

protected java.util.List maybeShuffle(java.util.List list)

removeIf

protected java.util.List removeIf(Status status,
                                  java.util.List nodeEnds)

keepIf

protected java.util.List keepIf(Status status,
                                java.util.List nodeEnds)

traceln

protected void traceln(java.lang.String message)

traceln

protected void traceln(java.lang.String message,
                       java.lang.Object obj)

main

public static void main(java.lang.String[] argv)
Standalone main program for testing. The most useful command-line arguments are:
   -domain=resource name
   -trace=true or false, default true
 


getPatternsAndRun

static void getPatternsAndRun(SimpleRSim sim)

processCommandLineArguments

protected void processCommandLineArguments()