SketchAggSensor.sensor
Class NormalAggSensor
- public class NormalAggSensor
- extends Sensor
- implements ClockListener
NormalAggSensor
public NormalAggSensor(Topology t,
int id,
Aggregator agg,
int dist)
- Constructor
- Parameters:
t
- The topology that the sensor uses to propagate messages
agg
- The aggregation function to apply
dist
- The sensor distribution to use (See Sensor)
parentReading
- unused
setTime
public void setTime(int time)
- Set the time... Check to see if this is our appointed time to send our aggregate value -- if so, send it out.
receiveMessage
public void receiveMessage(Message m)
- Called by Topology when a message arrives for this sensor. Check to see if:
1) This is a request to aggregate -- if so, start aggregation 2) This is a message from a child -- if so, add their aggregate value to our partial aggregate.
getAggObj
public Object getAggObj()
- Return the non-integer aggregate value from the last epoch