Class Producer

java.lang.Object
  |
  +--Process
        |
        +--BoundedBufferProcess
              |
              +--Producer
All Implemented Interfaces:
java.lang.Runnable

public class Producer
extends BoundedBufferProcess

A Producer is a bounded buffer process that removes buffers from its empty buffer queue, fills them, and places them onto its full buffer queue. The average amount of time spent filling a buffer is the twiddle time of the producer.


Fields inherited from class BoundedBufferProcess
empty, full
 
Constructor Summary
Producer(java.lang.String nm, double t, BufferQueue f, BufferQueue e)
          new Producer(nm, t, f, e) returns a new producer and starts executing its run method in a new thread.
 
Method Summary
 void step()
          prod.step() simulates filling a single buffer.
 
Methods inherited from class Process
run, setSimulationTime, toString, twiddle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Producer

public Producer(java.lang.String nm,
                double t,
                BufferQueue f,
                BufferQueue e)
new Producer(nm, t, f, e) returns a new producer and starts executing its run method in a new thread. The name of the new producer is formed by concatenating its class name with nm. The average twiddle time of the new producer is t. The new producer uses f as a queue for full buffers and e as a queue for empty buffers.
Method Detail

step

public void step()
prod.step() simulates filling a single buffer.
Overrides:
step in class Process