Welcome, Guest. Please Login or Register.
Apr 23rd, 2024, 5:43am

Home Home Help Help Search Search Members Members Login Login Register Register
Arimaa Forum « AEI sending move failed due to ended session »


   Arimaa Forum
   Arimaa
   Bot Development
(Moderator: supersamu)
   AEI sending move failed due to ended session
« Previous topic | Next topic »
Pages: 1  Reply Reply Notify of replies Notify of replies Send Topic Send Topic Print Print
   Author  Topic: AEI sending move failed due to ended session  (Read 1165 times)
Hippo
Forum Guru
*****




Arimaa player #4450

   


Gender: male
Posts: 883
AEI sending move failed due to ended session
« on: Jun 18th, 2012, 4:56pm »
Quote Quote Modify Modify

Let us discuss solution to the above problem here.
 
... Currently I try to cache the computed move and instead of second running of the engine I send the cached move.
The cache is cleared immediately after successful move sending.
 
Janzert complains there could be problem when two bot instances are playing the same game due to submitting an invalid move. But it seems to me there is no additional problem as the move would be sent anyways.
 
The problem could be in repeated attempt of the move sending, all rejected by an unknown reason, but in that case after 5 attempts the cycle is stopped.
IP Logged

Janzert
Forum Guru
*****



Arimaa player #247

   


Gender: male
Posts: 1016
Re: AEI sending move failed due to ended session
« Reply #1 on: Jun 18th, 2012, 11:09pm »
Quote Quote Modify Modify

I'm not sure I was completely clear on what I think currently happens and what I think any change needs to avoid having happen. So here is the full scenario. The bot is started to provide a move for a game, call it instance A. Accidentally a second instance of the bot is started to provide a move for the same game, instance B. Instance A finishes thinking and sends in a move that is accepted and executed by the server. Instance B then attempts the same thing but the server then ends the game because the bot has submitted an illegal move[1]. This is the scenario I meant bring attention to and make sure couldn't happen.
 
Currently I believe when instance A attempts to submit a move it will error out because its session will have been replaced by the session for instance B.
 
I'm also still rather unclear why you are getting these invalid session errors in the first place. If it's because someone or something is logging into games with the bot's account while the bot is thinking on that game, my first reaction is to just say "don't do that". Smiley
 
Janzert
 
1. This may or may not require that the opponent submit an intervening move between the two move submissions by instance A and B, I don't remember what exactly happens if you try and submit a move during your opponents turn. Either way the interface should make sure it is still safe to send the move that it cached.
IP Logged
Hippo
Forum Guru
*****




Arimaa player #4450

   


Gender: male
Posts: 883
Re: AEI sending move failed due to ended session
« Reply #2 on: Jun 19th, 2012, 1:08am »
Quote Quote Modify Modify

Fortunately running 2 instances on the same comp at the same table seems to be prevented by the stuff in running directory. But I could make caching strategy safe even for the case two comps are playing nonpostal at the same table at the same time (on the same side). Just remember the turn number of the cached move and invalidate the cache of it does not match the table state.
 
I think, the race is avoided by it. Sitting to the table prevents the other instance to communicate so playing the move is safe.
 
Hmmm, idea must be OK, but code still needs debugging.
« Last Edit: Jun 19th, 2012, 1:34am by Hippo » IP Logged

Janzert
Forum Guru
*****



Arimaa player #247

   


Gender: male
Posts: 1016
Re: AEI sending move failed due to ended session
« Reply #3 on: Jun 20th, 2012, 10:41pm »
Quote Quote Modify Modify

Sounds like it should work.  
 
Janzert
IP Logged
Hippo
Forum Guru
*****




Arimaa player #4450

   


Gender: male
Posts: 883
Re: AEI sending move failed due to ended session
« Reply #4 on: Jun 25th, 2012, 5:05pm »
Quote Quote Modify Modify

Hmmm, it solved the problem, but it is not in shape I would like ... now it finishes the turn by 6 "unknown exceptions" instead (it should better detect the move was sent and the loop should be terminated).
IP Logged

Hippo
Forum Guru
*****




Arimaa player #4450

   


Gender: male
Posts: 883
Re: AEI sending move failed due to ended session
« Reply #5 on: Jul 7th, 2012, 12:07pm »
Quote Quote Modify Modify

And my postal controller somehow terminates when there is no postal game for my bot to move.
 
This is why it sometimes does not play move in 8h 4m Wink.
IP Logged

Pages: 1  Reply Reply Notify of replies Notify of replies Send Topic Send Topic Print Print

« Previous topic | Next topic »

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