Class TrainBuilder
-
Field Summary
Fields inherited from class jmri.jmrit.operations.trains.trainbuilder.TrainBuilderCars
_routeToTrackFoundFields inherited from class jmri.jmrit.operations.trains.trainbuilder.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, TIMING, trainManager, trainScheduleManager, USE_BUNITFields inherited from class jmri.jmrit.operations.trains.trainbuilder.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 -
Method Summary
Modifier and TypeMethodDescriptionbooleanBuild 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.trainbuilder.TrainBuilderCars
addCarToTrain, blockCarsFromStaging, findDestinationsForCarsFromLocation, getCaboose, getCarWithFred, redirectCarsFromAlternateTrackMethods inherited from class jmri.jmrit.operations.trains.trainbuilder.TrainBuilderEngines
addEnginesToTrain, checkEngineHP, checkNumnberOfEnginesNeededHPT, getAndRemoveEnginesFromListMethods inherited from class jmri.jmrit.operations.trains.trainbuilder.TrainBuilderBase
addEnginesBasedHPT, adjustCarsInStaging, checkBasicMoves, checkDepartureStagingTrack, checkDropTrainDirection, checkDropTrainDirection, checkForAlternate, checkForEarlierDrop, checkForLaterPickUp, checkPickupInterchangeDestinationRestrictions, checkPickupInterchangeOrSpur, checkPickUpTrainDirection, checkPickUpTrainDirection, checkReserved, checkStuckCarsInStaging, checkTerminateStagingTrack, checkThroughCarsAllowed, checkTrainCanDrop, checkTrainLength, countRollingStockAt, createBuildReportFile, finishAddRsToTrain, generateLoadCarDepartingAndTerminatingIntoStaging, getCarList, getConsist, getEngines, getEngines, getLargestBlock, getLocationWithMaximumMoves, getNewEngine, getNumberEngines, getScheduleItem, getTracksAtDestination, isCarStuckStaging, makeAdjustmentsIfDepartingStaging, promptFromStagingDialog, promptToStagingDialog, 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, tryStagingMethods inherited from class jmri.jmrit.operations.trains.trainbuilder.TrainCommon
addCarsLocationUnknown, addLine, addLine, blockCarsByTrack, blockCarsByTrackNameTwoColumn, blockCarsTwoColumn, blockLocosTwoColumn, clearUtilityCarTypes, convertStringTime, convertStringToDate, countPickupUtilityCars, countSetoutUtilityCars, countUtilityCars, createTabIfNeeded, dropCar, dropCar, dropEngine, dropEngines, formatColorString, formatStringToCommaSeparated, getDate, getDate, getDropCarHeader, getDropEngineHeader, getISO8601Date, getLineLength, getLocalMoveHeader, getManifestHeaderLineLength, getPageSize, getPickupCarHeader, getPickupEngineHeader, getSwitchListTrainStatus, getTextColor, getTextColorName, getTextColorString, getTrainMessage, isNextCar, isNextCar, isThereWorkAtLocation, isThereWorkAtLocation, localMoveCar, newLine, newLine, padAndTruncate, padAndTruncateIfNeeded, padString, pickupCar, pickUpCar, pickUpCarTruncated, pickupEngine, pickupEngines, pickupUtilityCars, pickupUtilityCars, printCarHeader, printDropCarHeader, printDropEngineHeader, printEngineHeader, printHorizontalLine, printHorizontalLine, printHorizontalLine1, printHorizontalLine2, printHorizontalLine3, printLocalCarMoveHeader, printPickupCarHeader, printPickupEngineHeader, printTrackComments, printTrackNameHeader, setCarPickupAndSetoutTimes, setoutUtilityCars, setoutUtilityCars, setoutUtilityCars, splitString, splitStringLeftParenthesis, tabString, truncatedDropCar
-
Constructor Details
-
TrainBuilder
public TrainBuilder()
-
-
Method Details
-
build
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.
-