krychu / wfc

Wave Function Collapse library in C, plus a command-line tool

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Wrong entropy calculations

krychu opened this issue · comments

  • Entropy calculations should involve probabilities, not rough frequencies. These values are passed to log which gives different sign for probabilities (<1) and frequencies (>1).
  • I don't see how equations in the original implementation relate to entropy, use Shannon formulation instead.
  • Current implementation runs into rounding issues due to the use of int instead of double.

All in all this impacts the selection of the next cell to collapse. With the fix the frequencies of tiles in the output image should match that of the input image.