Skip to content

Instantly share code, notes, and snippets.

@hackerain
Last active December 17, 2015 01:09
Show Gist options
  • Save hackerain/5525906 to your computer and use it in GitHub Desktop.
Save hackerain/5525906 to your computer and use it in GitHub Desktop.
顺序分配
public void bindCloudletsToVmsSimple(){
int vmNum = vmList.size();
int cloudletNum = cloudletList.size();
int idx = 0;
for (int i=0;i<cloudletNum;i++){
cloudletList.get(i).setVmId(vmList.get(idx).getId());
idx = (idx+1)%vmNum;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment