Package teamwork :: Package examples :: Module TigerScenario
[hide private]
[frames] | no frames]

Module TigerScenario

source code

PsychSim specification of the multiagent tiger problem

Functions [hide private]
 
resetPosition()
Define the dynamics of how the location of the tiger is reset if either door is opened
source code
 
stayPosition()
Define the dynamics of how the location of the tiger stays the same
source code
 
openSame(side)
Define the payoff when opening the same door
source code
 
openDifferent()
Define the payoff when opening different doors
source code
 
listen()
Define the payoff when both listen
source code
 
openListen(side)
Define the payoff when one opens and the other listens
source code
 
openObs()
Define the observations when opening a door
source code
 
listenObs()
Define the observations when listening
source code
 
formatState(distribution) source code
 
exhaustive(scenario, transition, observations, reward, policyHorizon, lookaheadHorizon, timings) source code
 
executeObsPolicy(agent, beliefs) source code
 
printExhaustivePolicy(agent, policies, horizon, beliefs=None) source code
 
tagActions(value, option) source code
 
mergeAction(policy, value, option, comparisons=None, conditions=[]) source code
 
mergePolicy(agent, values) source code
 
printObsPolicy(agent, horizon, beliefs=None, observations=None) source code
 
EV(scenario, transition, observations, reward, horizon, debug=False, behaviors=None)
Computes the EV of a set of policies through exhaustive simulation
source code
 
simulate(scenario, current, transition, observations, reward, horizon, debug=False, behaviors=None) source code
 
setupTigers() source code
Variables [hide private]
  RIGHT = 1.0
  LEFT = 0.0
  LISTENCOST = -1.0
  DAMAGE = -50.0
  PRIZE = 20.0
  rewardDict = {'OpenRightOpenRight': openSame(RIGHT), 'OpenRigh...
  keyList = [{}, {'feature': 'position', 'entity': 'Tiger'}]
  Omega = {'left': {'type': 'heard left'}, 'right': {'type': 'he...
  observationDict = {'OpenRightOpenRight': openObs(), 'OpenRight...
  EMPTY_NAMESPACE = None
  EMPTY_PREFIX = None
  StringTypes = (<type 'str'>, <type 'unicode'>)
  XMLNS_NAMESPACE = 'http://www.w3.org/2000/xmlns/'
  tree = <teamwork.math.ProbabilityTree.ProbabilityTree instance...
Function Details [hide private]

exhaustive(scenario, transition, observations, reward, policyHorizon, lookaheadHorizon, timings)

source code 

Warning: pretty specific to tiger scenario

executeObsPolicy(agent, beliefs)

source code 
Parameters:
  • beliefs (Key[])
  • policies (dict)

simulate(scenario, current, transition, observations, reward, horizon, debug=False, behaviors=None)

source code 
Parameters:
  • current - list of nodes to expand

Variables Details [hide private]

rewardDict

Value:
{'OpenRightOpenRight': openSame(RIGHT), 'OpenRightListen': openListen(\
RIGHT), 'OpenRightOpenLeft': openDifferent(), 'ListenOpenRight': openL\
isten(RIGHT), 'ListenListen': listen(), 'ListenOpenLeft': openListen(L\
EFT), 'OpenLeftOpenRight': openDifferent(), 'OpenLeftListen': openList\
en(LEFT), 'OpenLeftOpenLeft': openSame(LEFT),}

Omega

Value:
{'left': {'type': 'heard left'}, 'right': {'type': 'heard right'}}

observationDict

Value:
{'OpenRightOpenRight': openObs(), 'OpenRightListen': openObs(), 'OpenR\
ightOpenLeft': openObs(), 'ListenOpenRight': openObs(), 'ListenListen'\
: listenObs(), 'ListenOpenLeft': openObs(), 'OpenLeftOpenRight': openO\
bs(), 'OpenLeftListen': openObs(), 'OpenLeftOpenLeft': openObs(),}

tree

Value:
<teamwork.math.ProbabilityTree.ProbabilityTree instance at 0x2392080>