本文整理汇总了C#中Bucket.Generalize方法的典型用法代码示例。如果您正苦于以下问题:C# Bucket.Generalize方法的具体用法?C# Bucket.Generalize怎么用?C# Bucket.Generalize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Bucket
的用法示例。
在下文中一共展示了Bucket.Generalize方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GeneralizeBucket
/// <summary>
/// Generalizes or specializes the input bucket according to the given hierarchy
/// and hierchy level that is stored inside the hierarchy.
/// </summary>
/// <returns>Returns the specialized or generalized version of the input Bucket.</returns>
protected Bucket GeneralizeBucket(Bucket bucket, List<IHierarchy> hierarchies)
{
Bucket newEq = new Bucket();
for (int i = 0; i < hierarchies.Count; i++)
{
hierarchies[i].SetLevel(bucket.node.generalizations[i]);
}
foreach (data.Tuple tuple in bucket)
{
//I suppose that the dimension of id is 0
int id = Convert.ToInt32(tuple.GetValue(0));
newEq.Add(idHashIndex[id]);
}
var generalizedEq = newEq.Generalize(hierarchies);
Node node = CopyNode(bucket.node);
generalizedEq.node = node;
return generalizedEq;
}