Herb-AI / HerbConstraints.jl

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

Implement `get_priority` for a constraint schedule order #39

Open Whebon opened 1 month ago

Whebon commented 1 month ago

The order in which scheduled constraints are propagated can have a big impact on the performance. Constraints with strong inference and/or fast propagate methods should be propagated first.

The schedule! method should enqueue constraints according to a priority value:

function schedule!(solver::Solver, constraint::Constraint)
    if constraint ∉ keys(solver.schedule)
        enqueue!(solver.schedule, constraint, 99) #TODO: replace `99` with `get_priority(c)`
    end
end