cloudsim-plus-master/cloudsim-plus-master/cloudsim-plus/src/main/java/org/cloudbus/cloudsim/cloudlets/network/CloudletSendTask.java
public VmPacket addPacket(Cloudlet destinationCloudlet, long dataLength) {
        if(Objects.isNull(getCloudlet())) {
            throw new RuntimeException("You must assign a NetworkCloudlet to this Task before adding packets.");
        }
        if(!getCloudlet().isBindToVm()) {
            throw new IllegalArgumentException("The source Cloudlet has to have an assigned VM.");
        }
        if(!destinationCloudlet.isBindToVm()) {
            throw new IllegalArgumentException("The destination Cloudlet has to have an assigned VM.");
        }

        VmPacket packet = new VmPacket(
                getCloudlet().getVm(), destinationCloudlet.getVm(),
                dataLength, getCloudlet(), destinationCloudlet);
        packetsToSend.add(packet);
        return packet;
    }
/**
     * Creates and add a packet to the list of packets to be sent to a
     * {@link Cloudlet} that is inside a specific VM.
     *
     * @param destinationCloudlet destination cloudlet to send packets to
     * @param dataLength the number of data bytes of the packet to create
     * @return the created packet
     * @throws RuntimeException when a NetworkCloudlet was not assigned to the Task
     * @throws IllegalArgumentException when the source or destination Cloudlet doesn't have an assigned VM
     */
Creates and add a packet to the list of packets to be sent to a
Cloudlet that is inside a specific VM.


Creates and add a packet to the list of packets to be sent to a Cloudlet that is inside a specific VM .
public VmPacket addPacket(Cloudlet destinationCloudlet, long dataLength) {
        if(Objects.isNull(getCloudlet())) {
            throw new RuntimeException("You must assign a NetworkCloudlet to this Task before adding packets.");
        }
        if(!getCloudlet().isBindToVm()) {
            throw new IllegalArgumentException("The source Cloudlet has to have an assigned VM.");
        }
        if(!destinationCloudlet.isBindToVm()) {
            throw new IllegalArgumentException("The destination Cloudlet has to have an assigned VM.");
        }
        VmPacket packet = new VmPacket(
                getCloudlet().getVm(), destinationCloudlet.getVm(),
                dataLength, getCloudlet(), destinationCloudlet);
        packetsToSend.add(packet);
        return packet;
    }
public VmPacket addPacket ( Cloudlet destinationCloudlet , long dataLength ) { if ( Objects . isNull ( getCloudlet ( ) ) ) { throw new RuntimeException ( "You must assign a NetworkCloudlet to this Task before adding packets." ) ; } if ( ! getCloudlet ( ) . isBindToVm ( ) ) { throw new IllegalArgumentException ( "The source Cloudlet has to have an assigned VM." ) ; } if ( ! destinationCloudlet . isBindToVm ( ) ) { throw new IllegalArgumentException ( "The destination Cloudlet has to have an assigned VM." ) ; } VmPacket packet = new VmPacket ( getCloudlet ( ) . getVm ( ) , destinationCloudlet . getVm ( ) , dataLength , getCloudlet ( ) , destinationCloudlet ) ; packetsToSend . add ( packet ) ; return packet ; }
Creates and add a packet to the list of packets to be sent to a
 {@link Cloudlet} that is inside a specific VM.
Creates and add a packet to the list of packets to be sent to a { @link Cloudlet } that is inside a specific VM .