The map tiles are defined in an xml file. If a tile on the map is found in a pool, a tile from the pool is assigned randomly.
I used it only for Tokuno, therefore the sizes are defined directly into the code.
The locations where changes have to be made for other maps are marked.
The package contains the source code (c#) and an example for the pools.xml file.