Just a simple Julia package to define search spaces for, perhaps, optimization.
Open Julia v1.7 and install using the command:
julia> ]add SearchSpaces
or
julia> import Pkg; Pkg.add("SearchSpaces")
Please, visit the documentation.
Assume the following three search spaces:
Let us define a mixed space
julia> using SearchSpaces
julia> searchspace = MixedSpace(
:X => 10:10:50,
:Y => [:red, :green, :blue],
:Z => 0:0.1:1
);
julia> cardinality(searchspace)
165
julia> rand(searchspace)
Dict{Symbol, Any} with 3 entries:
:Z => 0.1
:X => 50
:Y => :green
julia> collect(Grid(searchspace))
165-element Vector{Any}:
Dict{Symbol, Any}(:Z => 0.0, :X => 10, :Y => :red)
Dict{Symbol, Any}(:Z => 0.1, :X => 10, :Y => :red)
Dict{Symbol, Any}(:Z => 0.2, :X => 10, :Y => :red)
⋮
Dict{Symbol, Any}(:Z => 0.8, :X => 50, :Y => :blue)
Dict{Symbol, Any}(:Z => 0.9, :X => 50, :Y => :blue)
Dict{Symbol, Any}(:Z => 1.0, :X => 50, :Y => :blue)
See here for more examples.
Implemented search spaces:
julia> subtypes(SearchSpaces.AtomicSearchSpace)
4-element Vector{Any}:
BitArraySpace
BoxConstrainedSpace
CombinationSpace
PermutationSpace
And more can be found here.