v1.0.0 โ€” Full Digital Twin Platform

Model the World.
Optimize the Future.

AI-powered digital twin simulation for smart cities, factories, energy grids, and logistics. Free, open-source, research-grade โ€” runs entirely on your machine.

82
Source Files
9K+
Lines of Code
12
Python Modules
6
Versions Shipped

Everything You Need to Simulate
the Real World

From agent modeling to 3D visualization, from IoT data ingestion to distributed scaling โ€” all in one platform.

๐Ÿงฌ

Agent-Based Modeling

Four agent types with customizable behaviors.

  • Vehicles, Humans, Machines, EnergyUnits
  • Rule-based & probabilistic behaviors
  • Multi-agent AI coordination system
๐ŸŒ

Environment Modeling

Grid and graph worlds with 8 zone types.

  • Residential, industrial, commercial zones
  • Resource management (energy, water, materials)
  • Configurable world dimensions
๐Ÿง 

AI & Machine Learning

Deep learning with graceful fallbacks.

  • PyTorch LSTM predictor (NumPy fallback)
  • Autoencoder anomaly detection
  • LP-based optimization (scipy)
  • Reward-driven RL agents (PPO/Q-learning)
๐ŸŽฎ

3D Visualization

Interactive Three.js world with full controls.

  • React Three Fiber 3D rendering
  • Orbit, pan, zoom camera controls
  • Day/night cycle toggle
  • Seamless 2D โ†” 3D switching
๐Ÿ“ก

IoT Data Ingestion

Connect real-world sensors to your simulation.

  • MQTT, File, REST API, Simulator sources
  • Ring buffer with time-based queries
  • CRITICAL/WARNING/INFO alert system
๐Ÿ™

Digital Twin Platform

Full twin framework with GIS and plugins.

  • Live/replay/hybrid sync modes
  • GeoJSON support with geofencing
  • Plugin marketplace & hot-reload
  • API auth + rate limiting
๐Ÿ“Š

Distributed Simulation

Scale across multiple nodes.

  • Spatial agent partitioning
  • Load balancing with migration plans
  • gRPC protocol (no protoc required)
๐Ÿ”ฌ

Research Framework

Reproducible, exportable, configurable.

  • Deterministic mode (seed-based)
  • State snapshots & event logging
  • JSON/CSV/text export formats
  • YAML-driven configuration
๐Ÿณ

One-Command Deploy

Docker Compose gets you running instantly.

  • Backend + Frontend + PostgreSQL + Redis
  • Multi-stage frontend build (nginx)
  • FastAPI auto-documentation
  • WebSocket real-time streaming

Built-In Demo Scenarios

Four ready-to-run simulations covering smart cities, factories, energy grids, and emergency response.

๐Ÿ™๏ธ

Smart City Traffic

Urban traffic simulation with vehicles and pedestrians across residential, commercial, and industrial zones.

105 agents
8 zones
300 ticks
๐Ÿญ

Factory Optimization

Production line optimization with machines, workers, and energy constraints.

68 agents
3 zones
500 ticks
โšก

Energy Balancing

Multi-source energy grid with solar plants and varying demand patterns.

85 agents
8 zones
400 ticks
๐Ÿšจ

Emergency Failure

System resilience testing under power outages and machine breakdowns.

76 agents
6 zones
400 ticks

Clean, Modular Design

S(t+1) = F(S(t), A(t), E(t)) โ€” every step is deterministic, extensible, and research-grade.

๐Ÿ–ฅ๏ธ

Presentation

React Dashboard
Three.js 3D View
Canvas 2D
Metrics Charts

๐Ÿ“ก

API

FastAPI REST
WebSocket
CLI Tool
Auto-docs

โš™๏ธ

Simulation Core

Engine S(t+1)=F()
Event Bus
State Manager
Snapshot System

๐Ÿงฌ

Modeling

4 Agent Types
Grid + Graph
8 Zone Types
Resources

๐Ÿง 

Intelligence

LSTM Predictor
Anomaly Detector
LP Optimizer
RL Agents

๐Ÿ“ก

Data I/O

MQTT Source
File Source
API Source
Alert Manager

๐Ÿ™

Digital Twin

GIS / GeoJSON
Plugins
Marketplace
Connector

๐Ÿ“Š

Distributed

Multi-Node
Partitioning
Load Balancer
gRPC

All Versions Shipped

From core engine to full digital twin โ€” every planned feature is implemented and production-ready.

v0.1 โ€” Core Platform โœ…

Simulation Engine, Agents, Dashboard

Core engine with S(t+1)=F(S(t),A(t),E(t)), 4 agent types, grid/graph worlds, AI prediction + LP optimization, 4 scenarios, REST + WebSocket API, React 2D dashboard, Docker Compose.

v0.2 โ€” AI Enhanced โœ…

PyTorch ML, RL Agents, Multi-Agent System

PyTorch LSTM predictor with NumPy fallback, autoencoder anomaly detection, Gymnasium RL environment, PPO/Q-learning agents, multi-agent AI (Planner, Predictor, Optimizer), adaptive feedback loops.

v0.3 โ€” 3D Visualization โœ…

Three.js World, Camera Controls, View Switcher

React Three Fiber 3D world, orbit/pan/zoom, 3D zones + agent objects with glow, day/night cycle, seamless 2Dโ†”3D switching.

v0.4 โ€” IoT Ingestion โœ…

MQTT, File, API, Simulator Data Sources

MQTT topic subscription, CSV/JSON file ingestion, REST API polling, synthetic simulator with noise/drift injection, ring buffer, alert manager.

v0.5 โ€” Distributed โœ…

Multi-Node, Partitioning, gRPC

Distributed engine, simulation nodes with heartbeat, spatial partitioning, load balancing with migration, gRPC protocol, message serialization.

v1.0 โ€” Full Digital Twin โœ…

GIS, Plugins, Marketplace, Connector

Digital twin core (live/replay/hybrid), GIS with GeoJSON and geofencing, plugin system with hot-reload, marketplace client, REST/WebSocket connector, API key auth, rate limiting.

Running in 60 Seconds

# Clone the repository git clone https://github.com/rudra496/worldsim-ai.git cd worldsim-ai # Start everything with Docker docker-compose up --build # ๐Ÿ‘‰ Open http://localhost:3000

No Docker? Use Python only:

pip install -r requirements.txt python run_demo.py

Ready to Simulate?

Join the open-source digital twin community. Build, contribute, and push the boundaries of simulation.