// Path: src/edu/boun/edgecloudsim/edge_client/Task.java
// public class Task extends Cloudlet {
// 	private Location submittedLocation;
// 	private double creationTime;
// 	private int type;
// 	private int mobileDeviceId;
// 	private int hostIndex;
// 	private int vmIndex;
// 	private int datacenterId;
// 
// 	public Task(int _mobileDeviceId, int cloudletId, long cloudletLength, int pesNumber,
// 			long cloudletFileSize, long cloudletOutputSize,
// 			UtilizationModel utilizationModelCpu,
// 			UtilizationModel utilizationModelRam,
// 			UtilizationModel utilizationModelBw) {
// 		super(cloudletId, cloudletLength, pesNumber, cloudletFileSize,
// 				cloudletOutputSize, utilizationModelCpu, utilizationModelRam,
// 				utilizationModelBw);
// 		
// 		mobileDeviceId = _mobileDeviceId;
// 		creationTime = CloudSim.clock();
// 	}
// 
// 	
// 	public void setSubmittedLocation(Location _submittedLocation){
// 		submittedLocation =_submittedLocation;
// 	}
// 
// 	public void setAssociatedDatacenterId(int _datacenterId){
// 		datacenterId=_datacenterId;
// 	}
// 	
// 	public void setAssociatedHostId(int _hostIndex){
// 		hostIndex=_hostIndex;
// 	}
// 
// 	public void setAssociatedVmId(int _vmIndex){
// 		vmIndex=_vmIndex;
// 	}
// 	
// 	public void setTaskType(int _type){
// 		type=_type;
// 	}
// 
// 	public int getMobileDeviceId(){
// 		return mobileDeviceId;
// 	}
// 	
// 	public Location getSubmittedLocation(){
// 		return submittedLocation;
// 	}
// 	
// 	public int getAssociatedDatacenterId(){
// 		return datacenterId;
// 	}
// 	
// 	public int getAssociatedHostId(){
// 		return hostIndex;
// 	}
// 
// 	public int getAssociatedVmId(){
// 		return vmIndex;
// 	}
// 	
// 	public int getTaskType(){
// 		return type;
// 	}
// 	
// 	public double getCreationTime() {
// 		return creationTime;
// 	}
// }
// 
// Path: src/edu/boun/edgecloudsim/utils/Location.java
// public class Location {
// 	private int xPos;
// 	private int yPos;
// 	private int servingWlanId;
// 	private int placeTypeIndex;
// 	public Location(int _placeTypeIndex, int _servingWlanId, int _xPos, int _yPos){
// 		servingWlanId = _servingWlanId;
// 		placeTypeIndex=_placeTypeIndex;
// 		xPos = _xPos;
// 		yPos = _yPos;
// 	}
// 	
// 	/*
// 	 * Default Constructor: Creates an empty Location
// 	 */
// 	public Location() {
// 	}
// 	
// 	@Override
// 	public boolean equals(Object other){
// 		boolean result = false;
// 	    if (other == null) return false;
// 	    if (!(other instanceof Location))return false;
// 	    if (other == this) return true;
// 	    
// 	    Location otherLocation = (Location)other;
// 	    if(this.xPos == otherLocation.xPos && this.yPos == otherLocation.yPos)
// 	    	result = true;
// 
// 	    return result;
// 	}
// 
// 	public int getServingWlanId(){
// 		return servingWlanId;
// 	}
// 	
// 	public int getPlaceTypeIndex(){
// 		return placeTypeIndex;
// 	}
// 	
// 	public int getXPos(){
// 		return xPos;
// 	}
// 	
// 	public int getYPos(){
// 		return yPos;
// 	}
// }


import edu.boun.edgecloudsim.utils.Location;
import edu.boun.edgecloudsim.edge_client.Task;

/*
 * Title:        EdgeCloudSim - Network Model
 * 
 * Description: 
 * NetworkModel is an abstract class which is used for calculating the
 * network delay from device to device. For those who wants to add a
 * custom Network Model to EdgeCloudSim should extend this class and
 * provide a concrete instance via ScenarioFactory
 *               
 * Licence:      GPL - http://www.gnu.org/copyleft/gpl.html
 * Copyright (c) 2017, Bogazici University, Istanbul, Turkey
 */

package edu.boun.edgecloudsim.network;


public abstract class NetworkModel {
	protected int numberOfMobileDevices;
	protected String simScenario;

	public NetworkModel(int _numberOfMobileDevices, String _simScenario){
		numberOfMobileDevices=_numberOfMobileDevices;
		simScenario = _simScenario;
	};

	/**
	 * initializes custom network model
	 */
	public abstract void initialize();

	/**
	 * calculates the upload delay from source to destination device
	 */
	public abstract double getUploadDelay(int sourceDeviceId, int destDeviceId, Task task);

	/**
	 * calculates the download delay from source to destination device
	 */
	public abstract double getDownloadDelay(int sourceDeviceId, int destDeviceId, Task task);

	/**
	 * Mobile device manager should inform network manager about the network operation
	 * This information may be important for some network delay models
	 */

// Path: src/edu/boun/edgecloudsim/edge_client/Task.java
// public class Task extends Cloudlet {
// 	private Location submittedLocation;
// 	private double creationTime;
// 	private int type;
// 	private int mobileDeviceId;
// 	private int hostIndex;
// 	private int vmIndex;
// 	private int datacenterId;
// 
// 	public Task(int _mobileDeviceId, int cloudletId, long cloudletLength, int pesNumber,
// 			long cloudletFileSize, long cloudletOutputSize,
// 			UtilizationModel utilizationModelCpu,
// 			UtilizationModel utilizationModelRam,
// 			UtilizationModel utilizationModelBw) {
// 		super(cloudletId, cloudletLength, pesNumber, cloudletFileSize,
// 				cloudletOutputSize, utilizationModelCpu, utilizationModelRam,
// 				utilizationModelBw);
// 		
// 		mobileDeviceId = _mobileDeviceId;
// 		creationTime = CloudSim.clock();
// 	}
// 
// 	
// 	public void setSubmittedLocation(Location _submittedLocation){
// 		submittedLocation =_submittedLocation;
// 	}
// 
// 	public void setAssociatedDatacenterId(int _datacenterId){
// 		datacenterId=_datacenterId;
// 	}
// 	
// 	public void setAssociatedHostId(int _hostIndex){
// 		hostIndex=_hostIndex;
// 	}
// 
// 	public void setAssociatedVmId(int _vmIndex){
// 		vmIndex=_vmIndex;
// 	}
// 	
// 	public void setTaskType(int _type){
// 		type=_type;
// 	}
// 
// 	public int getMobileDeviceId(){
// 		return mobileDeviceId;
// 	}
// 	
// 	public Location getSubmittedLocation(){
// 		return submittedLocation;
// 	}
// 	
// 	public int getAssociatedDatacenterId(){
// 		return datacenterId;
// 	}
// 	
// 	public int getAssociatedHostId(){
// 		return hostIndex;
// 	}
// 
// 	public int getAssociatedVmId(){
// 		return vmIndex;
// 	}
// 	
// 	public int getTaskType(){
// 		return type;
// 	}
// 	
// 	public double getCreationTime() {
// 		return creationTime;
// 	}
// }
// 
// Path: src/edu/boun/edgecloudsim/utils/Location.java
// public class Location {
// 	private int xPos;
// 	private int yPos;
// 	private int servingWlanId;
// 	private int placeTypeIndex;
// 	public Location(int _placeTypeIndex, int _servingWlanId, int _xPos, int _yPos){
// 		servingWlanId = _servingWlanId;
// 		placeTypeIndex=_placeTypeIndex;
// 		xPos = _xPos;
// 		yPos = _yPos;
// 	}
// 	
// 	/*
// 	 * Default Constructor: Creates an empty Location
// 	 */
// 	public Location() {
// 	}
// 	
// 	@Override
// 	public boolean equals(Object other){
// 		boolean result = false;
// 	    if (other == null) return false;
// 	    if (!(other instanceof Location))return false;
// 	    if (other == this) return true;
// 	    
// 	    Location otherLocation = (Location)other;
// 	    if(this.xPos == otherLocation.xPos && this.yPos == otherLocation.yPos)
// 	    	result = true;
// 
// 	    return result;
// 	}
// 
// 	public int getServingWlanId(){
// 		return servingWlanId;
// 	}
// 	
// 	public int getPlaceTypeIndex(){
// 		return placeTypeIndex;
// 	}
// 	
// 	public int getXPos(){
// 		return xPos;
// 	}
// 	
// 	public int getYPos(){
// 		return yPos;
// 	}
// }


// Path: src/edu/boun/edgecloudsim/network/NetworkModel.java
import edu.boun.edgecloudsim.utils.Location;
import edu.boun.edgecloudsim.edge_client.Task;

/*
 * Title:        EdgeCloudSim - Network Model
 * 
 * Description: 
 * NetworkModel is an abstract class which is used for calculating the
 * network delay from device to device. For those who wants to add a
 * custom Network Model to EdgeCloudSim should extend this class and
 * provide a concrete instance via ScenarioFactory
 *               
 * Licence:      GPL - http://www.gnu.org/copyleft/gpl.html
 * Copyright (c) 2017, Bogazici University, Istanbul, Turkey
 */

package edu.boun.edgecloudsim.network;


public abstract class NetworkModel {
	protected int numberOfMobileDevices;
	protected String simScenario;

	public NetworkModel(int _numberOfMobileDevices, String _simScenario){
		numberOfMobileDevices=_numberOfMobileDevices;
		simScenario = _simScenario;
	};

	/**
	 * initializes custom network model
	 */
	public abstract void initialize();

	/**
	 * calculates the upload delay from source to destination device
	 */
	public abstract double getUploadDelay(int sourceDeviceId, int destDeviceId, Task task);

	/**
	 * calculates the download delay from source to destination device
	 */
	public abstract double getDownloadDelay(int sourceDeviceId, int destDeviceId, Task task);

	/**
	 * Mobile device manager should inform network manager about the network operation
	 * This information may be important for some network delay models
	 */

	public abstract void uploadStarted(Location accessPointLocation, int destDeviceId);
