ix.iplan
Class PlannerBase

java.lang.Object
  extended by ix.icore.IXAgent
      extended by ix.ip2.Ip2
          extended by ix.iplan.IPlan
              extended by ix.iplan.PlannerBase
All Implemented Interfaces:
Planner
Direct Known Subclasses:
IPlanOptionManager.ModelHolder, Slip, Thatcher

public abstract class PlannerBase
extends IPlan
implements Planner

A base class for GUI-less planners. Chiefly contains utility methods.


Nested Class Summary
 
Nested classes/interfaces inherited from class ix.ip2.Ip2
Ip2.AddExtensionsHandler, Ip2.AddHandlersHandler
 
Field Summary
 
Fields inherited from class ix.ip2.Ip2
activityViewer, agentTypeName, annotationViewer, controller, domain, frame, issueViewer, logoImage, logoLine1, logoLine2, modelManager, optionManager, resetHooks, showOptions, stateViewer
 
Fields inherited from class ix.icore.IXAgent
contactManager, displayName, eventLogger, exitHooks, initialDisplayName, ipcName, ipcStrategyName, iSimTimer, mainAgent, nameListeners, startupDate, startupHooks, symbolName, textFrame
 
Constructor Summary
PlannerBase(boolean standAlone)
           
 
Method Summary
protected  void addHandlers()
          Install any built-in issue and activity handlers.
protected  void completeStartup()
          Called in the AWT event thread to make the main GUI frame visible and perform any additional setup that ought to be done in that thread.
 PlanStats getStatistics()
          Returns statistics gathered by the most recent Planner.plan() or Planner.replan().
 void handleInput(IPC.InputMessage message)
          Handles external input in the form of an IPC.InputMessage that contains an object such as an Issue, Activity, or Report.
protected  void initOptions()
           
 boolean isStandAlone()
           
protected  java.lang.Object makeInstance(java.lang.String className)
           
protected  void outputOwlSPlan()
           
protected  void outputPlan()
           
protected  void outputPlanPSGraphData(Plan plan)
           
 void plan()
          Finds a plan that is a completion of this planner's current plan and makes it the new current plan.
 void replan()
          Finds the next in a series of plans that are completions of the plan that was current when Planner.plan() was most recently called.
protected  void startServer(java.lang.Object agentName, java.lang.String strategyName)
          Set the main (global) IPC communication strategy and set up to receive messages by calling the strategy's setupServer method.
 void startup()
          Completes setup and initialization.
 
Methods inherited from class ix.iplan.IPlan
displayFrame, main, makeDefaultPlanner, makeIp2Frame, makeModelManager, setDomain
 
Methods inherited from class ix.ip2.Ip2
addAboutInfo, addForwardingHandler, addHandlers, addResetHook, addTest, addTestMenuItems, addTool, clearAllButState, clearModel, do_reloadViewers, ensureTool, getActivityPatternSyntaxes, getAgentTypeName, getController, getDomain, getFrame, getIp2ModelManager, getModelManager, getOptionManager, getPlan, handleInputDirectly, handleNewActivity, handleNewChatMessage, handleNewConstraint, handleNewIssue, handleNewReport, isReloadingViewers, loadDomain, loadInitialPlan, loadPlan, loadPlan, loadPlan, makeActivityViewer, makeAnnotationViewer, makeController, makeIssueViewer, makeLogoPanel, makeStateViewer, makeViewer, processCommandLineArguments, readDomain, readDomain, reloadViewers, reset, resetAllButState, resetViewers, savePlanAs
 
Methods inherited from class ix.icore.IXAgent
addAgentNameListener, addExitHook, addStartupHook, adjustLookAndFeel, displayMessage, do_mainStartup, exit, fireSymbolNameChanged, getAgent, getAgentDisplayName, getAgentIPCName, getAgentStartupDate, getAgentSymbolName, getContactManager, getEventLogger, getISimTimer, getKnownAgents, handleReceivedReport, installAgentExtensions, installAgentExtensions, isMainAgent, log, mainStartup, notePossibleNewContact, pre_handleInput, preprocessInput, reportInputException, setAgentSymbolName, setEventLogger, setupISimTimer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface ix.iplan.Planner
getPlan, loadPlan, setDomain
 

Constructor Detail

PlannerBase

public PlannerBase(boolean standAlone)
Method Detail

isStandAlone

public boolean isStandAlone()

plan

public void plan()
Description copied from interface: Planner
Finds a plan that is a completion of this planner's current plan and makes it the new current plan. The precise meaning of "completion" depends on the planner in question, but typically it will mean that all activities in the initial plan that might be expanded into subactions, using refinements in this planner's domain, will be expanded, and that all constraints in the initial plan or introduced by expansion would be satisfied if the plan were executed in a way that respected all of the ordering constraints. (Here, the initial plan is the plan that was current when plan() was called.)

A successful call to plan() leaves this planner in a state in which Planner.replan() can be called.

Specified by:
plan in interface Planner

replan

public void replan()
Description copied from interface: Planner
Finds the next in a series of plans that are completions of the plan that was current when Planner.plan() was most recently called. That completion then becomes the new current plan. You can think of this as reconsidering some choice made when producing earlier plans in the sequence and making different decision at that point. However, it is not guaranteed that the plan found in this way will be interestingly different from all of the earlier plans in the sequence.

The replan() method should not be called if plan() has not been called or if this planner has thrown an exception.

A successful call to replan() leaves this planner in a state in which Planner.replan() can be called again. plan() may be called instead, but this will begin a new sequence of plans based on this planner's now current plan, rather than on the plan that was the base for the previous sequence.

Specified by:
replan in interface Planner

getStatistics

public PlanStats getStatistics()
Description copied from interface: Planner
Returns statistics gathered by the most recent Planner.plan() or Planner.replan().

Specified by:
getStatistics in interface Planner

startup

public void startup()
Completes setup and initialization.

Overrides:
startup in class Ip2

startServer

protected void startServer(java.lang.Object agentName,
                           java.lang.String strategyName)
Description copied from class: IXAgent
Set the main (global) IPC communication strategy and set up to receive messages by calling the strategy's setupServer method. If the "enqueue-incoming-messages" parameter is true, it uses a BufferedMessageListener so that the thread that supplies a message need't wait for the message to be processed by the panel; otherwise, a plain MessageListener is used. In both cases, the listener delivers the message by calling IXAgent.pre_handleInput(IPC.InputMessage), but a buffered listener has its own thread that waits for that call to return before looking for the next message.

Overrides:
startServer in class IXAgent
See Also:
IPC, IPC.setupServer(Object, IPC.MessageListener), IPC.BufferedMessageListener

completeStartup

protected void completeStartup()
Description copied from class: Ip2
Called in the AWT event thread to make the main GUI frame visible and perform any additional setup that ought to be done in that thread.

Overrides:
completeStartup in class Ip2
See Also:
Ip2Frame.becomeVisible()

handleInput

public void handleInput(IPC.InputMessage message)
Description copied from class: IXAgent
Handles external input in the form of an IPC.InputMessage that contains an object such as an Issue, Activity, or Report. It calls one of handleNewIssue, handleNewReport, etc as appropriate.

Overrides:
handleInput in class Ip2

addHandlers

protected void addHandlers()
Description copied from class: IPlan
Install any built-in issue and activity handlers.

Overrides:
addHandlers in class IPlan

initOptions

protected void initOptions()
Overrides:
initOptions in class IPlan

outputPlan

protected void outputPlan()

outputPlanPSGraphData

protected void outputPlanPSGraphData(Plan plan)

outputOwlSPlan

protected void outputOwlSPlan()
                       throws java.io.IOException
Throws:
java.io.IOException

makeInstance

protected java.lang.Object makeInstance(java.lang.String className)