Tellurian.Trains.Schedules.Model 3.2.1

Prefix Reserved
dotnet add package Tellurian.Trains.Schedules.Model --version 3.2.1
                    
NuGet\Install-Package Tellurian.Trains.Schedules.Model -Version 3.2.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Tellurian.Trains.Schedules.Model" Version="3.2.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Tellurian.Trains.Schedules.Model" Version="3.2.1" />
                    
Directory.Packages.props
<PackageReference Include="Tellurian.Trains.Schedules.Model" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Tellurian.Trains.Schedules.Model --version 3.2.1
                    
#r "nuget: Tellurian.Trains.Schedules.Model, 3.2.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Tellurian.Trains.Schedules.Model@3.2.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Tellurian.Trains.Schedules.Model&version=3.2.1
                    
Install as a Cake Addin
#tool nuget:?package=Tellurian.Trains.Schedules.Model&version=3.2.1
                    
Install as a Cake Tool

Tellurian.Trains.Schedules.Model

Core domain model for railway timetable planning and scheduling.

Installation

dotnet add package Tellurian.Trains.Schedules.Model

Key Types

Layout (Physical Infrastructure)

Type Description
Layout Physical track layout with stations, companies, and stretches
OperationLocation Abstract base class for locations where trains can stop or pass. The type governs whether a train may stop: at a Station or OtherLocation it stops per the call's IsStop; at a SignalControlledLocation it never stops
Station A manned operation location (dispatcher present). A train stops per the call's IsStop — to meet, be overtaken, or exchange passengers or cargo
SignalControlledLocation An unmanned, signal-controlled location (block post or junction). A train never stops here; it always passes through regardless of the call's IsStop
OtherLocation An unmanned location without signal control, for example a halt. A train may stop per the call's IsStop (passenger exchange only, no cargo)
StationTrack Track within an operation location
TrackStretch Physical connection between two operation locations with distance and track count. i.e. single or double track
TimetableStretch A named sequence of track stretches for timetable display
DispatchStretch A stretch between two adjacent stations where trains are dispatcheds
Company Railway company operating trains, vehicles and/or duties

Timetable (Train Operations)

Type Description
Timetable Holds a collection of trains running on the layout
Train Train with calls at operation locations, category, and optional cargo flows
TrainCategory Train type with prefix, suffix, color, and passenger/freight flags
StationCall A train's call at an operation location track with arrival/departure times. IsStop (it arrives and/or departs) versus IsPassthrough (neither, the train passes without stopping) is the single source of truth — times are never compared to decide it. The location can override it: a train never stops at a SignalControlledLocation, so the effective stop is IsStop && Station is not SignalControlledLocation
CargoFlowTrainPart Freight wagons a train couples at one call and uncouples at a later one, over a segment of its route, referencing a reusable CargoFlowOptions description
Sessions Representing which sessions/days a train runs

Schedule (Resource Assignments)

Type Description
Schedule Holds vehicles, vehicle schedules, and driver duties
Vehicle Locomotive or trainset with type, number, and company
VehicleSchedule A schedule containing train parts for locomotives and trainsets
VehicleScheduleAssignment Links a vehicle to a vehicle schedule for specific sessions (usually all session)
TrainPart A portion of a train between two station calls (used in vehicle schedules), default is a train part for the whole train
DriverDuty Driver shift assignments to train parts

Remark The concept with VehicleSchedules containing TrainParts is to make it possible to change locomotives and wagonsets at a station between the train's first and last station call.

Usage

using Tellurian.Trains.Schedules.Model;

// Create a layout with stations
var layout = new Layout { Name = "MyLayout" };
var station = new Station(1, "Central", "C");
station.Add(new StationTrack("1") { IsMain = true });
layout.Add(station);

// Create a timetable with trains
var timetable = new Timetable("Morning", layout);
var train = new Train(101, "P101") { Category = passengerCategory };
train.Add(new StationCall(station.Tracks.First(),
    arrival: new Time(8, 0),
    departure: new Time(8, 5)));
timetable.Add(train);

// Create a complete schedule
var schedule = Schedule.Create("Schedule2024", timetable);

// Add vehicles and assignments
var loco = new Vehicle(1, VehicleType.Locomotive, 1234);
schedule.AddVehicle(loco);

var vehicleSchedule = new VehicleSchedule(1);
schedule.AddVehicleSchedule(vehicleSchedule);
vehicleSchedule.Add(train.AsTrainPart(0, 1)); // First to last call

var assignment = new VehicleScheduleAssignment(1, loco, vehicleSchedule);
loco.ScheduleAssignments.Add(assignment);

Validation

The model includes comprehensive validation to detect scheduling conflicts and data inconsistencies. Validation is performed after data has been successfully imported with referential integrity intact.

For detailed validation documentation, see VALIDATION.md.

Validation Options

Validation can be configured using ValidationSettings:

var options = new ValidationSettings
{
    ValidateStationCalls = true,       // Check arrival/departure times
    ValidateStationTracks = true,      // Check track occupation conflicts
    ValidateStretches = true,          // Check single-track conflicts
    ValidateTrainSpeed = true,         // Check speed limits
    ValidateVehicleSchedules = true,   // Check vehicle schedule overlaps
    ValidateLocomotiveCoverage = true, // Check locomotive assignments cover entire train
    MinTrainSpeedMetersPerClockMinute = 0.3,
    MaxTrainSpeedMetersPerClockMinute = 10
};

var errors = schedule.GetValidationErrors(options);

ValidationError

Validation returns ValidationError objects containing location and time information for highlighting conflicts in a graphical timetable:

foreach (var error in errors)
{
    Console.WriteLine(error.Message);           // Localized message
    Console.WriteLine(error.ErrorType);         // Error category
    Console.WriteLine(error.Trains);            // Trains involved
    Console.WriteLine(error.FromTrack);         // Conflict start location
    Console.WriteLine(error.ToTrack);           // Conflict end location
    Console.WriteLine(error.FromTime.HHMM());   // Conflict start time
    Console.WriteLine(error.ToTime.HHMM());     // Conflict end time
}

// Check conflict type
if (error.IsStationConflict)  // FromTrack == ToTrack
    // Conflict is at a single station track
if (error.IsStretchConflict)  // FromTrack != ToTrack
    // Conflict spans a track stretch between stations

Validation Error Types

ErrorType Description
MissingTrackReference Station track is referenced but not in layout
StationCallTiming Station call has arrival after departure
StationTrackConflict Two trains conflict on the same station track
TrackStretchConflict Two trains conflict on a track stretch
TrainTimeSequence Train calls are not in correct time sequence
TrainSpeedTooSlow Train speed is too slow between calls
TrainSpeedTooFast Train speed is too fast between calls
TrainTooFewCalls Train must have at least two station calls
VehicleScheduleOverlap Vehicle schedule has overlapping train parts
LocomotiveCoverageGap Train has a gap in locomotive coverage
LocomotiveCoverageOverlap Train has overlapping locomotive assignments
VehicleDoubleBooked Vehicle has overlapping schedule assignments

Validation Checks by Option

Option Checks Performed
ValidateStationCalls StationCallTiming
ValidateStationTracks StationTrackConflict
ValidateStretches TrackStretchConflict
ValidateTrainSpeed TrainSpeedTooSlow, TrainSpeedTooFast
ValidateVehicleSchedules VehicleScheduleOverlap, VehicleDoubleBooked
ValidateLocomotiveCoverage LocomotiveCoverageGap, LocomotiveCoverageOverlap

Note: MissingTrackReference, TrainTimeSequence, and TrainTooFewCalls are always checked.

Localization

Validation messages are available in:

  • English (default)
  • German (de)
  • Danish (da)
  • Norwegian (nb)
  • Swedish (sv)
Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (5)

Showing the top 5 NuGet packages that depend on Tellurian.Trains.Schedules.Model:

Package Downloads
Tellurian.Trains.Schedules.Importers.Interfaces

Import operations for layouts, timetables and schedules.

Tellurian.Trains.Schedules.Importers.Xpln

Import operations for layouts, timetables and schedules.

Tellurian.Trains.Schedules.Importers.Services

Import operations for layouts, timetables and schedules.

Tellurian.Trains.Schedules.Model.Databases

Entity Framework Core support for Tellurian.Trains.Schedules.Model.

Tellurian.Trains.Schedules.Model.Planning

Planning utilities for creating layouts, timetables and schedules.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
3.2.1 145 8/10/2026
3.2.0 132 8/9/2026
3.1.0 150 7/30/2026
2.1.0 184 1/12/2026
2.0.1 168 1/1/2026
2.0.0 163 1/1/2026