org.cloudsimplus.network.VmPacket Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of cloudsim-plus Show documentation
Show all versions of cloudsim-plus Show documentation
CloudSim Plus: A modern, highly extensible and easier-to-use Java 8+ Framework for Modeling and Simulation of Cloud Computing Infrastructures and Services
The newest version!
/*
* Title: CloudSim Toolkit
* Description: CloudSim (Cloud Simulation) Toolkit for Modeling and Simulation of Clouds
* Licence: GPL - http://www.gnu.org/copyleft/gpl.html
*
* Copyright (c) 2009-2012, The University of Melbourne, Australia
*/
package org.cloudsimplus.network;
import lombok.Getter;
import lombok.NonNull;
import lombok.Setter;
import lombok.experimental.Accessors;
import org.cloudsimplus.cloudlets.network.NetworkCloudlet;
import org.cloudsimplus.hosts.network.NetworkHost;
import org.cloudsimplus.vms.network.NetworkVm;
/**
* Represents a packet that travels from a {@link NetworkVm} to another, through the virtual network
* within a {@link NetworkHost}. It contains information about {@link NetworkCloudlet}s which are
* communicating.
*
* Please refer to following publication for more details:
*
*
*
* @author Saurabh Kumar Garg
* @author Manoel Campos da Silva Filho
*
* @since CloudSim Toolkit 1.0
*/
@Accessors @Getter @Setter
public class VmPacket implements NetworkPacket {
/**
* The VM sending the packet.
* This is the VM where the {@link #getSenderCloudlet() sending cloudlet}
* is running.
*/
@NonNull
private NetworkVm source;
/**
* The VM that has to receive the packet.
* This is the VM where th {@link #getReceiverCloudlet() receiver cloudlet}
* is running.
*/
@NonNull
private NetworkVm destination;
/**
* The cloudlet sending the packet.
*/
@NonNull
private final NetworkCloudlet senderCloudlet;
/**
* The cloudlet that has to receive the packet.
*/
@NonNull
private final NetworkCloudlet receiverCloudlet;
private final long size;
private double sendTime;
private double receiveTime;
/**
* Creates a packet to be sent to a VM inside the
* Host of the sender VM.
* @param sourceVm id of the VM sending the packet
* @param destinationVm id of the VM that has to receive the packet
* @param size data length of the packet in bytes
* @param senderCloudlet cloudlet sending the packet
* @param receiverCloudlet cloudlet that has to receive the packet
*/
public VmPacket(
final NetworkVm sourceVm,
final NetworkVm destinationVm,
final long size,
final NetworkCloudlet senderCloudlet,
final NetworkCloudlet receiverCloudlet)
{
super();
this.source = sourceVm;
this.destination = destinationVm;
this.size = size;
this.receiverCloudlet = receiverCloudlet;
this.senderCloudlet = senderCloudlet;
}
public NetworkHost getDestinationHost() {
return destination.getHost();
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy