CargoBatch batch = (CargoBatch)batches.next();
CargoBatch batch = (CargoBatch)((Entry) batches.next()).getKey();
    public static AddTransactionMove processCargo(ReadOnlyWorld w,	CargoBundle cargoBundle, FreerailsPrincipal tp, int stationID,	FreerailsPrincipal sp) {	StationModel thisStation = (StationModel)w.get(KEY.STATIONS, stationID,		sp);        Iterator batches = cargoBundle.cargoBatchIterator();        int amountOfCargo = 0;        double amount = 0;        while (batches.hasNext()) {            CargoBatch batch = (CargoBatch)batches.next();	    int dx = (batch.getSourceX() - thisStation.x);	    int dy = (batch.getSourceY() - thisStation.y);            double dist = Math.sqrt(dx*dx + dy*dy);            amount += cargoBundle.getAmount(batch) * Math.log(dist) * 100;        }	System.out.println("amount for cargo is " + amount);	GameTime now = (GameTime) w.get(ITEM.TIME, tp);        DeliverCargoReceipt receipt = new DeliverCargoReceipt(now, (long)		amount, cargoBundle);	/* credit owner of the train for cargo delivery */        return new AddTransactionMove(0, receipt, tp);    }