Skip to content

What optimizations are in place in MarkovJunior? #58

Answered by kaya3
zylkowski asked this question in Q&A
Discussion options

You must be logged in to vote

From my understanding, there are separate algorithms for the initial scan and for updates. (I'll write as if it's 2D for simplicity.)

The initial scan looks at cells on a rectangular lattice, spaced IMX, IMY apart. It is guaranteed that every match of the pattern overlaps exactly one lattice cell. For each lattice cell, check its colour, and check which offsets in the pattern that that colour can appear at. For each of those possible offsets, do a straightforward check of every cell in the pattern to check for a match at the offset position. (The straightforward check does short-circuit when a non-matching cell is found.)

The update is run for each individual cell that changes. Again, it …

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by mxgmn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants