ZDT Benchmarks¶
The ZDT (Zitzler, Deb, and Thiele) benchmark collection contains all functions from the ZDT benchmark suite. Python implementation is derived from the optproblems python library.
Sources:
Zitzler, E., Deb, K., and Thiele, L. (2000). Comparison of Multiobjective Evolutionary Algorithms: Empirical Results. Evolutionary Computation 8(2).
Available Problems¶
bocode.Synthetics.ZDT.ZDT1bocode.Synthetics.ZDT.ZDT2bocode.Synthetics.ZDT.ZDT3bocode.Synthetics.ZDT.ZDT4bocode.Synthetics.ZDT.ZDT5ZDT 5 accepts 80 bits as input, automatically splitting it into the necessary sublists. See example below.
bocode.Synthetics.ZDT.ZDT6
Example Usage¶
import bocode
import torch
# Retrieve available dimensions for instantiation
available_dimensions = bocode.Synthetics.ZDT.ZDT1.available_dimensions
# Create a ZDT benchmark problem
problem = bocode.Synthetics.ZDT.ZDT1(dim=5)
# Get problem information
bounds = problem.bounds
# Evaluate at a point
x = torch.Tensor([[0.5] * problem.dim])
values, constraints = problem.evaluate(x)
print(f"First ZDT function values at [0.5]*5: {values[0]}")
Output:
First ZDT function values at [0.5]*5: tensor([0.5000, 3.8417])
Example Usage of ZDT5¶
import bocode
import torch
# Create a ZDT5 benchmark problem
problem = bocode.Synthetics.ZDT.ZDT5()
# Get problem information
bounds = problem.bounds
# Evaluate using 80 random bits of 0s and 1s
x = torch.randint(0, 2, (1, 80))
values, constraints = problem.evaluate(x)
print(f"ZDT5 function values at x: {values[0]}")
Output:
ZDT5 function values at x: tensor([10.0000, 4.5000])