01-29-2020, 07:40 PM
Good idea, we'll include that. Probably in our next version.
Hmm, will have to put some thought into exactly when we call the method though. In the case of programmatic users of Ludii (using Ludii as a library for experiments etc.), it's fairly simple.
When loading the AI in the GUI (for instance for human vs. AI playing), there are some subtleties. In a normal game from start to finish, we always call the init at start, and could call close at the end (or right before the next init I suppose). But if a human chooses to step back a few moves, and then the AI starts playing again from that previous point onwards, we also always call initAI() again. The built-in MCTSes use this for example to ensure they stop using a now-invalid search tree built up from previous turns. This means we could also get closeAI() calls in the middle of a game sometimes. Not really a problem I suppose, just something to keep in mind...
Hmm, will have to put some thought into exactly when we call the method though. In the case of programmatic users of Ludii (using Ludii as a library for experiments etc.), it's fairly simple.
When loading the AI in the GUI (for instance for human vs. AI playing), there are some subtleties. In a normal game from start to finish, we always call the init at start, and could call close at the end (or right before the next init I suppose). But if a human chooses to step back a few moves, and then the AI starts playing again from that previous point onwards, we also always call initAI() again. The built-in MCTSes use this for example to ensure they stop using a now-invalid search tree built up from previous turns. This means we could also get closeAI() calls in the middle of a game sometimes. Not really a problem I suppose, just something to keep in mind...