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 _sicpycontroller
else:
    import _sicpycontroller

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__ = _sicpycontroller.delete_SwigPyIterator

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

SHARED_PTR_DISOWN = _sicpycontroller.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 _sicpycontroller.nullDeleter___call__(self, arg2) __swig_destroy__ = _sicpycontroller.delete_nullDeleter
# Register nullDeleter in _sicpycontroller: _sicpycontroller.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 _sicpycontroller.VectorOfVectors_iterator(self) def __iter__(self): return self.iterator() def __nonzero__(self) -> "bool": return _sicpycontroller.VectorOfVectors___nonzero__(self) def __bool__(self) -> "bool": return _sicpycontroller.VectorOfVectors___bool__(self) def __len__(self) -> "std::vector< std::shared_ptr< SiconosVector > >::size_type": return _sicpycontroller.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 _sicpycontroller.VectorOfVectors___getslice__(self, i, j) def __setslice__(self, *args) -> "void": return _sicpycontroller.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 _sicpycontroller.VectorOfVectors___delslice__(self, i, j) def __delitem__(self, *args) -> "void": return _sicpycontroller.VectorOfVectors___delitem__(self, *args) def __getitem__(self, *args) -> "std::vector< std::shared_ptr< SiconosVector > >::value_type const &": return _sicpycontroller.VectorOfVectors___getitem__(self, *args) def __setitem__(self, *args) -> "void": return _sicpycontroller.VectorOfVectors___setitem__(self, *args) def pop(self) -> "std::vector< std::shared_ptr< SiconosVector > >::value_type": return _sicpycontroller.VectorOfVectors_pop(self) def append(self, x: "std::vector< std::shared_ptr< SiconosVector > >::value_type const &") -> "void": return _sicpycontroller.VectorOfVectors_append(self, x) def empty(self) -> "bool": return _sicpycontroller.VectorOfVectors_empty(self) def size(self) -> "std::vector< std::shared_ptr< SiconosVector > >::size_type": return _sicpycontroller.VectorOfVectors_size(self) def swap(self, v: "VectorOfVectors") -> "void": return _sicpycontroller.VectorOfVectors_swap(self, v) def begin(self) -> "std::vector< std::shared_ptr< SiconosVector > >::iterator": return _sicpycontroller.VectorOfVectors_begin(self) def end(self) -> "std::vector< std::shared_ptr< SiconosVector > >::iterator": return _sicpycontroller.VectorOfVectors_end(self) def rbegin(self) -> "std::vector< std::shared_ptr< SiconosVector > >::reverse_iterator": return _sicpycontroller.VectorOfVectors_rbegin(self) def rend(self) -> "std::vector< std::shared_ptr< SiconosVector > >::reverse_iterator": return _sicpycontroller.VectorOfVectors_rend(self) def clear(self) -> "void": return _sicpycontroller.VectorOfVectors_clear(self) def get_allocator(self) -> "std::vector< std::shared_ptr< SiconosVector > >::allocator_type": return _sicpycontroller.VectorOfVectors_get_allocator(self) def pop_back(self) -> "void": return _sicpycontroller.VectorOfVectors_pop_back(self) def erase(self, *args) -> "std::vector< std::shared_ptr< SiconosVector > >::iterator": return _sicpycontroller.VectorOfVectors_erase(self, *args) def __init__(self, *args): _sicpycontroller.VectorOfVectors_swiginit(self, _sicpycontroller.new_VectorOfVectors(*args)) def push_back(self, x: "std::vector< std::shared_ptr< SiconosVector > >::value_type const &") -> "void": return _sicpycontroller.VectorOfVectors_push_back(self, x) def front(self) -> "std::vector< std::shared_ptr< SiconosVector > >::value_type const &": return _sicpycontroller.VectorOfVectors_front(self) def back(self) -> "std::vector< std::shared_ptr< SiconosVector > >::value_type const &": return _sicpycontroller.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 _sicpycontroller.VectorOfVectors_assign(self, n, x) def resize(self, *args) -> "void": return _sicpycontroller.VectorOfVectors_resize(self, *args) def insert(self, *args) -> "void": return _sicpycontroller.VectorOfVectors_insert(self, *args) def reserve(self, n: "std::vector< std::shared_ptr< SiconosVector > >::size_type") -> "void": return _sicpycontroller.VectorOfVectors_reserve(self, n) def capacity(self) -> "std::vector< std::shared_ptr< SiconosVector > >::size_type": return _sicpycontroller.VectorOfVectors_capacity(self) __swig_destroy__ = _sicpycontroller.delete_VectorOfVectors # Register VectorOfVectors in _sicpycontroller: _sicpycontroller.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 _sicpycontroller.VectorOfBlockVectors_iterator(self) def __iter__(self): return self.iterator() def __nonzero__(self) -> "bool": return _sicpycontroller.VectorOfBlockVectors___nonzero__(self) def __bool__(self) -> "bool": return _sicpycontroller.VectorOfBlockVectors___bool__(self) def __len__(self) -> "std::vector< std::shared_ptr< BlockVector > >::size_type": return _sicpycontroller.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 _sicpycontroller.VectorOfBlockVectors___getslice__(self, i, j) def __setslice__(self, *args) -> "void": return _sicpycontroller.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 _sicpycontroller.VectorOfBlockVectors___delslice__(self, i, j) def __delitem__(self, *args) -> "void": return _sicpycontroller.VectorOfBlockVectors___delitem__(self, *args) def __getitem__(self, *args) -> "std::vector< std::shared_ptr< BlockVector > >::value_type const &": return _sicpycontroller.VectorOfBlockVectors___getitem__(self, *args) def __setitem__(self, *args) -> "void": return _sicpycontroller.VectorOfBlockVectors___setitem__(self, *args) def pop(self) -> "std::vector< std::shared_ptr< BlockVector > >::value_type": return _sicpycontroller.VectorOfBlockVectors_pop(self) def append(self, x: "std::vector< std::shared_ptr< BlockVector > >::value_type const &") -> "void": return _sicpycontroller.VectorOfBlockVectors_append(self, x) def empty(self) -> "bool": return _sicpycontroller.VectorOfBlockVectors_empty(self) def size(self) -> "std::vector< std::shared_ptr< BlockVector > >::size_type": return _sicpycontroller.VectorOfBlockVectors_size(self) def swap(self, v: "VectorOfBlockVectors") -> "void": return _sicpycontroller.VectorOfBlockVectors_swap(self, v) def begin(self) -> "std::vector< std::shared_ptr< BlockVector > >::iterator": return _sicpycontroller.VectorOfBlockVectors_begin(self) def end(self) -> "std::vector< std::shared_ptr< BlockVector > >::iterator": return _sicpycontroller.VectorOfBlockVectors_end(self) def rbegin(self) -> "std::vector< std::shared_ptr< BlockVector > >::reverse_iterator": return _sicpycontroller.VectorOfBlockVectors_rbegin(self) def rend(self) -> "std::vector< std::shared_ptr< BlockVector > >::reverse_iterator": return _sicpycontroller.VectorOfBlockVectors_rend(self) def clear(self) -> "void": return _sicpycontroller.VectorOfBlockVectors_clear(self) def get_allocator(self) -> "std::vector< std::shared_ptr< BlockVector > >::allocator_type": return _sicpycontroller.VectorOfBlockVectors_get_allocator(self) def pop_back(self) -> "void": return _sicpycontroller.VectorOfBlockVectors_pop_back(self) def erase(self, *args) -> "std::vector< std::shared_ptr< BlockVector > >::iterator": return _sicpycontroller.VectorOfBlockVectors_erase(self, *args) def __init__(self, *args): _sicpycontroller.VectorOfBlockVectors_swiginit(self, _sicpycontroller.new_VectorOfBlockVectors(*args)) def push_back(self, x: "std::vector< std::shared_ptr< BlockVector > >::value_type const &") -> "void": return _sicpycontroller.VectorOfBlockVectors_push_back(self, x) def front(self) -> "std::vector< std::shared_ptr< BlockVector > >::value_type const &": return _sicpycontroller.VectorOfBlockVectors_front(self) def back(self) -> "std::vector< std::shared_ptr< BlockVector > >::value_type const &": return _sicpycontroller.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 _sicpycontroller.VectorOfBlockVectors_assign(self, n, x) def resize(self, *args) -> "void": return _sicpycontroller.VectorOfBlockVectors_resize(self, *args) def insert(self, *args) -> "void": return _sicpycontroller.VectorOfBlockVectors_insert(self, *args) def reserve(self, n: "std::vector< std::shared_ptr< BlockVector > >::size_type") -> "void": return _sicpycontroller.VectorOfBlockVectors_reserve(self, n) def capacity(self) -> "std::vector< std::shared_ptr< BlockVector > >::size_type": return _sicpycontroller.VectorOfBlockVectors_capacity(self) __swig_destroy__ = _sicpycontroller.delete_VectorOfBlockVectors # Register VectorOfBlockVectors in _sicpycontroller: _sicpycontroller.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 _sicpycontroller.VectorOfMatrices_iterator(self) def __iter__(self): return self.iterator() def __nonzero__(self) -> "bool": return _sicpycontroller.VectorOfMatrices___nonzero__(self) def __bool__(self) -> "bool": return _sicpycontroller.VectorOfMatrices___bool__(self) def __len__(self) -> "std::vector< std::shared_ptr< SiconosMatrix > >::size_type": return _sicpycontroller.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 _sicpycontroller.VectorOfMatrices___getslice__(self, i, j) def __setslice__(self, *args) -> "void": return _sicpycontroller.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 _sicpycontroller.VectorOfMatrices___delslice__(self, i, j) def __delitem__(self, *args) -> "void": return _sicpycontroller.VectorOfMatrices___delitem__(self, *args) def __getitem__(self, *args) -> "std::vector< std::shared_ptr< SiconosMatrix > >::value_type const &": return _sicpycontroller.VectorOfMatrices___getitem__(self, *args) def __setitem__(self, *args) -> "void": return _sicpycontroller.VectorOfMatrices___setitem__(self, *args) def pop(self) -> "std::vector< std::shared_ptr< SiconosMatrix > >::value_type": return _sicpycontroller.VectorOfMatrices_pop(self) def append(self, x: "std::vector< std::shared_ptr< SiconosMatrix > >::value_type const &") -> "void": return _sicpycontroller.VectorOfMatrices_append(self, x) def empty(self) -> "bool": return _sicpycontroller.VectorOfMatrices_empty(self) def size(self) -> "std::vector< std::shared_ptr< SiconosMatrix > >::size_type": return _sicpycontroller.VectorOfMatrices_size(self) def swap(self, v: "VectorOfMatrices") -> "void": return _sicpycontroller.VectorOfMatrices_swap(self, v) def begin(self) -> "std::vector< std::shared_ptr< SiconosMatrix > >::iterator": return _sicpycontroller.VectorOfMatrices_begin(self) def end(self) -> "std::vector< std::shared_ptr< SiconosMatrix > >::iterator": return _sicpycontroller.VectorOfMatrices_end(self) def rbegin(self) -> "std::vector< std::shared_ptr< SiconosMatrix > >::reverse_iterator": return _sicpycontroller.VectorOfMatrices_rbegin(self) def rend(self) -> "std::vector< std::shared_ptr< SiconosMatrix > >::reverse_iterator": return _sicpycontroller.VectorOfMatrices_rend(self) def clear(self) -> "void": return _sicpycontroller.VectorOfMatrices_clear(self) def get_allocator(self) -> "std::vector< std::shared_ptr< SiconosMatrix > >::allocator_type": return _sicpycontroller.VectorOfMatrices_get_allocator(self) def pop_back(self) -> "void": return _sicpycontroller.VectorOfMatrices_pop_back(self) def erase(self, *args) -> "std::vector< std::shared_ptr< SiconosMatrix > >::iterator": return _sicpycontroller.VectorOfMatrices_erase(self, *args) def __init__(self, *args): _sicpycontroller.VectorOfMatrices_swiginit(self, _sicpycontroller.new_VectorOfMatrices(*args)) def push_back(self, x: "std::vector< std::shared_ptr< SiconosMatrix > >::value_type const &") -> "void": return _sicpycontroller.VectorOfMatrices_push_back(self, x) def front(self) -> "std::vector< std::shared_ptr< SiconosMatrix > >::value_type const &": return _sicpycontroller.VectorOfMatrices_front(self) def back(self) -> "std::vector< std::shared_ptr< SiconosMatrix > >::value_type const &": return _sicpycontroller.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 _sicpycontroller.VectorOfMatrices_assign(self, n, x) def resize(self, *args) -> "void": return _sicpycontroller.VectorOfMatrices_resize(self, *args) def insert(self, *args) -> "void": return _sicpycontroller.VectorOfMatrices_insert(self, *args) def reserve(self, n: "std::vector< std::shared_ptr< SiconosMatrix > >::size_type") -> "void": return _sicpycontroller.VectorOfMatrices_reserve(self, n) def capacity(self) -> "std::vector< std::shared_ptr< SiconosMatrix > >::size_type": return _sicpycontroller.VectorOfMatrices_capacity(self) __swig_destroy__ = _sicpycontroller.delete_VectorOfMatrices # Register VectorOfMatrices in _sicpycontroller: _sicpycontroller.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 _sicpycontroller.VectorOfSMatrices_iterator(self) def __iter__(self): return self.iterator() def __nonzero__(self) -> "bool": return _sicpycontroller.VectorOfSMatrices___nonzero__(self) def __bool__(self) -> "bool": return _sicpycontroller.VectorOfSMatrices___bool__(self) def __len__(self) -> "std::vector< std::shared_ptr< SimpleMatrix > >::size_type": return _sicpycontroller.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 _sicpycontroller.VectorOfSMatrices___getslice__(self, i, j) def __setslice__(self, *args) -> "void": return _sicpycontroller.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 _sicpycontroller.VectorOfSMatrices___delslice__(self, i, j) def __delitem__(self, *args) -> "void": return _sicpycontroller.VectorOfSMatrices___delitem__(self, *args) def __getitem__(self, *args) -> "std::vector< std::shared_ptr< SimpleMatrix > >::value_type const &": return _sicpycontroller.VectorOfSMatrices___getitem__(self, *args) def __setitem__(self, *args) -> "void": return _sicpycontroller.VectorOfSMatrices___setitem__(self, *args) def pop(self) -> "std::vector< std::shared_ptr< SimpleMatrix > >::value_type": return _sicpycontroller.VectorOfSMatrices_pop(self) def append(self, x: "std::vector< std::shared_ptr< SimpleMatrix > >::value_type const &") -> "void": return _sicpycontroller.VectorOfSMatrices_append(self, x) def empty(self) -> "bool": return _sicpycontroller.VectorOfSMatrices_empty(self) def size(self) -> "std::vector< std::shared_ptr< SimpleMatrix > >::size_type": return _sicpycontroller.VectorOfSMatrices_size(self) def swap(self, v: "VectorOfSMatrices") -> "void": return _sicpycontroller.VectorOfSMatrices_swap(self, v) def begin(self) -> "std::vector< std::shared_ptr< SimpleMatrix > >::iterator": return _sicpycontroller.VectorOfSMatrices_begin(self) def end(self) -> "std::vector< std::shared_ptr< SimpleMatrix > >::iterator": return _sicpycontroller.VectorOfSMatrices_end(self) def rbegin(self) -> "std::vector< std::shared_ptr< SimpleMatrix > >::reverse_iterator": return _sicpycontroller.VectorOfSMatrices_rbegin(self) def rend(self) -> "std::vector< std::shared_ptr< SimpleMatrix > >::reverse_iterator": return _sicpycontroller.VectorOfSMatrices_rend(self) def clear(self) -> "void": return _sicpycontroller.VectorOfSMatrices_clear(self) def get_allocator(self) -> "std::vector< std::shared_ptr< SimpleMatrix > >::allocator_type": return _sicpycontroller.VectorOfSMatrices_get_allocator(self) def pop_back(self) -> "void": return _sicpycontroller.VectorOfSMatrices_pop_back(self) def erase(self, *args) -> "std::vector< std::shared_ptr< SimpleMatrix > >::iterator": return _sicpycontroller.VectorOfSMatrices_erase(self, *args) def __init__(self, *args): _sicpycontroller.VectorOfSMatrices_swiginit(self, _sicpycontroller.new_VectorOfSMatrices(*args)) def push_back(self, x: "std::vector< std::shared_ptr< SimpleMatrix > >::value_type const &") -> "void": return _sicpycontroller.VectorOfSMatrices_push_back(self, x) def front(self) -> "std::vector< std::shared_ptr< SimpleMatrix > >::value_type const &": return _sicpycontroller.VectorOfSMatrices_front(self) def back(self) -> "std::vector< std::shared_ptr< SimpleMatrix > >::value_type const &": return _sicpycontroller.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 _sicpycontroller.VectorOfSMatrices_assign(self, n, x) def resize(self, *args) -> "void": return _sicpycontroller.VectorOfSMatrices_resize(self, *args) def insert(self, *args) -> "void": return _sicpycontroller.VectorOfSMatrices_insert(self, *args) def reserve(self, n: "std::vector< std::shared_ptr< SimpleMatrix > >::size_type") -> "void": return _sicpycontroller.VectorOfSMatrices_reserve(self, n) def capacity(self) -> "std::vector< std::shared_ptr< SimpleMatrix > >::size_type": return _sicpycontroller.VectorOfSMatrices_capacity(self) __swig_destroy__ = _sicpycontroller.delete_VectorOfSMatrices # Register VectorOfSMatrices in _sicpycontroller: _sicpycontroller.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 _sicpycontroller.VectorOfMemories_iterator(self) def __iter__(self): return self.iterator() def __nonzero__(self) -> "bool": return _sicpycontroller.VectorOfMemories___nonzero__(self) def __bool__(self) -> "bool": return _sicpycontroller.VectorOfMemories___bool__(self) def __len__(self) -> "std::vector< SiconosMemory >::size_type": return _sicpycontroller.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 _sicpycontroller.VectorOfMemories___getslice__(self, i, j) def __setslice__(self, *args) -> "void": return _sicpycontroller.VectorOfMemories___setslice__(self, *args) def __delslice__(self, i: "std::vector< SiconosMemory >::difference_type", j: "std::vector< SiconosMemory >::difference_type") -> "void": return _sicpycontroller.VectorOfMemories___delslice__(self, i, j) def __delitem__(self, *args) -> "void": return _sicpycontroller.VectorOfMemories___delitem__(self, *args) def __getitem__(self, *args) -> "std::vector< SiconosMemory >::value_type const &": return _sicpycontroller.VectorOfMemories___getitem__(self, *args) def __setitem__(self, *args) -> "void": return _sicpycontroller.VectorOfMemories___setitem__(self, *args) def pop(self) -> "std::vector< SiconosMemory >::value_type": return _sicpycontroller.VectorOfMemories_pop(self) def append(self, x: "SiconosMemory") -> "void": return _sicpycontroller.VectorOfMemories_append(self, x) def empty(self) -> "bool": return _sicpycontroller.VectorOfMemories_empty(self) def size(self) -> "std::vector< SiconosMemory >::size_type": return _sicpycontroller.VectorOfMemories_size(self) def swap(self, v: "VectorOfMemories") -> "void": return _sicpycontroller.VectorOfMemories_swap(self, v) def begin(self) -> "std::vector< SiconosMemory >::iterator": return _sicpycontroller.VectorOfMemories_begin(self) def end(self) -> "std::vector< SiconosMemory >::iterator": return _sicpycontroller.VectorOfMemories_end(self) def rbegin(self) -> "std::vector< SiconosMemory >::reverse_iterator": return _sicpycontroller.VectorOfMemories_rbegin(self) def rend(self) -> "std::vector< SiconosMemory >::reverse_iterator": return _sicpycontroller.VectorOfMemories_rend(self) def clear(self) -> "void": return _sicpycontroller.VectorOfMemories_clear(self) def get_allocator(self) -> "std::vector< SiconosMemory >::allocator_type": return _sicpycontroller.VectorOfMemories_get_allocator(self) def pop_back(self) -> "void": return _sicpycontroller.VectorOfMemories_pop_back(self) def erase(self, *args) -> "std::vector< SiconosMemory >::iterator": return _sicpycontroller.VectorOfMemories_erase(self, *args) def __init__(self, *args): _sicpycontroller.VectorOfMemories_swiginit(self, _sicpycontroller.new_VectorOfMemories(*args)) def push_back(self, x: "SiconosMemory") -> "void": return _sicpycontroller.VectorOfMemories_push_back(self, x) def front(self) -> "std::vector< SiconosMemory >::value_type const &": return _sicpycontroller.VectorOfMemories_front(self) def back(self) -> "std::vector< SiconosMemory >::value_type const &": return _sicpycontroller.VectorOfMemories_back(self) def assign(self, n: "std::vector< SiconosMemory >::size_type", x: "SiconosMemory") -> "void": return _sicpycontroller.VectorOfMemories_assign(self, n, x) def resize(self, *args) -> "void": return _sicpycontroller.VectorOfMemories_resize(self, *args) def insert(self, *args) -> "void": return _sicpycontroller.VectorOfMemories_insert(self, *args) def reserve(self, n: "std::vector< SiconosMemory >::size_type") -> "void": return _sicpycontroller.VectorOfMemories_reserve(self, n) def capacity(self) -> "std::vector< SiconosMemory >::size_type": return _sicpycontroller.VectorOfMemories_capacity(self) __swig_destroy__ = _sicpycontroller.delete_VectorOfMemories # Register VectorOfMemories in _sicpycontroller: _sicpycontroller.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 _sicpycontroller.UnsignedIntVector_iterator(self) def __iter__(self): return self.iterator() def __nonzero__(self) -> "bool": return _sicpycontroller.UnsignedIntVector___nonzero__(self) def __bool__(self) -> "bool": return _sicpycontroller.UnsignedIntVector___bool__(self) def __len__(self) -> "std::vector< unsigned int >::size_type": return _sicpycontroller.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 _sicpycontroller.UnsignedIntVector___getslice__(self, i, j) def __setslice__(self, *args) -> "void": return _sicpycontroller.UnsignedIntVector___setslice__(self, *args) def __delslice__(self, i: "std::vector< unsigned int >::difference_type", j: "std::vector< unsigned int >::difference_type") -> "void": return _sicpycontroller.UnsignedIntVector___delslice__(self, i, j) def __delitem__(self, *args) -> "void": return _sicpycontroller.UnsignedIntVector___delitem__(self, *args) def __getitem__(self, *args) -> "std::vector< unsigned int >::value_type const &": return _sicpycontroller.UnsignedIntVector___getitem__(self, *args) def __setitem__(self, *args) -> "void": return _sicpycontroller.UnsignedIntVector___setitem__(self, *args) def pop(self) -> "std::vector< unsigned int >::value_type": return _sicpycontroller.UnsignedIntVector_pop(self) def append(self, x: "std::vector< unsigned int >::value_type const &") -> "void": return _sicpycontroller.UnsignedIntVector_append(self, x) def empty(self) -> "bool": return _sicpycontroller.UnsignedIntVector_empty(self) def size(self) -> "std::vector< unsigned int >::size_type": return _sicpycontroller.UnsignedIntVector_size(self) def swap(self, v: "UnsignedIntVector") -> "void": return _sicpycontroller.UnsignedIntVector_swap(self, v) def begin(self) -> "std::vector< unsigned int >::iterator": return _sicpycontroller.UnsignedIntVector_begin(self) def end(self) -> "std::vector< unsigned int >::iterator": return _sicpycontroller.UnsignedIntVector_end(self) def rbegin(self) -> "std::vector< unsigned int >::reverse_iterator": return _sicpycontroller.UnsignedIntVector_rbegin(self) def rend(self) -> "std::vector< unsigned int >::reverse_iterator": return _sicpycontroller.UnsignedIntVector_rend(self) def clear(self) -> "void": return _sicpycontroller.UnsignedIntVector_clear(self) def get_allocator(self) -> "std::vector< unsigned int >::allocator_type": return _sicpycontroller.UnsignedIntVector_get_allocator(self) def pop_back(self) -> "void": return _sicpycontroller.UnsignedIntVector_pop_back(self) def erase(self, *args) -> "std::vector< unsigned int >::iterator": return _sicpycontroller.UnsignedIntVector_erase(self, *args) def __init__(self, *args): _sicpycontroller.UnsignedIntVector_swiginit(self, _sicpycontroller.new_UnsignedIntVector(*args)) def push_back(self, x: "std::vector< unsigned int >::value_type const &") -> "void": return _sicpycontroller.UnsignedIntVector_push_back(self, x) def front(self) -> "std::vector< unsigned int >::value_type const &": return _sicpycontroller.UnsignedIntVector_front(self) def back(self) -> "std::vector< unsigned int >::value_type const &": return _sicpycontroller.UnsignedIntVector_back(self) def assign(self, n: "std::vector< unsigned int >::size_type", x: "std::vector< unsigned int >::value_type const &") -> "void": return _sicpycontroller.UnsignedIntVector_assign(self, n, x) def resize(self, *args) -> "void": return _sicpycontroller.UnsignedIntVector_resize(self, *args) def insert(self, *args) -> "void": return _sicpycontroller.UnsignedIntVector_insert(self, *args) def reserve(self, n: "std::vector< unsigned int >::size_type") -> "void": return _sicpycontroller.UnsignedIntVector_reserve(self, n) def capacity(self) -> "std::vector< unsigned int >::size_type": return _sicpycontroller.UnsignedIntVector_capacity(self) __swig_destroy__ = _sicpycontroller.delete_UnsignedIntVector # Register UnsignedIntVector in _sicpycontroller: _sicpycontroller.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__ = _sicpycontroller.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 _sicpycontroller.Actuator_setId(self, newId)
[docs] def getId(self) -> "std::string const": r""" get id of the Actuator :rtype: string :return: a std::string """ return _sicpycontroller.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 _sicpycontroller.Actuator_getType(self)
[docs] def u(self) -> "SiconosVector const &": r""" Get the control value :rtype: :py:class:`SiconosVector` :return: current control value u """ return _sicpycontroller.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 _sicpycontroller.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 _sicpycontroller.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 _sicpycontroller.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 _sicpycontroller.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 _sicpycontroller.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 _sicpycontroller.Actuator_initialize(self, nsds, s)
[docs] def actuate(self) -> "void": r""" capture data when the ActuatorEvent is processed""" return _sicpycontroller.Actuator_actuate(self)
[docs] def display(self) -> "void": r""" display the data of the Actuator on the standard output""" return _sicpycontroller.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 _sicpycontroller.Actuator_getInternalNSDS(self)
# Register Actuator in _sicpycontroller: _sicpycontroller.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 _sicpycontroller.PID_swiginit(self, _sicpycontroller.new_PID(_self, *args)) __swig_destroy__ = _sicpycontroller.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 _sicpycontroller.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 _sicpycontroller.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 _sicpycontroller.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 _sicpycontroller.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 _sicpycontroller.PID_setTimeDiscretisation(self, td)
def setDeltaT(self, deltaT: "double") -> "void": return _sicpycontroller.PID_setDeltaT(self, deltaT)
[docs] def display(self) -> "void": r""" display the data of the Actuator on the standard output""" return _sicpycontroller.PID_display(self)
def __disown__(self): self.this.disown() _sicpycontroller.disown_PID(self) return weakref.proxy(self)
# Register PID in _sicpycontroller: _sicpycontroller.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(_sicpycontroller.CommonSMC__indx_get, _sicpycontroller.CommonSMC__indx_set, doc=r""" index for saving data""") _plugineName = property(_sicpycontroller.CommonSMC__plugineName_get, _sicpycontroller.CommonSMC__plugineName_set, doc=r""" name of the plugin to add a term to the sliding variable; useful when doing trajectory tracking""") _pluginhName = property(_sicpycontroller.CommonSMC__pluginhName_get, _sicpycontroller.CommonSMC__pluginhName_set, doc=r""" name of the plugin to compute :math:`y = h(x, ...)` for the nonlinear case""") _pluginJachxName = property(_sicpycontroller.CommonSMC__pluginJachxName_get, _sicpycontroller.CommonSMC__pluginJachxName_set, doc=r""" name of the plugin to compute :math:`\nabla_x h` for the nonlinear case""") _pluginJachlambdaName = property(_sicpycontroller.CommonSMC__pluginJachlambdaName_get, _sicpycontroller.CommonSMC__pluginJachlambdaName_set, doc=r""" name of the plugin to compute :math:`\nabla_\lambda h` for the nonlinear case""") _pluginJacglambdaName = property(_sicpycontroller.CommonSMC__pluginJacglambdaName_get, _sicpycontroller.CommonSMC__pluginJacglambdaName_set, doc=r""" name of the plugin to compute :math:`\nabla_\lambda g` for the nonlinear case""") _Csurface = property(_sicpycontroller.CommonSMC__Csurface_get, _sicpycontroller.CommonSMC__Csurface_set, doc=r""" the vector defining the linear contribution of the state to the sliding variable ( :math:`\sigma = Cx` )""") _D = property(_sicpycontroller.CommonSMC__D_get, _sicpycontroller.CommonSMC__D_set, doc=r""" matrix describing the influence of :math:`lambda` on :math:`\sigma`""") _alpha = property(_sicpycontroller.CommonSMC__alpha_get, _sicpycontroller.CommonSMC__alpha_set, doc=r""" scalar multiplying Sign; :math:`u^s = - \alpha Sign`""") _relationSMC = property(_sicpycontroller.CommonSMC__relationSMC_get, _sicpycontroller.CommonSMC__relationSMC_set, doc=r""" the Relation for the Controller""") _interactionSMC = property(_sicpycontroller.CommonSMC__interactionSMC_get, _sicpycontroller.CommonSMC__interactionSMC_set, doc=r""" Interaction for the control""") _lambda = property(_sicpycontroller.CommonSMC__lambda_get, _sicpycontroller.CommonSMC__lambda_set, doc=r""" easy access to lambda""") _numericsSolverId = property(_sicpycontroller.CommonSMC__numericsSolverId_get, _sicpycontroller.CommonSMC__numericsSolverId_set, doc=r""" Relay solver type""") _precision = property(_sicpycontroller.CommonSMC__precision_get, _sicpycontroller.CommonSMC__precision_set, doc=r""" Numerical precision expected for the Relay solver""") _nsdsSMC = property(_sicpycontroller.CommonSMC__nsdsSMC_get, _sicpycontroller.CommonSMC__nsdsSMC_set, doc=r""" the nsds for the controller""") _DS_SMC = property(_sicpycontroller.CommonSMC__DS_SMC_get, _sicpycontroller.CommonSMC__DS_SMC_set, doc=r""" the DynamicalSystem for the controller""") _td = property(_sicpycontroller.CommonSMC__td_get, _sicpycontroller.CommonSMC__td_set, doc=r""" the TimeDiscretisation for the controller""") _simulationSMC = property(_sicpycontroller.CommonSMC__simulationSMC_get, _sicpycontroller.CommonSMC__simulationSMC_set, doc=r""" Simulation for the controller""") _integratorSMC = property(_sicpycontroller.CommonSMC__integratorSMC_get, _sicpycontroller.CommonSMC__integratorSMC_set, doc=r""" Integrator for the controller""") _thetaSMC = property(_sicpycontroller.CommonSMC__thetaSMC_get, _sicpycontroller.CommonSMC__thetaSMC_set, doc=r""" Theta for the controller""") _OSNSPB_SMC = property(_sicpycontroller.CommonSMC__OSNSPB_SMC_get, _sicpycontroller.CommonSMC__OSNSPB_SMC_set, doc=r""" OneStepNsProblem for the controller""") _eventsManager = property(_sicpycontroller.CommonSMC__eventsManager_get, _sicpycontroller.CommonSMC__eventsManager_set, doc=r""" SP::EventsManager of the SMC Simulation""") _nsLawSMC = property(_sicpycontroller.CommonSMC__nsLawSMC_get, _sicpycontroller.CommonSMC__nsLawSMC_set, doc=r""" SP::NonSmoothLaw for computing the control law""") _invCB = property(_sicpycontroller.CommonSMC__invCB_get, _sicpycontroller.CommonSMC__invCB_set, doc=r""" inverse of CB""") _ueq = property(_sicpycontroller.CommonSMC__ueq_get, _sicpycontroller.CommonSMC__ueq_set, doc=r""" Store :math:`u^{eq}`""") _us = property(_sicpycontroller.CommonSMC__us_get, _sicpycontroller.CommonSMC__us_set, doc=r""" Store :math:`u^s`""") _noUeq = property(_sicpycontroller.CommonSMC__noUeq_get, _sicpycontroller.CommonSMC__noUeq_set, doc=r""" Do not use the state-continuous equivaluent control :math:`u^{eq}`""") _computeResidus = property(_sicpycontroller.CommonSMC__computeResidus_get, _sicpycontroller.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 _sicpycontroller.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 _sicpycontroller.CommonSMC_swiginit(self, _sicpycontroller.new_CommonSMC(_self, *args))
[docs] def actuate(self) -> "void": r""" Compute the new control law at each event""" return _sicpycontroller.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 _sicpycontroller.CommonSMC_initialize(self, nsds, s)
def sete(self, plugin: "std::string const &") -> "void": return _sicpycontroller.CommonSMC_sete(self, plugin) def seth(self, plugin: "std::string const &") -> "void": return _sicpycontroller.CommonSMC_seth(self, plugin) def setJachx(self, plugin: "std::string const &") -> "void": return _sicpycontroller.CommonSMC_setJachx(self, plugin) def setJachlambda(self, plugin: "std::string const &") -> "void": return _sicpycontroller.CommonSMC_setJachlambda(self, plugin)
[docs] def setg(self, plugin: "std::string const &") -> "void": return _sicpycontroller.CommonSMC_setg(self, plugin)
def setJacgx(self, plugin: "std::string const &") -> "void": return _sicpycontroller.CommonSMC_setJacgx(self, plugin) def setJacglambda(self, plugin: "std::string const &") -> "void": return _sicpycontroller.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 _sicpycontroller.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 _sicpycontroller.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 _sicpycontroller.CommonSMC_setAlpha(self, alpha)
[docs] def lambda_(self) -> "SP::SiconosVector": r""" get _lambda :rtype: :py:class:`SiconosVector` :return: a pointer to _lambda """ return _sicpycontroller.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 _sicpycontroller.CommonSMC_setSolver(self, numericsSolverId)
[docs] def setPrecision(self, newPrecision: "double") -> "void": r""" Set the precision :type newPrecision: float :param newPrecision: a double """ return _sicpycontroller.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 _sicpycontroller.CommonSMC_relay(self)
[docs] def ueq(self) -> "SiconosVector &": r""" get :math:`u^{eq}` :rtype: :py:class:`SiconosVector` :return: a reference to _ueq """ return _sicpycontroller.CommonSMC_ueq(self)
[docs] def us(self) -> "SiconosVector &": r""" get :math:`u^{s}` :rtype: :py:class:`SiconosVector` :return: a reference to _us """ return _sicpycontroller.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 _sicpycontroller.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 _sicpycontroller.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 _sicpycontroller.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 _sicpycontroller.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 _sicpycontroller.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 _sicpycontroller.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 _sicpycontroller.CommonSMC_getInternalOSI(self)
__swig_destroy__ = _sicpycontroller.delete_CommonSMC def __disown__(self): self.this.disown() _sicpycontroller.disown_CommonSMC(self) return weakref.proxy(self)
# Register CommonSMC in _sicpycontroller: _sicpycontroller.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 _sicpycontroller.LinearSMC_swiginit(self, _sicpycontroller.new_LinearSMC(_self, *args)) __swig_destroy__ = _sicpycontroller.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 _sicpycontroller.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 _sicpycontroller.LinearSMC_setDPtr(self, D)
def __disown__(self): self.this.disown() _sicpycontroller.disown_LinearSMC(self) return weakref.proxy(self)
# Register LinearSMC in _sicpycontroller: _sicpycontroller.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 _sicpycontroller.ExplicitLinearSMC_swiginit(self, _sicpycontroller.new_ExplicitLinearSMC(_self, *args)) __swig_destroy__ = _sicpycontroller.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 _sicpycontroller.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 _sicpycontroller.ExplicitLinearSMC_actuate(self)
def __disown__(self): self.this.disown() _sicpycontroller.disown_ExplicitLinearSMC(self) return weakref.proxy(self)
# Register ExplicitLinearSMC in _sicpycontroller: _sicpycontroller.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 _sicpycontroller.LinearSMCOT2_swiginit(self, _sicpycontroller.new_LinearSMCOT2(_self, sensor)) __swig_destroy__ = _sicpycontroller.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 _sicpycontroller.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 _sicpycontroller.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 _sicpycontroller.LinearSMCOT2_setTimeDiscretisation(self, td)
def __disown__(self): self.this.disown() _sicpycontroller.disown_LinearSMCOT2(self) return weakref.proxy(self)
# Register LinearSMCOT2 in _sicpycontroller: _sicpycontroller.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(_sicpycontroller.LinearSMCimproved__predictionPerturbation_get, _sicpycontroller.LinearSMCimproved__predictionPerturbation_set, doc=r""" try to predict the perturbation""") _inDisceteTimeSlidingPhase = property(_sicpycontroller.LinearSMCimproved__inDisceteTimeSlidingPhase_get, _sicpycontroller.LinearSMCimproved__inDisceteTimeSlidingPhase_set, doc=r""" boolean to determine if we are in the discrete-time sliding phase""") _measuredPert = property(_sicpycontroller.LinearSMCimproved__measuredPert_get, _sicpycontroller.LinearSMCimproved__measuredPert_set, doc=r""" Vector to store previous values of the perturbation""") _predictedPert = property(_sicpycontroller.LinearSMCimproved__predictedPert_get, _sicpycontroller.LinearSMCimproved__predictedPert_set, doc=r""" Vector of predicted values for the perturbation""") _ubPerturbation = property(_sicpycontroller.LinearSMCimproved__ubPerturbation_get, _sicpycontroller.LinearSMCimproved__ubPerturbation_set, doc=r""" Upper bound on the norm2 of the perturbation""") _up = property(_sicpycontroller.LinearSMCimproved__up_get, _sicpycontroller.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 _sicpycontroller.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 _sicpycontroller.LinearSMCimproved_swiginit(self, _sicpycontroller.new_LinearSMCimproved(_self, *args)) __swig_destroy__ = _sicpycontroller.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 _sicpycontroller.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 _sicpycontroller.LinearSMCimproved_actuate(self)
[docs] def setPerturbationPrediction(self, *args) -> "void": r""" Enable perturbation prediction""" return _sicpycontroller.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 _sicpycontroller.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 _sicpycontroller.LinearSMCimproved_setPredictionOrder(self, order)
def __disown__(self): self.this.disown() _sicpycontroller.disown_LinearSMCimproved(self) return weakref.proxy(self)
# Register LinearSMCimproved in _sicpycontroller: _sicpycontroller.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 _sicpycontroller.Twisting_swiginit(self, _sicpycontroller.new_Twisting(_self, *args)) __swig_destroy__ = _sicpycontroller.delete_Twisting
[docs] def actuate(self) -> "void": r""" Compute the new control law at each event Here we are using the following formula: """ return _sicpycontroller.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 _sicpycontroller.Twisting_setNSdata(self, hControl)
[docs] def initialize(self, nsds: "NonSmoothDynamicalSystem", s: "Simulation") -> "void": return _sicpycontroller.Twisting_initialize(self, nsds, s)
def __disown__(self): self.this.disown() _sicpycontroller.disown_Twisting(self) return weakref.proxy(self)
# Register Twisting in _sicpycontroller: _sicpycontroller.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 _sicpycontroller.RegularTwisting_swiginit(self, _sicpycontroller.new_RegularTwisting(_self, *args)) __swig_destroy__ = _sicpycontroller.delete_RegularTwisting def __disown__(self): self.this.disown() _sicpycontroller.disown_RegularTwisting(self) return weakref.proxy(self)
# Register RegularTwisting in _sicpycontroller: _sicpycontroller.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 _sicpycontroller.ExplicitTwisting_swiginit(self, _sicpycontroller.new_ExplicitTwisting(_self, *args)) __swig_destroy__ = _sicpycontroller.delete_ExplicitTwisting
[docs] def actuate(self) -> "void": r""" Compute the new control law at each event Here we are using the following formula: """ return _sicpycontroller.ExplicitTwisting_actuate(self)
[docs] def initialize(self, nsds: "NonSmoothDynamicalSystem", s: "Simulation") -> "void": return _sicpycontroller.ExplicitTwisting_initialize(self, nsds, s)
def __disown__(self): self.this.disown() _sicpycontroller.disown_ExplicitTwisting(self) return weakref.proxy(self)
# Register ExplicitTwisting in _sicpycontroller: _sicpycontroller.ExplicitTwisting_swigregister(ExplicitTwisting)