call

RestartEveryNFailed.call(state, best_state)[source]

Calls the restart function. If the number of consecutively rejected iterations is larger than max_it, the best_state is returned. Otherwise the state is returned.

Parameters

stateState

The state accepted or rejected state.

best_stateState

The best state until now.

Returns

stateState

Either the state or best_state.