Herb-AI / HerbConstraints.jl

Constraints for Herb.jl
https://herb-ai.github.io/
MIT License
0 stars 0 forks source link

Cache the tree size in the GenericSolver #52

Open Whebon opened 1 month ago

Whebon commented 1 month ago
"""
    function get_tree_size(solver::GenericSolver)::Int

Returns the number of [`AbstractRuleNode`](@ref)s in the tree.
"""
function get_tree_size(solver::GenericSolver)::Int
    #TODO: optimization: precompute/cache the size of the tree
    return length(get_tree(solver))
end