本文整理汇总了Java中moa.core.SizeOf类的典型用法代码示例。如果您正苦于以下问题:Java SizeOf类的具体用法?Java SizeOf怎么用?Java SizeOf使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SizeOf类属于moa.core包,在下文中一共展示了SizeOf类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: calcByteSize
import moa.core.SizeOf; //导入依赖的package包/类
public int calcByteSize() {
int size = (int) SizeOf.sizeOf(this);
if (this.treeRoot != null) {
size += this.treeRoot.calcByteSizeIncludingSubtree();
}
return size;
}
示例2: estimateModelByteSizes
import moa.core.SizeOf; //导入依赖的package包/类
public void estimateModelByteSizes() {
FoundNode[] learningNodes = findLearningNodes();
long totalActiveSize = 0;
long totalInactiveSize = 0;
for (FoundNode foundNode : learningNodes) {
if (foundNode.node instanceof ActiveLearningNode) {
totalActiveSize += SizeOf.fullSizeOf(foundNode.node);
} else {
totalInactiveSize += SizeOf.fullSizeOf(foundNode.node);
}
}
if (totalActiveSize > 0) {
this.activeLeafByteSizeEstimate = (double) totalActiveSize
/ this.activeLeafNodeCount;
}
if (totalInactiveSize > 0) {
this.inactiveLeafByteSizeEstimate = (double) totalInactiveSize
/ this.inactiveLeafNodeCount;
}
int actualModelSize = this.measureByteSize();
double estimatedModelSize = (this.activeLeafNodeCount
* this.activeLeafByteSizeEstimate + this.inactiveLeafNodeCount
* this.inactiveLeafByteSizeEstimate);
this.byteSizeEstimateOverheadFraction = actualModelSize
/ estimatedModelSize;
if (actualModelSize > this.maxByteSizeOption.getValue()) {
enforceTrackerLimit();
}
}
示例3: calcByteSize
import moa.core.SizeOf; //导入依赖的package包/类
public int calcByteSize() {
int size = (int) SizeOf.sizeOf(this);
if (this.treeRoot != null) {
size += this.treeRoot.calcByteSize();
}
return size;
}
示例4: calcByteSize
import moa.core.SizeOf; //导入依赖的package包/类
public int calcByteSize() {
return (int) SizeOf.fullSizeOf(this);
}
示例5: measureByteSize
import moa.core.SizeOf; //导入依赖的package包/类
/**
* Gets the memory size of an object.
*
* @param obj object to measure the memory size
* @return the memory size of this object
*/
public static int measureByteSize(MOAObject obj) {
return (int) SizeOf.fullSizeOf(obj);
}