Module cma :: Class BoundaryHandlerBase
[hide private]
[frames] | no frames]

Class BoundaryHandlerBase

source code

object --+
         |
        BoundaryHandlerBase
Known Subclasses:

hacked base class
Instance Methods [hide private]
 
__init__(self, bounds)
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).
source code
 
__call__(self, solutions, *args, **kwargs)
return penalty or list of penalties, by default zero(s).
source code
 
update(self, *args, **kwargs) source code
 
repair(self, x, copy_if_changed=True, copy_always=False)
projects infeasible values on the domain bound, might be overwritten by derived class
source code
 
inverse(self, y, copy_if_changed=True, copy_always=False) source code
 
get_bounds(self, which, dimension)
get_bounds('lower', 8) returns the lower bounds in 8-D
source code
 
_get_bounds(self, ib, dimension)
ib == 0/1 means lower/upper bound, return a vector of length dimension
source code
 
has_bounds(self)
return True, if any variable is bounded
source code
 
is_in_bounds(self, x)
not yet tested
source code
 
to_dim_times_two(self, bounds)
return boundaries in format [[lb0, ub0], [lb1, ub1], ...], as used by BoxConstraints... class.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, bounds)
(Constructor)

source code 

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.

Overrides: object.__init__

__call__(self, solutions, *args, **kwargs)
(Call operator)

source code 

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.