Skip to the content.

Python vs Java

PureEdgeSim for Python is a faithful port of the Java simulator: same scenario model, same parameter names, same CSV columns. This page is for readers coming from Java. It maps the API, translates the commands, and lists the honest gaps.

Class to module map

Java uses many small classes; Python groups them into modules. The table lists the notable ones.

Java package and class Python module and name
simulationengine.PureEdgeSim engine.Engine
simulationengine.Event, FutureQueue, SimEntity engine.Event, engine.FutureQueue, engine.SimEntity
distribution.Distribution and its subclasses distribution.Distribution and matching subclasses
distribution.Randomness randomness.Randomness
scenariomanager.SimulationParameters parameters.SimulationParameters (a dataclass)
scenariomanager.ParametersParser, FileParserAbstract, XmlFileParser, DistributionReader parameters.load_parameters, distribution.distribution_from_element
scenariomanager.ApplicationFileParser, ComputingNodesParser, DatacentersParser, EdgeDevicesParser config.load_settings, config.load_applications, config.load_cloud, config.load_edge_datacenters, config.load_devices
scenariomanager.Scenario manager.Scenario
taskgenerator.Application, Subtask config.Application, config.Subtask
taskgenerator.Task, DefaultTask, TaskAbstract tasks.Task
taskgenerator.DefaultTaskGenerator, TaskGenerator tasks.DefaultTaskGenerator
datacentersmanager.ComputingNode, DefaultComputingNode, AbstractNode, EnergyAwareNode, LocationAwareNode, NetworkingNode nodes.ComputingNode
datacentersmanager.ComputingNodeNull nodes.ComputingNode.NULL
datacentersmanager.DefaultComputingNodesGenerator, ComputingNodesGenerator, DataCentersManager topology.ComputingNodesGenerator
datacentersmanager.DefaultTopologyCreator, TopologyCreator topology.DefaultTopologyCreator
datacentersmanager.Router nodes.Router
energy.EnergyModelComputingNode nodes.EnergyModelComputingNode
locationmanager.MobilityModel and subclasses, Location mobility.MobilityModel, its subclasses, mobility.Location
network.NetworkModel, DefaultNetworkModel network.DefaultNetworkModel
network.NetworkLink and its up/down/type subclasses (NetworkLinkWifiUp, NetworkLinkCellularDown, …) network.NetworkLink plus the LinkType (WAN, MAN, LAN, IGNORE) and LinkTechnology enums
network.InfrastructureGraph, TransferProgress network.InfrastructureGraph, network.TransferProgress
taskorchestrator.Orchestrator, DefaultOrchestrator orchestrator.Orchestrator, orchestrator.DefaultOrchestrator
simulationmanager.Simulation, SimulationAbstract runner.Simulation
simulationmanager.DefaultSimulationManager, SimulationManager manager.SimulationManager
simulationmanager.RunMetadata metadata.write_run_metadata
MainApplication cli.main
simulationmanager.ChartsGenerator, all of simulationvisualizer.* not ported (see gaps)
simulationmanager.SimLog not ported (see gaps)
simulationmanager.SimulationThread replaced by runner.Simulation._run_parallel with a ProcessPoolExecutor

A few naming differences worth knowing:

Build and run commands

Task Java Python
Install/build mvn install (or mvn package) pip install -e ".[test]"
Run the bundled scenario mvn exec:java -Dexec.mainClass="com.mechalikh.pureedgesim.MainApplication" pureedgesim run --settings examples/default_settings
Run one example mvn exec:java -Dexec.mainClass="...Example1" python examples/custom_orchestrator/custom_orchestrator.py
Configure the scenario edit PureEdgeSim/settings/ edit examples/default_settings/ (or pass --settings <folder>)

The Python package has no runtime dependencies (Maven pulls in libraries; here the standard library is enough). Each example folder carries the settings it runs with, so a scenario is self-contained; Examples lists the runnable scripts and the Java example each one mirrors.

Tests

Task Java Python
Framework JUnit pytest
Run the suite mvn test pytest
Coverage JaCoCo (jacoco.xml) pytest --cov=pureedgesim (needs pytest-cov)
Shared fixtures test utility classes tests/conftest.py fixtures (parameters, files, manager)

The Python tests build a real SimulationManager from examples/default_settings/ and assert on the resulting Task states and metrics, the same spirit as the JUnit suite. See Contributing.

What the Python port does not have yet

These are real gaps against the Java simulator, verified against src/pureedgesim/.

What the Python port does have, matching Java: