Commit 262b52ea authored by Anton Beloglazov's avatar Anton Beloglazov

Started fixing the PlanetLab examples

parent bc1fa0a6
package org.cloudbus.cloudsim.examples.power.planetlab; package org.cloudbus.cloudsim.examples.power.planetlab;
/** /**
* @author Anton Beloglazov * If you are using any algorithms, policies or workload included in the power package please cite
* @since Dec 17, 2011 * the following paper:
*
* Anton Beloglazov, and Rajkumar Buyya, "Optimal Online Deterministic Algorithms and Adaptive
* Heuristics for Energy and Performance Efficient Dynamic Consolidation of Virtual Machines in
* Cloud Data Centers", Concurrency and Computation: Practice and Experience, ISSN: 1532-0626, Wiley
* Press, New York, USA, 2011, DOI: 10.1002/cpe.1867
* *
* @author Anton Beloglazov
* @since Jan 5, 2012
*/ */
public class PlanetLabConstants { public class PlanetLabConstants {
......
...@@ -12,9 +12,18 @@ import org.cloudbus.cloudsim.UtilizationModelPlanetLabInMemory; ...@@ -12,9 +12,18 @@ import org.cloudbus.cloudsim.UtilizationModelPlanetLabInMemory;
import org.cloudbus.cloudsim.examples.power.Constants; import org.cloudbus.cloudsim.examples.power.Constants;
/** /**
* @author Anton Beloglazov * A helper class for the running examples for the PlanetLab workload.
* @since Dec 17, 2011 *
* If you are using any algorithms, policies or workload included in the power package please cite
* the following paper:
* *
* Anton Beloglazov, and Rajkumar Buyya, "Optimal Online Deterministic Algorithms and Adaptive
* Heuristics for Energy and Performance Efficient Dynamic Consolidation of Virtual Machines in
* Cloud Data Centers", Concurrency and Computation: Practice and Experience, ISSN: 1532-0626, Wiley
* Press, New York, USA, 2011, DOI: 10.1002/cpe.1867
*
* @author Anton Beloglazov
* @since Jan 5, 2012
*/ */
public class PlanetLabHelper { public class PlanetLabHelper {
......
...@@ -8,24 +8,34 @@ import org.cloudbus.cloudsim.examples.power.Helper; ...@@ -8,24 +8,34 @@ import org.cloudbus.cloudsim.examples.power.Helper;
import org.cloudbus.cloudsim.examples.power.RunnerAbstract; import org.cloudbus.cloudsim.examples.power.RunnerAbstract;
/** /**
* The Class PlanetLabRunnerAbstract. * The example runner for the PlanetLab workload.
*
* If you are using any algorithms, policies or workload included in the power package please cite
* the following paper:
*
* Anton Beloglazov, and Rajkumar Buyya, "Optimal Online Deterministic Algorithms and Adaptive
* Heuristics for Energy and Performance Efficient Dynamic Consolidation of Virtual Machines in
* Cloud Data Centers", Concurrency and Computation: Practice and Experience, ISSN: 1532-0626, Wiley
* Press, New York, USA, 2011, DOI: 10.1002/cpe.1867
* *
* @author Anton Beloglazov * @author Anton Beloglazov
* @since Dec 17, 2011 * @since Jan 5, 2012
*/ */
public class PlanetLabRunnerAbstract extends RunnerAbstract { public class PlanetLabRunner extends RunnerAbstract {
/** /**
* @param enableOutput * Instantiates a new planet lab runner.
* @param outputToFile *
* @param inputFolder * @param enableOutput the enable output
* @param outputFolder * @param outputToFile the output to file
* @param workload * @param inputFolder the input folder
* @param vmAllocationPolicy * @param outputFolder the output folder
* @param vmSelectionPolicy * @param workload the workload
* @param parameter * @param vmAllocationPolicy the vm allocation policy
* @param vmSelectionPolicy the vm selection policy
* @param parameter the parameter
*/ */
public PlanetLabRunnerAbstract( public PlanetLabRunner(
boolean enableOutput, boolean enableOutput,
boolean outputToFile, boolean outputToFile,
String inputFolder, String inputFolder,
...@@ -63,7 +73,7 @@ public class PlanetLabRunnerAbstract extends RunnerAbstract { ...@@ -63,7 +73,7 @@ public class PlanetLabRunnerAbstract extends RunnerAbstract {
hostList = Helper.createHostList(PlanetLabConstants.NUMBER_OF_HOSTS); hostList = Helper.createHostList(PlanetLabConstants.NUMBER_OF_HOSTS);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
Log.printLine("Unwanted errors happen"); Log.printLine("The simulation has been terminated due to an unexpected error");
} }
} }
......
...@@ -2,16 +2,35 @@ package org.cloudbus.cloudsim.examples.power.planetlab; ...@@ -2,16 +2,35 @@ package org.cloudbus.cloudsim.examples.power.planetlab;
import java.io.IOException; import java.io.IOException;
import org.cloudbus.cloudsim.examples.power.RunnerAbstract; /**
* This is a universal example runner that can be used for running examples from console. All the
public class Runner extends RunnerAbstract { * parameters are specified as command line parameters.
*
* If you are using any algorithms, policies or workload included in the power package please cite
* the following paper:
*
* Anton Beloglazov, and Rajkumar Buyya, "Optimal Online Deterministic Algorithms and Adaptive
* Heuristics for Energy and Performance Efficient Dynamic Consolidation of Virtual Machines in
* Cloud Data Centers", Concurrency and Computation: Practice and Experience, ISSN: 1532-0626, Wiley
* Press, New York, USA, 2011, DOI: 10.1002/cpe.1867
*
* @author Anton Beloglazov
* @since Jan 5, 2012
*/
public class PlanetLabRunnerConsole {
/**
* The main method.
*
* @param args the arguments
* @throws IOException Signals that an I/O exception has occurred.
*/
public static void main(String[] args) throws IOException { public static void main(String[] args) throws IOException {
boolean enableOutput = false; boolean enableOutput = false;
boolean outputToFile = true;
if (args[0].equals("1")) { if (args[0].equals("1")) {
enableOutput = true; enableOutput = true;
} }
System.out.println("enable output: " + enableOutput);
String inputFolder = args[1]; String inputFolder = args[1];
String outputFolder = args[2]; String outputFolder = args[2];
String workload = args[3]; String workload = args[3];
...@@ -25,7 +44,14 @@ public class Runner extends RunnerAbstract { ...@@ -25,7 +44,14 @@ public class Runner extends RunnerAbstract {
parameter = args[6]; parameter = args[6];
} }
run(enableOutput, true, inputFolder, outputFolder, workload, vmAllocationPolicy, vmSelectionPolicy, new PlanetLabRunner(
enableOutput,
outputToFile,
inputFolder,
outputFolder,
workload,
vmAllocationPolicy,
vmSelectionPolicy,
parameter); parameter);
} }
......
package org.cloudbus.cloudsim.examples.power.random; package org.cloudbus.cloudsim.examples.power.random;
/** /**
* @author Anton Beloglazov * If you are using any algorithms, policies or workload included in the power package please cite
* @since Dec 17, 2011 * the following paper:
*
* Anton Beloglazov, and Rajkumar Buyya, "Optimal Online Deterministic Algorithms and Adaptive
* Heuristics for Energy and Performance Efficient Dynamic Consolidation of Virtual Machines in
* Cloud Data Centers", Concurrency and Computation: Practice and Experience, ISSN: 1532-0626, Wiley
* Press, New York, USA, 2011, DOI: 10.1002/cpe.1867
* *
* @author Anton Beloglazov
* @since Jan 5, 2012
*/ */
public class RandomConstants { public class RandomConstants {
......
...@@ -13,7 +13,18 @@ import org.cloudbus.cloudsim.UtilizationModelStochastic; ...@@ -13,7 +13,18 @@ import org.cloudbus.cloudsim.UtilizationModelStochastic;
import org.cloudbus.cloudsim.examples.power.Constants; import org.cloudbus.cloudsim.examples.power.Constants;
/** /**
* The Class Helper. * The Helper class for the random workload.
*
* If you are using any algorithms, policies or workload included in the power package please cite
* the following paper:
*
* Anton Beloglazov, and Rajkumar Buyya, "Optimal Online Deterministic Algorithms and Adaptive
* Heuristics for Energy and Performance Efficient Dynamic Consolidation of Virtual Machines in
* Cloud Data Centers", Concurrency and Computation: Practice and Experience, ISSN: 1532-0626, Wiley
* Press, New York, USA, 2011, DOI: 10.1002/cpe.1867
*
* @author Anton Beloglazov
* @since Jan 5, 2012
*/ */
public class RandomHelper { public class RandomHelper {
......
...@@ -8,9 +8,18 @@ import org.cloudbus.cloudsim.examples.power.Helper; ...@@ -8,9 +8,18 @@ import org.cloudbus.cloudsim.examples.power.Helper;
import org.cloudbus.cloudsim.examples.power.RunnerAbstract; import org.cloudbus.cloudsim.examples.power.RunnerAbstract;
/** /**
* @author Anton Beloglazov * The example runner for the random workload.
* @since Dec 17, 2011 *
* If you are using any algorithms, policies or workload included in the power package please cite
* the following paper:
* *
* Anton Beloglazov, and Rajkumar Buyya, "Optimal Online Deterministic Algorithms and Adaptive
* Heuristics for Energy and Performance Efficient Dynamic Consolidation of Virtual Machines in
* Cloud Data Centers", Concurrency and Computation: Practice and Experience, ISSN: 1532-0626, Wiley
* Press, New York, USA, 2011, DOI: 10.1002/cpe.1867
*
* @author Anton Beloglazov
* @since Jan 5, 2012
*/ */
public class RandomRunner extends RunnerAbstract { public class RandomRunner extends RunnerAbstract {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment