
examples.Example1 Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pureedgesim Show documentation
Show all versions of pureedgesim Show documentation
A simualtor for edge computing environments
/**
* PureEdgeSim: A Simulation Framework for Performance Evaluation of Cloud, Edge and Mist Computing Environments
*
* This file is part of PureEdgeSim Project.
*
* PureEdgeSim is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* PureEdgeSim is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with PureEdgeSim. If not, see .
*
* @author Mechalikh
**/
package examples;
import com.mechalikh.pureedgesim.simulationcore.Simulation;
import com.mechalikh.pureedgesim.tasksgenerator.DefaultTasksGenerator;
public class Example1 {
/**
* This is a simple example showing how to launch simulation using custom
* mobility model, energy model, custom edge orchestrator, custom tasks
* generator, and custom edge devices. By removing them, you will use the
* default models provided by PureEdgeSim. As you can see, this class extends
* the Main class provided by PureEdgeSim, which is required for this example to
* work.
*/
public Example1() {
//Create a PureEdgeSim simulation
Simulation sim = new Simulation();
// To change the mobility model
sim.setCustomMobilityModel(CustomMobilityManager.class);
// To change the tasks orchestrator
sim.setCustomEdgeOrchestrator(CustomEdgeOrchestrator.class);
// To change the tasks generator
sim.setCustomTasksGenerator(DefaultTasksGenerator.class);
// To use a custom edge device/datacenters class
sim.setCustomEdgeDataCenters(CustomDataCenter.class);
// To use a custom energy model
sim.setCustomEnergyModel(CustomEnergyModel.class);
/* to use the default one you can simply delete or comment those lines */
// Finally,you can launch the simulation
sim.launchSimulation();
}
public static void main(String[] args) {
new Example1();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy