public function getVolumeUtilisation(): float
    {
        $itemVolume = 0;
        $boxVolume = 0;

        /** @var PackedBox $box */
        foreach ($this as $box) {
            $boxVolume += $box->getInnerVolume();

            /** @var PackedItem $item */
            foreach ($box->getItems() as $item) {
                $itemVolume += ($item->getItem()->getWidth() * $item->getItem()->getLength() * $item->getItem()->getDepth());
            }
        }

        return round($itemVolume / $boxVolume * 100, 1);
    }
public function getVolumeUtilisation(): float
    {
        $itemVolume = 0;
        $boxVolume = 0;

        /** @var PackedBox $box */
        foreach ($this as $box) {
            $boxVolume += $box->getInnerVolume();

            /** @var PackedItem $item */
            foreach ($box->getItems() as $item) {
                $itemVolume += ($item->getItem()->getWidth() * $item->getItem()->getLength() * $item->getItem()->getDepth());
            }
        }

        return round($itemVolume / $boxVolume * 100, 1);
    }
public function getVolumeUtilisation ( ) : float { $ itemVolume = 0 ; $ boxVolume = 0 ; /** @var PackedBox $box */ foreach ( $ this as $ box ) { $ boxVolume += $ box -> getInnerVolume ( ) ; /** @var PackedItem $item */ foreach ( $ box -> getItems ( ) as $ item ) { $ itemVolume += ( $ item -> getItem ( ) -> getWidth ( ) * $ item -> getItem ( ) -> getLength ( ) * $ item -> getItem ( ) -> getDepth ( ) ) ; } } return round ( $ itemVolume / $ boxVolume * 100 , 1 ) ; }
Get volume utilisation of the set of packed boxes.

@return float
Get volume utilisation of the set of packed boxes .