A multi-agent system simulation of a smart electrical grid using the JADE (Java Agent DEvelopment Framework) platform. This project models the interactions between various components of a smart grid including power plants, smart buildings, load managers, and grids.
SmartGrid simulates a realistic smart electrical grid environment where autonomous agents represent different entities in the power distribution network. The system models energy production, consumption, distribution, and management through agent communication and coordination.
- Multi-Agent Architecture: Built on JADE framework for distributed agent communication
- Renewable & Non-Renewable Energy Sources: Solar, wind, hydro, and diesel power plants
- Smart Buildings: Intelligent energy consumers with priority-based appliance management
- Dynamic Weather Modeling: Weather-dependent energy production for renewable sources
- Load Management: Intelligent distribution and routing of electrical energy
- Real-time Monitoring: Energy flow tracking and logging
- Configurable Scenarios: Build your own scenario or use existing ones (e.g. Tioman)
PhotovoltaicPowerPlantAgent: Photovoltaic energy production based on weather conditionsWindPowerPlantAgent: Wind energy generation with wind speed dependenciesHydroPowerPlantAgent: Hydroelectric power generationDieselPowerPlantAgent: Traditional fossil fuel power
GridAgent: Manages energy distribution within buildings and other gridsLoadManagerAgent: Coordinates energy allocation and load balancing
SmartBuildingAgent: Represents intelligent buildings with controllable appliancesSimulationAgent: Orchestrates the overall simulation and time management with a turn-based system
- Java 11 or higher
- Maven 3.8.1 or higher
- JADE Framework 4.6.0 (included as dependency)
-
Clone the repository
git clone https://github.com/AlessandroIsceri/SmartGrid.git cd SmartGrid -
Set up the environment
# Use the provided batch script (Windows) run_config.bat -
Run the simulator
# On another terminal, run the following command mvn -Pjade-setup-simulation exec:java -
Start the simulation
Using the GUI, create a DummyAgent and send a message with a REQUEST performative and a conversation-id equal to "start-simulation" to the SimulationAgent.
-
Stopping and Resuming the simulation For stopping the simulation, the process is identical, you only have to change the conversation-id to "stop-simulation" and, naturally, the same applies to the resume message, which requires a "resume-simulation" conversation-id.
The simulation can be configured through src/main/resources/app.config:
turn_duration=00:30 # Duration of each simulation turn
interval_between_turns=500 # Milliseconds between turns
simulation_start_date=2025-04-01 # Simulation start date
latitude=2.792561903384909 # Geographic latitude (in degrees)
longitude=104.16942605504602 # Geographic longitude (in degrees)
scenario_name=Tioman # Scenario to load
weather_turn_duration=01:00 # Weather update frequency
price_volatility=0.05 # Energy price volatility
price_trend=0.002 # Energy price trend
random_seed=42 # Reproducible randomizationScenario files are located in src/main/resources/scenarios/{scenario_name}/ and must contain the following files:
smartBuildings.json- Building configurations and appliancesphotovoltaicPowerPlants.json- Photovoltaic panel specificationswindPowerPlants.json- Wind turbine configurationshydroPowerPlants.json- Hydroelectric plant datadieselPowerPlants.json- Diesel generator specificationsgrids.json- Grid specificationsowners.json- Owner specificationscables.json- Power transmission cables and layout informationloadManagers.json- Load management specifications
An example is available at src/main/resources/scenarios/Tioman/
SmartGrid/
├── src/main/java/com/ii/smartgrid/
│ ├── agents/ # Agent implementations
│ ├── behaviours/ # Agent behavior definitions
│ │ ├── grid/ # Grid management behaviors
│ │ ├── loadmanager/ # Load management behaviors
│ │ ├── powerplant/ # Power generation behaviors
│ │ ├── simulation/ # Simulation control behaviors
│ │ └── smartbuilding/ # Smart building behaviors
│ ├── model/ # Data models and entities
│ └── utils/ # Utility classes
├── src/main/resources/
│ ├── scenarios/ # Simulation scenarios
│ ├── output/ # Simulation results [auto generated]
│ └── *.properties # Configuration files
└── target/ # Compiled classes and output
The system generates detailed logs and energy data:
- Energy Data: JSON files tracking energy flow over time (
output/{scenario_name}/energy_data-*.json) - Simulation Logs: Detailed agent communication logs (
simulationLog.log)
- JADE Framework 4.6.0: Multi-agent platform
- Jackson 2.19.0: JSON processing
- SLF4J 2.0.17: Logging framework
- JGraphT 1.5.2: Graph algorithms for grid topology
- TimeZoneMap 4.5: Geographic timezone handling
A report (in italian) is available here.