Advanced Production Scheduling — Hybrid Rust/C# scheduling system
U-APS is a production scheduling system that combines a Rust optimization engine with a C# SDK.
Input (JSON/Excel) → Scheduling Engine → Output (JSON/Excel)
┌──────────────────────────────────────────────┐
│ U-APS │
├──────────────────────────────────────────────┤
│ APS Engine (Rust) │
│ ├── 7 scheduling algorithms │
│ ├── FFI interface (5 C-ABI functions) │
│ └── Built on u-schedule + u-metaheur │
├──────────────────────────────────────────────┤
│ UAPS.SDK (C#) │ UAPS.CLI (C#) │
│ ├── Fluent API │ ├── JSON I/O │
│ ├── SchedulerClient │ └── Excel I/O │
│ └── NativeLoader │ │
└──────────────────────────┴────────────────────┘
# Install as dotnet tool
dotnet tool install -g UAPS.CLI
# Usage
uaps input.json output.json
uaps input.xlsx output.xlsx
# With dispatching strategy
uaps input.json output.json --strategy SPT
uaps input.json output.json --strategy EDD --tie-breaker FIFOThe first run needs network access. A .NET tool package is runtime-identifier neutral, so
UAPS.CLIcannot carry the native engine the wayUAPS.SDKdoes. On its first run the tool downloads the engine binary for your platform from GitHub Releases into%LOCALAPPDATA%\UAPS\native(Windows) or~/.local/share/UAPS/native(Linux, macOS), and every later run uses that copy offline. To install onto a machine without network access, fetch the binary for your platform from GitHub Releases and place it in that directory before the first run, or use the SDK package instead —UAPS.SDKships the engine inside the package for every supported platform and never downloads anything.
Or download standalone binaries from GitHub Releases.
dotnet add package UAPS.SDKusing UAPS.SDK.Client;
using UAPS.SDK.Interop;
using UAPS.SDK.Models;
await NativeLoader.EnsureLoadedAsync();
var job = Job.Create("J1")
.WithPriority(1)
.WithDueDate(DateTime.Now.AddHours(8));
job.Operations.Add(
Operation.Create("O1", "J1", 1)
.WithTime(0, 60_000, 0)
.WithEquipment("M1")
.WithMaterial("MAT-001", 10.0)
);
var resource = Resource.CreateEquipment("M1", "Machine 1");
var client = new SchedulerClient();
var request = new ScheduleRequest
{
Jobs = [job],
Resources = [resource],
DispatchingConfig = new DispatchingConfig
{
PrimaryRule = "EDD",
TieBreaker = "SPT"
}
};
var result = client.Schedule(request);
Console.WriteLine($"Makespan: {result.Schedule.MakespanMs}ms");| Algorithm | Type | Best For |
|---|---|---|
| Simple | Dispatching rule | Fast baseline, small problems |
| GeneticAlgorithm | Metaheuristic | Medium problems (30-200 ops) |
| Production | GA + extensions | Real manufacturing with setup/split/overlap |
| Dynamic | Time-fence | Rescheduling with frozen horizons |
| CpSat | Constraint Programming | Exact solutions for small problems |
| Hybrid | GA + SA | Large problems needing escape from local optima |
| Auto | Adaptive | Selects algorithm based on problem characteristics |
| Rule | Description | Best For |
|---|---|---|
| FIFO | First In First Out | Fair scheduling |
| SPT | Shortest Processing Time | Minimize avg flow time |
| LPT | Longest Processing Time | Load balancing |
| EDD | Earliest Due Date | Minimize tardiness |
| SLACK | Minimum Slack Time | Urgent jobs |
| CR | Critical Ratio | Balance due dates |
| PRIORITY | Job Priority | Explicit prioritization |
| LWKR | Least Work Remaining | Quick completions |
| MWKR | Most Work Remaining | Complex jobs first |
| MOPNR | Most Operations Remaining | Complex jobs first |
| RANDOM | Random | Baseline comparison |
- Resource Constraints: Equipment, workers, calendars, shifts
- Material Constraints: BOM, stock levels, safety stock, lead times
- Time Constraints: Due dates, earliest start, time windows
- Setup Optimization: Setup matrices, campaign scheduling
- Multi-Site Scheduling: Site transitions with inter-site transit times
- Skill Matrix: Worker proficiency tracking with learning curves
- Certification Matrix: Worker certifications with expiry management
- Crew Management: Team assignments with shift schedules
- Rescheduling Events: 18 event types for dynamic adjustments
- Equipment: Breakdown, Recovery, Maintenance, Efficiency change
- Material: Shortage, Delay, Arrival
- Worker: Unavailable, Available, Skill change
- Quality: Defect, Inspection delay
- Order: Delay, Urgent order, Cancellation, Due date/Quantity/Priority change
- KPIs: Makespan, utilization, tardiness, MCE
- CTP (Capable-To-Promise): Delivery date promises
- What-If Analysis: Scenario comparison
- Bottleneck Detection: Resource utilization analysis
Five C-ABI functions for external consumption:
| Function | Purpose |
|---|---|
uaps_schedule() |
Schedule with algorithm selection + KPI + metrics |
uaps_validate() |
Pre-flight input validation |
uaps_reschedule() |
Event-driven rescheduling |
uaps_version() |
Engine version string |
uaps_free_string() |
Free allocated string memory |
- Rust 1.87+
- .NET 10.0+ SDK
# Full build
.\scripts\build.ps1 -Configuration Release
# Run tests
.\scripts\test.ps1
# Run samples
.\scripts\run-samples.ps1 -Report# Rust Engine only
cd engine
cargo build --release
cargo test
# C# SDK only
cd sdk
dotnet build -c Release
dotnet testU-APS/
├── engine/ # APS engine (Rust)
│ └── src/
│ ├── models/ # Job, Operation, Resource, Material, etc.
│ ├── scheduler/ # Scheduling algorithms, KPI, rescheduling
│ ├── ga/ # Genetic algorithm with dual-vector encoding
│ ├── cp/ # Constraint programming solver
│ ├── benchmark/ # Standard JSP/FJSSP instances
│ ├── validation/ # Input validation
│ └── ffi.rs # C-ABI FFI interface
├── sdk/
│ ├── UAPS.SDK/ # C# SDK
│ │ ├── Models/ # Domain models
│ │ ├── Client/ # SchedulerClient
│ │ ├── Simulation/ # SimulationSession
│ │ └── Analytics/ # WhatIfSimulator
│ ├── UAPS.CLI/ # Command-line tool
│ └── UAPS.SDK.Tests/ # C# tests
├── samples/ # Example scenarios
└── docs/ # Documentation
| Sample | Description |
|---|---|
001-simple |
Basic single job scheduling |
002-multi-job |
Multiple jobs with priorities |
003-due-dates |
Due date constraints and violations |
004-setup-matrix |
Setup time optimization |
005-multi-resource |
Multi-resource operations |
006-parallel-machines |
Parallel machine scheduling |
007-complex-flow |
Complex multi-job flow |
- Engine Tests: 373 passed (Rust)
- FFI Tests: 12 integration tests
- SDK Tests: 78 passed (C#)
Release history is in CHANGELOG.md. Both NuGet packages share
one version, UAPSVersion.
MIT License — see LICENSE.
- u-schedule — Scheduling framework
- u-metaheur — Metaheuristic optimization
- u-numflow — Mathematical primitives