Package teamwork :: Package policy :: Module LookupAheadPolicy :: Class LookupAheadPolicy
[hide private]
[frames] | no frames]

Class LookupAheadPolicy

source code

             generic.Policy --+    
                              |    
      LookupPolicy.LookupPolicy --+
                                  |
             generic.Policy --+   |
                              |   |
LookaheadPolicy.LookaheadPolicy --+
                                  |
                                 LookupAheadPolicy

Nested Classes [hide private]
  lookupClass
Class for representing a strictly reactive policy
  lookaheadClass
Policy subclass that looks a fixed number of turns into the future and examines the expected reward received in response to the actions of other agents
Instance Methods [hide private]
 
__init__(self, entity, actions, size, depth=1) source code
 
setHorizon(self, depth=1)
Sets the default horizon of lookahead (which can still be overridden by a method call argument
source code
 
tryLookup(self, state, choices, debug, explain) source code
 
execute(self, state, choices=[], debug=Debugger (0), explain=False) source code
 
__copy__(self) source code
 
__deepcopy__(self, memo) source code
 
actionValue(self, state, actStruct, debug=Debugger (0))
Return some quantified value of performing action
source code
 
__contains__(self, value)
Returns true if the specified value matches an entry in this policy
source code
 
__xml__(self) source code
 
parse(self, element) source code

Inherited from LookupPolicy.LookupPolicy: __str__, extend, instantiateKeys, matchAnswer, parseEntry, parseLHS, testCondition

Inherited from LookaheadPolicy.LookaheadPolicy: evaluateChoices, findBest

Instance Variables [hide private]

Inherited from LookaheadPolicy.LookaheadPolicy: consistentTieBreaking, horizon

Method Details [hide private]

__init__(self, entity, actions, size, depth=1)
(Constructor)

source code 
Parameters:
  • entity - the entity whose policy this is (not sure whether this is necessary)
  • actions - the options considered by this policy (used by superclass)
  • horizon - the lookahead horizon
Overrides: LookaheadPolicy.LookaheadPolicy.__init__
(inherited documentation)

setHorizon(self, depth=1)

source code 

Sets the default horizon of lookahead (which can still be overridden by a method call argument

Parameters:
  • horizon - the desired horizon (default is 1)
Overrides: LookaheadPolicy.LookaheadPolicy.setHorizon
(inherited documentation)

execute(self, state, choices=[], debug=Debugger (0), explain=False)

source code 
Overrides: LookaheadPolicy.LookaheadPolicy.execute

__copy__(self)

source code 
Overrides: LookaheadPolicy.LookaheadPolicy.__copy__

actionValue(self, state, actStruct, debug=Debugger (0))

source code 

Return some quantified value of performing action

Returns:
expected value of performing action
Overrides: LookaheadPolicy.LookaheadPolicy.actionValue
(inherited documentation)

__contains__(self, value)
(In operator)

source code 

Returns true if the specified value matches an entry in this policy

Overrides: LookaheadPolicy.LookaheadPolicy.__contains__

__xml__(self)

source code 
Overrides: LookaheadPolicy.LookaheadPolicy.__xml__

parse(self, element)

source code 
Overrides: LookaheadPolicy.LookaheadPolicy.parse