>xabsl   The Extensible Agent Behavior Specification Language

Xabsl Example Source Code for Ascii Soccer

 

File my-symbols.xabsl

			
/** My most used symbols */
namespace my_symbols("My Symbols") {

  /** The possible roles of a player */
  enum role {
    defender,
    midfielder,
    striker
  };

  /** The dynamically assigned role of the player */
  enum role input player_role;

  /** The x position of the player */
  float input x;

  /** The y position of the player */
  float input y;

  /** The x position of the ball */
  float input ball.x;

  /** The y position of the ball */
  float input ball.y;

  /** The distance to the ball */
  float input ball.distance;

  /** The direction of the ball if in the local area of the player. If the ball is not in the local area, -1 is returned */
  float input ball.local.direction;

  /** The x position of the most westerly teammate */
  float input most_westerly_teammate.x;

  /** The direction north west */
  float const NW = 0 "int";

  /** The direction north */
  float const N = 1 "int";

  /** The direction north east */
  float const NE = 2 "int";

  /** The direction west */
  float const W = 3 "int";

  /** The direction east */
  float const E = 5 "int";

  /** The direction south west */
  float const SW = 6 "int";

  /** The direction south */
  float const S = 7 "int";

  /** The direction south east */
  float const SE = 8 "int";

  /** The action id for kicking */
  float const KICK = 9 "int";

  /** The action id for doing nothing */
  float const DO_NOTHING = 10 "int";

}