Output visualisation
The auxiliary package ConsensusBasedXPlots.jl provides routines to visualise the output of minimise
for problems in one or two dimensions. These routines are kept as a separate package in order to minimise the dependencies of ConsensusBasedX.jl, since not every user will require visualisation tools.
To plot the output of CBO, simply run minimise
with extended_output = true
(see Extended output), and then call the plot_CBO
method:
out = minimise(f, D = 2, extended_output = true)
using ConsensusBasedXPlots
plot_CBO(out)
Examples in one dimension
Full example
using ConsensusBasedX, ConsensusBasedXPlots
f(x) = ConsensusBasedX.Ackley(x, shift = 1)
out = minimise(f, D = 1, extended_output = true)
plot_CBO(out)
savefig("CBO_1D")
and in two dimensions
Full example
using ConsensusBasedX, ConsensusBasedXPlots
f(x) = ConsensusBasedX.Ackley(x, shift = 1)
out = minimise(f, D = 2, extended_output = true)
plot_CBO(out)
savefig("CBO_2D")