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

remove use_uniformsolver parameter from GenericSolver #70

Merged
merged 2 commits into from
Feb 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "HerbConstraints"
uuid = "1fa96474-3206-4513-b4fa-23913f296dfc"
authors = ["Jaap de Jong <[email protected]>"]
version = "0.2.5"
version = "0.3.0"

[deps]
DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
Expand Down
9 changes: 4 additions & 5 deletions src/solver/generic_solver/generic_solver.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ mutable struct GenericSolver <: Solver
state::Union{SolverState, Nothing}
schedule::PriorityQueue{AbstractLocalConstraint, Int}
statistics::Union{SolverStatistics, Nothing}
use_uniformsolver::Bool
fix_point_running::Bool
max_size::Int
max_depth::Int
Expand All @@ -30,9 +29,9 @@ end

Constructs a new solver, with an initial state using starting symbol `sym`
"""
function GenericSolver(grammar::AbstractGrammar, sym::Symbol; with_statistics=false, use_uniformsolver=true, max_size = typemax(Int), max_depth = typemax(Int))
function GenericSolver(grammar::AbstractGrammar, sym::Symbol; with_statistics=false, max_size = typemax(Int), max_depth = typemax(Int))
init_node = Hole(get_domain(grammar, sym))
GenericSolver(grammar, init_node, with_statistics=with_statistics, use_uniformsolver=use_uniformsolver, max_size = max_size, max_depth = max_depth)
GenericSolver(grammar, init_node, with_statistics=with_statistics, max_size = max_size, max_depth = max_depth)
end


Expand All @@ -41,9 +40,9 @@ end

Constructs a new solver, with an initial state of the provided [`AbstractRuleNode`](@ref).
"""
function GenericSolver(grammar::AbstractGrammar, init_node::AbstractRuleNode; with_statistics=false, use_uniformsolver=true, max_size = typemax(Int), max_depth = typemax(Int))
function GenericSolver(grammar::AbstractGrammar, init_node::AbstractRuleNode; with_statistics=false, max_size = typemax(Int), max_depth = typemax(Int))
stats = with_statistics ? SolverStatistics() : nothing
solver = GenericSolver(grammar, nothing, PriorityQueue{AbstractLocalConstraint, Int}(), stats, use_uniformsolver, false, max_size, max_depth)
solver = GenericSolver(grammar, nothing, PriorityQueue{AbstractLocalConstraint, Int}(), stats, false, max_size, max_depth)
new_state!(solver, init_node)
return solver
end
Expand Down