cloudFPGA (cF) API  1.0
The documentation of the source code of cloudFPGA (cF)
var.common.StatValue Class Reference

Public Member Functions

def __init__ (self, smooth_coef=0.5)
 
def update (self, v)
 

Public Attributes

 value
 
 smooth_coef
 

Detailed Description

Definition at line 186 of file common.py.

Constructor & Destructor Documentation

◆ __init__()

def var.common.StatValue.__init__ (   self,
  smooth_coef = 0.5 
)

Definition at line 187 of file common.py.

187  def __init__(self, smooth_coef = 0.5):
188  self.value = None
189  self.smooth_coef = smooth_coef

Member Function Documentation

◆ update()

def var.common.StatValue.update (   self,
  v 
)

Definition at line 190 of file common.py.

190  def update(self, v):
191  if self.value is None:
192  self.value = v
193  else:
194  c = self.smooth_coef
195  self.value = c * self.value + (1.0-c) * v
196 

Member Data Documentation

◆ smooth_coef

var.common.StatValue.smooth_coef

Definition at line 189 of file common.py.

◆ value

var.common.StatValue.value

Definition at line 188 of file common.py.


The documentation for this class was generated from the following file: