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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

SHARED_PTR_DISOWN = _sicpysensor.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 _sicpysensor.nullDeleter___call__(self, arg2) __swig_destroy__ = _sicpysensor.delete_nullDeleter
# Register nullDeleter in _sicpysensor: _sicpysensor.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 _sicpysensor.VectorOfVectors_iterator(self) def __iter__(self): return self.iterator() def __nonzero__(self) -> "bool": return _sicpysensor.VectorOfVectors___nonzero__(self) def __bool__(self) -> "bool": return _sicpysensor.VectorOfVectors___bool__(self) def __len__(self) -> "std::vector< std::shared_ptr< SiconosVector > >::size_type": return _sicpysensor.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 _sicpysensor.VectorOfVectors___getslice__(self, i, j) def __setslice__(self, *args) -> "void": return _sicpysensor.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 _sicpysensor.VectorOfVectors___delslice__(self, i, j) def __delitem__(self, *args) -> "void": return _sicpysensor.VectorOfVectors___delitem__(self, *args) def __getitem__(self, *args) -> "std::vector< std::shared_ptr< SiconosVector > >::value_type const &": return _sicpysensor.VectorOfVectors___getitem__(self, *args) def __setitem__(self, *args) -> "void": return _sicpysensor.VectorOfVectors___setitem__(self, *args) def pop(self) -> "std::vector< std::shared_ptr< SiconosVector > >::value_type": return _sicpysensor.VectorOfVectors_pop(self) def append(self, x: "std::vector< std::shared_ptr< SiconosVector > >::value_type const &") -> "void": return _sicpysensor.VectorOfVectors_append(self, x) def empty(self) -> "bool": return _sicpysensor.VectorOfVectors_empty(self) def size(self) -> "std::vector< std::shared_ptr< SiconosVector > >::size_type": return _sicpysensor.VectorOfVectors_size(self) def swap(self, v: "VectorOfVectors") -> "void": return _sicpysensor.VectorOfVectors_swap(self, v) def begin(self) -> "std::vector< std::shared_ptr< SiconosVector > >::iterator": return _sicpysensor.VectorOfVectors_begin(self) def end(self) -> "std::vector< std::shared_ptr< SiconosVector > >::iterator": return _sicpysensor.VectorOfVectors_end(self) def rbegin(self) -> "std::vector< std::shared_ptr< SiconosVector > >::reverse_iterator": return _sicpysensor.VectorOfVectors_rbegin(self) def rend(self) -> "std::vector< std::shared_ptr< SiconosVector > >::reverse_iterator": return _sicpysensor.VectorOfVectors_rend(self) def clear(self) -> "void": return _sicpysensor.VectorOfVectors_clear(self) def get_allocator(self) -> "std::vector< std::shared_ptr< SiconosVector > >::allocator_type": return _sicpysensor.VectorOfVectors_get_allocator(self) def pop_back(self) -> "void": return _sicpysensor.VectorOfVectors_pop_back(self) def erase(self, *args) -> "std::vector< std::shared_ptr< SiconosVector > >::iterator": return _sicpysensor.VectorOfVectors_erase(self, *args) def __init__(self, *args): _sicpysensor.VectorOfVectors_swiginit(self, _sicpysensor.new_VectorOfVectors(*args)) def push_back(self, x: "std::vector< std::shared_ptr< SiconosVector > >::value_type const &") -> "void": return _sicpysensor.VectorOfVectors_push_back(self, x) def front(self) -> "std::vector< std::shared_ptr< SiconosVector > >::value_type const &": return _sicpysensor.VectorOfVectors_front(self) def back(self) -> "std::vector< std::shared_ptr< SiconosVector > >::value_type const &": return _sicpysensor.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 _sicpysensor.VectorOfVectors_assign(self, n, x) def resize(self, *args) -> "void": return _sicpysensor.VectorOfVectors_resize(self, *args) def insert(self, *args) -> "void": return _sicpysensor.VectorOfVectors_insert(self, *args) def reserve(self, n: "std::vector< std::shared_ptr< SiconosVector > >::size_type") -> "void": return _sicpysensor.VectorOfVectors_reserve(self, n) def capacity(self) -> "std::vector< std::shared_ptr< SiconosVector > >::size_type": return _sicpysensor.VectorOfVectors_capacity(self) __swig_destroy__ = _sicpysensor.delete_VectorOfVectors # Register VectorOfVectors in _sicpysensor: _sicpysensor.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 _sicpysensor.VectorOfBlockVectors_iterator(self) def __iter__(self): return self.iterator() def __nonzero__(self) -> "bool": return _sicpysensor.VectorOfBlockVectors___nonzero__(self) def __bool__(self) -> "bool": return _sicpysensor.VectorOfBlockVectors___bool__(self) def __len__(self) -> "std::vector< std::shared_ptr< BlockVector > >::size_type": return _sicpysensor.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 _sicpysensor.VectorOfBlockVectors___getslice__(self, i, j) def __setslice__(self, *args) -> "void": return _sicpysensor.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 _sicpysensor.VectorOfBlockVectors___delslice__(self, i, j) def __delitem__(self, *args) -> "void": return _sicpysensor.VectorOfBlockVectors___delitem__(self, *args) def __getitem__(self, *args) -> "std::vector< std::shared_ptr< BlockVector > >::value_type const &": return _sicpysensor.VectorOfBlockVectors___getitem__(self, *args) def __setitem__(self, *args) -> "void": return _sicpysensor.VectorOfBlockVectors___setitem__(self, *args) def pop(self) -> "std::vector< std::shared_ptr< BlockVector > >::value_type": return _sicpysensor.VectorOfBlockVectors_pop(self) def append(self, x: "std::vector< std::shared_ptr< BlockVector > >::value_type const &") -> "void": return _sicpysensor.VectorOfBlockVectors_append(self, x) def empty(self) -> "bool": return _sicpysensor.VectorOfBlockVectors_empty(self) def size(self) -> "std::vector< std::shared_ptr< BlockVector > >::size_type": return _sicpysensor.VectorOfBlockVectors_size(self) def swap(self, v: "VectorOfBlockVectors") -> "void": return _sicpysensor.VectorOfBlockVectors_swap(self, v) def begin(self) -> "std::vector< std::shared_ptr< BlockVector > >::iterator": return _sicpysensor.VectorOfBlockVectors_begin(self) def end(self) -> "std::vector< std::shared_ptr< BlockVector > >::iterator": return _sicpysensor.VectorOfBlockVectors_end(self) def rbegin(self) -> "std::vector< std::shared_ptr< BlockVector > >::reverse_iterator": return _sicpysensor.VectorOfBlockVectors_rbegin(self) def rend(self) -> "std::vector< std::shared_ptr< BlockVector > >::reverse_iterator": return _sicpysensor.VectorOfBlockVectors_rend(self) def clear(self) -> "void": return _sicpysensor.VectorOfBlockVectors_clear(self) def get_allocator(self) -> "std::vector< std::shared_ptr< BlockVector > >::allocator_type": return _sicpysensor.VectorOfBlockVectors_get_allocator(self) def pop_back(self) -> "void": return _sicpysensor.VectorOfBlockVectors_pop_back(self) def erase(self, *args) -> "std::vector< std::shared_ptr< BlockVector > >::iterator": return _sicpysensor.VectorOfBlockVectors_erase(self, *args) def __init__(self, *args): _sicpysensor.VectorOfBlockVectors_swiginit(self, _sicpysensor.new_VectorOfBlockVectors(*args)) def push_back(self, x: "std::vector< std::shared_ptr< BlockVector > >::value_type const &") -> "void": return _sicpysensor.VectorOfBlockVectors_push_back(self, x) def front(self) -> "std::vector< std::shared_ptr< BlockVector > >::value_type const &": return _sicpysensor.VectorOfBlockVectors_front(self) def back(self) -> "std::vector< std::shared_ptr< BlockVector > >::value_type const &": return _sicpysensor.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 _sicpysensor.VectorOfBlockVectors_assign(self, n, x) def resize(self, *args) -> "void": return _sicpysensor.VectorOfBlockVectors_resize(self, *args) def insert(self, *args) -> "void": return _sicpysensor.VectorOfBlockVectors_insert(self, *args) def reserve(self, n: "std::vector< std::shared_ptr< BlockVector > >::size_type") -> "void": return _sicpysensor.VectorOfBlockVectors_reserve(self, n) def capacity(self) -> "std::vector< std::shared_ptr< BlockVector > >::size_type": return _sicpysensor.VectorOfBlockVectors_capacity(self) __swig_destroy__ = _sicpysensor.delete_VectorOfBlockVectors # Register VectorOfBlockVectors in _sicpysensor: _sicpysensor.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 _sicpysensor.VectorOfMatrices_iterator(self) def __iter__(self): return self.iterator() def __nonzero__(self) -> "bool": return _sicpysensor.VectorOfMatrices___nonzero__(self) def __bool__(self) -> "bool": return _sicpysensor.VectorOfMatrices___bool__(self) def __len__(self) -> "std::vector< std::shared_ptr< SiconosMatrix > >::size_type": return _sicpysensor.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 _sicpysensor.VectorOfMatrices___getslice__(self, i, j) def __setslice__(self, *args) -> "void": return _sicpysensor.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 _sicpysensor.VectorOfMatrices___delslice__(self, i, j) def __delitem__(self, *args) -> "void": return _sicpysensor.VectorOfMatrices___delitem__(self, *args) def __getitem__(self, *args) -> "std::vector< std::shared_ptr< SiconosMatrix > >::value_type const &": return _sicpysensor.VectorOfMatrices___getitem__(self, *args) def __setitem__(self, *args) -> "void": return _sicpysensor.VectorOfMatrices___setitem__(self, *args) def pop(self) -> "std::vector< std::shared_ptr< SiconosMatrix > >::value_type": return _sicpysensor.VectorOfMatrices_pop(self) def append(self, x: "std::vector< std::shared_ptr< SiconosMatrix > >::value_type const &") -> "void": return _sicpysensor.VectorOfMatrices_append(self, x) def empty(self) -> "bool": return _sicpysensor.VectorOfMatrices_empty(self) def size(self) -> "std::vector< std::shared_ptr< SiconosMatrix > >::size_type": return _sicpysensor.VectorOfMatrices_size(self) def swap(self, v: "VectorOfMatrices") -> "void": return _sicpysensor.VectorOfMatrices_swap(self, v) def begin(self) -> "std::vector< std::shared_ptr< SiconosMatrix > >::iterator": return _sicpysensor.VectorOfMatrices_begin(self) def end(self) -> "std::vector< std::shared_ptr< SiconosMatrix > >::iterator": return _sicpysensor.VectorOfMatrices_end(self) def rbegin(self) -> "std::vector< std::shared_ptr< SiconosMatrix > >::reverse_iterator": return _sicpysensor.VectorOfMatrices_rbegin(self) def rend(self) -> "std::vector< std::shared_ptr< SiconosMatrix > >::reverse_iterator": return _sicpysensor.VectorOfMatrices_rend(self) def clear(self) -> "void": return _sicpysensor.VectorOfMatrices_clear(self) def get_allocator(self) -> "std::vector< std::shared_ptr< SiconosMatrix > >::allocator_type": return _sicpysensor.VectorOfMatrices_get_allocator(self) def pop_back(self) -> "void": return _sicpysensor.VectorOfMatrices_pop_back(self) def erase(self, *args) -> "std::vector< std::shared_ptr< SiconosMatrix > >::iterator": return _sicpysensor.VectorOfMatrices_erase(self, *args) def __init__(self, *args): _sicpysensor.VectorOfMatrices_swiginit(self, _sicpysensor.new_VectorOfMatrices(*args)) def push_back(self, x: "std::vector< std::shared_ptr< SiconosMatrix > >::value_type const &") -> "void": return _sicpysensor.VectorOfMatrices_push_back(self, x) def front(self) -> "std::vector< std::shared_ptr< SiconosMatrix > >::value_type const &": return _sicpysensor.VectorOfMatrices_front(self) def back(self) -> "std::vector< std::shared_ptr< SiconosMatrix > >::value_type const &": return _sicpysensor.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 _sicpysensor.VectorOfMatrices_assign(self, n, x) def resize(self, *args) -> "void": return _sicpysensor.VectorOfMatrices_resize(self, *args) def insert(self, *args) -> "void": return _sicpysensor.VectorOfMatrices_insert(self, *args) def reserve(self, n: "std::vector< std::shared_ptr< SiconosMatrix > >::size_type") -> "void": return _sicpysensor.VectorOfMatrices_reserve(self, n) def capacity(self) -> "std::vector< std::shared_ptr< SiconosMatrix > >::size_type": return _sicpysensor.VectorOfMatrices_capacity(self) __swig_destroy__ = _sicpysensor.delete_VectorOfMatrices # Register VectorOfMatrices in _sicpysensor: _sicpysensor.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 _sicpysensor.VectorOfSMatrices_iterator(self) def __iter__(self): return self.iterator() def __nonzero__(self) -> "bool": return _sicpysensor.VectorOfSMatrices___nonzero__(self) def __bool__(self) -> "bool": return _sicpysensor.VectorOfSMatrices___bool__(self) def __len__(self) -> "std::vector< std::shared_ptr< SimpleMatrix > >::size_type": return _sicpysensor.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 _sicpysensor.VectorOfSMatrices___getslice__(self, i, j) def __setslice__(self, *args) -> "void": return _sicpysensor.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 _sicpysensor.VectorOfSMatrices___delslice__(self, i, j) def __delitem__(self, *args) -> "void": return _sicpysensor.VectorOfSMatrices___delitem__(self, *args) def __getitem__(self, *args) -> "std::vector< std::shared_ptr< SimpleMatrix > >::value_type const &": return _sicpysensor.VectorOfSMatrices___getitem__(self, *args) def __setitem__(self, *args) -> "void": return _sicpysensor.VectorOfSMatrices___setitem__(self, *args) def pop(self) -> "std::vector< std::shared_ptr< SimpleMatrix > >::value_type": return _sicpysensor.VectorOfSMatrices_pop(self) def append(self, x: "std::vector< std::shared_ptr< SimpleMatrix > >::value_type const &") -> "void": return _sicpysensor.VectorOfSMatrices_append(self, x) def empty(self) -> "bool": return _sicpysensor.VectorOfSMatrices_empty(self) def size(self) -> "std::vector< std::shared_ptr< SimpleMatrix > >::size_type": return _sicpysensor.VectorOfSMatrices_size(self) def swap(self, v: "VectorOfSMatrices") -> "void": return _sicpysensor.VectorOfSMatrices_swap(self, v) def begin(self) -> "std::vector< std::shared_ptr< SimpleMatrix > >::iterator": return _sicpysensor.VectorOfSMatrices_begin(self) def end(self) -> "std::vector< std::shared_ptr< SimpleMatrix > >::iterator": return _sicpysensor.VectorOfSMatrices_end(self) def rbegin(self) -> "std::vector< std::shared_ptr< SimpleMatrix > >::reverse_iterator": return _sicpysensor.VectorOfSMatrices_rbegin(self) def rend(self) -> "std::vector< std::shared_ptr< SimpleMatrix > >::reverse_iterator": return _sicpysensor.VectorOfSMatrices_rend(self) def clear(self) -> "void": return _sicpysensor.VectorOfSMatrices_clear(self) def get_allocator(self) -> "std::vector< std::shared_ptr< SimpleMatrix > >::allocator_type": return _sicpysensor.VectorOfSMatrices_get_allocator(self) def pop_back(self) -> "void": return _sicpysensor.VectorOfSMatrices_pop_back(self) def erase(self, *args) -> "std::vector< std::shared_ptr< SimpleMatrix > >::iterator": return _sicpysensor.VectorOfSMatrices_erase(self, *args) def __init__(self, *args): _sicpysensor.VectorOfSMatrices_swiginit(self, _sicpysensor.new_VectorOfSMatrices(*args)) def push_back(self, x: "std::vector< std::shared_ptr< SimpleMatrix > >::value_type const &") -> "void": return _sicpysensor.VectorOfSMatrices_push_back(self, x) def front(self) -> "std::vector< std::shared_ptr< SimpleMatrix > >::value_type const &": return _sicpysensor.VectorOfSMatrices_front(self) def back(self) -> "std::vector< std::shared_ptr< SimpleMatrix > >::value_type const &": return _sicpysensor.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 _sicpysensor.VectorOfSMatrices_assign(self, n, x) def resize(self, *args) -> "void": return _sicpysensor.VectorOfSMatrices_resize(self, *args) def insert(self, *args) -> "void": return _sicpysensor.VectorOfSMatrices_insert(self, *args) def reserve(self, n: "std::vector< std::shared_ptr< SimpleMatrix > >::size_type") -> "void": return _sicpysensor.VectorOfSMatrices_reserve(self, n) def capacity(self) -> "std::vector< std::shared_ptr< SimpleMatrix > >::size_type": return _sicpysensor.VectorOfSMatrices_capacity(self) __swig_destroy__ = _sicpysensor.delete_VectorOfSMatrices # Register VectorOfSMatrices in _sicpysensor: _sicpysensor.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 _sicpysensor.VectorOfMemories_iterator(self) def __iter__(self): return self.iterator() def __nonzero__(self) -> "bool": return _sicpysensor.VectorOfMemories___nonzero__(self) def __bool__(self) -> "bool": return _sicpysensor.VectorOfMemories___bool__(self) def __len__(self) -> "std::vector< SiconosMemory >::size_type": return _sicpysensor.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 _sicpysensor.VectorOfMemories___getslice__(self, i, j) def __setslice__(self, *args) -> "void": return _sicpysensor.VectorOfMemories___setslice__(self, *args) def __delslice__(self, i: "std::vector< SiconosMemory >::difference_type", j: "std::vector< SiconosMemory >::difference_type") -> "void": return _sicpysensor.VectorOfMemories___delslice__(self, i, j) def __delitem__(self, *args) -> "void": return _sicpysensor.VectorOfMemories___delitem__(self, *args) def __getitem__(self, *args) -> "std::vector< SiconosMemory >::value_type const &": return _sicpysensor.VectorOfMemories___getitem__(self, *args) def __setitem__(self, *args) -> "void": return _sicpysensor.VectorOfMemories___setitem__(self, *args) def pop(self) -> "std::vector< SiconosMemory >::value_type": return _sicpysensor.VectorOfMemories_pop(self) def append(self, x: "SiconosMemory") -> "void": return _sicpysensor.VectorOfMemories_append(self, x) def empty(self) -> "bool": return _sicpysensor.VectorOfMemories_empty(self) def size(self) -> "std::vector< SiconosMemory >::size_type": return _sicpysensor.VectorOfMemories_size(self) def swap(self, v: "VectorOfMemories") -> "void": return _sicpysensor.VectorOfMemories_swap(self, v) def begin(self) -> "std::vector< SiconosMemory >::iterator": return _sicpysensor.VectorOfMemories_begin(self) def end(self) -> "std::vector< SiconosMemory >::iterator": return _sicpysensor.VectorOfMemories_end(self) def rbegin(self) -> "std::vector< SiconosMemory >::reverse_iterator": return _sicpysensor.VectorOfMemories_rbegin(self) def rend(self) -> "std::vector< SiconosMemory >::reverse_iterator": return _sicpysensor.VectorOfMemories_rend(self) def clear(self) -> "void": return _sicpysensor.VectorOfMemories_clear(self) def get_allocator(self) -> "std::vector< SiconosMemory >::allocator_type": return _sicpysensor.VectorOfMemories_get_allocator(self) def pop_back(self) -> "void": return _sicpysensor.VectorOfMemories_pop_back(self) def erase(self, *args) -> "std::vector< SiconosMemory >::iterator": return _sicpysensor.VectorOfMemories_erase(self, *args) def __init__(self, *args): _sicpysensor.VectorOfMemories_swiginit(self, _sicpysensor.new_VectorOfMemories(*args)) def push_back(self, x: "SiconosMemory") -> "void": return _sicpysensor.VectorOfMemories_push_back(self, x) def front(self) -> "std::vector< SiconosMemory >::value_type const &": return _sicpysensor.VectorOfMemories_front(self) def back(self) -> "std::vector< SiconosMemory >::value_type const &": return _sicpysensor.VectorOfMemories_back(self) def assign(self, n: "std::vector< SiconosMemory >::size_type", x: "SiconosMemory") -> "void": return _sicpysensor.VectorOfMemories_assign(self, n, x) def resize(self, *args) -> "void": return _sicpysensor.VectorOfMemories_resize(self, *args) def insert(self, *args) -> "void": return _sicpysensor.VectorOfMemories_insert(self, *args) def reserve(self, n: "std::vector< SiconosMemory >::size_type") -> "void": return _sicpysensor.VectorOfMemories_reserve(self, n) def capacity(self) -> "std::vector< SiconosMemory >::size_type": return _sicpysensor.VectorOfMemories_capacity(self) __swig_destroy__ = _sicpysensor.delete_VectorOfMemories # Register VectorOfMemories in _sicpysensor: _sicpysensor.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 _sicpysensor.UnsignedIntVector_iterator(self) def __iter__(self): return self.iterator() def __nonzero__(self) -> "bool": return _sicpysensor.UnsignedIntVector___nonzero__(self) def __bool__(self) -> "bool": return _sicpysensor.UnsignedIntVector___bool__(self) def __len__(self) -> "std::vector< unsigned int >::size_type": return _sicpysensor.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 _sicpysensor.UnsignedIntVector___getslice__(self, i, j) def __setslice__(self, *args) -> "void": return _sicpysensor.UnsignedIntVector___setslice__(self, *args) def __delslice__(self, i: "std::vector< unsigned int >::difference_type", j: "std::vector< unsigned int >::difference_type") -> "void": return _sicpysensor.UnsignedIntVector___delslice__(self, i, j) def __delitem__(self, *args) -> "void": return _sicpysensor.UnsignedIntVector___delitem__(self, *args) def __getitem__(self, *args) -> "std::vector< unsigned int >::value_type const &": return _sicpysensor.UnsignedIntVector___getitem__(self, *args) def __setitem__(self, *args) -> "void": return _sicpysensor.UnsignedIntVector___setitem__(self, *args) def pop(self) -> "std::vector< unsigned int >::value_type": return _sicpysensor.UnsignedIntVector_pop(self) def append(self, x: "std::vector< unsigned int >::value_type const &") -> "void": return _sicpysensor.UnsignedIntVector_append(self, x) def empty(self) -> "bool": return _sicpysensor.UnsignedIntVector_empty(self) def size(self) -> "std::vector< unsigned int >::size_type": return _sicpysensor.UnsignedIntVector_size(self) def swap(self, v: "UnsignedIntVector") -> "void": return _sicpysensor.UnsignedIntVector_swap(self, v) def begin(self) -> "std::vector< unsigned int >::iterator": return _sicpysensor.UnsignedIntVector_begin(self) def end(self) -> "std::vector< unsigned int >::iterator": return _sicpysensor.UnsignedIntVector_end(self) def rbegin(self) -> "std::vector< unsigned int >::reverse_iterator": return _sicpysensor.UnsignedIntVector_rbegin(self) def rend(self) -> "std::vector< unsigned int >::reverse_iterator": return _sicpysensor.UnsignedIntVector_rend(self) def clear(self) -> "void": return _sicpysensor.UnsignedIntVector_clear(self) def get_allocator(self) -> "std::vector< unsigned int >::allocator_type": return _sicpysensor.UnsignedIntVector_get_allocator(self) def pop_back(self) -> "void": return _sicpysensor.UnsignedIntVector_pop_back(self) def erase(self, *args) -> "std::vector< unsigned int >::iterator": return _sicpysensor.UnsignedIntVector_erase(self, *args) def __init__(self, *args): _sicpysensor.UnsignedIntVector_swiginit(self, _sicpysensor.new_UnsignedIntVector(*args)) def push_back(self, x: "std::vector< unsigned int >::value_type const &") -> "void": return _sicpysensor.UnsignedIntVector_push_back(self, x) def front(self) -> "std::vector< unsigned int >::value_type const &": return _sicpysensor.UnsignedIntVector_front(self) def back(self) -> "std::vector< unsigned int >::value_type const &": return _sicpysensor.UnsignedIntVector_back(self) def assign(self, n: "std::vector< unsigned int >::size_type", x: "std::vector< unsigned int >::value_type const &") -> "void": return _sicpysensor.UnsignedIntVector_assign(self, n, x) def resize(self, *args) -> "void": return _sicpysensor.UnsignedIntVector_resize(self, *args) def insert(self, *args) -> "void": return _sicpysensor.UnsignedIntVector_insert(self, *args) def reserve(self, n: "std::vector< unsigned int >::size_type") -> "void": return _sicpysensor.UnsignedIntVector_reserve(self, n) def capacity(self) -> "std::vector< unsigned int >::size_type": return _sicpysensor.UnsignedIntVector_capacity(self) __swig_destroy__ = _sicpysensor.delete_UnsignedIntVector # Register UnsignedIntVector in _sicpysensor: _sicpysensor.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__ = _sicpysensor.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 _sicpysensor.Sensor_setId(self, newId)
[docs] def getId(self) -> "std::string const": r""" get id of the Sensor :rtype: string :return: a std::string """ return _sicpysensor.Sensor_getId(self)
[docs] def getType(self) -> "unsigned int": r""" get the type of the Sensor :rtype: int :return: an int """ return _sicpysensor.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 _sicpysensor.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 _sicpysensor.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 _sicpysensor.Sensor_initialize(self, nsds)
[docs] def capture(self) -> "void": r""" capture data when the SensorEvent is processed => set data[SensorEvent]=...""" return _sicpysensor.Sensor_capture(self)
[docs] def display(self) -> "void": r""" display the data of the Sensor on the standard output""" return _sicpysensor.Sensor_display(self)
# Register Sensor in _sicpysensor: _sicpysensor.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(_sicpysensor.ControlSensor__storedY_get, _sicpysensor.ControlSensor__storedY_set, doc=r""" A vector for the current value of the output""") _delay = property(_sicpysensor.ControlSensor__delay_get, _sicpysensor.ControlSensor__delay_set, doc=r""" delay between the measurement on the DynamicalSystem and the avaibility of the value""") _bufferY = property(_sicpysensor.ControlSensor__bufferY_get, _sicpysensor.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 _sicpysensor.ControlSensor_swiginit(self, _sicpysensor.new_ControlSensor(_self, *args))
[docs] def initialize(self, nsds: "NonSmoothDynamicalSystem") -> "void": return _sicpysensor.ControlSensor_initialize(self, nsds)
[docs] def getYDim(self) -> "unsigned int": r""" Get the dimension of the output :rtype: int :return: an unsigned int """ return _sicpysensor.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 _sicpysensor.ControlSensor_y(self)
def yTk(self) -> "SP::SiconosVector": return _sicpysensor.ControlSensor_yTk(self)
[docs] def capture(self) -> "void": r""" capture data when the SensorEvent is processed => set data[SensorEvent]=...""" return _sicpysensor.ControlSensor_capture(self)
__swig_destroy__ = _sicpysensor.delete_ControlSensor def __disown__(self): self.this.disown() _sicpysensor.disown_ControlSensor(self) return weakref.proxy(self)
# Register ControlSensor in _sicpysensor: _sicpysensor.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 _sicpysensor.LinearSensor_swiginit(self, _sicpysensor.new_LinearSensor(_self, *args)) __swig_destroy__ = _sicpysensor.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 _sicpysensor.LinearSensor_initialize(self, nsds)
[docs] def capture(self) -> "void": r""" capture data when the SensorEvent is processed ( for example set data[SensorEvent]=... )""" return _sicpysensor.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 _sicpysensor.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 _sicpysensor.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 _sicpysensor.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 _sicpysensor.LinearSensor_setDPtr(self, D)
def __disown__(self): self.this.disown() _sicpysensor.disown_LinearSensor(self) return weakref.proxy(self)
# Register LinearSensor in _sicpysensor: _sicpysensor.LinearSensor_swigregister(LinearSensor)