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

Class ObservationPolicy

source code

generic.Policy --+
                 |
                ObservationPolicy

Policy that uses a lookup table, indexed by observation history

Instance Methods [hide private]
 
__init__(self, choices, observations, horizon=0) source code
 
initialize(self, horizon)
Sets the policy to the first policy in the ordered space
source code
bool
next(self)
Increments this policy to the next one in the ordered space
source code
 
execute(self, state=None, choices=[], debug=None, depth=-1, explain=False)
Execute the policy in the given state
source code
 
__str__(self, buf=None) source code
Instance Variables [hide private]
  Omega
list of possible observations
  entries
lookup table
  horizon
the maximum observation history that has been solved for (default is None)
Method Details [hide private]

__init__(self, choices, observations, horizon=0)
(Constructor)

source code 
Overrides: generic.Policy.__init__

next(self)

source code 

Increments this policy to the next one in the ordered space

Returns: bool
True if the next policy has been found; False if reached the end of the policy space

execute(self, state=None, choices=[], debug=None, depth=-1, explain=False)

source code 

Execute the policy in the given state

Parameters:
  • state - observation history
Overrides: generic.Policy.execute

Warning: Ignores choices and depth argument