How to use the pyswarms.utils.functions.single_obj.booth function in pyswarms

To help you get started, we’ve selected a few pyswarms examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ljvmiranda921 / pyswarms / tests / utils / functions / test_singleobj_bounds.py View on Github external
def test_booth_bound_fail(outbound):
    """Test booth bound exception"""
    with pytest.raises(ValueError):
        x = outbound(b["booth"].low, b["booth"].high, size=(3, 2))
        fx.booth(x)
github ljvmiranda921 / pyswarms / tests / utils / functions / test_singleobj_return.py View on Github external
def test_booth_output(common_minima2):
    """Test booth function output."""
    assert np.isclose(fx.booth([1, 3] * common_minima2), np.zeros(3)).all()
github ljvmiranda921 / pyswarms / tests / utils / functions / test_singleobj_dims.py View on Github external
def test_booth_dim_fail(outdim):
    """Test booth dim exception"""
    with pytest.raises(IndexError):
        fx.booth(outdim)
github ljvmiranda921 / pyswarms / tests / utils / functions / test_singleobj_returndims.py View on Github external
def test_booth_output_size(common_minima, targetdim):
    """Test booth output size."""
    assert fx.booth(common_minima).shape == targetdim