Source code for siconos.control.sensor

# 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 _pysensor
else:
    import _pysensor

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

SHARED_PTR_DISOWN = _pysensor.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 _pysensor.nullDeleter___call__(self, arg2) __swig_destroy__ = _pysensor.delete_nullDeleter
# Register nullDeleter in _pysensor: _pysensor.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 _pysensor.VectorOfVectors_iterator(self) def __iter__(self): return self.iterator() def __nonzero__(self) -> "bool": return _pysensor.VectorOfVectors___nonzero__(self) def __bool__(self) -> "bool": return _pysensor.VectorOfVectors___bool__(self) def __len__(self) -> "std::vector< std::shared_ptr< SiconosVector > >::size_type": return _pysensor.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 _pysensor.VectorOfVectors___getslice__(self, i, j) def __setslice__(self, *args) -> "void": return _pysensor.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 _pysensor.VectorOfVectors___delslice__(self, i, j) def __delitem__(self, *args) -> "void": return _pysensor.VectorOfVectors___delitem__(self, *args) def __getitem__(self, *args) -> "std::vector< std::shared_ptr< SiconosVector > >::value_type const &": return _pysensor.VectorOfVectors___getitem__(self, *args) def __setitem__(self, *args) -> "void": return _pysensor.VectorOfVectors___setitem__(self, *args) def pop(self) -> "std::vector< std::shared_ptr< SiconosVector > >::value_type": return _pysensor.VectorOfVectors_pop(self) def append(self, x: "std::vector< std::shared_ptr< SiconosVector > >::value_type const &") -> "void": return _pysensor.VectorOfVectors_append(self, x) def empty(self) -> "bool": return _pysensor.VectorOfVectors_empty(self) def size(self) -> "std::vector< std::shared_ptr< SiconosVector > >::size_type": return _pysensor.VectorOfVectors_size(self) def swap(self, v: "VectorOfVectors") -> "void": return _pysensor.VectorOfVectors_swap(self, v) def begin(self) -> "std::vector< std::shared_ptr< SiconosVector > >::iterator": return _pysensor.VectorOfVectors_begin(self) def end(self) -> "std::vector< std::shared_ptr< SiconosVector > >::iterator": return _pysensor.VectorOfVectors_end(self) def rbegin(self) -> "std::vector< std::shared_ptr< SiconosVector > >::reverse_iterator": return _pysensor.VectorOfVectors_rbegin(self) def rend(self) -> "std::vector< std::shared_ptr< SiconosVector > >::reverse_iterator": return _pysensor.VectorOfVectors_rend(self) def clear(self) -> "void": return _pysensor.VectorOfVectors_clear(self) def get_allocator(self) -> "std::vector< std::shared_ptr< SiconosVector > >::allocator_type": return _pysensor.VectorOfVectors_get_allocator(self) def pop_back(self) -> "void": return _pysensor.VectorOfVectors_pop_back(self) def erase(self, *args) -> "std::vector< std::shared_ptr< SiconosVector > >::iterator": return _pysensor.VectorOfVectors_erase(self, *args) def __init__(self, *args): _pysensor.VectorOfVectors_swiginit(self, _pysensor.new_VectorOfVectors(*args)) def push_back(self, x: "std::vector< std::shared_ptr< SiconosVector > >::value_type const &") -> "void": return _pysensor.VectorOfVectors_push_back(self, x) def front(self) -> "std::vector< std::shared_ptr< SiconosVector > >::value_type const &": return _pysensor.VectorOfVectors_front(self) def back(self) -> "std::vector< std::shared_ptr< SiconosVector > >::value_type const &": return _pysensor.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 _pysensor.VectorOfVectors_assign(self, n, x) def resize(self, *args) -> "void": return _pysensor.VectorOfVectors_resize(self, *args) def insert(self, *args) -> "void": return _pysensor.VectorOfVectors_insert(self, *args) def reserve(self, n: "std::vector< std::shared_ptr< SiconosVector > >::size_type") -> "void": return _pysensor.VectorOfVectors_reserve(self, n) def capacity(self) -> "std::vector< std::shared_ptr< SiconosVector > >::size_type": return _pysensor.VectorOfVectors_capacity(self) __swig_destroy__ = _pysensor.delete_VectorOfVectors # Register VectorOfVectors in _pysensor: _pysensor.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 _pysensor.VectorOfBlockVectors_iterator(self) def __iter__(self): return self.iterator() def __nonzero__(self) -> "bool": return _pysensor.VectorOfBlockVectors___nonzero__(self) def __bool__(self) -> "bool": return _pysensor.VectorOfBlockVectors___bool__(self) def __len__(self) -> "std::vector< std::shared_ptr< BlockVector > >::size_type": return _pysensor.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 _pysensor.VectorOfBlockVectors___getslice__(self, i, j) def __setslice__(self, *args) -> "void": return _pysensor.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 _pysensor.VectorOfBlockVectors___delslice__(self, i, j) def __delitem__(self, *args) -> "void": return _pysensor.VectorOfBlockVectors___delitem__(self, *args) def __getitem__(self, *args) -> "std::vector< std::shared_ptr< BlockVector > >::value_type const &": return _pysensor.VectorOfBlockVectors___getitem__(self, *args) def __setitem__(self, *args) -> "void": return _pysensor.VectorOfBlockVectors___setitem__(self, *args) def pop(self) -> "std::vector< std::shared_ptr< BlockVector > >::value_type": return _pysensor.VectorOfBlockVectors_pop(self) def append(self, x: "std::vector< std::shared_ptr< BlockVector > >::value_type const &") -> "void": return _pysensor.VectorOfBlockVectors_append(self, x) def empty(self) -> "bool": return _pysensor.VectorOfBlockVectors_empty(self) def size(self) -> "std::vector< std::shared_ptr< BlockVector > >::size_type": return _pysensor.VectorOfBlockVectors_size(self) def swap(self, v: "VectorOfBlockVectors") -> "void": return _pysensor.VectorOfBlockVectors_swap(self, v) def begin(self) -> "std::vector< std::shared_ptr< BlockVector > >::iterator": return _pysensor.VectorOfBlockVectors_begin(self) def end(self) -> "std::vector< std::shared_ptr< BlockVector > >::iterator": return _pysensor.VectorOfBlockVectors_end(self) def rbegin(self) -> "std::vector< std::shared_ptr< BlockVector > >::reverse_iterator": return _pysensor.VectorOfBlockVectors_rbegin(self) def rend(self) -> "std::vector< std::shared_ptr< BlockVector > >::reverse_iterator": return _pysensor.VectorOfBlockVectors_rend(self) def clear(self) -> "void": return _pysensor.VectorOfBlockVectors_clear(self) def get_allocator(self) -> "std::vector< std::shared_ptr< BlockVector > >::allocator_type": return _pysensor.VectorOfBlockVectors_get_allocator(self) def pop_back(self) -> "void": return _pysensor.VectorOfBlockVectors_pop_back(self) def erase(self, *args) -> "std::vector< std::shared_ptr< BlockVector > >::iterator": return _pysensor.VectorOfBlockVectors_erase(self, *args) def __init__(self, *args): _pysensor.VectorOfBlockVectors_swiginit(self, _pysensor.new_VectorOfBlockVectors(*args)) def push_back(self, x: "std::vector< std::shared_ptr< BlockVector > >::value_type const &") -> "void": return _pysensor.VectorOfBlockVectors_push_back(self, x) def front(self) -> "std::vector< std::shared_ptr< BlockVector > >::value_type const &": return _pysensor.VectorOfBlockVectors_front(self) def back(self) -> "std::vector< std::shared_ptr< BlockVector > >::value_type const &": return _pysensor.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 _pysensor.VectorOfBlockVectors_assign(self, n, x) def resize(self, *args) -> "void": return _pysensor.VectorOfBlockVectors_resize(self, *args) def insert(self, *args) -> "void": return _pysensor.VectorOfBlockVectors_insert(self, *args) def reserve(self, n: "std::vector< std::shared_ptr< BlockVector > >::size_type") -> "void": return _pysensor.VectorOfBlockVectors_reserve(self, n) def capacity(self) -> "std::vector< std::shared_ptr< BlockVector > >::size_type": return _pysensor.VectorOfBlockVectors_capacity(self) __swig_destroy__ = _pysensor.delete_VectorOfBlockVectors # Register VectorOfBlockVectors in _pysensor: _pysensor.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 _pysensor.VectorOfMatrices_iterator(self) def __iter__(self): return self.iterator() def __nonzero__(self) -> "bool": return _pysensor.VectorOfMatrices___nonzero__(self) def __bool__(self) -> "bool": return _pysensor.VectorOfMatrices___bool__(self) def __len__(self) -> "std::vector< std::shared_ptr< SiconosMatrix > >::size_type": return _pysensor.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 _pysensor.VectorOfMatrices___getslice__(self, i, j) def __setslice__(self, *args) -> "void": return _pysensor.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 _pysensor.VectorOfMatrices___delslice__(self, i, j) def __delitem__(self, *args) -> "void": return _pysensor.VectorOfMatrices___delitem__(self, *args) def __getitem__(self, *args) -> "std::vector< std::shared_ptr< SiconosMatrix > >::value_type const &": return _pysensor.VectorOfMatrices___getitem__(self, *args) def __setitem__(self, *args) -> "void": return _pysensor.VectorOfMatrices___setitem__(self, *args) def pop(self) -> "std::vector< std::shared_ptr< SiconosMatrix > >::value_type": return _pysensor.VectorOfMatrices_pop(self) def append(self, x: "std::vector< std::shared_ptr< SiconosMatrix > >::value_type const &") -> "void": return _pysensor.VectorOfMatrices_append(self, x) def empty(self) -> "bool": return _pysensor.VectorOfMatrices_empty(self) def size(self) -> "std::vector< std::shared_ptr< SiconosMatrix > >::size_type": return _pysensor.VectorOfMatrices_size(self) def swap(self, v: "VectorOfMatrices") -> "void": return _pysensor.VectorOfMatrices_swap(self, v) def begin(self) -> "std::vector< std::shared_ptr< SiconosMatrix > >::iterator": return _pysensor.VectorOfMatrices_begin(self) def end(self) -> "std::vector< std::shared_ptr< SiconosMatrix > >::iterator": return _pysensor.VectorOfMatrices_end(self) def rbegin(self) -> "std::vector< std::shared_ptr< SiconosMatrix > >::reverse_iterator": return _pysensor.VectorOfMatrices_rbegin(self) def rend(self) -> "std::vector< std::shared_ptr< SiconosMatrix > >::reverse_iterator": return _pysensor.VectorOfMatrices_rend(self) def clear(self) -> "void": return _pysensor.VectorOfMatrices_clear(self) def get_allocator(self) -> "std::vector< std::shared_ptr< SiconosMatrix > >::allocator_type": return _pysensor.VectorOfMatrices_get_allocator(self) def pop_back(self) -> "void": return _pysensor.VectorOfMatrices_pop_back(self) def erase(self, *args) -> "std::vector< std::shared_ptr< SiconosMatrix > >::iterator": return _pysensor.VectorOfMatrices_erase(self, *args) def __init__(self, *args): _pysensor.VectorOfMatrices_swiginit(self, _pysensor.new_VectorOfMatrices(*args)) def push_back(self, x: "std::vector< std::shared_ptr< SiconosMatrix > >::value_type const &") -> "void": return _pysensor.VectorOfMatrices_push_back(self, x) def front(self) -> "std::vector< std::shared_ptr< SiconosMatrix > >::value_type const &": return _pysensor.VectorOfMatrices_front(self) def back(self) -> "std::vector< std::shared_ptr< SiconosMatrix > >::value_type const &": return _pysensor.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 _pysensor.VectorOfMatrices_assign(self, n, x) def resize(self, *args) -> "void": return _pysensor.VectorOfMatrices_resize(self, *args) def insert(self, *args) -> "void": return _pysensor.VectorOfMatrices_insert(self, *args) def reserve(self, n: "std::vector< std::shared_ptr< SiconosMatrix > >::size_type") -> "void": return _pysensor.VectorOfMatrices_reserve(self, n) def capacity(self) -> "std::vector< std::shared_ptr< SiconosMatrix > >::size_type": return _pysensor.VectorOfMatrices_capacity(self) __swig_destroy__ = _pysensor.delete_VectorOfMatrices # Register VectorOfMatrices in _pysensor: _pysensor.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 _pysensor.VectorOfSMatrices_iterator(self) def __iter__(self): return self.iterator() def __nonzero__(self) -> "bool": return _pysensor.VectorOfSMatrices___nonzero__(self) def __bool__(self) -> "bool": return _pysensor.VectorOfSMatrices___bool__(self) def __len__(self) -> "std::vector< std::shared_ptr< SimpleMatrix > >::size_type": return _pysensor.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 _pysensor.VectorOfSMatrices___getslice__(self, i, j) def __setslice__(self, *args) -> "void": return _pysensor.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 _pysensor.VectorOfSMatrices___delslice__(self, i, j) def __delitem__(self, *args) -> "void": return _pysensor.VectorOfSMatrices___delitem__(self, *args) def __getitem__(self, *args) -> "std::vector< std::shared_ptr< SimpleMatrix > >::value_type const &": return _pysensor.VectorOfSMatrices___getitem__(self, *args) def __setitem__(self, *args) -> "void": return _pysensor.VectorOfSMatrices___setitem__(self, *args) def pop(self) -> "std::vector< std::shared_ptr< SimpleMatrix > >::value_type": return _pysensor.VectorOfSMatrices_pop(self) def append(self, x: "std::vector< std::shared_ptr< SimpleMatrix > >::value_type const &") -> "void": return _pysensor.VectorOfSMatrices_append(self, x) def empty(self) -> "bool": return _pysensor.VectorOfSMatrices_empty(self) def size(self) -> "std::vector< std::shared_ptr< SimpleMatrix > >::size_type": return _pysensor.VectorOfSMatrices_size(self) def swap(self, v: "VectorOfSMatrices") -> "void": return _pysensor.VectorOfSMatrices_swap(self, v) def begin(self) -> "std::vector< std::shared_ptr< SimpleMatrix > >::iterator": return _pysensor.VectorOfSMatrices_begin(self) def end(self) -> "std::vector< std::shared_ptr< SimpleMatrix > >::iterator": return _pysensor.VectorOfSMatrices_end(self) def rbegin(self) -> "std::vector< std::shared_ptr< SimpleMatrix > >::reverse_iterator": return _pysensor.VectorOfSMatrices_rbegin(self) def rend(self) -> "std::vector< std::shared_ptr< SimpleMatrix > >::reverse_iterator": return _pysensor.VectorOfSMatrices_rend(self) def clear(self) -> "void": return _pysensor.VectorOfSMatrices_clear(self) def get_allocator(self) -> "std::vector< std::shared_ptr< SimpleMatrix > >::allocator_type": return _pysensor.VectorOfSMatrices_get_allocator(self) def pop_back(self) -> "void": return _pysensor.VectorOfSMatrices_pop_back(self) def erase(self, *args) -> "std::vector< std::shared_ptr< SimpleMatrix > >::iterator": return _pysensor.VectorOfSMatrices_erase(self, *args) def __init__(self, *args): _pysensor.VectorOfSMatrices_swiginit(self, _pysensor.new_VectorOfSMatrices(*args)) def push_back(self, x: "std::vector< std::shared_ptr< SimpleMatrix > >::value_type const &") -> "void": return _pysensor.VectorOfSMatrices_push_back(self, x) def front(self) -> "std::vector< std::shared_ptr< SimpleMatrix > >::value_type const &": return _pysensor.VectorOfSMatrices_front(self) def back(self) -> "std::vector< std::shared_ptr< SimpleMatrix > >::value_type const &": return _pysensor.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 _pysensor.VectorOfSMatrices_assign(self, n, x) def resize(self, *args) -> "void": return _pysensor.VectorOfSMatrices_resize(self, *args) def insert(self, *args) -> "void": return _pysensor.VectorOfSMatrices_insert(self, *args) def reserve(self, n: "std::vector< std::shared_ptr< SimpleMatrix > >::size_type") -> "void": return _pysensor.VectorOfSMatrices_reserve(self, n) def capacity(self) -> "std::vector< std::shared_ptr< SimpleMatrix > >::size_type": return _pysensor.VectorOfSMatrices_capacity(self) __swig_destroy__ = _pysensor.delete_VectorOfSMatrices # Register VectorOfSMatrices in _pysensor: _pysensor.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 _pysensor.VectorOfMemories_iterator(self) def __iter__(self): return self.iterator() def __nonzero__(self) -> "bool": return _pysensor.VectorOfMemories___nonzero__(self) def __bool__(self) -> "bool": return _pysensor.VectorOfMemories___bool__(self) def __len__(self) -> "std::vector< SiconosMemory >::size_type": return _pysensor.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 _pysensor.VectorOfMemories___getslice__(self, i, j) def __setslice__(self, *args) -> "void": return _pysensor.VectorOfMemories___setslice__(self, *args) def __delslice__(self, i: "std::vector< SiconosMemory >::difference_type", j: "std::vector< SiconosMemory >::difference_type") -> "void": return _pysensor.VectorOfMemories___delslice__(self, i, j) def __delitem__(self, *args) -> "void": return _pysensor.VectorOfMemories___delitem__(self, *args) def __getitem__(self, *args) -> "std::vector< SiconosMemory >::value_type const &": return _pysensor.VectorOfMemories___getitem__(self, *args) def __setitem__(self, *args) -> "void": return _pysensor.VectorOfMemories___setitem__(self, *args) def pop(self) -> "std::vector< SiconosMemory >::value_type": return _pysensor.VectorOfMemories_pop(self) def append(self, x: "SiconosMemory") -> "void": return _pysensor.VectorOfMemories_append(self, x) def empty(self) -> "bool": return _pysensor.VectorOfMemories_empty(self) def size(self) -> "std::vector< SiconosMemory >::size_type": return _pysensor.VectorOfMemories_size(self) def swap(self, v: "VectorOfMemories") -> "void": return _pysensor.VectorOfMemories_swap(self, v) def begin(self) -> "std::vector< SiconosMemory >::iterator": return _pysensor.VectorOfMemories_begin(self) def end(self) -> "std::vector< SiconosMemory >::iterator": return _pysensor.VectorOfMemories_end(self) def rbegin(self) -> "std::vector< SiconosMemory >::reverse_iterator": return _pysensor.VectorOfMemories_rbegin(self) def rend(self) -> "std::vector< SiconosMemory >::reverse_iterator": return _pysensor.VectorOfMemories_rend(self) def clear(self) -> "void": return _pysensor.VectorOfMemories_clear(self) def get_allocator(self) -> "std::vector< SiconosMemory >::allocator_type": return _pysensor.VectorOfMemories_get_allocator(self) def pop_back(self) -> "void": return _pysensor.VectorOfMemories_pop_back(self) def erase(self, *args) -> "std::vector< SiconosMemory >::iterator": return _pysensor.VectorOfMemories_erase(self, *args) def __init__(self, *args): _pysensor.VectorOfMemories_swiginit(self, _pysensor.new_VectorOfMemories(*args)) def push_back(self, x: "SiconosMemory") -> "void": return _pysensor.VectorOfMemories_push_back(self, x) def front(self) -> "std::vector< SiconosMemory >::value_type const &": return _pysensor.VectorOfMemories_front(self) def back(self) -> "std::vector< SiconosMemory >::value_type const &": return _pysensor.VectorOfMemories_back(self) def assign(self, n: "std::vector< SiconosMemory >::size_type", x: "SiconosMemory") -> "void": return _pysensor.VectorOfMemories_assign(self, n, x) def resize(self, *args) -> "void": return _pysensor.VectorOfMemories_resize(self, *args) def insert(self, *args) -> "void": return _pysensor.VectorOfMemories_insert(self, *args) def reserve(self, n: "std::vector< SiconosMemory >::size_type") -> "void": return _pysensor.VectorOfMemories_reserve(self, n) def capacity(self) -> "std::vector< SiconosMemory >::size_type": return _pysensor.VectorOfMemories_capacity(self) __swig_destroy__ = _pysensor.delete_VectorOfMemories # Register VectorOfMemories in _pysensor: _pysensor.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 _pysensor.UnsignedIntVector_iterator(self) def __iter__(self): return self.iterator() def __nonzero__(self) -> "bool": return _pysensor.UnsignedIntVector___nonzero__(self) def __bool__(self) -> "bool": return _pysensor.UnsignedIntVector___bool__(self) def __len__(self) -> "std::vector< unsigned int >::size_type": return _pysensor.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 _pysensor.UnsignedIntVector___getslice__(self, i, j) def __setslice__(self, *args) -> "void": return _pysensor.UnsignedIntVector___setslice__(self, *args) def __delslice__(self, i: "std::vector< unsigned int >::difference_type", j: "std::vector< unsigned int >::difference_type") -> "void": return _pysensor.UnsignedIntVector___delslice__(self, i, j) def __delitem__(self, *args) -> "void": return _pysensor.UnsignedIntVector___delitem__(self, *args) def __getitem__(self, *args) -> "std::vector< unsigned int >::value_type const &": return _pysensor.UnsignedIntVector___getitem__(self, *args) def __setitem__(self, *args) -> "void": return _pysensor.UnsignedIntVector___setitem__(self, *args) def pop(self) -> "std::vector< unsigned int >::value_type": return _pysensor.UnsignedIntVector_pop(self) def append(self, x: "std::vector< unsigned int >::value_type const &") -> "void": return _pysensor.UnsignedIntVector_append(self, x) def empty(self) -> "bool": return _pysensor.UnsignedIntVector_empty(self) def size(self) -> "std::vector< unsigned int >::size_type": return _pysensor.UnsignedIntVector_size(self) def swap(self, v: "UnsignedIntVector") -> "void": return _pysensor.UnsignedIntVector_swap(self, v) def begin(self) -> "std::vector< unsigned int >::iterator": return _pysensor.UnsignedIntVector_begin(self) def end(self) -> "std::vector< unsigned int >::iterator": return _pysensor.UnsignedIntVector_end(self) def rbegin(self) -> "std::vector< unsigned int >::reverse_iterator": return _pysensor.UnsignedIntVector_rbegin(self) def rend(self) -> "std::vector< unsigned int >::reverse_iterator": return _pysensor.UnsignedIntVector_rend(self) def clear(self) -> "void": return _pysensor.UnsignedIntVector_clear(self) def get_allocator(self) -> "std::vector< unsigned int >::allocator_type": return _pysensor.UnsignedIntVector_get_allocator(self) def pop_back(self) -> "void": return _pysensor.UnsignedIntVector_pop_back(self) def erase(self, *args) -> "std::vector< unsigned int >::iterator": return _pysensor.UnsignedIntVector_erase(self, *args) def __init__(self, *args): _pysensor.UnsignedIntVector_swiginit(self, _pysensor.new_UnsignedIntVector(*args)) def push_back(self, x: "std::vector< unsigned int >::value_type const &") -> "void": return _pysensor.UnsignedIntVector_push_back(self, x) def front(self) -> "std::vector< unsigned int >::value_type const &": return _pysensor.UnsignedIntVector_front(self) def back(self) -> "std::vector< unsigned int >::value_type const &": return _pysensor.UnsignedIntVector_back(self) def assign(self, n: "std::vector< unsigned int >::size_type", x: "std::vector< unsigned int >::value_type const &") -> "void": return _pysensor.UnsignedIntVector_assign(self, n, x) def resize(self, *args) -> "void": return _pysensor.UnsignedIntVector_resize(self, *args) def insert(self, *args) -> "void": return _pysensor.UnsignedIntVector_insert(self, *args) def reserve(self, n: "std::vector< unsigned int >::size_type") -> "void": return _pysensor.UnsignedIntVector_reserve(self, n) def capacity(self) -> "std::vector< unsigned int >::size_type": return _pysensor.UnsignedIntVector_capacity(self) __swig_destroy__ = _pysensor.delete_UnsignedIntVector # Register UnsignedIntVector in _pysensor: _pysensor.UnsignedIntVector_swigregister(UnsignedIntVector) import siconos.kernel
[docs]class Sensor(object): r""" Sensor Base Class Abstract class, interface to user-defined sensors. A Sensor is dedicated to data capture. It gives an interface for User who can implement its own Sensor to clearly define which data he needs to save. A Sensor handles a TimeDiscretisation, which defines the set of all instants where the sensor must operate (i.e. each times where capture() function will be called). An Event, inserted into the EventsManager of the Simulation, is linked to this TimeDiscretisation. Moreover, a Sensor is identified thanks to an id and a type (a number associated to the derived class type indeed). Construction To build a Sensor 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 SensorFactory::Registry& regSensor(SensorFactory::Registry::get()) ; Build a Sensor of type "myType" with t as a TimeDiscretisation. regSensor.instantiate(myType, t); The best way is to use the controlManager: .. code-block:: c++ cm a ControlManager cm->addSensor(myType,t); or if cm has already been initialized: cm->addAndRecordSensor(myType,t) The data are saved in a DataSet object named data, a map which associate to each Event another map. This second map links a std::string, used to identify the data, and a SiconosVector. As an example consider the case where you need to save the state vector x of a DynamicalSystem, then you can define a Data object, with "myDS_X" as an id and yourDS->x() as the SiconosVector. For myEvent being an Event where you need to save data, you get: (data[myEvent])["myDS_X"] = model->nonSmoothDynamicalSystem()->dynamicalSystem()->x() See users' manual for details on how to define its own Sensor. """ 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__ = _pysensor.delete_Sensor
[docs] def setId(self, newId: "std::string const &") -> "void": r""" set id of the Sensor :type newId: string :param newId: the id of the Sensor """ return _pysensor.Sensor_setId(self, newId)
[docs] def getId(self) -> "std::string const": r""" get id of the Sensor :rtype: string :return: a std::string """ return _pysensor.Sensor_getId(self)
[docs] def getType(self) -> "unsigned int": r""" get the type of the Sensor :rtype: int :return: an int """ return _pysensor.Sensor_getType(self)
[docs] def getDS(self) -> "SP::DynamicalSystem": r""" get the DynamicalSystem linked to this Sensor :rtype: :py:class:`DynamicalSystem` :return: SP::DynamicalSystem """ return _pysensor.Sensor_getDS(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 _pysensor.Sensor_setTimeDiscretisation(self, td)
[docs] def initialize(self, nsds: "NonSmoothDynamicalSystem") -> "void": r""" initialize sensor data. :type nsds: :py:class:`NonSmoothDynamicalSystem` :param nsds: the Model """ return _pysensor.Sensor_initialize(self, nsds)
[docs] def capture(self) -> "void": r""" capture data when the SensorEvent is processed => set data[SensorEvent]=...""" return _pysensor.Sensor_capture(self)
[docs] def display(self) -> "void": r""" display the data of the Sensor on the standard output""" return _pysensor.Sensor_display(self)
# Register Sensor in _pysensor: _pysensor.Sensor_swigregister(Sensor)
[docs]class ControlSensor(Sensor): r""" Generic control Sensor to get the output of the system""" thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr _storedY = property(_pysensor.ControlSensor__storedY_get, _pysensor.ControlSensor__storedY_set, doc=r""" A vector for the current value of the output""") _delay = property(_pysensor.ControlSensor__delay_get, _pysensor.ControlSensor__delay_set, doc=r""" delay between the measurement on the DynamicalSystem and the avaibility of the value""") _bufferY = property(_pysensor.ControlSensor__bufferY_get, _pysensor.ControlSensor__bufferY_set, doc=r""" A buffer to store the value of :math:`y_k` if there is a delay""") def __init__(self, *args): r""" *Overload 1:* Default constructor | *Overload 2:* Simple Constructor :type type: int :param type: the type of the Sensor :type ds: :py:class:`DynamicalSystem` :param ds: the SP::DynamicalSystem it observes :type delay: float, optional :param delay: the delay between the measurement and the avaibility of the data | *Overload 3:* Simple Constructor :type type: int :param type: the type of the Sensor :type ds: :py:class:`DynamicalSystem` :param ds: the SP::DynamicalSystem it observes :param delay: the delay between the measurement and the avaibility of the data """ if self.__class__ == ControlSensor: _self = None else: _self = self _pysensor.ControlSensor_swiginit(self, _pysensor.new_ControlSensor(_self, *args))
[docs] def initialize(self, nsds: "NonSmoothDynamicalSystem") -> "void": return _pysensor.ControlSensor_initialize(self, nsds)
[docs] def getYDim(self) -> "unsigned int": r""" Get the dimension of the output :rtype: int :return: an unsigned int """ return _pysensor.ControlSensor_getYDim(self)
[docs] def y(self) -> "SiconosVector const &": r""" Get a pointer to the output :rtype: :py:class:`SiconosVector` :return: SP::SiconosVector to the output """ return _pysensor.ControlSensor_y(self)
def yTk(self) -> "SP::SiconosVector": return _pysensor.ControlSensor_yTk(self)
[docs] def capture(self) -> "void": r""" capture data when the SensorEvent is processed => set data[SensorEvent]=...""" return _pysensor.ControlSensor_capture(self)
__swig_destroy__ = _pysensor.delete_ControlSensor def __disown__(self): self.this.disown() _pysensor.disown_ControlSensor(self) return weakref.proxy(self)
# Register ControlSensor in _pysensor: _pysensor.ControlSensor_swigregister(ControlSensor)
[docs]class LinearSensor(ControlSensor): r""" A generic linear sensor, to capture the output y defined as y = Cx + Du""" 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 for the SensorFactory :type ds: :py:class:`DynamicalSystem` :param ds: the SP::DynamicalSystem it observes | *Overload 2:* Constructor with the full set of data :type ds: :py:class:`DynamicalSystem` :param ds: the SP::DynamicalSystem it observes. :type C: :py:class:`SimpleMatrix` :param C: a SP::SiconosMatrix. :type D: :py:class:`SimpleMatrix`, optional :param D: a SP::SiconosMatrix (optional). | *Overload 3:* Constructor with the full set of data :type ds: :py:class:`DynamicalSystem` :param ds: the SP::DynamicalSystem it observes. :type C: :py:class:`SimpleMatrix` :param C: a SP::SiconosMatrix. :param D: a SP::SiconosMatrix (optional). """ if self.__class__ == LinearSensor: _self = None else: _self = self _pysensor.LinearSensor_swiginit(self, _pysensor.new_LinearSensor(_self, *args)) __swig_destroy__ = _pysensor.delete_LinearSensor
[docs] def initialize(self, nsds: "NonSmoothDynamicalSystem") -> "void": r""" initialize sensor data :type nsds: :py:class:`NonSmoothDynamicalSystem` :param nsds: current nonsmooth dynamical system """ return _pysensor.LinearSensor_initialize(self, nsds)
[docs] def capture(self) -> "void": r""" capture data when the SensorEvent is processed ( for example set data[SensorEvent]=... )""" return _pysensor.LinearSensor_capture(self)
[docs] def setC(self, C: "SimpleMatrix") -> "void": r""" Set the C matrix. :type C: :py:class:`SimpleMatrix` :param C: a SimpleMatrix """ return _pysensor.LinearSensor_setC(self, C)
[docs] def setCPtr(self, C: "SP::SimpleMatrix") -> "void": r""" Set the C matrix :type C: :py:class:`SimpleMatrix` :param C: a SP::SimpleMatrix """ return _pysensor.LinearSensor_setCPtr(self, C)
[docs] def setD(self, D: "SimpleMatrix") -> "void": r""" Set the D matrix :type D: :py:class:`SimpleMatrix` :param D: a SimpleMatrix """ return _pysensor.LinearSensor_setD(self, D)
[docs] def setDPtr(self, D: "SP::SimpleMatrix") -> "void": r""" Set the D matrix :type D: :py:class:`SimpleMatrix` :param D: a SP::SimpleMatrix """ return _pysensor.LinearSensor_setDPtr(self, D)
def __disown__(self): self.this.disown() _pysensor.disown_LinearSensor(self) return weakref.proxy(self)
# Register LinearSensor in _pysensor: _pysensor.LinearSensor_swigregister(LinearSensor)