Home > marl > world > robotsgw > robotsgw.m

robotsgw

PURPOSE ^

Creates a 2D grid world

SYNOPSIS ^

function gw = robotsgw(agents, name, worldsize, goal, initpos, obstacles, rewards, cfg)

DESCRIPTION ^

Creates a 2D grid world
  GW = robotsgw(AGENTS, NAME, WORLDSIZE, GOAL, [INITPOS, OBSTACLES, REWARDS, CFG])
  Parameters:
   AGENTS      - the agents in the robotsgw, as a (possibly
               heterogeneous) cell array
   NAME        - the name of the robotsgw
   WORLDSIZE   - the size of the 2D robotsgw, a vector [W H]
   GOAL        - the goal positions of the agents. Can be either a
   structure or a matrix. If a structure, it contains the following
   fields:
       type  - 'mixed', 'coop', or 'comp'
       pos   - goal position. For mixed settings, one agent's goal position on
               each row. Should specify goal positions for the maximum
               number of agents in the robotsgw. For cooperative or
               competitive settings, one goal position only.
       rew   - (optional) a vector of reward values, with the structure
               [ORD COLL GOAL]. ORD will be rewarded for ordinary moves,
               COLL for collisions, GOAL for reaching the goal. For
               cooperative goals, COLL is ignored. For competitive goals,
               ORD and COLL are ignored. This field supersedes the REWARDS
               argument.
   If GOAL is an array, a mixed setting is assumed, and GOAL should have the
   structure of GOAL.pos described above.
   INITPOS     - (optional) 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. One agent
               position on each column. Should specify initial positions for
               the maximum number of agents in the robotsgw.
               Default: empty matrix.
   OBSTACLES   - (optional) the obstacles to place in the robotsgw.
               May be: a matrix with obstacle 2D coordinates on each column;
               an empty matrix, in which case no obstacles are placed; or
               the string 'user' to obtain the obstacles interactively
               from the user. Default is empty matrix (no obstacles)
   REWARDS     - (optional) a vector with three elements, same structure as
               GOAL.rew. Default is [-1 -2 10]
   CFG         - (optional) other configuration options

  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
  Note that an agent can function without the fifth action.

  The agents cannot move out of the grid, onto an obstacle, or in mixed
  worlds onto a goal that does not belong to them. If agents collide, they
  will be reset to their positions previous to the collision.
  Each agent finishes when it has reached its corresponding goal. There is
  no failure situation. In competitive worlds, the agent that reaches the
  goal first wins, the other loses, and the trial terminates at that
  moment.


  See also robotsgwview, robotsgw_advance, robotsgw_destroy,
      robotsgw_obstacles, robotsgw_reset

CROSS-REFERENCE INFORMATION ^

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