Details
The penalty computes like sum(w[i] * (x[i]-xfeas[i])**2),
where xfeas
is the closest feasible (in-bounds) solution from x
.
The weight w[i]
should be updated during each iteration using
the update method.
Example:
>>> import cma
>>> cma.fmin(cma.felli, 6 * [1], 1,
... {
... 'boundary_handling': 'BoundPenalty',
... 'bounds': [-1, 1],
... 'fixed_variables': {0: 0.012, 2:0.234}
... })
Reference: Hansen et al 2009, A Method for Handling Uncertainty...
IEEE TEC, with addendum, see
http://www.lri.fr/~hansen/TEC2009online.pdf
|
__init__(self,
bounds=None)
Argument bounds can be None or bounds[0] and bounds[1]
are lower and upper domain boundaries, each is either None or
a scalar or a list or array of appropriate size. |
source code
|
|
|
repair(self,
x,
copy_if_changed=True,
copy_always=False)
sets out-of-bounds components of x on the bounds. |
source code
|
|
|
__call__(self,
x,
archive,
gp)
returns the boundary violation penalty for x ,where x is a
single solution or a list or array of solutions. |
source code
|
|
|
feasible_ratio(self,
solutions)
counts for each coordinate the number of feasible values in
solutions and returns an array of length len(solutions[0])
with the ratios. |
source code
|
|
|
update(self,
function_values,
es)
updates the weights for computing a boundary penalty. |
source code
|
|
Inherited from BoundaryHandlerBase :
get_bounds ,
has_bounds ,
inverse ,
is_in_bounds ,
to_dim_times_two
Inherited from object :
__delattr__ ,
__format__ ,
__getattribute__ ,
__hash__ ,
__new__ ,
__reduce__ ,
__reduce_ex__ ,
__repr__ ,
__setattr__ ,
__sizeof__ ,
__str__ ,
__subclasshook__
|