You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the current implementation, the UniformSolver posts all possible LocalConstraints from scratch:
""" notify_new_nodes(node::AbstractRuleNode, path::Vector{Int})Notify all grammar constraints about the `node` and its (grand)children"""functionnotify_new_nodes(solver::UniformSolver, node::AbstractRuleNode, path::Vector{Int})
for (i, childnode) ∈enumerate(get_children(node))
notify_new_nodes(solver, childnode, push!(copy(path), i))
end
solver.path_to_node[path] = node
solver.node_to_path[node] = path
for c ∈get_grammar(solver).constraints
on_new_node(solver, c, path)
endend
on_new_node(solver, c, path) is responsible for creating a related local constraint.
Target implementation
UniformSolver is instantiated inside another search. The outer search already keeps track of a list of active local constraints. It would be more efficient to copy the list of active constraints from the outer solver instead of trying to post all constraints from scratch.
This can be achieved by accepting a Set{LocalConstraint} in the constructor of the UniformSolver.
And skipping posting new constraints (on_new_node(solver, c, path)).
The text was updated successfully, but these errors were encountered:
In the current implementation, the
UniformSolver
posts all possibleLocalConstraints
from scratch:on_new_node(solver, c, path)
is responsible for creating a related local constraint.Target implementation
UniformSolver
is instantiated inside another search. The outer search already keeps track of a list of active local constraints. It would be more efficient to copy the list of active constraints from the outer solver instead of trying to post all constraints from scratch.This can be achieved by accepting a
Set{LocalConstraint}
in the constructor of theUniformSolver
.And skipping posting new constraints (
on_new_node(solver, c, path)
).The text was updated successfully, but these errors were encountered: