Arimaa Forum (http://arimaa.com/arimaa/forum/cgi/YaBB.cgi)
Arimaa >> Bot Development >> AEI Protocol Question
(Message started by: jdb on Jan 22nd, 2015, 10:30am)

Title: AEI Protocol Question
Post by jdb on Jan 22nd, 2015, 10:30am
I have a question about the AEI protocol.

Say the following sequence of commands occurs, which I cut and pasted from aei-protocol.txt,

   CTL: setoption name hash value 500
   CTL: isready
   ENG: log Set transposition table size to 500MB (9362285 entries)
   ENG: readyok
   CTL: setoption name rated value 1
   CTL: newgame
   CTL: isready
   ENG: log Starting new game.
   ENG: readyok

If there are a list of say 50 or so setup parameters in the gameroom.cfg file, they all get sent to the engine at once. Some of them take a significant amount of time to act on.

When should the bot act on the setoption commands?

Is it guaranteed that an isready is sent after a list of setoption commands?

Or is it better to wait for a newgame command?


Title: Re: AEI Protocol Question
Post by browni3141 on Jan 22nd, 2015, 7:30pm
"Engines should start up and respond to the initial "aei" message as soon as
possible and delay any lengthy initialisation until after the opening phase is
complete."
Also, "An engine should try and process messages as soon as possible even while thinking."
These are the only related things I know of. My interpretation of this is that you should be able to do basic initialization any time you want after the opening phase (although immediately seems best for reasons mentioned below), and should act on setoption commands immediately. Why wait for a specific command? It seems risky to wait for an "isready" command, since the protocol doesn't seem to guarantee one. The same is true for the "newgame" command. The controller could interrupt a search, send some setoption commands and run the same search or a "makemove" and a "go" etc.
It is probably safe to wait for a "go" command and initialize then, but it seems to me to be contrary of what is expected of you. Also, you'd end up having to keep track of whether or not and which configuration options have been changed since the last "go," unless you want to run initialization over again after every "go."

Title: Re: AEI Protocol Question
Post by Janzert on Jan 23rd, 2015, 10:13am
In general the engine should act on the setoption directly after receiving it. Some engines may not be able to change some options except at say the point of a new game, or when a search is not in progress. In those cases it's fine to delay the change to that time.

An isready query is not guaranteed at any point, the controller will generally send it when it wants to know that the engine has "caught up". For example if you look at the other comunication example, it shows an isready-readyok sequence just before the setoption command.

Janzert



Arimaa Forum » Powered by YaBB 1 Gold - SP 1.3.1!
YaBB © 2000-2003. All Rights Reserved.