3 == Ports ===========================================================
8 == Constants ========================================================
10 == TeX ==============================================================
12 The {\tt Fifo} ship is a simple fifo. Values delivered to the {\tt
13 in} port are enqueued into the fifo, and values which arrive at the
14 end of the fifo are provided to the {\tt out} port.
16 The internal capacity of the fifo is unspecified, but guaranteed to be
19 == Fleeterpreter ====================================================
20 private Queue<Long> fifo = new LinkedList<Long>();
21 public void service() {
22 if (box_in.dataReadyForShip()) {
23 fifo.add(box_in.removeDataForShip());
25 if (box_out.readyForDataFromShip() && fifo.size() > 0) {
26 box_out.addDataFromShip(fifo.remove());
30 == FleetSim ==============================================================
32 == Test =================================================================
36 // ships required in order to run this code
40 debug.in: [*] take, deliver;
46 [99] take, sendto fifo.in;
47 [1] take, sendto debug.in;
51 == Contributors =========================================================
52 Adam Megacz <megacz@cs.berkeley.edu>