您的位置:首页 > 大数据 > 云计算

中文注释云计算仿真工具cloudsim源码

2011-11-08 15:49 483 查看

org.cloudbus.cloudsim

CloudCoordinator.java:

/*
* 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-2010, The University of Melbourne, Australia
*/

package org.cloudbus.cloudsim;

import java.util.List;

/**
* 虚类用于联邦云
* This class represents the coordinator of a federation of clouds.
* It interacts with other clouds coordinators in order to exchange
* virtual machines and user applicatoins, if required.
*
* @author		Rodrigo N. Calheiros
* @since		CloudSim Toolkit 1.0
*/
public abstract class CloudCoordinator {

/** The datacenter. */
protected FederatedDatacenter datacenter;

/** The federation. */
protected List<Integer> federation;

/**
* Defines the FederatedDataCenter this coordinator works for.
*
* @param datacenter FederatedDataCenter associated to this coordinator.
*
* @pre $none
* @post $none
*/
public void setDatacenter(FederatedDatacenter datacenter){
this.datacenter = datacenter;
}

/**
* Informs about the other data centers that are part of the federation.
*
* @param federationList List of DataCenters ids that are part of the federation
*
* @pre federationList != null
* @post $none
*/
public void setFederation(List<Integer> federationList) {
this.federation = federationList;
}

/**
* This method is periodically called by the FederatedDataCenter to
* make the coordinator update the sensors measuring in order to decide
* if modification in the data center must be processed. This modification
* requires migration of virtual machines and/or user applications from
* one data center to another.
*
* @pre $none
* @post $none
*/
public void updateDatacenter() {
for (Sensor<Double> s : this.datacenter.getSensors()) {
int result = s.monitor();
if (result != 0) {
migrate(s, result);
}
}
}

/**
* Implements a specific migration policy to be deployed by the cloud coordinator.
*
* @param result the result vof the last measurement:
* -1 if the measurement fell below the lower threshold
* +1 if the measurement fell above the higher threshold
* @param sensor the sensor
*
* @pre sensor != null
* @post $none
*/
protected abstract void migrate(Sensor<Double> sensor,int result);

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: