Beispiel #1
0
    def setValue(self, val):
        """Set the value of the Parameter and the bounds.

        val     --  The value to assign.
        lb      --  The lower bounds for the bounds list. If this is None
                    (default), then the lower bound will not be alterered.
        ub      --  The upper bounds for the bounds list. If this is None
                    (default), then the upper bound will not be alterered.

        Returns self so that mutators can be chained.

        """
        Argument.setValue(self, val)
        return self
Beispiel #2
0
    def setValue(self, val):
        """Set the value of the Parameter and the bounds.

        val     --  The value to assign.
        lb      --  The lower bounds for the bounds list. If this is None
                    (default), then the lower bound will not be alterered.
        ub      --  The upper bounds for the bounds list. If this is None
                    (default), then the upper bound will not be alterered.

        Returns self so that mutators can be chained.

        """
        Argument.setValue(self, val)
        return self
Beispiel #3
0
    def setValue(self, val, lb=None, ub=None):
        """Set the value of the Parameter and the bounds.

        val     --  The value to assign.
        lb      --  The lower bounds for the bounds list. If this is None
                    (default), then the lower bound will not be alterered.
        ub      --  The upper bounds for the bounds list. If this is None
                    (default), then the upper bound will not be alterered.

        Returns self so that mutators can be chained.

        """
        Argument.setValue(self, val)
        if lb is not None: self.bounds[0] = lb
        if ub is not None: self.bounds[1] = ub
        return self
Beispiel #4
0
    def setValue(self, val, lb = None, ub = None):
        """Set the value of the Parameter and the bounds.

        val     --  The value to assign.
        lb      --  The lower bounds for the bounds list. If this is None
                    (default), then the lower bound will not be alterered.
        ub      --  The upper bounds for the bounds list. If this is None
                    (default), then the upper bound will not be alterered.

        Returns self so that mutators can be chained.

        """
        Argument.setValue(self, val)
        if lb is not None: self.bounds[0] = lb
        if ub is not None: self.bounds[1] = ub
        return self
Beispiel #5
0
    def __init__(self, name, value=None, const=False):
        """Initialization.

        name    --  The name of this Parameter (must be a valid attribute
                    identifier)
        value   --  The initial value of this Parameter (default 0).
        const   --  A flag inticating whether the Parameter is a constant (like
                    pi).

        Raises ValueError if the name is not a valid attribute identifier

        """
        self.constrained = False
        self.bounds = [-inf, inf]
        validateName(name)
        Argument.__init__(self, name, value, const)
        return
Beispiel #6
0
    def __init__(self, name, value = None, const = False):
        """Initialization.

        name    --  The name of this Parameter (must be a valid attribute
                    identifier)
        value   --  The initial value of this Parameter (default 0).
        const   --  A flag inticating whether the Parameter is a constant (like
                    pi).

        Raises ValueError if the name is not a valid attribute identifier

        """
        self.constrained = False
        self.bounds = [-inf, inf]
        validateName(name)
        Argument.__init__(self, name, value, const)
        return