after.setAmount(cb, (amountSupplied * UNITS_OF_CARGO_PER_WAGON) + amountAlready);
after.setAmount(cb, (amountSupplied) + amountAlready);
    public void update(World w) {        NonNullElements nonNullStations = new NonNullElements(KEY.STATIONS, w);        while (nonNullStations.next()) {            StationModel station = (StationModel)nonNullStations.getElement();            SupplyAtStation supply = station.getSupply();            CargoBundle cargoBundle = (CargoBundle)w.get(KEY.CARGO_BUNDLES,                    station.getCargoBundleNumber());            CargoBundle before = cargoBundle.getCopy();            CargoBundle after = cargoBundle.getCopy();            int stationNumber = nonNullStations.getIndex();            /* Let the cargo have a half life of one year, so half the existing cargo wastes away.*/            Iterator it = after.cargoBatchIterator();            while (it.hasNext()) {                CargoBatch cb = (CargoBatch)it.next();                int amount = after.getAmount(cb);                if (amount > 0) {                    after.setAmount(cb, amount / 2);                }            }            for (int i = 0; i < w.size(KEY.CARGO_TYPES); i++) {                int amountSupplied = supply.getSupply(i);		CargoType cargoType = (CargoType) w.get(KEY.CARGO_TYPES, i);                if (amountSupplied > 0) {                    CargoBatch cb = new CargoBatch(i, station.x, station.y, 0,                            stationNumber);                    int amountAlready = after.getAmount(cb);		    after.setAmount(cb, (amountSupplied *				UNITS_OF_CARGO_PER_WAGON) + amountAlready);                }            }            Move m = new ChangeCargoBundleMove(before, after,                    station.getCargoBundleNumber());            moveReceiver.processMove(m);        }    }