Skip to content

Repository files navigation

Simulation of a Distributed Processor Load Balancing Algorithm

This repository contains a Java simulation of a distributed processor load balancing algorithm. The main entry point is src/Main.java.

Prerequisites

  • Java JDK 8 or later installed
  • A command-line terminal (PowerShell, Command Prompt, or similar)

Project Structure

  • src/ - Java source files
  • src/Main.java - program entry point
  • src/Processor/ - processor and task classes
  • src/Simulation/ - simulation engine
  • src/Strategies/ - strategy classes for processor load balancing

Build and Run

From the repository root, run the following commands:

  1. Compile all Java sources into an output directory:
javac -d out src\Main.java src\Processor\*.java src\Round\*.java src\Simulation\*.java src\Strategies\*.java
  1. Run the simulation:
java -cp out Main

Notes

  • The main simulation parameters are configured in src/Main.java.
  • After running, the program prints statistics and shows charts based on the simulation results if the charting dependency is available.

JFreeChart dependency

src/Simulation/Simulation.java depends on JFreeChart classes (org.jfree.chart.* and org.jfree.data.*). To compile and run the charting functionality, download the JFreeChart library and add the JAR to the classpath.

Example with a downloaded JAR named jfreechart-1.5.3.jar:

javac -cp jfreechart-1.5.3.jar -d out src\Main.java src\Processor\*.java src\Round\*.java src\Simulation\*.java src\Strategies\*.java
java -cp "out;jfreechart-1.5.3.jar" Main

If you do not want to use charts, comment out or remove the simulation.showCharts(); call in src/Main.java.

Optional

If you prefer one command for both compilation and execution:

javac -d out src\Main.java src\Processor\*.java src\Simulation\*.java src\Strategies\*.java ; java -cp out Main

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages