jmri.jmrit.operations.router
Class Router

java.lang.Object
  extended by jmri.jmrit.operations.trains.TrainCommon
      extended by jmri.jmrit.operations.router.Router

public class Router
extends TrainCommon

Router for car movement. This code attempts to find a way to move a car to its final destination through the use of two or more trains. Code first tries to move car using a single train. If that fails, attempts are made to use two trains via an interchange track , then a yard. Next attempts are made using three or more trains using any combination of interchanges and yards. Currently the router is limited to five trains.

Author:
Daniel Boudreau Copyright (C) 2010, 2011

Field Summary
 boolean enable_staging
           
protected static String SEVEN
           
 
Fields inherited from class jmri.jmrit.operations.trains.TrainCommon
TAB
 
Constructor Summary
Router()
           
 
Method Summary
 String getStatus()
           
static Router instance()
           
 boolean setDestination(Car car, Train train, PrintWriter buildReport)
          Attempts to set the car's destination if a next destination exists.
 
Methods inherited from class jmri.jmrit.operations.trains.TrainCommon
addLine, addLine, dropCar, dropEngine, dropEngines, getCarAttribute, getCarsLocationUnknown, getDate, getEngineAttribute, getRollingStockAttribute, lineLength, newLine, pickupCar, pickupEngine, pickupEngines, searchForCar, splitString, tabString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

enable_staging

public boolean enable_staging

SEVEN

protected static final String SEVEN
See Also:
Constant Field Values
Constructor Detail

Router

public Router()
Method Detail

instance

public static Router instance()

setDestination

public boolean setDestination(Car car,
                              Train train,
                              PrintWriter buildReport)
Attempts to set the car's destination if a next destination exists. Only sets the car's destination if the train is part of the car's route.

Parameters:
car - the car to route
train - the first train to carry this car, can be null
buildReport - PrintWriter for build report, and can be null
Returns:
true if car can be routed.

getStatus

public String getStatus()


Copyright © 1997 - 2011 JMRI Community.
JMRI, DecoderPro, PanelPro, SoundPro, DispatcherPro and associated logos are our trademarks.

Additional information on copyright, trademarks and licenses is linked here.
Site hosted by: Get JMRI Model Railroad Interface at SourceForge.net. Fast, secure and Free Open Source software downloads