Code Examples
A repository of 155 code examples for BeepBeep
basic.AverageFork Class Reference

Compute the cumulative average of a list of numbers. More...

Static Public Member Functions

static void main (String[] args)
 

Detailed Description

Compute the cumulative average of a list of numbers.

The cumulative average is the average of all the numbers processed so far.

This example is similar to Average, except that the second queue is replaced by a fork and a TurnInto processor. Represented graphically, this example corresponds to the following chain of processors:

Processor graph

The output of this program should look like this:

 The cumulative average is...
 2.0, 4.5, 3.3333333, 4.5, 4.0, 4.6666665, 4.142857, 4.625, 4.3333335, 
Author
Sylvain Hallé Easy

Definition at line 57 of file AverageFork.java.


The documentation for this class was generated from the following file: