private:
/** The current count. */
Counter current;
+ /** The tick of the last reset */
+ Tick lastReset;
/** The total count for all tick. */
mutable Result total;
/** The tick that current last changed. */
* Build and initializes this stat storage.
*/
AvgStor(Info *info)
- : current(0), total(0), last(0)
+ : current(0), lastReset(0), total(0), last(0)
{ }
/**
result() const
{
assert(last == curTick);
- return (Result)(total + current) / (Result)(curTick + 1);
+ return (Result)(total + current) / (Result)(curTick - lastReset + 1);
}
/**
{
total = 0.0;
last = curTick;
+ lastReset = curTick;
}
};
: node(new VectorStatNode(s.info()))
{ }
+ Temp(const AverageVector &s)
+ : node(new VectorStatNode(s.info()))
+ { }
+
/**
*
*/
print "Restoring from checkpoint"
internal.core.unserializeAll(dir)
need_resume.append(root)
+ stats.reset()
def changeToAtomic(system):
if not isinstance(system, (objects.Root, objects.System)):