08-16-2021, 04:20 PM
Different AI objects really should be completely isolated, they should not have any references to each other. Certainly on of our AI classes (like our MCTS) should not be able to have a reference to your own custom AI classes, and I can't really envision how they would be able to trigger such method calls on your AI. Any such calls should happen through the GUI, and like you said, then the issue should be consistent regardless of which opponent AI there is.
We cannot replicate any such issue on our end, though there might be a possibility that some of our changes in the past few weeks (after our latest release) changed something there, so either way it'd be good to test again when we release a new version.
Just to be sure: how are you determining that these methods are being called on your specific AI? Are you doing it in a way that ensures that you only see if when there are calls really on your AI object, for example by putting prints in the overridden method in your own new, custom class? Or are you checking in some other way, like just counting how many initAI() / closeAI() calls there are on *any* AI object? Because in that case, you could definitely see more calls than you'd expect. Our Ludii AI is a wrapper around another AI object, so calls on a LudiiAI object will always get "duplicated" by it calling the same methods on its nested/inner AI. The Biased MCTS objects have SoftmaxPolicy objects inside them, which they in turn also call init/close methods on.
We cannot replicate any such issue on our end, though there might be a possibility that some of our changes in the past few weeks (after our latest release) changed something there, so either way it'd be good to test again when we release a new version.
Just to be sure: how are you determining that these methods are being called on your specific AI? Are you doing it in a way that ensures that you only see if when there are calls really on your AI object, for example by putting prints in the overridden method in your own new, custom class? Or are you checking in some other way, like just counting how many initAI() / closeAI() calls there are on *any* AI object? Because in that case, you could definitely see more calls than you'd expect. Our Ludii AI is a wrapper around another AI object, so calls on a LudiiAI object will always get "duplicated" by it calling the same methods on its nested/inner AI. The Biased MCTS objects have SoftmaxPolicy objects inside them, which they in turn also call init/close methods on.