SketchAggSensor
Class Grouping

public class Grouping

Title: Aggregation Query in Sensor Network with Sketches

Description: This code is for the simulation of sensor network with sketches algorithms. It applies with aggregation queries.

Copyright: Computer Science Department, Boston University,Copyright (c) 2003

Company: Boston University

Version:
1.0
Author:
Feifei Li
Field Detail

groups

private int[] groups
groups is a sorted list of sensor readings that deliminate the upper bounds of groups e.g. groups[0] = 10 -- group 0 is readings 0 .. 10 groups[1] = 20 -- group 1 is readings 11.20 ...

Constructor Detail

Grouping

public Grouping(int[] groups)
Constructor
Parameters:
groups - Array specifying the upper bound on sensor reading for each group. Lower bound of first group is assumed to be 0.

Method Detail

getGroup

public int getGroup(int reading)
Return the group number corresponding to the specified sensor reading

numGroups

public int numGroups()
Return the number of groups