Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How does the ancestry cache work? #130

Open
lunik1 opened this issue Dec 9, 2020 · 0 comments
Open

How does the ancestry cache work? #130

lunik1 opened this issue Dec 9, 2020 · 0 comments

Comments

@lunik1
Copy link

lunik1 commented Dec 9, 2020

I am having trouble understanding how to use the ancestry cache, and the docs are not very clear. I assume it must be populated using ancestry-add however doing this the obvious way results in an error:

(ancestry-add (ancestry-new) :child1 :parent1 :parent2)
Execution error (IllegalArgumentException) at loom.alg-generic/ancestry-add (alg_generic.cljc:558).
Key must be integer

ancestry-add only seems to work if the parent nodes already exist in the cache, but then the cache does not properly reflect the hierarchy:

(ancestor? (ancestry-add (ancestry-add (ancestry-add (ancestry-new) :child) :parent) :child :parent) :child :parent)
false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant