Skip to content

Commit b84388f

Browse files
authored
Merge pull request #66 from JuliaConstraints/check
Update to check satisfaction in ConstraintExplorer
2 parents feb220d + a10a514 commit b84388f

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

src/explore.jl

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ struct ExploreSettings
66
end
77

88
"""
9-
ExploreSettings(domains;
10-
complete_search_limit = 10^6,
11-
max_samplings = sum(domain_size, domains),
12-
search = :flexible,
9+
ExploreSettings(domains;
10+
complete_search_limit = 10^6,
11+
max_samplings = sum(domain_size, domains),
12+
search = :flexible,
1313
solutions_limit = floor(Int, sqrt(max_samplings)))
1414
1515
Create an `ExploreSettings` object to configure the exploration of a search space composed of a collection of domains.
@@ -124,7 +124,7 @@ end
124124
125125
Internals of the `explore` function. Behavior is automatically adjusted on the kind of exploration: `:flexible`, `:complete`, `:partial`.
126126
"""
127-
function _explore!(explorer, f, ::Val{:partial})
127+
function _explore!(explorer, f, ::Val{:partial};)
128128
sl = explorer.settings.solutions_limit
129129
ms = explorer.settings.max_samplings
130130

@@ -181,6 +181,16 @@ function explore(domains, concept; settings = ExploreSettings(domains), paramete
181181
return explorer.state.solutions, explorer.state.non_solutions
182182
end
183183

184+
function _check!(explorer, configurations)
185+
g =
186+
x -> all([
187+
f(isempty(vars) ? x : @view x[vars]) for
188+
(f, vars) in explorer.concepts |> values
189+
])
190+
foreach(c -> update_exploration!(explorer, g, c, :complete), configurations)
191+
return nothing
192+
end
193+
184194
## SECTION - Test Items
185195
@testitem "Exploration" tags = [:exploration] begin
186196
domains = [domain([1, 2, 3, 4]) for i = 1:4]

0 commit comments

Comments
 (0)