You are on page 1of 4

TRSoccerbots User Manual

Version 1.2 TRSoccerbots is an educational product intended to expose high school and college students to the construction of autonomous agents that are capable of reacting to a dynamic environment. This document specifies the major components of the programming language.

Behaviors are composed of a list of rules. The rules are evaluated from top to bottom. The first rule whose condition is satisfied is activated, meaning that the specified action is taken. Behaviors may take any number of objects as arguments. The actions may be either primitive actions or calls to other behaviors.

Rules are composed of a condition and an action. If the condition is satisfied, then the action is taken.

A condition is something that is either true or false at a given instant in time.

Close(object1, object2, range)
True if object1 is close to object2.

Front(object1, object2)
True if object2 is in front of object1, from object1’s perspective.

Behind(object1, object2)
True if object2 is behind object1, from object1’s perspective.

Left(object1, object2)
True if object2 is to the left of object1, from object1’s perspective.

Right(object1, object2)
True if object2 is to the right of object1, from object1’s perspective.

object2) True if object2 is directly to the right of object1. range) True if there is a clear path between object1 and object2. MoveForward(value) Move the robot forward at a speed determined by value. and object3 are all in a straight line. object2) True if object2 is directly behind object1. object3) True if object1. from object1’s perspective. from object1’s perspective. Actions Actions are things that the robot can do in the world. DirectlyBehind(object1. object2. DirectlyLeft(object1. True A condition that is always True. . DirectlyRight(object1. from object1’s perspective. MoveBackward(value) Move the robot backward at a speed determined by value. Equal(object1. object2) True if object1 and object2 are actually the same object. from object1’s perspective. Not(condition) True if the given condition is false.DirectlyFront(object1. object2. Aligned(object1. object2) True if object2 is directly in front of object1. object2. Path(object1. object2) True if object2 is directly to the left of object1.

WALL-LEFT. PLAYER is divided into several sub-categories: PLAYER-US is all the players on your team. GOAL-OPP is the opponents goal. WALL-OPP. Primitive objects have a position and an orientation. WALL-US are each a single wall in a specific directions. Objects Objects may be either primitive objects (such as BALL) or a set of primitive objects (such PLAYER-OPP). Goal GOAL is the set of both goals. Nil The robot does nothing at all. where LEFT is the top of the field. Wall WALL is the set of all walls. GOAL-US is your own goal. The value determines how hard the ball is kicked. Player PLAYER is the set of all the robots playing soccer. Ball BALL is the soccer ball. PLAYER-US-OTHER is all your teammates not including yourself.TurnLeft(value) Turn the robot counter-clockwise at the speed specified by value. PLAYER-US-1 through PLAYER-US-5 is a specific numbered player. PLAYER-OPP is the set of all your opponents. Kick(value) Kick the ball in the direction the robot is facing. WALL-RIGHT. Me ME simply refers to yourself. including yourself. the opposing soccer team. . the robot who is running this program. TurnRight(value) Turn the robot clockwise at speed specified by value.

Shimano. such as WALL or PLAYER. and the second must be an individual object. MED. K.Home HOME is the starting point of the robot currently running this program. The first parameter must be a set. or HI. Closest(set-of-objects. Comments Any line preceeded with "%" is treated as a comment and is ignored by the interpreter. This position is set at a game time. individual objects) This is a function that returns as its result another object. like ME or BALL. J. Sego. The precise meaning of these values depend on the context in which they are used. Kochenderfer. M. These objects may be treated just like any other object specified explicitly. Inputs Inputs are arguments passed to the behavior. Copyright (c) 2004 by M. but it dynamically determines which object from a set to use during the game. Values Values may be LO. Tansuwan 8 March 2004 . It is used just like a normal object.