zeus.actors
Class PlanRecord

java.lang.Object
  extended byzeus.actors.PlanRecord
All Implemented Interfaces:
SuppliedRequester

public class PlanRecord
extends java.lang.Object
implements SuppliedRequester

PlanRecord is used to manage the execution of a (primitive, mutable or infered) task. The field task is the primitive task being executed, the field thread is the ZeusTask that is actually being run


Field Summary
static int AGREEMENT
           
protected static boolean BOOKED
           
static java.awt.Color[] color
           
static int COMPLETED
           
protected  ConsumedDb consumedDb
           
protected  double cost
           
protected  java.lang.String diagnostic
           
protected  int end_time
           
static int FAILED
           
static int FIRM
           
static int FREE
           
protected  Goal goal
           
protected  java.lang.String id
           
protected  java.util.Vector images
           
protected  boolean is_disposed
           
static int JEOPARDY
           
protected  java.lang.String key
           
protected  int lstart_time
           
protected  int noAllowedInvocations
           
protected  int noAvailableItems
           
protected  PlanRecord original
           
protected  java.util.Vector other_tasks
           
protected  PlanRecord parent
           
protected  java.util.Vector path
           
protected  Planner planner
           
protected  int proc
           
protected  ProducedDb producedDb
           
protected  int reconfirm_count
           
static int RUNNING
           
protected  boolean[] slots
           
protected  int start_time
           
protected  int state
           
static java.lang.String[] state_string
           
protected  PrimitiveTask task
           
static int TEMP
           
static int TENTATIVE
           
protected  ZeusTask thread
           
 
Constructor Summary
  PlanRecord()
           
protected PlanRecord(Planner planner, PlanRecord original, java.lang.String key, PlanRecord parent, Goal goal, PrimitiveTask task, int proc, int start, int end)
           
  PlanRecord(Planner planner, java.lang.String key, PlanRecord parent, Goal goal, PrimitiveTask task, int proc, int start, int end)
           
 
Method Summary
 int anySideEffect(Fact desc, PlanRecord rec, java.lang.Object precond, int required)
           
 boolean applyConstraints(Bindings bindings)
           
 void breakEffectChain(int effect_position, PlanRecord rec, int precond_position, int amount)
           
 void chainPrecondition(PlanRecord child, int effect_position, int amount, int precond_position)
           
 Goal createSubgoal(Fact fact, int precon_position)
           
 void debug(java.lang.String str)
           
 java.util.Vector descendantSubgoals()
           
 java.lang.String diagnostic()
           
 void dispose()
           
 void dispose(PlanRecord parent, java.lang.String key)
           
protected  void dispose(PlanRecord aParent, java.lang.String aKey, SuppliedDb db)
           
 PlanRecord enact(PlannerEnactStruct es, Goal goal_image, PlanRecord parent_image, java.lang.String key_image, java.util.Hashtable substitution_table)
           
 boolean equals(PlanRecord rec)
           
 boolean exec()
           
 AgentContext getAgentContext()
           
 int getAmountUsed(int precond_position)
           
 Bindings getBindings()
           
 java.util.Vector getChildPath()
           
 PlanRecord[] getChildren()
           
 ConsumedDb getConsumedDb()
           
 int getConsumedPosition(java.lang.String goal_id)
           
 double getCost()
           
 DataRec getDatarec(int precond_position)
           
 int getEndTime()
           
 Goal getGoal()
           
 java.lang.String getId()
           
 java.lang.String getKey()
           
 int getLatestStartTime()
           
 PlanRecord getParent()
           
 int getProc()
           
 ProducedDb getProducedDb()
           
 PlanRecord getRoot()
           
 int getStartTime()
           
 int getState()
           
 SuppliedDb getSuppliedDb()
           
 PrimitiveTask getTask()
           
 boolean hasAncestor(PlanRecord ancestor)
           
 boolean hasAtMostOneParent(PlanRecord parent, java.lang.String key)
           
 boolean hasEnoughResources()
           
 boolean hasMoreEnactments()
           
 boolean hasSubgoal(Goal goal)
           
 boolean hasSubgoal(java.lang.String goalId)
           
 void incrementTime(int t)
           
protected  void init(Planner planner, java.lang.String key, PlanRecord parent, Goal goal, PrimitiveTask task, int proc, int start, int end)
           
 boolean isContinuous()
           
 boolean isDiscrete()
           
 boolean isOnCell(int proc, int t)
           
 boolean isPreconditionConsumed(int precond_position)
           
 int latestConfirmTime()
           
 void map(ValueFunction val, Fact lhs, Fact rhs)
           
 void mapCostAndTime()
          bind the any variables in the task cost and time to their pre & postcondition values at run time
 Fact[][] mapPreToPost(Fact[][] input, Fact[] exp_out)
          mapPreToPost is used to map precondition variables that are supposed to be copied to post conditions synchronised?
 int noRequiredItems(int precond_position)
           
protected  void originalDisposed()
           
 boolean overRun()
           
 void preconditionExists(PlanRecord child, int effect_position, int amount, int precond_position)
           
 void preconditionExists(java.lang.String goal_id)
           
 void raiseException(int effect_position, java.lang.String exception_key, int amount)
           
 void reallocateResource(int precond_position, int amount)
           
 void reallocateResource(int precond_position, int amount, java.util.Vector Tasks, java.util.Vector Path)
           
 void reallocateResource(int precond_position, PlanRecord child, int effect_position, int amount, java.util.Vector Tasks, java.util.Vector path)
           
 void reassign(int pc, int st)
           
 void reconfirm()
           
 Goal recreateSubgoal(Goal g)
           
 void removeRecordTree(java.util.Vector data)
           
 void replacePrecondition(java.lang.String goal_id, PlanRecord child, int effect_position, int amount)
           
 ReportRec report()
           
 void setAlternativeTasks(java.util.Vector Tasks)
           
 void setKey(java.lang.String nkey)
           
 void setPath(java.util.Vector path)
           
 void setState(int newState)
           
protected  void setState(int newState, PlanRecord parent)
           
 boolean setSupplier(int precond_position, int amount, SuppliedItem item)
           
 void softFail(PlannerQueryStruct struct, int mode)
           
 void softRaiseException(int effect_position, java.lang.String exception_key, int amount, PlannerQueryStruct struct, int mode)
           
 void softReallocateResource(int precond_position, int amount, java.util.Vector Tasks, java.util.Vector Path, PlannerQueryStruct struct, int mode)
           
 void softReallocateResource(int precond_position, PlanRecord child, int effect_position, int amount, java.util.Vector Tasks, java.util.Vector path, PlannerQueryStruct struct, int mode)
           
 java.lang.String toString()
           
 void updateCost(double value)
           
protected  void vacatingPosition(int proc, int start, int end)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

FREE

public static final int FREE
See Also:
Constant Field Values

TEMP

public static final int TEMP
See Also:
Constant Field Values

TENTATIVE

public static final int TENTATIVE
See Also:
Constant Field Values

FIRM

public static final int FIRM
See Also:
Constant Field Values

RUNNING

public static final int RUNNING
See Also:
Constant Field Values

FAILED

public static final int FAILED
See Also:
Constant Field Values

COMPLETED

public static final int COMPLETED
See Also:
Constant Field Values

JEOPARDY

public static final int JEOPARDY
See Also:
Constant Field Values

AGREEMENT

public static final int AGREEMENT
See Also:
Constant Field Values

BOOKED

protected static final boolean BOOKED
See Also:
Constant Field Values

color

public static final java.awt.Color[] color

state_string

public static final java.lang.String[] state_string

planner

protected Planner planner

state

protected int state

parent

protected PlanRecord parent

id

protected java.lang.String id

goal

protected Goal goal

task

protected PrimitiveTask task

proc

protected int proc

start_time

protected int start_time

lstart_time

protected int lstart_time

end_time

protected int end_time

cost

protected double cost

thread

protected ZeusTask thread

diagnostic

protected java.lang.String diagnostic

key

protected java.lang.String key

is_disposed

protected boolean is_disposed

consumedDb

protected ConsumedDb consumedDb

producedDb

protected ProducedDb producedDb

reconfirm_count

protected int reconfirm_count

other_tasks

protected java.util.Vector other_tasks

path

protected java.util.Vector path

original

protected PlanRecord original

noAllowedInvocations

protected int noAllowedInvocations

noAvailableItems

protected int noAvailableItems

slots

protected boolean[] slots

images

protected java.util.Vector images
Constructor Detail

PlanRecord

public PlanRecord()

PlanRecord

public PlanRecord(Planner planner,
                  java.lang.String key,
                  PlanRecord parent,
                  Goal goal,
                  PrimitiveTask task,
                  int proc,
                  int start,
                  int end)

PlanRecord

protected PlanRecord(Planner planner,
                     PlanRecord original,
                     java.lang.String key,
                     PlanRecord parent,
                     Goal goal,
                     PrimitiveTask task,
                     int proc,
                     int start,
                     int end)
Method Detail

init

protected void init(Planner planner,
                    java.lang.String key,
                    PlanRecord parent,
                    Goal goal,
                    PrimitiveTask task,
                    int proc,
                    int start,
                    int end)

getId

public java.lang.String getId()

getProc

public int getProc()

getState

public int getState()

getStartTime

public int getStartTime()
Specified by:
getStartTime in interface SuppliedRequester

getLatestStartTime

public int getLatestStartTime()

getEndTime

public int getEndTime()

getTask

public PrimitiveTask getTask()
Specified by:
getTask in interface SuppliedRequester

getGoal

public Goal getGoal()

getParent

public PlanRecord getParent()

getKey

public java.lang.String getKey()

getCost

public double getCost()

getConsumedDb

public ConsumedDb getConsumedDb()

getProducedDb

public ProducedDb getProducedDb()

getAgentContext

public AgentContext getAgentContext()

getSuppliedDb

public SuppliedDb getSuppliedDb()

anySideEffect

public int anySideEffect(Fact desc,
                         PlanRecord rec,
                         java.lang.Object precond,
                         int required)

setAlternativeTasks

public void setAlternativeTasks(java.util.Vector Tasks)

setPath

public void setPath(java.util.Vector path)

getChildPath

public java.util.Vector getChildPath()

getChildren

public PlanRecord[] getChildren()

hasAtMostOneParent

public boolean hasAtMostOneParent(PlanRecord parent,
                                  java.lang.String key)

getDatarec

public DataRec getDatarec(int precond_position)

getConsumedPosition

public int getConsumedPosition(java.lang.String goal_id)

isPreconditionConsumed

public boolean isPreconditionConsumed(int precond_position)

noRequiredItems

public int noRequiredItems(int precond_position)
Specified by:
noRequiredItems in interface SuppliedRequester

getAmountUsed

public int getAmountUsed(int precond_position)

setSupplier

public boolean setSupplier(int precond_position,
                           int amount,
                           SuppliedItem item)
Specified by:
setSupplier in interface SuppliedRequester

chainPrecondition

public void chainPrecondition(PlanRecord child,
                              int effect_position,
                              int amount,
                              int precond_position)

preconditionExists

public void preconditionExists(PlanRecord child,
                               int effect_position,
                               int amount,
                               int precond_position)

preconditionExists

public void preconditionExists(java.lang.String goal_id)

replacePrecondition

public void replacePrecondition(java.lang.String goal_id,
                                PlanRecord child,
                                int effect_position,
                                int amount)

breakEffectChain

public void breakEffectChain(int effect_position,
                             PlanRecord rec,
                             int precond_position,
                             int amount)

recreateSubgoal

public Goal recreateSubgoal(Goal g)

reconfirm

public void reconfirm()

setKey

public void setKey(java.lang.String nkey)

isDiscrete

public boolean isDiscrete()

isContinuous

public boolean isContinuous()

hasMoreEnactments

public boolean hasMoreEnactments()

hasEnoughResources

public boolean hasEnoughResources()

updateCost

public void updateCost(double value)

applyConstraints

public boolean applyConstraints(Bindings bindings)
Specified by:
applyConstraints in interface SuppliedRequester

getBindings

public Bindings getBindings()

isOnCell

public boolean isOnCell(int proc,
                        int t)

vacatingPosition

protected void vacatingPosition(int proc,
                                int start,
                                int end)

originalDisposed

protected void originalDisposed()

reassign

public void reassign(int pc,
                     int st)

incrementTime

public void incrementTime(int t)

diagnostic

public java.lang.String diagnostic()

mapPreToPost

public Fact[][] mapPreToPost(Fact[][] input,
                             Fact[] exp_out)
mapPreToPost is used to map precondition variables that are supposed to be copied to post conditions synchronised?

Since:
1.2

mapCostAndTime

public void mapCostAndTime()
bind the any variables in the task cost and time to their pre & postcondition values at run time


map

public void map(ValueFunction val,
                Fact lhs,
                Fact rhs)

exec

public boolean exec()

overRun

public boolean overRun()

setState

protected void setState(int newState,
                        PlanRecord parent)

setState

public void setState(int newState)

softFail

public void softFail(PlannerQueryStruct struct,
                     int mode)

descendantSubgoals

public java.util.Vector descendantSubgoals()

latestConfirmTime

public int latestConfirmTime()

dispose

public void dispose()

dispose

public void dispose(PlanRecord parent,
                    java.lang.String key)

dispose

protected void dispose(PlanRecord aParent,
                       java.lang.String aKey,
                       SuppliedDb db)

hasAncestor

public boolean hasAncestor(PlanRecord ancestor)

getRoot

public PlanRecord getRoot()

reallocateResource

public void reallocateResource(int precond_position,
                               int amount)

reallocateResource

public void reallocateResource(int precond_position,
                               PlanRecord child,
                               int effect_position,
                               int amount,
                               java.util.Vector Tasks,
                               java.util.Vector path)

reallocateResource

public void reallocateResource(int precond_position,
                               int amount,
                               java.util.Vector Tasks,
                               java.util.Vector Path)

raiseException

public void raiseException(int effect_position,
                           java.lang.String exception_key,
                           int amount)

softReallocateResource

public void softReallocateResource(int precond_position,
                                   PlanRecord child,
                                   int effect_position,
                                   int amount,
                                   java.util.Vector Tasks,
                                   java.util.Vector path,
                                   PlannerQueryStruct struct,
                                   int mode)

softReallocateResource

public void softReallocateResource(int precond_position,
                                   int amount,
                                   java.util.Vector Tasks,
                                   java.util.Vector Path,
                                   PlannerQueryStruct struct,
                                   int mode)

softRaiseException

public void softRaiseException(int effect_position,
                               java.lang.String exception_key,
                               int amount,
                               PlannerQueryStruct struct,
                               int mode)

removeRecordTree

public void removeRecordTree(java.util.Vector data)

report

public ReportRec report()

createSubgoal

public Goal createSubgoal(Fact fact,
                          int precon_position)

hasSubgoal

public boolean hasSubgoal(java.lang.String goalId)

hasSubgoal

public boolean hasSubgoal(Goal goal)

equals

public boolean equals(PlanRecord rec)

enact

public PlanRecord enact(PlannerEnactStruct es,
                        Goal goal_image,
                        PlanRecord parent_image,
                        java.lang.String key_image,
                        java.util.Hashtable substitution_table)

toString

public java.lang.String toString()

debug

public void debug(java.lang.String str)


Copyright © 2000-2003 BT Exact Technologies. All Rights Reserved.