Class TrainBuilder
- java.lang.Object
-
- jmri.jmrit.operations.trains.TrainCommon
-
- jmri.jmrit.operations.trains.TrainBuilderBase
-
- jmri.jmrit.operations.trains.TrainBuilderEngines
-
- jmri.jmrit.operations.trains.TrainBuilderCars
-
- jmri.jmrit.operations.trains.TrainBuilder
-
public class TrainBuilder extends TrainBuilderCars
Builds a train and then creates the train's manifest.
-
-
Field Summary
-
Fields inherited from class jmri.jmrit.operations.trains.TrainBuilderCars
_routeToTrackFound
-
Fields inherited from class jmri.jmrit.operations.trains.TrainBuilderBase
_buildReport, _carIndex, _carList, _completedMoves, _departLocation, _departStageTrack, _engineList, _lastEngine, _modifiedLocations, _notRoutable, _numberCars, _numOfBlocks, _reqNumOfMoves, _routeList, _secondLeadEngine, _startTime, _terminateLocation, _terminateStageTrack, _thirdLeadEngine, _train, _warnings, carLoads, DISPLAY_CAR_LIMIT_100, DISPLAY_CAR_LIMIT_20, DISPLAY_CAR_LIMIT_50, FIVE, ONE, router, routeToTrackFound, SEVEN, THREE, trainManager, trainScheduleManager, USE_BUNIT
-
Fields inherited from class jmri.jmrit.operations.trains.TrainCommon
_dropCars, _pickupCars, _printLocalMoveHeader, _printPickupHeader, _printSetoutHeader, BLANK_LINE, BUILD_REPORT_CHAR, carManager, doneCars, ENGINE, engineManager, HORIZONTAL_LINE_CHAR, HYPHEN, index, IS_MANIFEST, IS_TWO_COLUMN_TRACK, LOCAL, locationManager, NEW_LINE, PAPER_MARGINS, PICKUP, SPACE, TAB, TEXT_COLOR_DONE, TEXT_COLOR_END, TEXT_COLOR_START, utilityCarTypes, VERTICAL_LINE_CHAR
-
-
Constructor Summary
Constructors Constructor Description TrainBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
build(Train train)
Build rules: Need at least one location in route to build train Select only locos and cars that the train can service If required, add caboose or car with FRED to train When departing staging find a track matching train requirements All cars and locos on one track must leave staging Optionally block cars from staging Route cars with home divisions Route cars with custom loads or final destinations.-
Methods inherited from class jmri.jmrit.operations.trains.TrainBuilderCars
blockCarsFromStaging, findDestinationsForCarsFromLocation, getCaboose, getCarWithFred
-
Methods inherited from class jmri.jmrit.operations.trains.TrainBuilderEngines
addEnginesToTrain, checkEngineHP, checkNumnberOfEnginesNeededHPT, getAndRemoveEnginesFromList
-
Methods inherited from class jmri.jmrit.operations.trains.TrainBuilderBase
addCarToTrain, addEnginesBasedHPT, adjustCarsInStaging, checkBasicMoves, checkDepartureStagingTrack, checkDropTrainDirection, checkDropTrainDirection, checkForEarlierDrop, checkForLaterPickUp, checkPickUpTrainDirection, checkPickUpTrainDirection, checkStuckCarsInStaging, checkTerminateStagingTrack, checkThroughCarsAllowed, checkTrainCanDrop, checkTrainLength, countRollingStockAt, createBuildReportFile, finishAddRsToTrain, generateLoadCarDepartingAndTerminatingIntoStaging, getCarList, getConsist, getEngines, getEngines, getLargestBlock, getLocationWithMaximumMoves, getNewEngine, getNumberEngines, getScheduleItem, getTracksAtDestination, isCarStuckStaging, makeAdjustmentsIfDepartingStaging, promptFromStagingDialog, promptToStagingDialog, redirectCarsFromAlternateTrack, removeCaboosesAndCarsWithFred, removeCarsFromStaging, removeEngineFromTrain, removeRollingStockFromTrain, restoreCarsIfDepartingStaging, saveCarFinalDestinations, setDepartureTrack, setEngineDestination, setUpRoute, showAndInitializeTrainRoute, showBuildReportInfo, showCarsByLocation, showCarServiceOrder, showCarsNotMoved, showCarsNotRoutable, showEnginesByLocation, showIfLocalSwitcher, showLoadGenerationOptionsStaging, showSpecificTrainBuildOptions, showTrainBuildOptions, showTrainCabooseRoads, showTrainCarRoads, showTrainCarTypes, showTrainLoadNames, showTrainRequirements, showTrainServices, sortCarsOnFifoLifoTracks, tryStaging
-
Methods inherited from class jmri.jmrit.operations.trains.TrainCommon
addCarsLocationUnknown, addLine, addLine, blockCarsByTrack, blockCarsByTrackNameTwoColumn, blockCarsTwoColumn, blockLocosTwoColumn, clearUtilityCarTypes, convertStringToDate, countPickupUtilityCars, countSetoutUtilityCars, countUtilityCars, createTabIfNeeded, dropCar, dropCar, dropEngine, dropEngines, formatColorString, formatStringToCommaSeparated, getDate, getDate, getDropCarHeader, getDropEngineHeader, getISO8601Date, getLineLength, getLocalMoveHeader, getManifestHeaderLineLength, getPageSize, getPickupCarHeader, getPickupEngineHeader, getTextColor, getTextColorName, getTextColorString, isNextCar, isNextCar, isThereWorkAtLocation, isThereWorkAtLocation, localMoveCar, newLine, newLine, padAndTruncate, padAndTruncateIfNeeded, padString, pickupCar, pickUpCar, pickUpCarTruncated, pickupEngine, pickupEngines, pickupUtilityCars, pickupUtilityCars, printCarHeader, printDropCarHeader, printDropEngineHeader, printEngineHeader, printHorizontalLine, printHorizontalLine, printLocalCarMoveHeader, printPickupCarHeader, printPickupEngineHeader, printTrackComments, printTrackNameHeader, setoutUtilityCars, setoutUtilityCars, setoutUtilityCars, splitString, tabString, truncatedDropCar
-
-
-
-
Constructor Detail
-
TrainBuilder
public TrainBuilder()
-
-
Method Detail
-
build
public boolean build(Train train)
Build rules:- Need at least one location in route to build train
- Select only locos and cars that the train can service
- If required, add caboose or car with FRED to train
- When departing staging find a track matching train requirements
- All cars and locos on one track must leave staging
- Optionally block cars from staging
- Route cars with home divisions
- Route cars with custom loads or final destinations.
- Service locations based on train direction, location car types, roads and loads.
- Ignore track direction when train is a local (serves one location)
History:
First version of train builder found cars along a train's route and assigned destinations (tracks) willing to accept the car. This is called the random method as cars just bounce around the layout without purpose. Afterwards custom loads and routing was added to the program. Cars with custom loads or final destinations move with purpose as those cars are routed. The last major feature added was car divisions. Cars assigned a division are always routed.
The program was written around the concept of a build report. The report provides a description of the train build process and the steps taken to place rolling stock in a train. The goal was to help users understand why rolling stock was either assigned to the train or not, and which choices the program had available when determining an engine's or car's destination.
- Parameters:
train
- the train that is to be built- Returns:
- True if successful.
-
-