class BoundaryHandlerBase(object):
Known subclasses: cma.constraints_handler.BoundNone
, cma.constraints_handler.BoundPenalty
, cma.constraints_handler.BoundTransform
Constructor: BoundaryHandlerBase(bounds)
quick hack versatile base class
Method | __call__ |
return penalty or list of penalties, by default zero(s). |
Method | __init__ |
bounds are not copied, but possibly modified and put into a normalized form: bounds can be None or [lb, ub] where lb and ub are either None or a vector (which can have None entries). |
Method | amend |
set bounds away from at=0.5 such that |
Method | get |
return lower and upper bound of variable with index index |
Method | get |
get_bounds('lower', 8) returns the lower bounds in 8-D |
Method | has |
return True if any variable is bounded |
Method | idx |
return index list of out-of-bound values in x . |
Method | inverse |
inverse of repair if it exists, at least it should hold repair == repair o inverse o repair |
Method | is |
not yet tested |
Method | repair |
projects infeasible values on the domain bound, might be overwritten by derived class |
Method | to |
return boundaries in format [[lb0, ub0], [lb1, ub1], ...], as used by BoxConstraints... class. |
Method | update |
end-iteration callback of boundary handler (abstract/empty) |
Instance Variable | bounds |
Undocumented |
Method | _get |
ib == 0/1 means lower/upper bound, return a vector of length dimension |
cma.constraints_handler.BoundPenalty
return penalty or list of penalties, by default zero(s).
This interface seems too specifically tailored to the derived BoundPenalty class, it should maybe change.
cma.constraints_handler.BoundNone
, cma.constraints_handler.BoundPenalty
, cma.constraints_handler.BoundTransform
bounds are not copied, but possibly modified and put into a normalized form: bounds can be None or [lb, ub] where lb and ub are either None or a vector (which can have None entries).
Generally, the last entry is recycled to compute bounds for any dimension.
set bounds away from at=0.5 such that
a repaired solution is always rounded into the feasible domain.
return index list of out-of-bound values in x
.
if bounds.idx_out_of_bounds evaluates to True
if and only if
x
is out of bounds.
cma.constraints_handler.BoundTransform
inverse of repair if it exists, at least it should hold repair == repair o inverse o repair
cma.constraints_handler.BoundPenalty
end-iteration callback of boundary handler (abstract/empty)