+++ /dev/null
-package edu.berkeley.fleet.ships;
-import edu.berkeley.fleet.interpreter.*;
-import edu.berkeley.fleet.*;
-
-import java.util.*;
-import java.io.*;
-
-public class Sort2 extends InterpreterShip {
-
- DataInbox ap = new DataInbox(this, "a");
- DataInbox bp = new DataInbox(this, "b");
- DataOutbox min = new DataOutbox(this, "min");
- DataOutbox max = new DataOutbox(this, "max");
-
- public Sort2(Interpreter fleet, String name) { super(fleet, name); }
-
- public String getBalsaName() { return "sort2"; }
-
- public void service() {
- if (ap.dataReadyForShip() && bp.dataReadyForShip()) {
- int a = ap.removeDataForShip();
- int b = bp.removeDataForShip();
- max.addDataFromShip(Math.max(a,b));
- min.addDataFromShip(Math.min(a,b));
- }
- }
-
-}