Share Site Map Contact us Home Page
Home > LMC 1 > LMC1 Interface Specs


LMC1 Quick Overview

LMC1 Announcement

LMC1 Detailed Info

LMC1 Official Rules

LMC1 Interface Specs

LMC1 Testing Zone

Enter LMC1

LMC1 FAQ

Summary and Conclusions
LMC1 Interface Specs
  Printable version
Ai Discussion Boards  Idea Exchange
Specification of the API for the Learning Machine Challenge
To enter the Learning Machine Challenge, your program is required to conform to a simple API. This API allows your program to communicate with the judge program using standard input/output functions: exactly the kind of functions you'd use to read from and write to the console.(Example)

There are several advantages to doing things this way. It enables you to test your program directly, by running it in a stand-alone fashion and playing the role of judge yourself. Also, it gives you the opportunity to submit source code written in your programming language of choice. You can even submit a binary executable! Finally, it is platform-independent, meaning that we can support both Windows and Linux binaries.

We have provided you with example programs, written in a variety of programming languages, in the Testing Zone section. These example programs completely implement the API, and you may wish to base your entry on them.

Interface Specification
Your program is a "black box" which communicates with the outside world via a number of different "channels". These channels are:

> The input channel. This channel allows your program to observe moves coming in from the outside world.
> The output channel. This channel allows your program to send a move to the outside world.
> The score channel. This channel allows the judge to inform your program of its score.
> The command channel. This channel allows the judge to send special commands to your program.
> The info channel. This channel allows your program to send special informational messages to the judge.

Each of these five channels is implemented using standard input/output operations. This requires a special syntax to be used. The syntax is line-based, and specifies a channel, along with the data which is to be transmitted over that channel. The basic syntax is:

@channel data

Where channel is the name of the channel and data is channel-specific data. Note that a single space character separates the channel name from the channel data and that the channel data is a string which is terminated by the end-of-line.

The Input Channel
The input channel allows your program to observe a move coming in from the outside word. The input channel is the default channel coming into your program, and so the channel specifier is optional. The syntax of the input channel is:

[@input ]string

Where string is a valid move, represented as a string which contains no whitespace.

The output channel
The output channel allows your program to make a move itself. The output channel is the default channel coming out of your program, and so the channel specifier is optional. The syntax of the output channel is:

[@output ]string

Where string is a valid move, represented as a string which contains no whitespace.

The score channel
The score channel is used by the judge program to inform your program of its score. The syntax of the score channel is:

@score number

Where number is a floating-point number between -1.0 and +1.0.

The command channel
The command channel is used by the judge program to send information to your program or request it to perform an action. There are four different commands, and we'll describe them one-by-one.

To begin with, the judge program can ask your program to exit cleanly. The syntax of this command is:

@command exit

When your program receives an exit command, it should do any cleaning up which it needs to perform and it should terminate itself.

The judge program can inform your program that it is about to begin a new game against a new player. The syntax