Package teamwork :: Package action :: Module DecisionSpace :: Class DecisionSpace
[hide private]
[frames] | no frames]

Class DecisionSpace

source code

Known Subclasses:

Space of possible options that an agent may have Each option is assumed to be a dictionary-type object. A DecisionSpace object generates all of the possible objects that can be generated by extending a given base (partially filled) object with a given key, whose value ranges over a supplied list of possible fillers.

Instance Methods [hide private]
 
__init__(self, key=None, values=[], base=None)
Constructor that initializes the base option and relevant key
source code
 
directAdd(self, option)
Adds the given option directly to the space
source code
 
append(self, value)
Adds the given value to the list of possible fillers
source code
 
remove(self, value)
Removes the given value from the list of possible fillers
source code
 
replace(self, old, new)
Replaces single old value with new values
source code
 
getOptions(self)
Accessor for the options in this space
source code
 
testForField(self, field='actor')
Debugging method that returns true iff the given field is set
source code
 
generateOptions(self)
Utility method that generates possible options
source code
 
__str__(self) source code
 
__copy__(self) source code
 
__deepcopy(self) source code
 
__xml__(self) source code
 
parse(self, element) source code
Class Variables [hide private]
string branchType = None
label for this class of DecisionSpace
Instance Variables [hide private]
  base
the kernel dictionary object about which all the options are convolved
str→Action illegal
options that should never be considered
  values
the possible options that can be used at this level of the decision hierarchy
Method Details [hide private]

__init__(self, key=None, values=[], base=None)
(Constructor)

source code 

Constructor that initializes the base option and relevant key

Parameters:
  • key (string) - the dictionary key over which this decision space generates possible fillers
  • base - the original dictionary object that is to be filled in (by default, a list containing a single empty Action object)

directAdd(self, option)

source code 

Adds the given option directly to the space

Parameters:
  • option (Action[]) - the option to add to the space

append(self, value)

source code 

Adds the given value to the list of possible fillers

Parameters:
  • value (str)

remove(self, value)

source code 

Removes the given value from the list of possible fillers

Returns:
false if the value is not present; otherwise, true

replace(self, old, new)

source code 

Replaces single old value with new values

Parameters:
  • old - a single value
  • new - a list of values

    The method continues the replacement by descending recursively if there are any nested decision spaces

getOptions(self)

source code 

Accessor for the options in this space

Returns:
a list of possible options (typically, Action instances)