Hi All,
I am fairly new to simpy, very new in fact, and I wonder if I can get help on the following problem. I need to write a class with two methods, put() and read().
An object of the class is created with something like:
a = Average(4)
Meaning that it waits for 4 numbers and then returns their average.
The numbers are put in (by another process) via a.put(4), a.put(7), etc.
The process that created the a object then does something like:
avg = yield a.read()
and, once 4 put() have occurred, avg will receive the average of their arguments.
What's a good way to implement the Average class?
I apologize if this is a simple question; I am still wrapping my mind around simpy.
Many thanks!
Luca