// Sets a numerical value to a variable.
// These changes are not persistent. They only last the duration of the engine session.
//
// Parameters:
//
// ◾ val   -   Value of the variable.
//
767845
func (obj *GenericVariable) SetNumValue(ctx context.Context, val Float64) error {
	err := obj.rpc(ctx, "SetNumValue", nil, val)
	return err 
}
1065804
func (n NullFloat64) Value() (driver.Value, error) {
	if !n.Valid {
		return nil, nil
	}
	return n.Float64, nil
}
576607
func (setting Setting) Value() (driver.Value, error) {
	result, err := json.Marshal(setting)
	return string(result), err
}
674262
func (ctx *Context) SetVar(k string, v interface{}, scope Scope) {
	i := len(ctx.scopes) - 1 // index of local scope
	if i < 0 {
		panic("no scopes")
	}

	switch scope {
	case GlobalScope:
		i = 0 // index of global scope

	case ParentScope:
		if i > 0 {
			i -= 1 // index of parent scope
		}
	}

	ctx.scopes[i][k] = fmt.Sprintf("%v", v)
}
925671
func (c *keyValueChanger) SetValue(value interface{}) (interface{}, error) {
	if c.err != nil {
		return nil, c.err
	}
	current := c.node.content.value()
	c.node.content = keyValue{c.node.content.key(), value}
	return current, nil
}
1101496
func (state *Runtime) Set(name string, val interface{}) {
	state.setValue(name, reflect.ValueOf(val))
}
538931
func (me *Int) Set(s string) {
	v, _ := strconv.ParseInt(s, 0, 32)
	*me = Int(v)
}
1148415
func Setval(db XODB, v0 pgtypes.Regclass, v1 int64, v2 pgtypes.Regclass, v3 int64, v4 bool) (int64, error) {
	var err error

	// sql query
	const sqlstr = `SELECT pg_catalog.setval($1, $2, $3, $4, $5)`

	// run query
	var ret int64
	XOLog(sqlstr, v0, v1, v2, v3, v4)
	err = db.QueryRow(sqlstr, v0, v1, v2, v3, v4).Scan(&ret)
	if err != nil {
		return 0, err
	}

	return ret, nil
}
976458
func (decaying *Decaying) Value() float64 {
	decaying.Lock()
	now := time.Now()
	dt := now.Sub(decaying.t0).Seconds()
	decaying.t0 = now
	curValP := decaying.p
	decaying.p = curValP * math.Pow(decaying.e, (decaying.r*dt))
	pOut := decaying.p
	decaying.Unlock()
	return pOut
}
392672
func (s *Settings) Set(name string, val interface{}) {
	s.lock.Lock()
	s.data[name] = val
	s.lock.Unlock()
	s.onChange(name)
}
830604
func SetVariable(id string, v int64) {
	monitor.RLock()
	defer monitor.RUnlock()
	monitor.backend().SetVariable(id, v)
}
1369387
func (i *Int64) Set(value int64) {
	i.lock.Lock()
	defer i.lock.Unlock()
	i.increment = value
}
290958
func (m *pcpSingletonMetric) set(val interface{}) error {
	if !m.t.IsCompatible(val) {
		return errors.Errorf("value %v is incompatible with MetricType %v", val, m.t)
	}

	val = m.t.resolve(val)

	if val != m.val {
		if m.update != nil {
			err := m.update(val)
			if err != nil {
				return err
			}
		}
		m.val = val
	}

	return nil
}
1171950
func (nn *NullNumber) Set(value interface{}) error {

	nn.valid = false
	nn.value = ""

	if value == nil {
		return nil
	}

	s := fmt.Sprint(value)
	_, err := strconv.ParseFloat(s, 64)
	if err != nil {
		return err
	}

	nn.valid = true
	nn.value = s

	return nil
}
180023
func (m *PCPSingletonMetric) Set(val interface{}) error {
	m.mutex.Lock()
	defer m.mutex.Unlock()

	return m.set(val)
}
286466
func (i *Uint8) Set(value uint8) {
	i.lock.Lock()
	defer i.lock.Unlock()
	i.increment = value
}
1316713
func (vn *VecN) Set(i int, val float64) {
	vn.vec[i] = val
}