Home > marl > world > rrgw > rrgw.m

rrgw

PURPOSE ^

Creates a 2D grid world

SYNOPSIS ^

function gw = rrgw(agents, cfg)

DESCRIPTION ^

Creates a 2D grid world
  GW = rrgw(AGENTS, CFG)
  Parameters:
   AGENTS      - the agents in the rrgw, as a (possibly
               heterogeneous) cell array
   CFG         - configuration structure with the following fields:
       name        - the name of the rrgw
       tasktype    - one of 'coop', 'mixed' for fully cooperative or mixed.
       size        - the size of the 2D rrgw, a vector [W H]'
       obstacles   - the coordinates of the obstacles, one obstacle 
       homebase    - the coordinates of the homebase, [XLL YLL; XUR YUR]'
       targets     - cell array of targets. Each target is a structure:
           pos         - position e.g. [X Y]'
           lockpos     - relative lock positions, e.g. 'sw' for south and west
           Only one target is considered for cooperative settings. For one target,
           it can be directly given without wrapping in a cell array.
       rew         - a structure containing the rewards setup
           step        - step penalty
           coll        - collision penalty
           lock        - lock reward (when locking onto target)
           sit         - when sitting pinned to target. Default is step
           pull        - reward for successful pull step while locked on target
           rip         - penalty for pulling on target uncoordinately (either
                   alone, or in a different direction than the other agent)
           home        - reward for successfuly reaching the homebase with
                   target in tow
       Rewards can also be given as a vector with the components in this
       order, [step coll lock sit pull rip home].
       initpos     - the deterministic initial positions of the
                   agents. If an empty matrix, at each trial start agents will
                   be placed in random positions in the world. E.g., [X10 Y10; X20 Y20]'.

  Agents can move one cell in either of the four compass directions,
  or stay still. Each agent has one action variable available, and its
  values are coded in the following way:
   1 - left
   2 - right
   3 - up
   4 - down
   5 - stay put


  See also rrgwview, rrgw_advance, rrgw_destroy,
      rrgw_obstacles, rrgw_reset

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:
Generated on Wed 04-Aug-2010 16:55:08 by m2html © 2005