10-11-2021, 04:54 PM
If you want to use more complex heuristics than those that are available through the metadata, you will indeed have to implement them from scratch in Java. Such custom code would also not be accessible as heuristics through the metadata, and therefore would not be possible to specify in .lud files. This means that you would have to write a custom AI class as well to actually use them.
The source code of all of our existing heuristic terms, which you can find on GitHub (see: https://github.com/Ludeme/Ludii/tree/mas...tics/terms), should be a useful starting point for how to access relevant state variables. For example, our implementation of the Material heuristic will demonstrate how you can access lists of positions occupied by different types of pieces for the different players.
The source code of all of our existing heuristic terms, which you can find on GitHub (see: https://github.com/Ludeme/Ludii/tree/mas...tics/terms), should be a useful starting point for how to access relevant state variables. For example, our implementation of the Material heuristic will demonstrate how you can access lists of positions occupied by different types of pieces for the different players.