Skip to content

Commit 975df5d

Browse files
authored
Merge branch 'main' into dev
2 parents 3469100 + 7e8f095 commit 975df5d

File tree

2 files changed

+27
-18
lines changed

2 files changed

+27
-18
lines changed

src/discrete.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ ArbitraryDomain(elements) = ArbitraryDomain(Set(elements))
3131
"""
3232
domain(values)
3333
domain(range::R) where {T <: Real, R <: AbstractRange{T}}
34-
Construct either a `SetDomain` or a `RangeDomain``.
34+
Construct either a `SetDomain` or a `RangeDomain`.
3535
```julia
3636
d1 = domain(1:5)
3737
d2 = domain([53.69, 89.2, 0.12])

src/explore.jl

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

88
"""
9-
ExploreSettings(
10-
domains;
11-
complete_search_limit = 10^6,
12-
max_samplings = sum(domain_size, domains),
13-
search = :flexible,
14-
solutions_limit = floor(Int, sqrt(max_samplings)),
15-
)
16-
17-
Settings for the exploration of a search space composed by a collection of domains.
9+
ExploreSettings(domains;
10+
complete_search_limit = 10^6,
11+
max_samplings = sum(domain_size, domains),
12+
search = :flexible,
13+
solutions_limit = floor(Int, sqrt(max_samplings)))
14+
15+
Create an `ExploreSettings` object to configure the exploration of a search space composed of a collection of domains.
16+
17+
# Arguments
18+
- `domains`: A collection of domains to be explored.
19+
- `complete_search_limit`: An integer specifying the maximum limit for complete search iterations. Default is 10^6.
20+
- `max_samplings`: An integer specifying the maximum number of samplings. Default is the sum of domain sizes.
21+
- `search`: A symbol indicating the type of search to perform. Default is `:flexible`.
22+
- `solutions_limit`: An integer specifying the limit on the number of solutions. Default is the floor of the square root of `max_samplings`.
23+
24+
# Returns
25+
- `ExploreSettings` object with the specified settings.
1826
"""
1927
function ExploreSettings(
2028
domains;
@@ -153,17 +161,18 @@ function explore!(explorer::Explorer)
153161
end
154162

155163
"""
156-
explore(domains, concept, param = nothing; search_limit = 1000, solutions_limit = 100)
164+
explore(domains, concept; settings = ExploreSettings(domains), parameters...)
157165
158-
Search (a part of) a search space and returns a pair of vector of configurations: `(solutions, non_solutions)`. If the search space size is over `search_limit`, then both `solutions` and `non_solutions` are limited to `solutions_limit`.
166+
Search (a part of) a search space and return a pair of vectors of configurations: `(solutions, non_solutions)`. The exploration behavior is determined based on the `settings`.
159167
160-
Beware that if the density of the solutions in the search space is low, `solutions_limit` needs to be reduced. This process will be automatic in the future (simple reinforcement learning).
168+
# Arguments
169+
- `domains`: A collection of domains to be explored.
170+
- `concept`: The concept representing the constraint to be targeted.
171+
- `settings`: An optional `ExploreSettings` object to configure the exploration. Default is `ExploreSettings(domains)`.
172+
- `parameters...`: Additional parameters for the `concept`.
161173
162-
# Arguments:
163-
- `domains`: a collection of domains
164-
- `concept`: the concept of the targeted constraint
165-
- `param`: an optional parameter of the constraint
166-
- `sol_number`: the required number of solutions (half of the number of configurations), default to `100`
174+
# Returns
175+
- A tuple of sets: `(solutions, non_solutions)`.
167176
"""
168177
function explore(domains, concept; settings = ExploreSettings(domains), parameters...)
169178
f = x -> concept(x; parameters...)

0 commit comments

Comments
 (0)