/** * Changes the block status for a list of pallet. * * @param pNbr Which pallets to be changed. * @param setting True if the pallets are to be blocked, false otherwise. * @return The list of pallets. Value is -1 if no change has been done. */ public int[] setBlock(int[] pNbr, boolean setting) { for (int i = 0; i < pNbr.length; i++) { Pallet p = palls.get(pNbr[i]); if (p.getBlocked() != setting && p.getDelivered() == false) p.setBlocked(setting); else pNbr[i] = -1; } return pNbr; }
public Solution findSolution() { Solution solution = new Solution(); for (Package package0 : instance.getPackages()) { Pallet pallet = solution.getPalletFor(package0); if (pallet == null) { pallet = new Pallet(generatePalletId(), package0.getPrefferedPalletType()); solution.addPallet(pallet); } pallet.addPackage(package0); } return solution; }
@Override public void terminatingEvent() { int nextPosition; if (rcPallet.position > 0) { nextPosition = rcPallet.position - 1; rcPallet.conveyor.list[rcPallet.position] = null; rcPallet.position = nextPosition; rcPallet.conveyor.list[nextPosition] = rcPallet; } else { if (rcPallet.conveyor == model.rqConveyor[Const.OP60CID]) model.output.numTVAssembled++; nextPosition = rcPallet.conveyor.nextConveyor.capacity - 1; rcPallet.conveyor.list[rcPallet.position] = null; rcPallet.position = nextPosition; rcPallet.conveyor = rcPallet.conveyor.nextConveyor; rcPallet.conveyor.list[nextPosition] = rcPallet; if (rcPallet.conveyor == model.rqConveyor[Const.NONECID]) rcPallet.serviced = true; else rcPallet.serviced = false; } rcPallet.moving = false; }
@Override public void startingEvent() { rcPallet = model.up.movablePallet(model); rcPallet.moving = true; }