Think in opponent's time

Firstly, I am delighted about the idea of using I/O for the interface between the engines. This is really great news. I am still wondering about the rationale of not using I/O for the map as well, but the fact that we are not starting a new process at each round is a really good idea.

My question:

In the starter bot (Java for me), I see that the engine waits for the round number with the sc.nextInt(); command. During this wait, the opponents is of course thinking. Is it allowed to rather use this time to think ahead, rather than wait? (i.e. have that part in a separate thread rather?)

I guess if each engine is in its own container, I can use the resources to its fullest potential, correct?

1 Like

Hi @sparky.

Yes! You’re free to use the resources to the fullest. Since the bot process does not shutdown you can leave computations running to assist in your decision making. However, you will still need the sc.nextInt() since it allows the bot to know the current round, this round is then needed when printing out your command.

Every bot outputs C;<round_number>;<command>. The C;<round_number>; portion is required by the game runner, therefore, your bot needs to know the round.

Have I answered your question?

1 Like

Can we start multiple processes? Python doesn’t have true multi-threading, but it can be achieved by spawning multiple processes rather than threads.

Hi @sentient, yes you are allowed to start multiple processes for your bot.

1 Like