PathMover is a discrete-event simulation library built on the O2DESNet framework for modeling and simulating Automated Guided Vehicle (AGV) movements in warehouse and logistics networks.
- Discrete-Event Simulation: Built on O2DESNet framework for accurate time-based simulation
- Path-Based Movement: Models AGV movement along predefined paths between control points
- Capacity Management: Tracks path occupancy and prevents collisions
- Routing Table Support: Precomputed routing tables for efficient path finding
- Large-Scale Networks: Supports networks with thousands of control points
- Performance Metrics: Tracks utilization, throughput, and waiting times
- Visualization Tools: Python-based visualization of network and trajectories
PathMover/
├── PathMoverLibrary/ # Core library (NuGet package)
│ ├── PathMover.cs # Main simulation engine
│ ├── Vehicle.cs # AGV vehicle interface and implementation
│ ├── ControlPoint.cs # Network control points
│ ├── PathMoverStatics.cs # Static network configuration
│ ├── PmPath.cs # Path between control points
│ └── IdMapper.cs # ID to name mapping
├── PathMoverDemo/ # Demo applications
│ ├── Program.cs # Main demo program
│ ├── Simulator.cs # Simple 6-node demo
│ ├── LargeScaleSimulator.cs # Large-scale simulation
│ ├── NetworkLoader.cs # JSON network loader
│ └── SimulationLogger.cs # Simulation logging
├── PathMoverRoutingGenerator/ # Routing table generation
│ ├── RoutingTableGenerator.cs
│ ├── AStarPathfinder.cs
│ └── DijkstraPathfinder.cs
├── RoutingTableBuilder/ # Routing table builder tool
├── NUnitTest_PM/ # Unit tests
├── Visualization/ # Python visualization tools
└── layout_gen/ # Network layout generation
dotnet add package PathMovergit clone https://github.com/chen-tianhao/PathMover.git
cd PathMover
dotnet buildusing PathMover;
using O2DESNet;
// Create network statics
var statics = new PathMoverStatics();
// Add control points
var A = new ControlPoint(0);
var B = new ControlPoint(1);
var C = new ControlPoint(2);
// Add paths
statics.AddPath(A.Id, B.Id, new PmPath(A, B));
statics.AddPath(B.Id, C.Id, new PmPath(B, C));
// Create PathMover instance
var pathMover = new PathMover(statics, smoothFactor: 1.0, coldStartDelay: 0.0);
// Create AGV
var agv = new Vehicle
{
Name = "AGV-001",
Speed = 1.0,
CapacityNeeded = 1
};
// Request entry
pathMover.RequestToEnter(agv, A);cd PathMoverDemo
dotnet runChoose simulation mode:
- Simple Demo: 6 control points, 5 AGVs
- Large-Scale Network: 14,944 control points from JSON data
Network nodes where AGVs can enter, exit, or change direction.
Connections between control points with capacity constraints.
- Move along paths between control points
- Have speed and capacity requirements
- Follow routing tables to reach destinations
Precomputed shortest paths between all control point pairs.
Load network data from JSON files:
var networkLoader = new NetworkLoader();
var statics = networkLoader.LoadFromJson("network.json");- Path occupancy rates
- Vehicle waiting times
- Throughput statistics
- Utilization metrics
Use the Python visualization tools:
cd Visualization
pip install -r requirements.txt
python visualize_network.py
python visualize_trajectories.pyRequestToEnter(IVehicle vehicle, ControlPoint cp): Request AGV entryAttemptToDepart(IVehicle vehicle): Attempt to depart from current pathReadyToExit(IVehicle vehicle, PmPath path): Signal ready to exit path
Name: Vehicle identifierSpeed: Movement speedCapacityNeeded: Path capacity requiredCurrentPath: Currently occupied pathTargetList: Destination control points
See PathMoverDemo/Simulator.cs for a complete example with 6 control points and multiple AGVs.
public class CustomVehicle : IVehicle
{
public string Name { get; set; }
public double Speed { get; set; }
public int CapacityNeeded { get; set; }
public PmPath CurrentPath { get; set; }
public PmPath? PengingPath { get; set; }
public bool IsStoped { get; set; }
public List<ControlPoint> TargetList { get; set; }
public PathMoverStatics PathMoverStatics { get; set; }
// Implement interface methods
public void RemoveTarget(ushort controlPointId) { ... }
public PmPath NextPath(ushort currentPointId) { ... }
}dotnet build PathMover.slncd NUnitTest_PM
dotnet testcd PathMoverLibrary
dotnet pack --configuration Release- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
- Built on O2DESNet framework
- Developed at National University of Singapore (NUS)
For issues and questions, please use the GitHub Issues page.
- Performance optimization: Improved path finding algorithm for large-scale networks, enhancing simulation speed
- New feature: Added dynamic routing support, allowing vehicles to adjust paths based on real-time network status
- API improvements: Simplified vehicle interface with more flexible configuration options
- Visualization enhancement: Improved Python visualization tools with real-time simulation monitoring support
- Model revise: Since overtake is not allowed, only the 1st vehicle in OutPengList can be added to relevant InPendingList.
- Bug fix: Add PengingPath to interface IVehicle, to manage item inside path.InPendingList in event AttemptToDepart.
- Bug fix: Attempt to depart the specific vehicle in currentPath.InPendingList (rather than the 1st one in previousPath.OutPendingList) when release of capacity propagate backward.
- Initial release