Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
try to activate sonar on framagit
[simgrid.git] / examples / java / cloud / migration / XVM.java
index 9fcaa907f4c12ba63ec4ff02b40d50d9076a632f..bdf79cb9e1d916487370b142da40d7aa6169d0e7 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2014-2017. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2014-2018. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -8,19 +8,17 @@ package cloud.migration;
 import org.simgrid.msg.Msg;
 import org.simgrid.msg.VM;
 import org.simgrid.msg.Host;
-import org.simgrid.msg.HostNotFoundException;
 import org.simgrid.msg.HostFailureException;
 
 public class XVM extends VM {
   private int dpIntensity;
   private int ramsize;
-  private int currentLoad;
+  private int currentLoad = 0;
 
   private Daemon daemon;
 
   public XVM(Host host, String name, int ramsize, int migNetBW, int dpIntensity){
     super(host, name, ramsize, (int)(migNetBW*0.9), dpIntensity);
-    this.currentLoad = 0;
     this.dpIntensity = dpIntensity ;
     this.ramsize= ramsize;
     this.daemon = new Daemon(this);
@@ -29,7 +27,6 @@ public class XVM extends VM {
   public void setLoad(int load){  
     if (load >0) {
       this.setBound(this.getSpeed()*load/100);
-      //    this.getDaemon().setLoad(load);
       daemon.resume();
     } else{
       daemon.suspend();
@@ -48,11 +45,6 @@ public class XVM extends VM {
     return this.daemon;
   }
 
-  public int getLoad(){
-    System.out.println("Remaining comp:" + this.daemon.getRemaining());
-    return this.currentLoad;
-  }
-
   @Override
   public void migrate(Host host) throws HostFailureException {
     Msg.info("Start migration of VM " + this.getName() + " to " + host.getName());