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

Class _CMAStopDict

source code

object --+    
         |    
      dict --+
             |
            _CMAStopDict

keep and update a termination condition dictionary, which is "usually" empty and returned by CMAEvolutionStrategy.stop(). The class methods entirely depend on CMAEvolutionStrategy class attributes.

Details

This class is not relevant for the end-user and could be a nested class, but nested classes cannot be serialized.

Example

>>> import cma
>>> es = cma.CMAEvolutionStrategy(4 * [1], 1, {'verbose':-1})
>>> print(es.stop())
{}
>>> es.optimize(cma.fcts.sphere, verb_disp=0)
>>> print(es.stop())
{'tolfun': 1e-11}

See Also: OOOptimizer.stop(), CMAEvolutionStrategy.stop()

Instance Methods [hide private]
new empty dictionary

__init__(self, d={})
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
__call__(self, es=None, check=True)
update and return the termination conditions dictionary
source code
 
_update(self, es)
Test termination criteria and update dictionary
source code
 
_addstop(self, key, cond, val=None) source code
None
clear(self)
Remove all items from D.
source code

Inherited from dict: __cmp__, __contains__, __delitem__, __eq__, __ge__, __getattribute__, __getitem__, __gt__, __iter__, __le__, __len__, __lt__, __ne__, __new__, __repr__, __setitem__, __sizeof__, copy, fromkeys, get, has_key, items, iteritems, iterkeys, itervalues, keys, pop, popitem, setdefault, update, values, viewitems, viewkeys, viewvalues

Inherited from object: __delattr__, __format__, __reduce__, __reduce_ex__, __setattr__, __str__, __subclasshook__

Class Variables [hide private]

Inherited from dict: __hash__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, d={})
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Returns:
new empty dictionary

Overrides: object.__init__
(inherited documentation)

clear(self)

source code 

Remove all items from D.

Returns: None
Overrides: dict.clear
(inherited documentation)