Source code for siconos.control.controller

# This file was automatically generated by SWIG (http://www.swig.org).
# Version 4.0.2
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.

from sys import version_info as _swig_python_version_info
if _swig_python_version_info < (2, 7, 0):
    raise RuntimeError("Python 2.7 or later required")

# Import the low-level C/C++ module
if __package__ or "." in __name__:
    from . import _pycontroller
else:
    import _pycontroller

try:
    import builtins as __builtin__
except ImportError:
    import __builtin__

def _swig_repr(self):
    try:
        strthis = "proxy of " + self.this.__repr__()
    except __builtin__.Exception:
        strthis = ""
    return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)


def _swig_setattr_nondynamic_instance_variable(set):
    def set_instance_attr(self, name, value):
        if name == "thisown":
            self.this.own(value)
        elif name == "this":
            set(self, name, value)
        elif hasattr(self, name) and isinstance(getattr(type(self), name), property):
            set(self, name, value)
        else:
            raise AttributeError("You cannot add instance attributes to %s" % self)
    return set_instance_attr


def _swig_setattr_nondynamic_class_variable(set):
    def set_class_attr(cls, name, value):
        if hasattr(cls, name) and not isinstance(getattr(cls, name), property):
            set(cls, name, value)
        else:
            raise AttributeError("You cannot add class attributes to %s" % cls)
    return set_class_attr


def _swig_add_metaclass(metaclass):
    """Class decorator for adding a metaclass to a SWIG wrapped class - a slimmed down version of six.add_metaclass"""
    def wrapper(cls):
        return metaclass(cls.__name__, cls.__bases__, cls.__dict__.copy())
    return wrapper


class _SwigNonDynamicMeta(type):
    """Meta class to enforce nondynamic attributes (no new attributes) for a class"""
    __setattr__ = _swig_setattr_nondynamic_class_variable(type.__setattr__)


import weakref

class SwigPyIterator(object):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def __init__(self, *args, **kwargs):
        raise AttributeError("No constructor defined - class is abstract")
    __repr__ = _swig_repr
    __swig_destroy__ = _pycontroller.delete_SwigPyIterator

    def value(self) -> "PyObject *":
        return _pycontroller.SwigPyIterator_value(self)

    def incr(self, n: "size_t"=1) -> "swig::SwigPyIterator *":
        return _pycontroller.SwigPyIterator_incr(self, n)

    def decr(self, n: "size_t"=1) -> "swig::SwigPyIterator *":
        return _pycontroller.SwigPyIterator_decr(self, n)

    def distance(self, x: "SwigPyIterator") -> "ptrdiff_t":
        return _pycontroller.SwigPyIterator_distance(self, x)

    def equal(self, x: "SwigPyIterator") -> "bool":
        return _pycontroller.SwigPyIterator_equal(self, x)

    def copy(self) -> "swig::SwigPyIterator *":
        return _pycontroller.SwigPyIterator_copy(self)

    def next(self) -> "PyObject *":
        return _pycontroller.SwigPyIterator_next(self)

    def __next__(self) -> "PyObject *":
        return _pycontroller.SwigPyIterator___next__(self)

    def previous(self) -> "PyObject *":
        return _pycontroller.SwigPyIterator_previous(self)

    def advance(self, n: "ptrdiff_t") -> "swig::SwigPyIterator *":
        return _pycontroller.SwigPyIterator_advance(self, n)

    def __eq__(self, x: "SwigPyIterator") -> "bool":
        return _pycontroller.SwigPyIterator___eq__(self, x)

    def __ne__(self, x: "SwigPyIterator") -> "bool":
        return _pycontroller.SwigPyIterator___ne__(self, x)

    def __iadd__(self, n: "ptrdiff_t") -> "swig::SwigPyIterator &":
        return _pycontroller.SwigPyIterator___iadd__(self, n)

    def __isub__(self, n: "ptrdiff_t") -> "swig::SwigPyIterator &":
        return _pycontroller.SwigPyIterator___isub__(self, n)

    def __add__(self, n: "ptrdiff_t") -> "swig::SwigPyIterator *":
        return _pycontroller.SwigPyIterator___add__(self, n)

    def __sub__(self, *args) -> "ptrdiff_t":
        return _pycontroller.SwigPyIterator___sub__(self, *args)
    def __iter__(self):
        return self

# Register SwigPyIterator in _pycontroller:
_pycontroller.SwigPyIterator_swigregister(SwigPyIterator)

SHARED_PTR_DISOWN = _pycontroller.SHARED_PTR_DISOWN
[docs]class nullDeleter(object): r""" Using a shared_ptr to hold a pointer to a statically allocated object use create<type>SPtr(<type> &x) cf http://www.boost.org/doc/ """ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined") __repr__ = _swig_repr def __call__(self, arg2: "void const *") -> "void": return _pycontroller.nullDeleter___call__(self, arg2) __swig_destroy__ = _pycontroller.delete_nullDeleter
# Register nullDeleter in _pycontroller: _pycontroller.nullDeleter_swigregister(nullDeleter) class VectorOfVectors(object): thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr def iterator(self) -> "swig::SwigPyIterator *": return _pycontroller.VectorOfVectors_iterator(self) def __iter__(self): return self.iterator() def __nonzero__(self) -> "bool": return _pycontroller.VectorOfVectors___nonzero__(self) def __bool__(self) -> "bool": return _pycontroller.VectorOfVectors___bool__(self) def __len__(self) -> "std::vector< std::shared_ptr< SiconosVector > >::size_type": return _pycontroller.VectorOfVectors___len__(self) def __getslice__(self, i: "std::vector< std::shared_ptr< SiconosVector > >::difference_type", j: "std::vector< std::shared_ptr< SiconosVector > >::difference_type") -> "std::vector< std::shared_ptr< SiconosVector >,std::allocator< std::shared_ptr< SiconosVector > > > *": return _pycontroller.VectorOfVectors___getslice__(self, i, j) def __setslice__(self, *args) -> "void": return _pycontroller.VectorOfVectors___setslice__(self, *args) def __delslice__(self, i: "std::vector< std::shared_ptr< SiconosVector > >::difference_type", j: "std::vector< std::shared_ptr< SiconosVector > >::difference_type") -> "void": return _pycontroller.VectorOfVectors___delslice__(self, i, j) def __delitem__(self, *args) -> "void": return _pycontroller.VectorOfVectors___delitem__(self, *args) def __getitem__(self, *args) -> "std::vector< std::shared_ptr< SiconosVector > >::value_type const &": return _pycontroller.VectorOfVectors___getitem__(self, *args) def __setitem__(self, *args) -> "void": return _pycontroller.VectorOfVectors___setitem__(self, *args) def pop(self) -> "std::vector< std::shared_ptr< SiconosVector > >::value_type": return _pycontroller.VectorOfVectors_pop(self) def append(self, x: "std::vector< std::shared_ptr< SiconosVector > >::value_type const &") -> "void": return _pycontroller.VectorOfVectors_append(self, x) def empty(self) -> "bool": return _pycontroller.VectorOfVectors_empty(self) def size(self) -> "std::vector< std::shared_ptr< SiconosVector > >::size_type": return _pycontroller.VectorOfVectors_size(self) def swap(self, v: "VectorOfVectors") -> "void": return _pycontroller.VectorOfVectors_swap(self, v) def begin(self) -> "std::vector< std::shared_ptr< SiconosVector > >::iterator": return _pycontroller.VectorOfVectors_begin(self) def end(self) -> "std::vector< std::shared_ptr< SiconosVector > >::iterator": return _pycontroller.VectorOfVectors_end(self) def rbegin(self) -> "std::vector< std::shared_ptr< SiconosVector > >::reverse_iterator": return _pycontroller.VectorOfVectors_rbegin(self) def rend(self) -> "std::vector< std::shared_ptr< SiconosVector > >::reverse_iterator": return _pycontroller.VectorOfVectors_rend(self) def clear(self) -> "void": return _pycontroller.VectorOfVectors_clear(self) def get_allocator(self) -> "std::vector< std::shared_ptr< SiconosVector > >::allocator_type": return _pycontroller.VectorOfVectors_get_allocator(self) def pop_back(self) -> "void": return _pycontroller.VectorOfVectors_pop_back(self) def erase(self, *args) -> "std::vector< std::shared_ptr< SiconosVector > >::iterator": return _pycontroller.VectorOfVectors_erase(self, *args) def __init__(self, *args): _pycontroller.VectorOfVectors_swiginit(self, _pycontroller.new_VectorOfVectors(*args)) def push_back(self, x: "std::vector< std::shared_ptr< SiconosVector > >::value_type const &") -> "void": return _pycontroller.VectorOfVectors_push_back(self, x) def front(self) -> "std::vector< std::shared_ptr< SiconosVector > >::value_type const &": return _pycontroller.VectorOfVectors_front(self) def back(self) -> "std::vector< std::shared_ptr< SiconosVector > >::value_type const &": return _pycontroller.VectorOfVectors_back(self) def assign(self, n: "std::vector< std::shared_ptr< SiconosVector > >::size_type", x: "std::vector< std::shared_ptr< SiconosVector > >::value_type const &") -> "void": return _pycontroller.VectorOfVectors_assign(self, n, x) def resize(self, *args) -> "void": return _pycontroller.VectorOfVectors_resize(self, *args) def insert(self, *args) -> "void": return _pycontroller.VectorOfVectors_insert(self, *args) def reserve(self, n: "std::vector< std::shared_ptr< SiconosVector > >::size_type") -> "void": return _pycontroller.VectorOfVectors_reserve(self, n) def capacity(self) -> "std::vector< std::shared_ptr< SiconosVector > >::size_type": return _pycontroller.VectorOfVectors_capacity(self) __swig_destroy__ = _pycontroller.delete_VectorOfVectors # Register VectorOfVectors in _pycontroller: _pycontroller.VectorOfVectors_swigregister(VectorOfVectors) class VectorOfBlockVectors(object): thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr def iterator(self) -> "swig::SwigPyIterator *": return _pycontroller.VectorOfBlockVectors_iterator(self) def __iter__(self): return self.iterator() def __nonzero__(self) -> "bool": return _pycontroller.VectorOfBlockVectors___nonzero__(self) def __bool__(self) -> "bool": return _pycontroller.VectorOfBlockVectors___bool__(self) def __len__(self) -> "std::vector< std::shared_ptr< BlockVector > >::size_type": return _pycontroller.VectorOfBlockVectors___len__(self) def __getslice__(self, i: "std::vector< std::shared_ptr< BlockVector > >::difference_type", j: "std::vector< std::shared_ptr< BlockVector > >::difference_type") -> "std::vector< std::shared_ptr< BlockVector >,std::allocator< std::shared_ptr< BlockVector > > > *": return _pycontroller.VectorOfBlockVectors___getslice__(self, i, j) def __setslice__(self, *args) -> "void": return _pycontroller.VectorOfBlockVectors___setslice__(self, *args) def __delslice__(self, i: "std::vector< std::shared_ptr< BlockVector > >::difference_type", j: "std::vector< std::shared_ptr< BlockVector > >::difference_type") -> "void": return _pycontroller.VectorOfBlockVectors___delslice__(self, i, j) def __delitem__(self, *args) -> "void": return _pycontroller.VectorOfBlockVectors___delitem__(self, *args) def __getitem__(self, *args) -> "std::vector< std::shared_ptr< BlockVector > >::value_type const &": return _pycontroller.VectorOfBlockVectors___getitem__(self, *args) def __setitem__(self, *args) -> "void": return _pycontroller.VectorOfBlockVectors___setitem__(self, *args) def pop(self) -> "std::vector< std::shared_ptr< BlockVector > >::value_type": return _pycontroller.VectorOfBlockVectors_pop(self) def append(self, x: "std::vector< std::shared_ptr< BlockVector > >::value_type const &") -> "void": return _pycontroller.VectorOfBlockVectors_append(self, x) def empty(self) -> "bool": return _pycontroller.VectorOfBlockVectors_empty(self) def size(self) -> "std::vector< std::shared_ptr< BlockVector > >::size_type": return _pycontroller.VectorOfBlockVectors_size(self) def swap(self, v: "VectorOfBlockVectors") -> "void": return _pycontroller.VectorOfBlockVectors_swap(self, v) def begin(self) -> "std::vector< std::shared_ptr< BlockVector > >::iterator": return _pycontroller.VectorOfBlockVectors_begin(self) def end(self) -> "std::vector< std::shared_ptr< BlockVector > >::iterator": return _pycontroller.VectorOfBlockVectors_end(self) def rbegin(self) -> "std::vector< std::shared_ptr< BlockVector > >::reverse_iterator": return _pycontroller.VectorOfBlockVectors_rbegin(self) def rend(self) -> "std::vector< std::shared_ptr< BlockVector > >::reverse_iterator": return _pycontroller.VectorOfBlockVectors_rend(self) def clear(self) -> "void": return _pycontroller.VectorOfBlockVectors_clear(self) def get_allocator(self) -> "std::vector< std::shared_ptr< BlockVector > >::allocator_type": return _pycontroller.VectorOfBlockVectors_get_allocator(self) def pop_back(self) -> "void": return _pycontroller.VectorOfBlockVectors_pop_back(self) def erase(self, *args) -> "std::vector< std::shared_ptr< BlockVector > >::iterator": return _pycontroller.VectorOfBlockVectors_erase(self, *args) def __init__(self, *args): _pycontroller.VectorOfBlockVectors_swiginit(self, _pycontroller.new_VectorOfBlockVectors(*args)) def push_back(self, x: "std::vector< std::shared_ptr< BlockVector > >::value_type const &") -> "void": return _pycontroller.VectorOfBlockVectors_push_back(self, x) def front(self) -> "std::vector< std::shared_ptr< BlockVector > >::value_type const &": return _pycontroller.VectorOfBlockVectors_front(self) def back(self) -> "std::vector< std::shared_ptr< BlockVector > >::value_type const &": return _pycontroller.VectorOfBlockVectors_back(self) def assign(self, n: "std::vector< std::shared_ptr< BlockVector > >::size_type", x: "std::vector< std::shared_ptr< BlockVector > >::value_type const &") -> "void": return _pycontroller.VectorOfBlockVectors_assign(self, n, x) def resize(self, *args) -> "void": return _pycontroller.VectorOfBlockVectors_resize(self, *args) def insert(self, *args) -> "void": return _pycontroller.VectorOfBlockVectors_insert(self, *args) def reserve(self, n: "std::vector< std::shared_ptr< BlockVector > >::size_type") -> "void": return _pycontroller.VectorOfBlockVectors_reserve(self, n) def capacity(self) -> "std::vector< std::shared_ptr< BlockVector > >::size_type": return _pycontroller.VectorOfBlockVectors_capacity(self) __swig_destroy__ = _pycontroller.delete_VectorOfBlockVectors # Register VectorOfBlockVectors in _pycontroller: _pycontroller.VectorOfBlockVectors_swigregister(VectorOfBlockVectors) class VectorOfMatrices(object): thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr def iterator(self) -> "swig::SwigPyIterator *": return _pycontroller.VectorOfMatrices_iterator(self) def __iter__(self): return self.iterator() def __nonzero__(self) -> "bool": return _pycontroller.VectorOfMatrices___nonzero__(self) def __bool__(self) -> "bool": return _pycontroller.VectorOfMatrices___bool__(self) def __len__(self) -> "std::vector< std::shared_ptr< SiconosMatrix > >::size_type": return _pycontroller.VectorOfMatrices___len__(self) def __getslice__(self, i: "std::vector< std::shared_ptr< SiconosMatrix > >::difference_type", j: "std::vector< std::shared_ptr< SiconosMatrix > >::difference_type") -> "std::vector< std::shared_ptr< SiconosMatrix >,std::allocator< std::shared_ptr< SiconosMatrix > > > *": return _pycontroller.VectorOfMatrices___getslice__(self, i, j) def __setslice__(self, *args) -> "void": return _pycontroller.VectorOfMatrices___setslice__(self, *args) def __delslice__(self, i: "std::vector< std::shared_ptr< SiconosMatrix > >::difference_type", j: "std::vector< std::shared_ptr< SiconosMatrix > >::difference_type") -> "void": return _pycontroller.VectorOfMatrices___delslice__(self, i, j) def __delitem__(self, *args) -> "void": return _pycontroller.VectorOfMatrices___delitem__(self, *args) def __getitem__(self, *args) -> "std::vector< std::shared_ptr< SiconosMatrix > >::value_type const &": return _pycontroller.VectorOfMatrices___getitem__(self, *args) def __setitem__(self, *args) -> "void": return _pycontroller.VectorOfMatrices___setitem__(self, *args) def pop(self) -> "std::vector< std::shared_ptr< SiconosMatrix > >::value_type": return _pycontroller.VectorOfMatrices_pop(self) def append(self, x: "std::vector< std::shared_ptr< SiconosMatrix > >::value_type const &") -> "void": return _pycontroller.VectorOfMatrices_append(self, x) def empty(self) -> "bool": return _pycontroller.VectorOfMatrices_empty(self) def size(self) -> "std::vector< std::shared_ptr< SiconosMatrix > >::size_type": return _pycontroller.VectorOfMatrices_size(self) def swap(self, v: "VectorOfMatrices") -> "void": return _pycontroller.VectorOfMatrices_swap(self, v) def begin(self) -> "std::vector< std::shared_ptr< SiconosMatrix > >::iterator": return _pycontroller.VectorOfMatrices_begin(self) def end(self) -> "std::vector< std::shared_ptr< SiconosMatrix > >::iterator": return _pycontroller.VectorOfMatrices_end(self) def rbegin(self) -> "std::vector< std::shared_ptr< SiconosMatrix > >::reverse_iterator": return _pycontroller.VectorOfMatrices_rbegin(self) def rend(self) -> "std::vector< std::shared_ptr< SiconosMatrix > >::reverse_iterator": return _pycontroller.VectorOfMatrices_rend(self) def clear(self) -> "void": return _pycontroller.VectorOfMatrices_clear(self) def get_allocator(self) -> "std::vector< std::shared_ptr< SiconosMatrix > >::allocator_type": return _pycontroller.VectorOfMatrices_get_allocator(self) def pop_back(self) -> "void": return _pycontroller.VectorOfMatrices_pop_back(self) def erase(self, *args) -> "std::vector< std::shared_ptr< SiconosMatrix > >::iterator": return _pycontroller.VectorOfMatrices_erase(self, *args) def __init__(self, *args): _pycontroller.VectorOfMatrices_swiginit(self, _pycontroller.new_VectorOfMatrices(*args)) def push_back(self, x: "std::vector< std::shared_ptr< SiconosMatrix > >::value_type const &") -> "void": return _pycontroller.VectorOfMatrices_push_back(self, x) def front(self) -> "std::vector< std::shared_ptr< SiconosMatrix > >::value_type const &": return _pycontroller.VectorOfMatrices_front(self) def back(self) -> "std::vector< std::shared_ptr< SiconosMatrix > >::value_type const &": return _pycontroller.VectorOfMatrices_back(self) def assign(self, n: "std::vector< std::shared_ptr< SiconosMatrix > >::size_type", x: "std::vector< std::shared_ptr< SiconosMatrix > >::value_type const &") -> "void": return _pycontroller.VectorOfMatrices_assign(self, n, x) def resize(self, *args) -> "void": return _pycontroller.VectorOfMatrices_resize(self, *args) def insert(self, *args) -> "void": return _pycontroller.VectorOfMatrices_insert(self, *args) def reserve(self, n: "std::vector< std::shared_ptr< SiconosMatrix > >::size_type") -> "void": return _pycontroller.VectorOfMatrices_reserve(self, n) def capacity(self) -> "std::vector< std::shared_ptr< SiconosMatrix > >::size_type": return _pycontroller.VectorOfMatrices_capacity(self) __swig_destroy__ = _pycontroller.delete_VectorOfMatrices # Register VectorOfMatrices in _pycontroller: _pycontroller.VectorOfMatrices_swigregister(VectorOfMatrices) class VectorOfSMatrices(object): thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr def iterator(self) -> "swig::SwigPyIterator *": return _pycontroller.VectorOfSMatrices_iterator(self) def __iter__(self): return self.iterator() def __nonzero__(self) -> "bool": return _pycontroller.VectorOfSMatrices___nonzero__(self) def __bool__(self) -> "bool": return _pycontroller.VectorOfSMatrices___bool__(self) def __len__(self) -> "std::vector< std::shared_ptr< SimpleMatrix > >::size_type": return _pycontroller.VectorOfSMatrices___len__(self) def __getslice__(self, i: "std::vector< std::shared_ptr< SimpleMatrix > >::difference_type", j: "std::vector< std::shared_ptr< SimpleMatrix > >::difference_type") -> "std::vector< std::shared_ptr< SimpleMatrix >,std::allocator< std::shared_ptr< SimpleMatrix > > > *": return _pycontroller.VectorOfSMatrices___getslice__(self, i, j) def __setslice__(self, *args) -> "void": return _pycontroller.VectorOfSMatrices___setslice__(self, *args) def __delslice__(self, i: "std::vector< std::shared_ptr< SimpleMatrix > >::difference_type", j: "std::vector< std::shared_ptr< SimpleMatrix > >::difference_type") -> "void": return _pycontroller.VectorOfSMatrices___delslice__(self, i, j) def __delitem__(self, *args) -> "void": return _pycontroller.VectorOfSMatrices___delitem__(self, *args) def __getitem__(self, *args) -> "std::vector< std::shared_ptr< SimpleMatrix > >::value_type const &": return _pycontroller.VectorOfSMatrices___getitem__(self, *args) def __setitem__(self, *args) -> "void": return _pycontroller.VectorOfSMatrices___setitem__(self, *args) def pop(self) -> "std::vector< std::shared_ptr< SimpleMatrix > >::value_type": return _pycontroller.VectorOfSMatrices_pop(self) def append(self, x: "std::vector< std::shared_ptr< SimpleMatrix > >::value_type const &") -> "void": return _pycontroller.VectorOfSMatrices_append(self, x) def empty(self) -> "bool": return _pycontroller.VectorOfSMatrices_empty(self) def size(self) -> "std::vector< std::shared_ptr< SimpleMatrix > >::size_type": return _pycontroller.VectorOfSMatrices_size(self) def swap(self, v: "VectorOfSMatrices") -> "void": return _pycontroller.VectorOfSMatrices_swap(self, v) def begin(self) -> "std::vector< std::shared_ptr< SimpleMatrix > >::iterator": return _pycontroller.VectorOfSMatrices_begin(self) def end(self) -> "std::vector< std::shared_ptr< SimpleMatrix > >::iterator": return _pycontroller.VectorOfSMatrices_end(self) def rbegin(self) -> "std::vector< std::shared_ptr< SimpleMatrix > >::reverse_iterator": return _pycontroller.VectorOfSMatrices_rbegin(self) def rend(self) -> "std::vector< std::shared_ptr< SimpleMatrix > >::reverse_iterator": return _pycontroller.VectorOfSMatrices_rend(self) def clear(self) -> "void": return _pycontroller.VectorOfSMatrices_clear(self) def get_allocator(self) -> "std::vector< std::shared_ptr< SimpleMatrix > >::allocator_type": return _pycontroller.VectorOfSMatrices_get_allocator(self) def pop_back(self) -> "void": return _pycontroller.VectorOfSMatrices_pop_back(self) def erase(self, *args) -> "std::vector< std::shared_ptr< SimpleMatrix > >::iterator": return _pycontroller.VectorOfSMatrices_erase(self, *args) def __init__(self, *args): _pycontroller.VectorOfSMatrices_swiginit(self, _pycontroller.new_VectorOfSMatrices(*args)) def push_back(self, x: "std::vector< std::shared_ptr< SimpleMatrix > >::value_type const &") -> "void": return _pycontroller.VectorOfSMatrices_push_back(self, x) def front(self) -> "std::vector< std::shared_ptr< SimpleMatrix > >::value_type const &": return _pycontroller.VectorOfSMatrices_front(self) def back(self) -> "std::vector< std::shared_ptr< SimpleMatrix > >::value_type const &": return _pycontroller.VectorOfSMatrices_back(self) def assign(self, n: "std::vector< std::shared_ptr< SimpleMatrix > >::size_type", x: "std::vector< std::shared_ptr< SimpleMatrix > >::value_type const &") -> "void": return _pycontroller.VectorOfSMatrices_assign(self, n, x) def resize(self, *args) -> "void": return _pycontroller.VectorOfSMatrices_resize(self, *args) def insert(self, *args) -> "void": return _pycontroller.VectorOfSMatrices_insert(self, *args) def reserve(self, n: "std::vector< std::shared_ptr< SimpleMatrix > >::size_type") -> "void": return _pycontroller.VectorOfSMatrices_reserve(self, n) def capacity(self) -> "std::vector< std::shared_ptr< SimpleMatrix > >::size_type": return _pycontroller.VectorOfSMatrices_capacity(self) __swig_destroy__ = _pycontroller.delete_VectorOfSMatrices # Register VectorOfSMatrices in _pycontroller: _pycontroller.VectorOfSMatrices_swigregister(VectorOfSMatrices) class VectorOfMemories(object): thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr def iterator(self) -> "swig::SwigPyIterator *": return _pycontroller.VectorOfMemories_iterator(self) def __iter__(self): return self.iterator() def __nonzero__(self) -> "bool": return _pycontroller.VectorOfMemories___nonzero__(self) def __bool__(self) -> "bool": return _pycontroller.VectorOfMemories___bool__(self) def __len__(self) -> "std::vector< SiconosMemory >::size_type": return _pycontroller.VectorOfMemories___len__(self) def __getslice__(self, i: "std::vector< SiconosMemory >::difference_type", j: "std::vector< SiconosMemory >::difference_type") -> "std::vector< SiconosMemory,std::allocator< SiconosMemory > > *": return _pycontroller.VectorOfMemories___getslice__(self, i, j) def __setslice__(self, *args) -> "void": return _pycontroller.VectorOfMemories___setslice__(self, *args) def __delslice__(self, i: "std::vector< SiconosMemory >::difference_type", j: "std::vector< SiconosMemory >::difference_type") -> "void": return _pycontroller.VectorOfMemories___delslice__(self, i, j) def __delitem__(self, *args) -> "void": return _pycontroller.VectorOfMemories___delitem__(self, *args) def __getitem__(self, *args) -> "std::vector< SiconosMemory >::value_type const &": return _pycontroller.VectorOfMemories___getitem__(self, *args) def __setitem__(self, *args) -> "void": return _pycontroller.VectorOfMemories___setitem__(self, *args) def pop(self) -> "std::vector< SiconosMemory >::value_type": return _pycontroller.VectorOfMemories_pop(self) def append(self, x: "SiconosMemory") -> "void": return _pycontroller.VectorOfMemories_append(self, x) def empty(self) -> "bool": return _pycontroller.VectorOfMemories_empty(self) def size(self) -> "std::vector< SiconosMemory >::size_type": return _pycontroller.VectorOfMemories_size(self) def swap(self, v: "VectorOfMemories") -> "void": return _pycontroller.VectorOfMemories_swap(self, v) def begin(self) -> "std::vector< SiconosMemory >::iterator": return _pycontroller.VectorOfMemories_begin(self) def end(self) -> "std::vector< SiconosMemory >::iterator": return _pycontroller.VectorOfMemories_end(self) def rbegin(self) -> "std::vector< SiconosMemory >::reverse_iterator": return _pycontroller.VectorOfMemories_rbegin(self) def rend(self) -> "std::vector< SiconosMemory >::reverse_iterator": return _pycontroller.VectorOfMemories_rend(self) def clear(self) -> "void": return _pycontroller.VectorOfMemories_clear(self) def get_allocator(self) -> "std::vector< SiconosMemory >::allocator_type": return _pycontroller.VectorOfMemories_get_allocator(self) def pop_back(self) -> "void": return _pycontroller.VectorOfMemories_pop_back(self) def erase(self, *args) -> "std::vector< SiconosMemory >::iterator": return _pycontroller.VectorOfMemories_erase(self, *args) def __init__(self, *args): _pycontroller.VectorOfMemories_swiginit(self, _pycontroller.new_VectorOfMemories(*args)) def push_back(self, x: "SiconosMemory") -> "void": return _pycontroller.VectorOfMemories_push_back(self, x) def front(self) -> "std::vector< SiconosMemory >::value_type const &": return _pycontroller.VectorOfMemories_front(self) def back(self) -> "std::vector< SiconosMemory >::value_type const &": return _pycontroller.VectorOfMemories_back(self) def assign(self, n: "std::vector< SiconosMemory >::size_type", x: "SiconosMemory") -> "void": return _pycontroller.VectorOfMemories_assign(self, n, x) def resize(self, *args) -> "void": return _pycontroller.VectorOfMemories_resize(self, *args) def insert(self, *args) -> "void": return _pycontroller.VectorOfMemories_insert(self, *args) def reserve(self, n: "std::vector< SiconosMemory >::size_type") -> "void": return _pycontroller.VectorOfMemories_reserve(self, n) def capacity(self) -> "std::vector< SiconosMemory >::size_type": return _pycontroller.VectorOfMemories_capacity(self) __swig_destroy__ = _pycontroller.delete_VectorOfMemories # Register VectorOfMemories in _pycontroller: _pycontroller.VectorOfMemories_swigregister(VectorOfMemories) class UnsignedIntVector(object): thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr def iterator(self) -> "swig::SwigPyIterator *": return _pycontroller.UnsignedIntVector_iterator(self) def __iter__(self): return self.iterator() def __nonzero__(self) -> "bool": return _pycontroller.UnsignedIntVector___nonzero__(self) def __bool__(self) -> "bool": return _pycontroller.UnsignedIntVector___bool__(self) def __len__(self) -> "std::vector< unsigned int >::size_type": return _pycontroller.UnsignedIntVector___len__(self) def __getslice__(self, i: "std::vector< unsigned int >::difference_type", j: "std::vector< unsigned int >::difference_type") -> "std::vector< unsigned int,std::allocator< unsigned int > > *": return _pycontroller.UnsignedIntVector___getslice__(self, i, j) def __setslice__(self, *args) -> "void": return _pycontroller.UnsignedIntVector___setslice__(self, *args) def __delslice__(self, i: "std::vector< unsigned int >::difference_type", j: "std::vector< unsigned int >::difference_type") -> "void": return _pycontroller.UnsignedIntVector___delslice__(self, i, j) def __delitem__(self, *args) -> "void": return _pycontroller.UnsignedIntVector___delitem__(self, *args) def __getitem__(self, *args) -> "std::vector< unsigned int >::value_type const &": return _pycontroller.UnsignedIntVector___getitem__(self, *args) def __setitem__(self, *args) -> "void": return _pycontroller.UnsignedIntVector___setitem__(self, *args) def pop(self) -> "std::vector< unsigned int >::value_type": return _pycontroller.UnsignedIntVector_pop(self) def append(self, x: "std::vector< unsigned int >::value_type const &") -> "void": return _pycontroller.UnsignedIntVector_append(self, x) def empty(self) -> "bool": return _pycontroller.UnsignedIntVector_empty(self) def size(self) -> "std::vector< unsigned int >::size_type": return _pycontroller.UnsignedIntVector_size(self) def swap(self, v: "UnsignedIntVector") -> "void": return _pycontroller.UnsignedIntVector_swap(self, v) def begin(self) -> "std::vector< unsigned int >::iterator": return _pycontroller.UnsignedIntVector_begin(self) def end(self) -> "std::vector< unsigned int >::iterator": return _pycontroller.UnsignedIntVector_end(self) def rbegin(self) -> "std::vector< unsigned int >::reverse_iterator": return _pycontroller.UnsignedIntVector_rbegin(self) def rend(self) -> "std::vector< unsigned int >::reverse_iterator": return _pycontroller.UnsignedIntVector_rend(self) def clear(self) -> "void": return _pycontroller.UnsignedIntVector_clear(self) def get_allocator(self) -> "std::vector< unsigned int >::allocator_type": return _pycontroller.UnsignedIntVector_get_allocator(self) def pop_back(self) -> "void": return _pycontroller.UnsignedIntVector_pop_back(self) def erase(self, *args) -> "std::vector< unsigned int >::iterator": return _pycontroller.UnsignedIntVector_erase(self, *args) def __init__(self, *args): _pycontroller.UnsignedIntVector_swiginit(self, _pycontroller.new_UnsignedIntVector(*args)) def push_back(self, x: "std::vector< unsigned int >::value_type const &") -> "void": return _pycontroller.UnsignedIntVector_push_back(self, x) def front(self) -> "std::vector< unsigned int >::value_type const &": return _pycontroller.UnsignedIntVector_front(self) def back(self) -> "std::vector< unsigned int >::value_type const &": return _pycontroller.UnsignedIntVector_back(self) def assign(self, n: "std::vector< unsigned int >::size_type", x: "std::vector< unsigned int >::value_type const &") -> "void": return _pycontroller.UnsignedIntVector_assign(self, n, x) def resize(self, *args) -> "void": return _pycontroller.UnsignedIntVector_resize(self, *args) def insert(self, *args) -> "void": return _pycontroller.UnsignedIntVector_insert(self, *args) def reserve(self, n: "std::vector< unsigned int >::size_type") -> "void": return _pycontroller.UnsignedIntVector_reserve(self, n) def capacity(self) -> "std::vector< unsigned int >::size_type": return _pycontroller.UnsignedIntVector_capacity(self) __swig_destroy__ = _pycontroller.delete_UnsignedIntVector # Register UnsignedIntVector in _pycontroller: _pycontroller.UnsignedIntVector_swigregister(UnsignedIntVector) import siconos.kernel
[docs]class Actuator(object): r""" Actuators Base Class Abstract class, interface to user-defined actuators. An Actuator is dedicated to act on parameters of the Model (especially z param. in DynamicalSystem) according to some specific values recorded thanks to sensors. It gives an interface for User who can implement its own Actuator. clearly define which data he needs to save. An Actuator handles a TimeDiscretisation, which defines the set of all instants where the Actuator must operate (i.e. each times where actuate() function will be called). An Event, inserted into the EventsManager of the Simulation, is linked to this TimeDiscretisation. Moreover, an Actuator is identified thanks to an id and a type (a number associated to the derived class type indeed). Construction To build an Actuator it is necessary to use the factory. Inputs are a number which identify the derived class type and a TimeDiscretisation: .. code-block:: c++ Get the registry ActuatorFactory::Registry& regActuator(ActuatorFactory::Registry::get()) ; Build an Actuator of type "myType" with t as a TimeDiscretisation. regActuator.instantiate(myType, t); The best way is to use the controlManager: .. code-block:: c++ cm a ControlManager cm->addActuator(myType,t); or if cm has already been initialized: cm->addAndRecordActuator(myType,t) """ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined - class is abstract") __repr__ = _swig_repr __swig_destroy__ = _pycontroller.delete_Actuator
[docs] def setId(self, newId: "std::string const &") -> "void": r""" set id of the Actuator :type newId: string :param newId: the new id. """ return _pycontroller.Actuator_setId(self, newId)
[docs] def getId(self) -> "std::string const": r""" get id of the Actuator :rtype: string :return: a std::string """ return _pycontroller.Actuator_getId(self)
[docs] def getType(self) -> "unsigned int": r""" get the type of the Actuator (ie class name) :rtype: int :return: an integer """ return _pycontroller.Actuator_getType(self)
[docs] def u(self) -> "SiconosVector const &": r""" Get the control value :rtype: :py:class:`SiconosVector` :return: current control value u """ return _pycontroller.Actuator_u(self)
[docs] def setSizeu(self, size: "unsigned int") -> "void": r""" Set the control size :type size: int :param size: dimension of the control input u """ return _pycontroller.Actuator_setSizeu(self, size)
[docs] def setB(self, B: "SP::SimpleMatrix") -> "void": r""" Set the B matrix :type B: :py:class:`SimpleMatrix` :param B: the new B matrix """ return _pycontroller.Actuator_setB(self, B)
[docs] def setg(self, g: "std::string const &") -> "void": r""" Set the name of the plugin for computing g :type g: string :param g: the name of the plugin to compute g """ return _pycontroller.Actuator_setg(self, g)
[docs] def addSensorPtr(self, newSensor: "SP::ControlSensor") -> "void": r""" add a Sensor in the actuator. :type newSensor: ControlSensor :param newSensor: a Sensor that will be connected to the Actuator """ return _pycontroller.Actuator_addSensorPtr(self, newSensor)
[docs] def setTimeDiscretisation(self, td: "TimeDiscretisation") -> "void": r""" This is derived in child classes if they need to copy the TimeDiscretisation associated with this Actuator :type td: :py:class:`TimeDiscretisation` :param td: the TimeDiscretisation for this Actuator """ return _pycontroller.Actuator_setTimeDiscretisation(self, td)
[docs] def initialize(self, nsds: "NonSmoothDynamicalSystem", s: "Simulation") -> "void": r""" initialize actuator data. :type nsds: :py:class:`NonSmoothDynamicalSystem` :param nsds: the NonSmoothDynamicalSystem :type s: :py:class:`Simulation` :param s: the simulation """ return _pycontroller.Actuator_initialize(self, nsds, s)
[docs] def actuate(self) -> "void": r""" capture data when the ActuatorEvent is processed""" return _pycontroller.Actuator_actuate(self)
[docs] def display(self) -> "void": r""" display the data of the Actuator on the standard output""" return _pycontroller.Actuator_display(self)
[docs] def getInternalNSDS(self) -> "SP::NonSmoothDynamicalSystem": r""" get the NSDS used in the Controller, if there is one :rtype: :py:class:`NonSmoothDynamicalSystem` :return: "NULL" shared_ptr if there is no internal simulation, otherwise it returns the Model hoding the simulation """ return _pycontroller.Actuator_getInternalNSDS(self)
# Register Actuator in _pycontroller: _pycontroller.Actuator_swigregister(Actuator)
[docs]class PID(Actuator): thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr def __init__(self, *args): r""" Constructor. :type sensor: ControlSensor :param sensor: the ControlSensor feeding the Actuator :type B: :py:class:`SimpleMatrix`, optional :param B: the B matrix """ if self.__class__ == PID: _self = None else: _self = self _pycontroller.PID_swiginit(self, _pycontroller.new_PID(_self, *args)) __swig_destroy__ = _pycontroller.delete_PID
[docs] def initialize(self, nsds: "NonSmoothDynamicalSystem", s: "Simulation") -> "void": r""" initialize actuator data. :type nsds: :py:class:`NonSmoothDynamicalSystem` :param nsds: a NonSmoothDynamicalSystem :type s: :py:class:`Simulation` :param s: the simulation """ return _pycontroller.PID_initialize(self, nsds, s)
[docs] def actuate(self) -> "void": r""" Compute the new control law at each event Here we are using the following formula: :math:`u_k = u_{k-1} + c_1 e_k + c_2 e_{k-1} + c_3 e_{k-2}` , where .. math:: c_1 &= K_P - \frac{K_D}{\Delta t} + K_I \Delta t \\ c_2 &= -1 - \frac{2K_D}{\Delta t} \\ c_3 &= \frac{K_D}{\Delta t} """ return _pycontroller.PID_actuate(self)
[docs] def setK(self, K: "SP::SiconosVector") -> "void": r""" Set K :type K: :py:class:`SiconosVector` :param K: SP::SiconosVector :math:`[K_P, K_I, K_D]` """ return _pycontroller.PID_setK(self, K)
[docs] def setRef(self, reference: "double") -> "void": r""" Set the value of _ref to reference :type reference: float :param reference: the new value """ return _pycontroller.PID_setRef(self, reference)
[docs] def setTimeDiscretisation(self, td: "TimeDiscretisation") -> "void": r""" Get the timestep from the TimeDiscretisation associated with this PID controller :type td: :py:class:`TimeDiscretisation` :param td: the TimeDiscretisation for this Actuator """ return _pycontroller.PID_setTimeDiscretisation(self, td)
def setDeltaT(self, deltaT: "double") -> "void": return _pycontroller.PID_setDeltaT(self, deltaT)
[docs] def display(self) -> "void": r""" display the data of the Actuator on the standard output""" return _pycontroller.PID_display(self)
def __disown__(self): self.this.disown() _pycontroller.disown_PID(self) return weakref.proxy(self)
# Register PID in _pycontroller: _pycontroller.PID_swigregister(PID)
[docs]class CommonSMC(Actuator): thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr _indx = property(_pycontroller.CommonSMC__indx_get, _pycontroller.CommonSMC__indx_set, doc=r""" index for saving data""") _plugineName = property(_pycontroller.CommonSMC__plugineName_get, _pycontroller.CommonSMC__plugineName_set, doc=r""" name of the plugin to add a term to the sliding variable; useful when doing trajectory tracking""") _pluginhName = property(_pycontroller.CommonSMC__pluginhName_get, _pycontroller.CommonSMC__pluginhName_set, doc=r""" name of the plugin to compute :math:`y = h(x, ...)` for the nonlinear case""") _pluginJachxName = property(_pycontroller.CommonSMC__pluginJachxName_get, _pycontroller.CommonSMC__pluginJachxName_set, doc=r""" name of the plugin to compute :math:`\nabla_x h` for the nonlinear case""") _pluginJachlambdaName = property(_pycontroller.CommonSMC__pluginJachlambdaName_get, _pycontroller.CommonSMC__pluginJachlambdaName_set, doc=r""" name of the plugin to compute :math:`\nabla_\lambda h` for the nonlinear case""") _pluginJacglambdaName = property(_pycontroller.CommonSMC__pluginJacglambdaName_get, _pycontroller.CommonSMC__pluginJacglambdaName_set, doc=r""" name of the plugin to compute :math:`\nabla_\lambda g` for the nonlinear case""") _Csurface = property(_pycontroller.CommonSMC__Csurface_get, _pycontroller.CommonSMC__Csurface_set, doc=r""" the vector defining the linear contribution of the state to the sliding variable ( :math:`\sigma = Cx` )""") _D = property(_pycontroller.CommonSMC__D_get, _pycontroller.CommonSMC__D_set, doc=r""" matrix describing the influence of :math:`lambda` on :math:`\sigma`""") _alpha = property(_pycontroller.CommonSMC__alpha_get, _pycontroller.CommonSMC__alpha_set, doc=r""" scalar multiplying Sign; :math:`u^s = - \alpha Sign`""") _relationSMC = property(_pycontroller.CommonSMC__relationSMC_get, _pycontroller.CommonSMC__relationSMC_set, doc=r""" the Relation for the Controller""") _interactionSMC = property(_pycontroller.CommonSMC__interactionSMC_get, _pycontroller.CommonSMC__interactionSMC_set, doc=r""" Interaction for the control""") _lambda = property(_pycontroller.CommonSMC__lambda_get, _pycontroller.CommonSMC__lambda_set, doc=r""" easy access to lambda""") _numericsSolverId = property(_pycontroller.CommonSMC__numericsSolverId_get, _pycontroller.CommonSMC__numericsSolverId_set, doc=r""" Relay solver type""") _precision = property(_pycontroller.CommonSMC__precision_get, _pycontroller.CommonSMC__precision_set, doc=r""" Numerical precision expected for the Relay solver""") _nsdsSMC = property(_pycontroller.CommonSMC__nsdsSMC_get, _pycontroller.CommonSMC__nsdsSMC_set, doc=r""" the nsds for the controller""") _DS_SMC = property(_pycontroller.CommonSMC__DS_SMC_get, _pycontroller.CommonSMC__DS_SMC_set, doc=r""" the DynamicalSystem for the controller""") _td = property(_pycontroller.CommonSMC__td_get, _pycontroller.CommonSMC__td_set, doc=r""" the TimeDiscretisation for the controller""") _simulationSMC = property(_pycontroller.CommonSMC__simulationSMC_get, _pycontroller.CommonSMC__simulationSMC_set, doc=r""" Simulation for the controller""") _integratorSMC = property(_pycontroller.CommonSMC__integratorSMC_get, _pycontroller.CommonSMC__integratorSMC_set, doc=r""" Integrator for the controller""") _thetaSMC = property(_pycontroller.CommonSMC__thetaSMC_get, _pycontroller.CommonSMC__thetaSMC_set, doc=r""" Theta for the controller""") _OSNSPB_SMC = property(_pycontroller.CommonSMC__OSNSPB_SMC_get, _pycontroller.CommonSMC__OSNSPB_SMC_set, doc=r""" OneStepNsProblem for the controller""") _eventsManager = property(_pycontroller.CommonSMC__eventsManager_get, _pycontroller.CommonSMC__eventsManager_set, doc=r""" SP::EventsManager of the SMC Simulation""") _nsLawSMC = property(_pycontroller.CommonSMC__nsLawSMC_get, _pycontroller.CommonSMC__nsLawSMC_set, doc=r""" SP::NonSmoothLaw for computing the control law""") _invCB = property(_pycontroller.CommonSMC__invCB_get, _pycontroller.CommonSMC__invCB_set, doc=r""" inverse of CB""") _ueq = property(_pycontroller.CommonSMC__ueq_get, _pycontroller.CommonSMC__ueq_set, doc=r""" Store :math:`u^{eq}`""") _us = property(_pycontroller.CommonSMC__us_get, _pycontroller.CommonSMC__us_set, doc=r""" Store :math:`u^s`""") _noUeq = property(_pycontroller.CommonSMC__noUeq_get, _pycontroller.CommonSMC__noUeq_set, doc=r""" Do not use the state-continuous equivaluent control :math:`u^{eq}`""") _computeResidus = property(_pycontroller.CommonSMC__computeResidus_get, _pycontroller.CommonSMC__computeResidus_set, doc=r""" If true perform the computation of the residus in the Newton loop if needed""")
[docs] def computeUeq(self) -> "void": r""" Compute the equivalent part of the control :math:`u^{eq}`. The method used here is to discretize the continuous-time formula using a theta method """ return _pycontroller.CommonSMC_computeUeq(self)
def __init__(self, *args): r""" *Overload 1:* General constructor :type type: int :param type: the type of the SMC Actuator :type sensor: ControlSensor :param sensor: the ControlSensor feeding the Actuator | *Overload 2:* Constructor for dynamics affine in control :type type: int :param type: the type of the SMC Actuator :type sensor: ControlSensor :param sensor: the ControlSensor feeding the Actuator :type B: :py:class:`SimpleMatrix` :param B: the matrix multiplying the control input :type D: :py:class:`SimpleMatrix`, optional :param D: the saturation matrix (optional) | *Overload 3:* Constructor for dynamics affine in control :type type: int :param type: the type of the SMC Actuator :type sensor: ControlSensor :param sensor: the ControlSensor feeding the Actuator :type B: :py:class:`SimpleMatrix` :param B: the matrix multiplying the control input :param D: the saturation matrix (optional) """ if self.__class__ == CommonSMC: _self = None else: _self = self _pycontroller.CommonSMC_swiginit(self, _pycontroller.new_CommonSMC(_self, *args))
[docs] def actuate(self) -> "void": r""" Compute the new control law at each event""" return _pycontroller.CommonSMC_actuate(self)
[docs] def initialize(self, nsds: "NonSmoothDynamicalSystem", s: "Simulation") -> "void": r""" Initialization :type nsds: :py:class:`NonSmoothDynamicalSystem` :param nsds: current nonsmooth dynamical system :type s: :py:class:`Simulation` :param s: current simulation setup """ return _pycontroller.CommonSMC_initialize(self, nsds, s)
def sete(self, plugin: "std::string const &") -> "void": return _pycontroller.CommonSMC_sete(self, plugin) def seth(self, plugin: "std::string const &") -> "void": return _pycontroller.CommonSMC_seth(self, plugin) def setJachx(self, plugin: "std::string const &") -> "void": return _pycontroller.CommonSMC_setJachx(self, plugin) def setJachlambda(self, plugin: "std::string const &") -> "void": return _pycontroller.CommonSMC_setJachlambda(self, plugin)
[docs] def setg(self, plugin: "std::string const &") -> "void": return _pycontroller.CommonSMC_setg(self, plugin)
def setJacgx(self, plugin: "std::string const &") -> "void": return _pycontroller.CommonSMC_setJacgx(self, plugin) def setJacglambda(self, plugin: "std::string const &") -> "void": return _pycontroller.CommonSMC_setJacglambda(self, plugin)
[docs] def setCsurface(self, Csurface: "SP::SimpleMatrix") -> "void": r""" Set Csurface :type Csurface: :py:class:`SimpleMatrix` :param Csurface: a SP::SimpleMatrix containing the new value for _Csurface """ return _pycontroller.CommonSMC_setCsurface(self, Csurface)
[docs] def setSaturationMatrix(self, newSat: "SP::SimpleMatrix") -> "void": r""" Set _D to pointer newPtr :type newSat: :py:class:`SimpleMatrix` :param newSat: a SP::SimpleMatrix containing the new value for _D """ return _pycontroller.CommonSMC_setSaturationMatrix(self, newSat)
[docs] def setAlpha(self, alpha: "double") -> "void": r""" Set _alpha :type alpha: float :param alpha: the new value for _alpha """ return _pycontroller.CommonSMC_setAlpha(self, alpha)
[docs] def lambda_(self) -> "SP::SiconosVector": r""" get _lambda :rtype: :py:class:`SiconosVector` :return: a pointer to _lambda """ return _pycontroller.CommonSMC_lambda_(self)
[docs] def setSolver(self, numericsSolverId: "int const") -> "void": r""" Set the solver :type numericsSolverId: int :param numericsSolverId: the solver for the relay """ return _pycontroller.CommonSMC_setSolver(self, numericsSolverId)
[docs] def setPrecision(self, newPrecision: "double") -> "void": r""" Set the precision :type newPrecision: float :param newPrecision: a double """ return _pycontroller.CommonSMC_setPrecision(self, newPrecision)
[docs] def relay(self) -> "LinearOSNS const &": r""" Get the OneStepNSProblem problem associated with the controller. This is useful to gain access to the data given to the solver in Numerics :rtype: :py:class:`LinearOSNS` :return: a reference to the LinearOSNS problem """ return _pycontroller.CommonSMC_relay(self)
[docs] def ueq(self) -> "SiconosVector &": r""" get :math:`u^{eq}` :rtype: :py:class:`SiconosVector` :return: a reference to _ueq """ return _pycontroller.CommonSMC_ueq(self)
[docs] def us(self) -> "SiconosVector &": r""" get :math:`u^{s}` :rtype: :py:class:`SiconosVector` :return: a reference to _us """ return _pycontroller.CommonSMC_us(self)
[docs] def setTheta(self, newTheta: "double") -> "void": r""" Set _theta, used in some discretization method for :math:`u^{eq}` :type newTheta: float :param newTheta: the new value for _thetaSMC """ return _pycontroller.CommonSMC_setTheta(self, newTheta)
[docs] def noUeq(self, b: "bool") -> "void": r""" Disable (or enable) the use of the state-continuous control :math:`u^{eq}` :type b: boolean :param b: disable the use of Ueq if true """ return _pycontroller.CommonSMC_noUeq(self, b)
[docs] def setComputeResidus(self, b: "bool") -> "void": r""" Disable (or enable) the computation of the residus on the Newton loop. This has an incidence only if the Relation is nonlinear :type b: boolean :param b: disable the computation of the residus """ return _pycontroller.CommonSMC_setComputeResidus(self, b)
[docs] def setTimeDiscretisation(self, td: "TimeDiscretisation") -> "void": r""" This is derived in child classes if they need to copy the TimeDiscretisation associated with this Sensor :type td: :py:class:`TimeDiscretisation` :param td: the TimeDiscretisation for this Sensor """ return _pycontroller.CommonSMC_setTimeDiscretisation(self, td)
[docs] def setDS(self, ds: "SP::FirstOrderNonLinearDS") -> "void": r""" Set the DynamicalSystem used to compute the control law. This is useful when we have a Nonlinear problem and we need to compute the control law with an approximate model, or when the dynamics are quite different. :type ds: :py:class:`FirstOrderNonLinearDS` :param ds: the DynamicalSystem to be used in the Controller """ return _pycontroller.CommonSMC_setDS(self, ds)
[docs] def getInternalNSDS(self) -> "SP::NonSmoothDynamicalSystem": r""" get the NSDS used in the SMC :rtype: :py:class:`NonSmoothDynamicalSystem` :return: the NSDS used in the SMC """ return _pycontroller.CommonSMC_getInternalNSDS(self)
[docs] def getInternalOSI(self) -> "OneStepIntegrator &": r""" get the Integrator used in the SMC :rtype: :py:class:`OneStepIntegrator` :return: the Integrator used in the SMC """ return _pycontroller.CommonSMC_getInternalOSI(self)
__swig_destroy__ = _pycontroller.delete_CommonSMC def __disown__(self): self.this.disown() _pycontroller.disown_CommonSMC(self) return weakref.proxy(self)
# Register CommonSMC in _pycontroller: _pycontroller.CommonSMC_swigregister(CommonSMC)
[docs]class LinearSMC(CommonSMC): r""" Linear sliding mode controller This controller implements the following sliding mode control strategy: .. math:: \begin{equation} u = u_{\mathrm{eq}} + u_s\qquad\text{where}\begin{cases} u_{\mathrm{eq}} \text{is the equivalent control input}\\u_s = -sgn(\sigma)\end{cases},\end{equation} where :math:`\sigma = Cx` is the user-defined sliding variable. """ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr def __init__(self, *args): r""" *Overload 1:* default constructor | *Overload 2:* Constructor for the ActuatorFactory :type sensor: ControlSensor :param sensor: the ControlSensor feeding the Actuator :type type: int, optional :param type: do not set this yourself ! this is used in derived classes | *Overload 3:* Constructor for the ActuatorFactory :type sensor: ControlSensor :param sensor: the ControlSensor feeding the Actuator :param type: do not set this yourself ! this is used in derived classes | *Overload 4:* Constructor with all the data :type sensor: ControlSensor :param sensor: the ControlSensor feeding the Actuator :type B: :py:class:`SimpleMatrix` :param B: the matrix :type D: :py:class:`SimpleMatrix`, optional :param D: the D matrix in the FirstOrderLinearR :type type: int, optional :param type: do not set this yourself ! this is used in derived classes | *Overload 5:* Constructor with all the data :type sensor: ControlSensor :param sensor: the ControlSensor feeding the Actuator :type B: :py:class:`SimpleMatrix` :param B: the matrix :type D: :py:class:`SimpleMatrix`, optional :param D: the D matrix in the FirstOrderLinearR :param type: do not set this yourself ! this is used in derived classes | *Overload 6:* Constructor with all the data :type sensor: ControlSensor :param sensor: the ControlSensor feeding the Actuator :type B: :py:class:`SimpleMatrix` :param B: the matrix :param D: the D matrix in the FirstOrderLinearR :param type: do not set this yourself ! this is used in derived classes """ if self.__class__ == LinearSMC: _self = None else: _self = self _pycontroller.LinearSMC_swiginit(self, _pycontroller.new_LinearSMC(_self, *args)) __swig_destroy__ = _pycontroller.delete_LinearSMC
[docs] def actuate(self) -> "void": r""" Compute the new control law at each event Here we are using the following formula: :math:`u = u_{\mathrm{eq}} + u_s` """ return _pycontroller.LinearSMC_actuate(self)
[docs] def setDPtr(self, D: "SP::SimpleMatrix") -> "void": r""" Set the D matrix :type D: :py:class:`SimpleMatrix` :param D: the new D matrix """ return _pycontroller.LinearSMC_setDPtr(self, D)
def __disown__(self): self.this.disown() _pycontroller.disown_LinearSMC(self) return weakref.proxy(self)
# Register LinearSMC in _pycontroller: _pycontroller.LinearSMC_swigregister(LinearSMC)
[docs]class ExplicitLinearSMC(CommonSMC): thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr def __init__(self, *args): r""" *Overload 1:* Constructor :type sensor: ControlSensor :param sensor: the ControlSensor feeding the Actuator | *Overload 2:* Constructor.with all data :type sensor: ControlSensor :param sensor: the ControlSensor feeding the Actuator :type B: :py:class:`SimpleMatrix` :param B: the B matrix """ if self.__class__ == ExplicitLinearSMC: _self = None else: _self = self _pycontroller.ExplicitLinearSMC_swiginit(self, _pycontroller.new_ExplicitLinearSMC(_self, *args)) __swig_destroy__ = _pycontroller.delete_ExplicitLinearSMC
[docs] def initialize(self, nsds: "NonSmoothDynamicalSystem", s: "Simulation") -> "void": r""" Initializer :type nsds: :py:class:`NonSmoothDynamicalSystem` :param nsds: current nonsmooth dynamical system :type s: :py:class:`Simulation` :param s: current simulation setup """ return _pycontroller.ExplicitLinearSMC_initialize(self, nsds, s)
[docs] def actuate(self) -> "void": r""" Compute the new control law at each event Here we are using the following formula: TODO """ return _pycontroller.ExplicitLinearSMC_actuate(self)
def __disown__(self): self.this.disown() _pycontroller.disown_ExplicitLinearSMC(self) return weakref.proxy(self)
# Register ExplicitLinearSMC in _pycontroller: _pycontroller.ExplicitLinearSMC_swigregister(ExplicitLinearSMC)
[docs]class LinearSMCOT2(CommonSMC): thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr def __init__(self, sensor: "SP::ControlSensor"): r""" Constructor :type sensor: ControlSensor :param sensor: the ControlSensor feeding the Actuator """ if self.__class__ == LinearSMCOT2: _self = None else: _self = self _pycontroller.LinearSMCOT2_swiginit(self, _pycontroller.new_LinearSMCOT2(_self, sensor)) __swig_destroy__ = _pycontroller.delete_LinearSMCOT2
[docs] def initialize(self, nsds: "NonSmoothDynamicalSystem", s: "Simulation") -> "void": r""" initialize actuator data. :type nsds: :py:class:`NonSmoothDynamicalSystem` :param nsds: current nonsmooth dynamical system :type s: :py:class:`Simulation` :param s: current simulation setup """ return _pycontroller.LinearSMCOT2_initialize(self, nsds, s)
[docs] def actuate(self) -> "void": r""" Compute the new control law at each event Here we are using the following formula: TODO """ return _pycontroller.LinearSMCOT2_actuate(self)
[docs] def setTimeDiscretisation(self, td: "TimeDiscretisation") -> "void": r""" This is derived in child classes if they need to copy the TimeDiscretisation associated with this Sensor :type td: :py:class:`TimeDiscretisation` :param td: the TimeDiscretisation for this Sensor """ return _pycontroller.LinearSMCOT2_setTimeDiscretisation(self, td)
def __disown__(self): self.this.disown() _pycontroller.disown_LinearSMCOT2(self) return weakref.proxy(self)
# Register LinearSMCOT2 in _pycontroller: _pycontroller.LinearSMCOT2_swigregister(LinearSMCOT2)
[docs]class LinearSMCimproved(LinearSMC): thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr _predictionPerturbation = property(_pycontroller.LinearSMCimproved__predictionPerturbation_get, _pycontroller.LinearSMCimproved__predictionPerturbation_set, doc=r""" try to predict the perturbation""") _inDisceteTimeSlidingPhase = property(_pycontroller.LinearSMCimproved__inDisceteTimeSlidingPhase_get, _pycontroller.LinearSMCimproved__inDisceteTimeSlidingPhase_set, doc=r""" boolean to determine if we are in the discrete-time sliding phase""") _measuredPert = property(_pycontroller.LinearSMCimproved__measuredPert_get, _pycontroller.LinearSMCimproved__measuredPert_set, doc=r""" Vector to store previous values of the perturbation""") _predictedPert = property(_pycontroller.LinearSMCimproved__predictedPert_get, _pycontroller.LinearSMCimproved__predictedPert_set, doc=r""" Vector of predicted values for the perturbation""") _ubPerturbation = property(_pycontroller.LinearSMCimproved__ubPerturbation_get, _pycontroller.LinearSMCimproved__ubPerturbation_set, doc=r""" Upper bound on the norm2 of the perturbation""") _up = property(_pycontroller.LinearSMCimproved__up_get, _pycontroller.LinearSMCimproved__up_set, doc=r""" Control input to counteract the effect of the perturbation""")
[docs] def predictionPerturbation(self, xTk: "SiconosVector", CBstar: "SimpleMatrix") -> "void": r""" Predict the effect of the perturnation during the next timestep :type xTk: :py:class:`SiconosVector` :param xTk: available state at the current time instant :type CBstar: :py:class:`SimpleMatrix` :param CBstar: matrix :math:`CB^{*}` """ return _pycontroller.LinearSMCimproved_predictionPerturbation(self, xTk, CBstar)
def __init__(self, *args): r""" *Overload 1:* Constructor :type sensor: ControlSensor :param sensor: the ControlSensor feeding the Actuator | *Overload 2:* Constructor with all the data :type sensor: ControlSensor :param sensor: the ControlSensor feeding the Actuator :type B: :py:class:`SimpleMatrix` :param B: the B matrix in the FirstOrderLinearR :type D: :py:class:`SimpleMatrix`, optional :param D: the D matrix in the FirstOrderLinearR | *Overload 3:* Constructor with all the data :type sensor: ControlSensor :param sensor: the ControlSensor feeding the Actuator :type B: :py:class:`SimpleMatrix` :param B: the B matrix in the FirstOrderLinearR :param D: the D matrix in the FirstOrderLinearR """ if self.__class__ == LinearSMCimproved: _self = None else: _self = self _pycontroller.LinearSMCimproved_swiginit(self, _pycontroller.new_LinearSMCimproved(_self, *args)) __swig_destroy__ = _pycontroller.delete_LinearSMCimproved
[docs] def initialize(self, nsds: "NonSmoothDynamicalSystem", s: "Simulation") -> "void": r""" Initialize Controller :type nsds: :py:class:`NonSmoothDynamicalSystem` :param nsds: current nonsmooth dynamical system :type s: :py:class:`Simulation` :param s: current simulation setup """ return _pycontroller.LinearSMCimproved_initialize(self, nsds, s)
[docs] def actuate(self) -> "void": r""" Compute the new control law at each event Here we are using the following formula: TODO """ return _pycontroller.LinearSMCimproved_actuate(self)
[docs] def setPerturbationPrediction(self, *args) -> "void": r""" Enable perturbation prediction""" return _pycontroller.LinearSMCimproved_setPerturbationPrediction(self, *args)
[docs] def up(self) -> "SiconosVector const &": r""" Get the control input _up, acting against matched perturbations :rtype: :py:class:`SiconosVector` :return: a reference to _up """ return _pycontroller.LinearSMCimproved_up(self)
[docs] def setPredictionOrder(self, order: "unsigned int") -> "void": r""" Set the order of the prediction - 0 -> the predicted value is the same as the one we measured - 1 -> :math:`\widetilde{Cp_{k+1}} = 2Cp_k - Cp_{k-1}` - 2 -> :math:`\widetilde{Cp_{k+1}} = 3Cp_k - 3Cp_{k-1} + Cp_{k-2}` :type order: int :param order: the order of the prediction """ return _pycontroller.LinearSMCimproved_setPredictionOrder(self, order)
def __disown__(self): self.this.disown() _pycontroller.disown_LinearSMCimproved(self) return weakref.proxy(self)
# Register LinearSMCimproved in _pycontroller: _pycontroller.LinearSMCimproved_swigregister(LinearSMCimproved)
[docs]class Twisting(CommonSMC): r""" Modified Twisting Controller with an implicit discretization This is the twisting controller that gives the best result """ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr def __init__(self, *args): r""" *Overload 1:* default constructor | *Overload 2:* Constructor for the ActuatorFactory :type sensor: ControlSensor :param sensor: the ControlSensor feeding the Actuator | *Overload 3:* Constructor for a nonlinear system. :type sensor: ControlSensor :param sensor: the ControlSensor feeding the Actuator :type hControl: float :param hControl: sampling period | *Overload 4:* Constructor for the linear case :type sensor: ControlSensor :param sensor: the ControlSensor feeding the Actuator :type gain: float :param gain: control magnitude :type beta: float :param beta: twisting parameter :type hControl: float :param hControl: sampling period """ if self.__class__ == Twisting: _self = None else: _self = self _pycontroller.Twisting_swiginit(self, _pycontroller.new_Twisting(_self, *args)) __swig_destroy__ = _pycontroller.delete_Twisting
[docs] def actuate(self) -> "void": r""" Compute the new control law at each event Here we are using the following formula: """ return _pycontroller.Twisting_actuate(self)
[docs] def setNSdata(self, hControl: "double") -> "void": r""" set nonsmooth data: NormalConeNSL and AVI osnsp :type hControl: float :param hControl: sampling period """ return _pycontroller.Twisting_setNSdata(self, hControl)
[docs] def initialize(self, nsds: "NonSmoothDynamicalSystem", s: "Simulation") -> "void": return _pycontroller.Twisting_initialize(self, nsds, s)
def __disown__(self): self.this.disown() _pycontroller.disown_Twisting(self) return weakref.proxy(self)
# Register Twisting in _pycontroller: _pycontroller.Twisting_swigregister(Twisting)
[docs]class RegularTwisting(Twisting): r""" Twisting Controller with a straightforward discretization""" thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr def __init__(self, *args): r""" *Overload 1:* default constructor | *Overload 2:* Constructor for a nonlinear system or the ActuatorFactory :type sensor: ControlSensor :param sensor: the ControlSensor feeding the Actuator :param hControl: sampling period | *Overload 3:* Constructor for the linear case :type sensor: ControlSensor :param sensor: the ControlSensor feeding the Actuator :type gain: float :param gain: control magnitude :type beta: float :param beta: twisting parameter :param hControl: sampling period """ if self.__class__ == RegularTwisting: _self = None else: _self = self _pycontroller.RegularTwisting_swiginit(self, _pycontroller.new_RegularTwisting(_self, *args)) __swig_destroy__ = _pycontroller.delete_RegularTwisting def __disown__(self): self.this.disown() _pycontroller.disown_RegularTwisting(self) return weakref.proxy(self)
# Register RegularTwisting in _pycontroller: _pycontroller.RegularTwisting_swigregister(RegularTwisting)
[docs]class ExplicitTwisting(CommonSMC): r""" Twisting Controller with an explicit discretization""" thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr def __init__(self, *args): r""" *Overload 1:* default constructor | *Overload 2:* Constructor for a nonlinear system or the ActuatorFactory :type sensor: ControlSensor :param sensor: the ControlSensor feeding the Actuator | *Overload 3:* Constructor for the linear case :type sensor: ControlSensor :param sensor: the ControlSensor feeding the Actuator :type gain: float :param gain: control magnitude :type beta: float :param beta: twisting parameter """ if self.__class__ == ExplicitTwisting: _self = None else: _self = self _pycontroller.ExplicitTwisting_swiginit(self, _pycontroller.new_ExplicitTwisting(_self, *args)) __swig_destroy__ = _pycontroller.delete_ExplicitTwisting
[docs] def actuate(self) -> "void": r""" Compute the new control law at each event Here we are using the following formula: """ return _pycontroller.ExplicitTwisting_actuate(self)
[docs] def initialize(self, nsds: "NonSmoothDynamicalSystem", s: "Simulation") -> "void": return _pycontroller.ExplicitTwisting_initialize(self, nsds, s)
def __disown__(self): self.this.disown() _pycontroller.disown_ExplicitTwisting(self) return weakref.proxy(self)
# Register ExplicitTwisting in _pycontroller: _pycontroller.ExplicitTwisting_swigregister(ExplicitTwisting)