Sie sind auf Seite 1von 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
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
Rules are composed of a condition and an action. If the condition is satisfied, then the action is taken.

Conditions
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 object1s perspective.

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

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

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

DirectlyFront(object1, object2)
True if object2 is directly in front of object1, from object1s perspective.

DirectlyBehind(object1, object2)
True if object2 is directly behind object1, from object1s perspective.

DirectlyLeft(object1, object2)
True if object2 is directly to the left of object1, from object1s perspective.

DirectlyRight(object1, object2)
True if object2 is directly to the right of object1, from object1s perspective.

Aligned(object1, object2, object3)


True if object1, object2, and object3 are all in a straight line.

Path(object1, object2, range)


True if there is a clear path between object1 and object2.

Equal(object1, object2)
True if object1 and object2 are actually the same object.

Not(condition)
True if the given condition is false.

True
A condition that is always True.

Actions
Actions are things that the robot can do in the world.

MoveForward(value)
Move the robot forward at a speed determined by value.

MoveBackward(value)
Move the robot backward at a speed determined by value.

TurnLeft(value)
Turn the robot counter-clockwise at the speed specified by value.

TurnRight(value)
Turn the robot clockwise at speed specified by value.

Kick(value)
Kick the ball in the direction the robot is facing. The value determines how hard the ball is kicked.

Nil
The robot does nothing at all.

Objects
Objects may be either primitive objects (such as BALL) or a set of primitive objects (such PLAYER-OPP). Primitive objects have a position and an orientation.

Me
ME simply refers to yourself, the robot who is running this program.

Ball
BALL is the soccer ball.

Player
PLAYER is the set of all the robots playing soccer. PLAYER is divided into several sub-categories: PLAYER-US is all the players on your team, including yourself. PLAYER-US-OTHER is all your teammates not including yourself. PLAYER-US-1 through PLAYER-US-5 is a specific numbered player. PLAYER-OPP is the set of all your opponents; the opposing soccer team.

Goal
GOAL is the set of both goals. GOAL-US is your own goal, GOAL-OPP is the opponents goal.

Wall
WALL is the set of all walls. WALL-LEFT, WALL-OPP, WALL-RIGHT, WALL-US are each a single wall in a specific directions, where LEFT is the top of the field.

Home
HOME is the starting point of the robot currently running this program. This position is set at a game time.

Closest(set-of-objects, individual objects)


This is a function that returns as its result another object. It is used just like a normal object, but it dynamically determines which object from a set to use during the game. The first parameter must be a set, such as WALL or PLAYER, and the second must be an individual object, like ME or BALL.

Values
Values may be LO, MED, or HI. The precise meaning of these values depend on the context in which they are used.

Inputs
Inputs are arguments passed to the behavior. These objects may be treated just like any other object specified explicitly.

Comments
Any line preceeded with "%" is treated as a comment and is ignored by the interpreter. Copyright (c) 2004 by M. Kochenderfer, M. Sego, K. Shimano, J. Tansuwan 8 March 2004

Das könnte Ihnen auch gefallen