'Set the value of a state variable.
If None is given for the value, then the constraint will also be set to None.
If a tuple is given for a scalar variable, then the tuple is used as a range constraint instead of a value.
Otherwise, the constraint is set to \'fixed\'.'

def __setattr__(self, name, value):

    if (name in self._vars):
        if (value is None):
            self.set(name, value, None)
        elif (isinstance(value, tuple) and (self._vars[name][1] is not np.ndarray)):
            self.set(name, None, value)
        else:
            self.set(name, value, 'fixed')
    elif hasattr(self, name):
        object.__setattr__(self, name, value)
    else:
        raise AttributeError(name)
