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

Started fixing the PlanetLab examples

parent bc1fa0a6
package org.cloudbus.cloudsim.examples.power.planetlab;
/**
* @author Anton Beloglazov
* @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 PlanetLabConstants {
......
......@@ -12,9 +12,18 @@ import org.cloudbus.cloudsim.UtilizationModelPlanetLabInMemory;
import org.cloudbus.cloudsim.examples.power.Constants;
/**
* @author Anton Beloglazov
* @since Dec 17, 2011
* A helper class for the running examples 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
* @since Jan 5, 2012
*/
public class PlanetLabHelper {
......
......@@ -8,24 +8,34 @@ import org.cloudbus.cloudsim.examples.power.Helper;
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
* @since Dec 17, 2011
* @since Jan 5, 2012
*/
public class PlanetLabRunnerAbstract extends RunnerAbstract {
public class PlanetLabRunner extends RunnerAbstract {
/**
* @param enableOutput
* @param outputToFile
* @param inputFolder
* @param outputFolder
* @param workload
* @param vmAllocationPolicy
* @param vmSelectionPolicy
* @param parameter
* Instantiates a new planet lab runner.
*
* @param enableOutput the enable output
* @param outputToFile the output to file
* @param inputFolder the input folder
* @param outputFolder the output folder
* @param workload the workload
* @param vmAllocationPolicy the vm allocation policy
* @param vmSelectionPolicy the vm selection policy
* @param parameter the parameter
*/
public PlanetLabRunnerAbstract(
public PlanetLabRunner(
boolean enableOutput,
boolean outputToFile,
String inputFolder,
......@@ -63,7 +73,7 @@ public class PlanetLabRunnerAbstract extends RunnerAbstract {
hostList = Helper.createHostList(PlanetLabConstants.NUMBER_OF_HOSTS);
} catch (Exception e) {
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;
import java.io.IOException;
import org.cloudbus.cloudsim.examples.power.RunnerAbstract;
public class Runner extends RunnerAbstract {
/**
* This is a universal example runner that can be used for running examples from console. All the
* 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 {
boolean enableOutput = false;
boolean outputToFile = true;
if (args[0].equals("1")) {
enableOutput = true;
}
System.out.println("enable output: " + enableOutput);
String inputFolder = args[1];
String outputFolder = args[2];
String workload = args[3];
......@@ -25,7 +44,14 @@ public class Runner extends RunnerAbstract {
parameter = args[6];
}
run(enableOutput, true, inputFolder, outputFolder, workload, vmAllocationPolicy, vmSelectionPolicy,
new PlanetLabRunner(
enableOutput,
outputToFile,
inputFolder,
outputFolder,
workload,
vmAllocationPolicy,
vmSelectionPolicy,
parameter);
}
......
package org.cloudbus.cloudsim.examples.power.random;
/**
* @author Anton Beloglazov
* @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 RandomConstants {
......
......@@ -13,7 +13,18 @@ import org.cloudbus.cloudsim.UtilizationModelStochastic;
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 {
......
......@@ -8,9 +8,18 @@ import org.cloudbus.cloudsim.examples.power.Helper;
import org.cloudbus.cloudsim.examples.power.RunnerAbstract;
/**
* @author Anton Beloglazov
* @since Dec 17, 2011
* The example runner 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 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