Package jmri.jmrit.operations.locations
Class Track
- java.lang.Object
-
- jmri.beans.PropertyChangeSupport
-
- jmri.jmrit.operations.locations.Track
-
- All Implemented Interfaces:
PropertyChangeFirer
,PropertyChangeProvider
public class Track extends PropertyChangeSupport
Represents a location (track) on the layout Can be a spur, yard, staging, or interchange track.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String
_alternateTrackId
protected int
_blockingOrder
protected int
_blockOptions
protected java.lang.String
_comment
protected java.lang.String
_commentBoth
protected java.lang.String
_commentPickup
protected java.lang.String
_commentSetout
protected java.util.List<java.lang.String>
_destinationIdList
protected java.lang.String
_destinationOption
protected java.util.List<java.lang.String>
_dropList
protected java.lang.String
_dropOption
protected int
_dropRS
protected boolean
_holdCustomLoads
protected java.lang.String
_id
protected int
_ignoreUsedLengthPercentage
protected int
_length
protected java.util.List<java.lang.String>
_loadList
protected java.lang.String
_loadOption
protected int
_loadOptions
protected Location
_location
protected int
_minimumLength
protected int
_mode
protected int
_moves
protected java.lang.String
_name
protected int
_numberCars
protected int
_numberCarsEnRoute
protected int
_numberEngines
protected int
_numberRS
protected boolean
_onlyCarsWithFD
protected java.lang.String
_order
protected java.util.List<java.lang.String>
_pickupList
protected java.lang.String
_pickupOption
protected int
_pickupRS
protected Pool
_pool
protected boolean
_printCommentManifest
protected boolean
_printCommentSwitchList
protected Reporter
_reader
protected int
_reservationFactor
protected int
_reserved
protected int
_reservedEnRoute
protected int
_reservedLengthDrops
protected java.util.List<java.lang.String>
_roadList
protected java.lang.String
_roadOption
protected int
_scheduleCount
protected java.lang.String
_scheduleId
protected java.lang.String
_scheduleItemId
protected java.lang.String
_scheduleName
protected java.util.List<java.lang.String>
_shipLoadList
protected java.lang.String
_shipLoadOption
protected java.lang.String
_trackType
protected int
_trainDir
protected java.util.List<java.lang.String>
_typeList
protected int
_usedLength
static java.lang.String
ALL
static java.lang.String
ALL_DESTINATIONS
static java.lang.String
ALL_LOADS
static java.lang.String
ALL_ROADS
static java.lang.String
ALTERNATE_TRACK_CHANGED_PROPERTY
static java.lang.String
ANY
static java.lang.String
CAPACITY
static java.lang.String
CUSTOM
static java.lang.String
DESTINATION
static java.lang.String
DESTINATION_OPTIONS_CHANGED_PROPERTY
static java.lang.String
DESTINATIONS_CHANGED_PROPERTY
static java.lang.String
DISPOSE_CHANGED_PROPERTY
static java.lang.String
DROP_CHANGED_PROPERTY
static int
EAST
static java.lang.String
EXCLUDE_DESTINATIONS
static java.lang.String
EXCLUDE_LOADS
static java.lang.String
EXCLUDE_ROADS
static java.lang.String
EXCLUDE_ROUTES
static java.lang.String
EXCLUDE_TRAINS
static java.lang.String
FIFO
static java.lang.String
HOLD_CARS_CHANGED_PROPERTY
static int
IGNORE_0
static int
IGNORE_100
static int
IGNORE_25
static int
IGNORE_50
static int
IGNORE_75
static java.lang.String
INCLUDE_DESTINATIONS
static java.lang.String
INCLUDE_LOADS
static java.lang.String
INCLUDE_ROADS
static java.lang.String
INTERCHANGE
static java.lang.String
LENGTH
static java.lang.String
LENGTH_CHANGED_PROPERTY
static java.lang.String
LIFO
static java.lang.String
LOAD
static java.lang.String
LOAD_OPTIONS_CHANGED_PROPERTY
static java.lang.String
LOADS_CHANGED_PROPERTY
static int
MATCH
static java.lang.String
MIN_LENGTH_CHANGED_PROPERTY
static java.lang.String
NAME_CHANGED_PROPERTY
static java.lang.String
NO_FINAL_DESTINATION
static java.lang.String
NONE
static java.lang.String
NORMAL
static int
NORTH
static java.lang.String
OKAY
static java.lang.String
PICKUP_CHANGED_PROPERTY
static java.lang.String
PICKUP_OKAY
static java.lang.String
PLANNED_PICKUPS_CHANGED_PROPERTY
static java.lang.String
POOL_CHANGED_PROPERTY
static java.lang.String
ROAD
static java.lang.String
ROADS_CHANGED_PROPERTY
static java.lang.String
ROUTED_CHANGED_PROPERTY
static java.lang.String
ROUTES
static java.lang.String
SCHEDULE
static java.lang.String
SCHEDULE_CHANGED_PROPERTY
static java.lang.String
SCHEDULE_ID_CHANGED_PROPERTY
static java.lang.String
SCHEDULE_MODE_CHANGED_PROPERTY
static int
SEQUENTIAL
static java.lang.String
SERVICE_ORDER_CHANGED_PROPERTY
static int
SOUTH
static java.lang.String
SPUR
static java.lang.String
STAGING
static java.lang.String
TRACK_BLOCKING_ORDER_CHANGED_PROPERTY
static java.lang.String
TRACK_COMMENT_CHANGED_PROPERTY
static java.lang.String
TRACK_REPORTER_CHANGED_PROPERTY
static java.lang.String
TRACK_TYPE_CHANGED_PROPERTY
static java.lang.String
TRAIN_DIRECTION_CHANGED_PROPERTY
static java.lang.String
TRAIN_SCHEDULE
static java.lang.String
TRAINS
static java.lang.String
TYPE
static java.lang.String
TYPES_CHANGED_PROPERTY
static int
WEST
static java.lang.String
YARD
-
Fields inherited from class jmri.beans.PropertyChangeSupport
propertyChangeSupport
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addDestination(Location destination)
adds a location to the list of acceptable destinations for this track.void
addDropId(java.lang.String id)
void
addDropRS(RollingStock rs)
void
addLoadName(java.lang.String load)
Add a receive load that the track will either service or exclude.void
addPickupId(java.lang.String id)
Add train or route id to this track.void
addPickupRS(RollingStock rs)
Increments the number of cars and or engines that will be picked up by a train from this track.void
addReservedInRoute(Car car)
void
addRoadName(java.lang.String road)
void
addRS(RollingStock rs)
Adds rolling stock to a specific track.void
addShipLoadName(java.lang.String load)
Add a ship load that the track will either service or exclude.void
addTypeName(java.lang.String type)
void
bumpMoves()
void
bumpSchedule()
Increments the schedule count if there's a schedule and the schedule is running in sequential mode.java.lang.String
checkPickups()
Checks to see if all car types can be pulled from this trackjava.lang.String
checkSchedule(Car car)
Checks to see if car can be placed on this spur using this schedule.boolean
checkScheduleAttribute(java.lang.String attribute, java.lang.String carType, Car car)
java.lang.String
checkScheduleValid()
Check to see if schedule is valid for the track at this location.boolean
containsDropId(java.lang.String id)
boolean
containsPickupId(java.lang.String id)
boolean
containsRoadName(java.lang.String road)
Track
copyTrack(java.lang.String newName, Location newLocation)
Creates a copy of this track.void
deleteDestination(Location destination)
void
deleteDropId(java.lang.String id)
void
deleteDropRS(RollingStock rs)
void
deleteLoadName(java.lang.String load)
Delete a receive load name that the track will either service or exclude.void
deletePickupId(java.lang.String id)
void
deletePickupRS(RollingStock rs)
void
deleteReservedInRoute(Car car)
void
deleteRoadName(java.lang.String road)
void
deleteRS(RollingStock rs)
void
deleteShipLoadName(java.lang.String load)
Delete a ship load name that the track will either service or exclude.void
deleteTypeName(java.lang.String type)
void
dispose()
Track
getAlternateTrack()
Returns the alternate track for a spurint
getAvailableTrackSpace()
Available track space.int
getBlockingOrder()
Gets the blocking order for this track.java.lang.String
getComment()
java.lang.String
getCommentBoth()
java.lang.String
getCommentBothWithColor()
java.lang.String
getCommentPickup()
java.lang.String
getCommentPickupWithColor()
java.lang.String
getCommentSetout()
java.lang.String
getCommentSetoutWithColor()
ScheduleItem
getCurrentScheduleItem()
Get's the current schedule item for this track Protects against user deleting an item in a shared schedule.java.lang.String[]
getDestinationIds()
int
getDestinationListSize()
java.lang.String
getDestinationOption()
Get destination option for interchange or staging trackDivision
getDivision()
java.lang.String
getDivisionName()
java.lang.String[]
getDropIds()
java.lang.String
getDropOption()
Gets the drop option for this track.int
getDropRS()
java.lang.String
getId()
int
getIgnoreUsedLengthPercentage()
int
getLength()
java.lang.String[]
getLoadNames()
Provides a list of receive loads that the track will either service or exclude.java.lang.String
getLoadOption()
Gets the car receive load option for this track.java.lang.String
getLoadOptionString()
Location
getLocation()
int
getMinimumLength()
int
getMoves()
java.lang.String
getName()
ScheduleItem
getNextScheduleItem()
int
getNumberCars()
int
getNumberEngines()
int
getNumberOfCarsInRoute()
int
getNumberRS()
java.lang.String[]
getPickupIds()
java.lang.String
getPickupOption()
Gets the pickup option for this track.int
getPickupRS()
Pool
getPool()
java.lang.String
getPoolName()
Reporter
getReporter()
java.lang.String
getReporterName()
int
getReservationFactor()
int
getReserved()
int
getReservedInRoute()
Used to determine how much track space is going to be consumed by cars in route to this track.int
getReservedLengthDrops()
java.lang.String[]
getRoadNames()
java.lang.String
getRoadOption()
java.lang.String
getRoadOptionString()
Schedule
getSchedule()
int
getScheduleCount()
Returns how many times the current schedule item has been accessed.java.lang.String
getScheduleId()
java.lang.String
getScheduleItemId()
Recommend getCurrentScheduleItem() to get the current schedule item for this track.int
getScheduleMode()
Gets the mode of operation for the schedule assigned to this track.java.lang.String
getScheduleModeName()
java.lang.String
getScheduleName()
Returns the name of the schedule.java.lang.String
getServiceOrder()
Get the service order for this track.java.lang.String[]
getShipLoadNames()
Provides a list of ship loads that the track will either service or exclude.java.lang.String
getShipLoadOption()
Gets the car ship load option for this track.java.lang.String
getShipLoadOptionString()
java.lang.String
getSplitName()
java.lang.String
getTrackType()
Gets the track typejava.lang.String
getTrackTypeName()
static java.lang.String
getTrackTypeName(java.lang.String trackType)
int
getTrainDirections()
java.lang.String[]
getTypeNames()
Returns all of the rolling stock type names serviced by this track.int
getUsedLength()
boolean
hasMessages()
boolean
isAddCustomLoadsAnySpurEnabled()
boolean
isAddCustomLoadsAnyStagingTrackEnabled()
boolean
isAddCustomLoadsEnabled()
boolean
isAlternate()
Used to determine if track has been assigned as an alternateboolean
isBlockCarsEnabled()
When enabled block cars from staging.boolean
isDestinationAccepted(Location destination)
Returns true if destination is valid from this track.boolean
isDisableLoadChangeEnabled()
boolean
isDropRouteAccepted(Route route)
boolean
isDropTrainAccepted(Train train)
Determine if train can set out cars to this track.boolean
isHoldCarsWithCustomLoadsEnabled()
If enabled (true), hold cars with custom loads rather than allowing them to go to staging if the spur and the alternate track were full.boolean
isInterchange()
boolean
isLoadEmptyEnabled()
boolean
isLoadNameAccepted(java.lang.String load)
Determine if track will service a specific receive load name.boolean
isLoadNameAndCarTypeAccepted(java.lang.String load, java.lang.String type)
Determine if track will service a specific receive load and car type.boolean
isLoadNameAndCarTypeShipped(java.lang.String load, java.lang.String type)
Determine if track will service a specific ship load and car type.boolean
isLoadNameShipped(java.lang.String load)
Determine if track will service a specific ship load name.boolean
isLoadSwapEnabled()
boolean
isModifyLoadsEnabled()
boolean
isOnlyCarsWithFinalDestinationEnabled()
When true the track will only accept cars that have a final destination that can be serviced by the track.boolean
isPickupRouteAccepted(Route route)
boolean
isPickupTrainAccepted(Train train)
Determine if train can pick up cars from this track.boolean
isPrintManifestCommentEnabled()
boolean
isPrintSwitchListCommentEnabled()
boolean
isRemoveCustomLoadsEnabled()
boolean
isRoadNameAccepted(java.lang.String road)
java.lang.String
isRollingStockAccepted(RollingStock rs)
Used to determine if track can service the rolling stock.boolean
isSpaceAvailable(Car car)
Used to determine if there's space available at this track for the car.boolean
isSpur()
boolean
isStaging()
boolean
isTypeNameAccepted(java.lang.String type)
boolean
isYard()
java.lang.String
scheduleNext(Car car)
Check to see if track has schedule and if it does will schedule the next item in the list.void
setAddCustomLoadsAnySpurEnabled(boolean enable)
When enabled, add custom car loads if there's a demand by any spur/industry.void
setAddCustomLoadsAnyStagingTrackEnabled(boolean enable)
When enabled, add custom car loads to cars in staging for new destinations that are staging.void
setAddCustomLoadsEnabled(boolean enable)
When enabled, add custom car loads if there's a demand.void
setAlternateTrack(Track track)
void
setBlockCarsEnabled(boolean enable)
void
setBlockingOrder(int order)
void
setComment(java.lang.String comment)
void
setCommentBoth(java.lang.String comment)
void
setCommentPickup(java.lang.String comment)
void
setCommentSetout(java.lang.String comment)
void
setDestinationIds(java.lang.String[] ids)
void
setDestinationOption(java.lang.String option)
Sets the destination option for this track.protected void
setDirtyAndFirePropertyChange(java.lang.String p, java.lang.Object old, java.lang.Object n)
void
setDisableLoadChangeEnabled(boolean enable)
void
setDropOption(java.lang.String option)
Set the car drop option for this track.void
setHoldCarsWithCustomLoadsEnabled(boolean enable)
void
setIgnoreUsedLengthPercentage(int percentage)
The amount of consumed track space to be ignored when sending new rolling stock to the track.void
setLength(int length)
void
setLoadEmptyEnabled(boolean enable)
Enable setting the car generic load state to empty when car arrives at this track.void
setLoadOption(java.lang.String option)
Set how this track deals with receiving car loadsvoid
setLoadSwapEnabled(boolean enable)
Enable changing the car generic load state when car arrives at this track.void
setMinimumLength(int length)
Sets the minimum length of this track when the track is in a pool.void
setMoves(int moves)
void
setName(java.lang.String name)
void
setOnlyCarsWithFinalDestinationEnabled(boolean enable)
void
setPickupOption(java.lang.String option)
Set the car pick up option for this track.void
setPool(Pool pool)
void
setPrintManifestCommentEnabled(boolean enable)
void
setPrintSwitchListCommentEnabled(boolean enable)
void
setRemoveCustomLoadsEnabled(boolean enable)
When enabled, remove Scheduled car loads.void
setReporter(Reporter r)
void
setReservationFactor(int factor)
Set the reservation factor.void
setReserved(int reserved)
void
setRoadOption(java.lang.String option)
Set the road option for this track.void
setSchedule(Schedule schedule)
void
setScheduleCount(int count)
void
setScheduleId(java.lang.String id)
void
setScheduleItemId(java.lang.String id)
void
setScheduleMode(int mode)
Sets the mode of operation for the schedule assigned to this track.void
setServiceOrder(java.lang.String order)
Set the service order for this track.void
setShipLoadOption(java.lang.String option)
Set how this track deals with shipping car loadsvoid
setTrackType(java.lang.String type)
Sets the track type, spur, interchange, yard, stagingvoid
setTrainDirections(int direction)
Sets the train directions that can service this trackvoid
setUsedLength(int length)
org.jdom2.Element
store()
Create an XML element to represent this Entry.java.lang.String
toString()
-
Methods inherited from class jmri.beans.PropertyChangeSupport
addPropertyChangeListener, addPropertyChangeListener, fireIndexedPropertyChange, fireIndexedPropertyChange, fireIndexedPropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
-
-
-
-
Field Detail
-
NONE
public static final java.lang.String NONE
- See Also:
- Constant Field Values
-
_id
protected java.lang.String _id
-
_name
protected java.lang.String _name
-
_trackType
protected java.lang.String _trackType
-
_trainDir
protected int _trainDir
-
_numberRS
protected int _numberRS
-
_numberCars
protected int _numberCars
-
_numberEngines
protected int _numberEngines
-
_pickupRS
protected int _pickupRS
-
_dropRS
protected int _dropRS
-
_length
protected int _length
-
_reserved
protected int _reserved
-
_reservedLengthDrops
protected int _reservedLengthDrops
-
_numberCarsEnRoute
protected int _numberCarsEnRoute
-
_usedLength
protected int _usedLength
-
_ignoreUsedLengthPercentage
protected int _ignoreUsedLengthPercentage
-
IGNORE_0
public static final int IGNORE_0
- See Also:
- Constant Field Values
-
IGNORE_25
public static final int IGNORE_25
- See Also:
- Constant Field Values
-
IGNORE_50
public static final int IGNORE_50
- See Also:
- Constant Field Values
-
IGNORE_75
public static final int IGNORE_75
- See Also:
- Constant Field Values
-
IGNORE_100
public static final int IGNORE_100
- See Also:
- Constant Field Values
-
_moves
protected int _moves
-
_blockingOrder
protected int _blockingOrder
-
_alternateTrackId
protected java.lang.String _alternateTrackId
-
_comment
protected java.lang.String _comment
-
_typeList
protected java.util.List<java.lang.String> _typeList
-
_printCommentManifest
protected boolean _printCommentManifest
-
_printCommentSwitchList
protected boolean _printCommentSwitchList
-
_commentPickup
protected java.lang.String _commentPickup
-
_commentSetout
protected java.lang.String _commentSetout
-
_commentBoth
protected java.lang.String _commentBoth
-
_roadOption
protected java.lang.String _roadOption
-
_roadList
protected java.util.List<java.lang.String> _roadList
-
_loadOption
protected java.lang.String _loadOption
-
_loadList
protected java.util.List<java.lang.String> _loadList
-
_shipLoadOption
protected java.lang.String _shipLoadOption
-
_shipLoadList
protected java.util.List<java.lang.String> _shipLoadList
-
_destinationOption
protected java.lang.String _destinationOption
-
_destinationIdList
protected java.util.List<java.lang.String> _destinationIdList
-
_scheduleName
protected java.lang.String _scheduleName
-
_scheduleId
protected java.lang.String _scheduleId
-
_scheduleItemId
protected java.lang.String _scheduleItemId
-
_scheduleCount
protected int _scheduleCount
-
_reservedEnRoute
protected int _reservedEnRoute
-
_reservationFactor
protected int _reservationFactor
-
_mode
protected int _mode
-
_holdCustomLoads
protected boolean _holdCustomLoads
-
_dropOption
protected java.lang.String _dropOption
-
_pickupOption
protected java.lang.String _pickupOption
-
ANY
public static final java.lang.String ANY
- See Also:
- Constant Field Values
-
TRAINS
public static final java.lang.String TRAINS
- See Also:
- Constant Field Values
-
ROUTES
public static final java.lang.String ROUTES
- See Also:
- Constant Field Values
-
EXCLUDE_TRAINS
public static final java.lang.String EXCLUDE_TRAINS
- See Also:
- Constant Field Values
-
EXCLUDE_ROUTES
public static final java.lang.String EXCLUDE_ROUTES
- See Also:
- Constant Field Values
-
_dropList
protected java.util.List<java.lang.String> _dropList
-
_pickupList
protected java.util.List<java.lang.String> _pickupList
-
_loadOptions
protected int _loadOptions
-
_blockOptions
protected int _blockOptions
-
_order
protected java.lang.String _order
-
NORMAL
public static final java.lang.String NORMAL
-
FIFO
public static final java.lang.String FIFO
-
LIFO
public static final java.lang.String LIFO
-
STAGING
public static final java.lang.String STAGING
- See Also:
- Constant Field Values
-
INTERCHANGE
public static final java.lang.String INTERCHANGE
- See Also:
- Constant Field Values
-
YARD
public static final java.lang.String YARD
- See Also:
- Constant Field Values
-
SPUR
public static final java.lang.String SPUR
- See Also:
- Constant Field Values
-
EAST
public static final int EAST
- See Also:
- Constant Field Values
-
WEST
public static final int WEST
- See Also:
- Constant Field Values
-
NORTH
public static final int NORTH
- See Also:
- Constant Field Values
-
SOUTH
public static final int SOUTH
- See Also:
- Constant Field Values
-
ALL_ROADS
public static final java.lang.String ALL_ROADS
-
INCLUDE_ROADS
public static final java.lang.String INCLUDE_ROADS
-
EXCLUDE_ROADS
public static final java.lang.String EXCLUDE_ROADS
-
ALL_LOADS
public static final java.lang.String ALL_LOADS
-
INCLUDE_LOADS
public static final java.lang.String INCLUDE_LOADS
-
EXCLUDE_LOADS
public static final java.lang.String EXCLUDE_LOADS
-
ALL_DESTINATIONS
public static final java.lang.String ALL_DESTINATIONS
-
INCLUDE_DESTINATIONS
public static final java.lang.String INCLUDE_DESTINATIONS
-
EXCLUDE_DESTINATIONS
public static final java.lang.String EXCLUDE_DESTINATIONS
-
_onlyCarsWithFD
protected boolean _onlyCarsWithFD
-
SEQUENTIAL
public static final int SEQUENTIAL
- See Also:
- Constant Field Values
-
MATCH
public static final int MATCH
- See Also:
- Constant Field Values
-
PICKUP_OKAY
public static final java.lang.String PICKUP_OKAY
- See Also:
- Constant Field Values
-
_minimumLength
protected int _minimumLength
-
OKAY
public static final java.lang.String OKAY
-
LENGTH
public static final java.lang.String LENGTH
-
TYPE
public static final java.lang.String TYPE
-
ROAD
public static final java.lang.String ROAD
-
LOAD
public static final java.lang.String LOAD
-
CAPACITY
public static final java.lang.String CAPACITY
-
SCHEDULE
public static final java.lang.String SCHEDULE
-
CUSTOM
public static final java.lang.String CUSTOM
-
DESTINATION
public static final java.lang.String DESTINATION
-
NO_FINAL_DESTINATION
public static final java.lang.String NO_FINAL_DESTINATION
-
TYPES_CHANGED_PROPERTY
public static final java.lang.String TYPES_CHANGED_PROPERTY
- See Also:
- Constant Field Values
-
ROADS_CHANGED_PROPERTY
public static final java.lang.String ROADS_CHANGED_PROPERTY
- See Also:
- Constant Field Values
-
NAME_CHANGED_PROPERTY
public static final java.lang.String NAME_CHANGED_PROPERTY
- See Also:
- Constant Field Values
-
LENGTH_CHANGED_PROPERTY
public static final java.lang.String LENGTH_CHANGED_PROPERTY
- See Also:
- Constant Field Values
-
MIN_LENGTH_CHANGED_PROPERTY
public static final java.lang.String MIN_LENGTH_CHANGED_PROPERTY
- See Also:
- Constant Field Values
-
SCHEDULE_CHANGED_PROPERTY
public static final java.lang.String SCHEDULE_CHANGED_PROPERTY
- See Also:
- Constant Field Values
-
DISPOSE_CHANGED_PROPERTY
public static final java.lang.String DISPOSE_CHANGED_PROPERTY
- See Also:
- Constant Field Values
-
TRAIN_DIRECTION_CHANGED_PROPERTY
public static final java.lang.String TRAIN_DIRECTION_CHANGED_PROPERTY
- See Also:
- Constant Field Values
-
DROP_CHANGED_PROPERTY
public static final java.lang.String DROP_CHANGED_PROPERTY
- See Also:
- Constant Field Values
-
PICKUP_CHANGED_PROPERTY
public static final java.lang.String PICKUP_CHANGED_PROPERTY
- See Also:
- Constant Field Values
-
TRACK_TYPE_CHANGED_PROPERTY
public static final java.lang.String TRACK_TYPE_CHANGED_PROPERTY
- See Also:
- Constant Field Values
-
LOADS_CHANGED_PROPERTY
public static final java.lang.String LOADS_CHANGED_PROPERTY
- See Also:
- Constant Field Values
-
POOL_CHANGED_PROPERTY
public static final java.lang.String POOL_CHANGED_PROPERTY
- See Also:
- Constant Field Values
-
PLANNED_PICKUPS_CHANGED_PROPERTY
public static final java.lang.String PLANNED_PICKUPS_CHANGED_PROPERTY
- See Also:
- Constant Field Values
-
LOAD_OPTIONS_CHANGED_PROPERTY
public static final java.lang.String LOAD_OPTIONS_CHANGED_PROPERTY
- See Also:
- Constant Field Values
-
DESTINATIONS_CHANGED_PROPERTY
public static final java.lang.String DESTINATIONS_CHANGED_PROPERTY
- See Also:
- Constant Field Values
-
DESTINATION_OPTIONS_CHANGED_PROPERTY
public static final java.lang.String DESTINATION_OPTIONS_CHANGED_PROPERTY
- See Also:
- Constant Field Values
-
SCHEDULE_MODE_CHANGED_PROPERTY
public static final java.lang.String SCHEDULE_MODE_CHANGED_PROPERTY
- See Also:
- Constant Field Values
-
SCHEDULE_ID_CHANGED_PROPERTY
public static final java.lang.String SCHEDULE_ID_CHANGED_PROPERTY
- See Also:
- Constant Field Values
-
SERVICE_ORDER_CHANGED_PROPERTY
public static final java.lang.String SERVICE_ORDER_CHANGED_PROPERTY
- See Also:
- Constant Field Values
-
ALTERNATE_TRACK_CHANGED_PROPERTY
public static final java.lang.String ALTERNATE_TRACK_CHANGED_PROPERTY
- See Also:
- Constant Field Values
-
TRACK_BLOCKING_ORDER_CHANGED_PROPERTY
public static final java.lang.String TRACK_BLOCKING_ORDER_CHANGED_PROPERTY
- See Also:
- Constant Field Values
-
TRACK_REPORTER_CHANGED_PROPERTY
public static final java.lang.String TRACK_REPORTER_CHANGED_PROPERTY
- See Also:
- Constant Field Values
-
ROUTED_CHANGED_PROPERTY
public static final java.lang.String ROUTED_CHANGED_PROPERTY
- See Also:
- Constant Field Values
-
HOLD_CARS_CHANGED_PROPERTY
public static final java.lang.String HOLD_CARS_CHANGED_PROPERTY
- See Also:
- Constant Field Values
-
TRACK_COMMENT_CHANGED_PROPERTY
public static final java.lang.String TRACK_COMMENT_CHANGED_PROPERTY
- See Also:
- Constant Field Values
-
TRAIN_SCHEDULE
public static final java.lang.String TRAIN_SCHEDULE
- See Also:
- Constant Field Values
-
ALL
public static final java.lang.String ALL
- See Also:
- Constant Field Values
-
-
Method Detail
-
copyTrack
public Track copyTrack(java.lang.String newName, Location newLocation)
Creates a copy of this track.- Parameters:
newName
- The name of the new track.newLocation
- The location of the new track.- Returns:
- Track
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getId
public java.lang.String getId()
-
getLocation
public Location getLocation()
-
setName
public void setName(java.lang.String name)
-
getName
public java.lang.String getName()
-
getSplitName
public java.lang.String getSplitName()
-
getDivision
public Division getDivision()
-
getDivisionName
public java.lang.String getDivisionName()
-
isSpur
public boolean isSpur()
-
isYard
public boolean isYard()
-
isInterchange
public boolean isInterchange()
-
isStaging
public boolean isStaging()
-
hasMessages
public boolean hasMessages()
-
getTrackType
public java.lang.String getTrackType()
Gets the track type- Returns:
- Track.SPUR Track.YARD Track.INTERCHANGE or Track.STAGING
-
setTrackType
public void setTrackType(java.lang.String type)
Sets the track type, spur, interchange, yard, staging- Parameters:
type
- Track.SPUR Track.YARD Track.INTERCHANGE Track.STAGING
-
getTrackTypeName
public java.lang.String getTrackTypeName()
-
getTrackTypeName
public static java.lang.String getTrackTypeName(java.lang.String trackType)
-
setLength
public void setLength(int length)
-
getLength
public int getLength()
-
setMinimumLength
public void setMinimumLength(int length)
Sets the minimum length of this track when the track is in a pool.- Parameters:
length
- minimum
-
getMinimumLength
public int getMinimumLength()
-
setReserved
public void setReserved(int reserved)
-
getReserved
public int getReserved()
-
addReservedInRoute
public void addReservedInRoute(Car car)
-
deleteReservedInRoute
public void deleteReservedInRoute(Car car)
-
getReservedInRoute
public int getReservedInRoute()
Used to determine how much track space is going to be consumed by cars in route to this track. See isSpaceAvailable().- Returns:
- The length of all cars en route to this track including couplers.
-
getNumberOfCarsInRoute
public int getNumberOfCarsInRoute()
-
setReservationFactor
public void setReservationFactor(int factor)
Set the reservation factor. Default 100 (100%). Used by the program when generating car loads from staging. A factor of 100% allows the program to fill a track with car loads. Numbers over 100% can overload a track.- Parameters:
factor
- A number from 0 to 10000.
-
getReservationFactor
public int getReservationFactor()
-
setScheduleMode
public void setScheduleMode(int mode)
Sets the mode of operation for the schedule assigned to this track.- Parameters:
mode
- Track.SEQUENTIAL or Track.MATCH
-
getScheduleMode
public int getScheduleMode()
Gets the mode of operation for the schedule assigned to this track.- Returns:
- Mode of operation: Track.SEQUENTIAL or Track.MATCH
-
getScheduleModeName
public java.lang.String getScheduleModeName()
-
setAlternateTrack
public void setAlternateTrack(Track track)
-
getAlternateTrack
public Track getAlternateTrack()
Returns the alternate track for a spur- Returns:
- alternate track
-
setHoldCarsWithCustomLoadsEnabled
public void setHoldCarsWithCustomLoadsEnabled(boolean enable)
-
isHoldCarsWithCustomLoadsEnabled
public boolean isHoldCarsWithCustomLoadsEnabled()
If enabled (true), hold cars with custom loads rather than allowing them to go to staging if the spur and the alternate track were full. If disabled, cars with custom loads can be forwarded to staging when this spur and all others with this option are also false.- Returns:
- True if enabled
-
isSpaceAvailable
public boolean isSpaceAvailable(Car car)
Used to determine if there's space available at this track for the car. Considers cars en-route to this track. Used to prevent overloading the track.- Parameters:
car
- The car to be set out.- Returns:
- true if space available.
-
setUsedLength
public void setUsedLength(int length)
-
getUsedLength
public int getUsedLength()
-
setIgnoreUsedLengthPercentage
public void setIgnoreUsedLengthPercentage(int percentage)
The amount of consumed track space to be ignored when sending new rolling stock to the track. See Planned Pickups in help.- Parameters:
percentage
- a number between 0 and 100
-
getIgnoreUsedLengthPercentage
public int getIgnoreUsedLengthPercentage()
-
getNumberRS
public int getNumberRS()
- Returns:
- The number of rolling stock (cars and engines) on this track
-
getNumberCars
public int getNumberCars()
- Returns:
- The number of cars on this track
-
getNumberEngines
public int getNumberEngines()
- Returns:
- The number of engines on this track
-
addRS
public void addRS(RollingStock rs)
Adds rolling stock to a specific track.- Parameters:
rs
- The rolling stock to place on the track.
-
deleteRS
public void deleteRS(RollingStock rs)
-
addPickupRS
public void addPickupRS(RollingStock rs)
Increments the number of cars and or engines that will be picked up by a train from this track.- Parameters:
rs
- The rolling stock.
-
deletePickupRS
public void deletePickupRS(RollingStock rs)
-
getPickupRS
public int getPickupRS()
- Returns:
- the number of rolling stock (cars and or locos) that are scheduled for pick up from this track.
-
getDropRS
public int getDropRS()
-
addDropRS
public void addDropRS(RollingStock rs)
-
deleteDropRS
public void deleteDropRS(RollingStock rs)
-
setComment
public void setComment(java.lang.String comment)
-
getComment
public java.lang.String getComment()
-
setCommentPickup
public void setCommentPickup(java.lang.String comment)
-
getCommentPickup
public java.lang.String getCommentPickup()
-
getCommentPickupWithColor
public java.lang.String getCommentPickupWithColor()
-
setCommentSetout
public void setCommentSetout(java.lang.String comment)
-
getCommentSetout
public java.lang.String getCommentSetout()
-
getCommentSetoutWithColor
public java.lang.String getCommentSetoutWithColor()
-
setCommentBoth
public void setCommentBoth(java.lang.String comment)
-
getCommentBoth
public java.lang.String getCommentBoth()
-
getCommentBothWithColor
public java.lang.String getCommentBothWithColor()
-
isPrintManifestCommentEnabled
public boolean isPrintManifestCommentEnabled()
-
setPrintManifestCommentEnabled
public void setPrintManifestCommentEnabled(boolean enable)
-
isPrintSwitchListCommentEnabled
public boolean isPrintSwitchListCommentEnabled()
-
setPrintSwitchListCommentEnabled
public void setPrintSwitchListCommentEnabled(boolean enable)
-
getTypeNames
public java.lang.String[] getTypeNames()
Returns all of the rolling stock type names serviced by this track.- Returns:
- rolling stock type names
-
addTypeName
public void addTypeName(java.lang.String type)
-
deleteTypeName
public void deleteTypeName(java.lang.String type)
-
isTypeNameAccepted
public boolean isTypeNameAccepted(java.lang.String type)
-
setTrainDirections
public void setTrainDirections(int direction)
Sets the train directions that can service this track- Parameters:
direction
- EAST, WEST, NORTH, SOUTH
-
getTrainDirections
public int getTrainDirections()
-
getRoadOption
public java.lang.String getRoadOption()
-
getRoadOptionString
public java.lang.String getRoadOptionString()
-
setRoadOption
public void setRoadOption(java.lang.String option)
Set the road option for this track.- Parameters:
option
- ALLROADS, INCLUDEROADS, or EXCLUDEROADS
-
getRoadNames
public java.lang.String[] getRoadNames()
-
addRoadName
public void addRoadName(java.lang.String road)
-
deleteRoadName
public void deleteRoadName(java.lang.String road)
-
isRoadNameAccepted
public boolean isRoadNameAccepted(java.lang.String road)
-
containsRoadName
public boolean containsRoadName(java.lang.String road)
-
getLoadOption
public java.lang.String getLoadOption()
Gets the car receive load option for this track.- Returns:
- ALL_LOADS INCLUDE_LOADS EXCLUDE_LOADS
-
getLoadOptionString
public java.lang.String getLoadOptionString()
-
setLoadOption
public void setLoadOption(java.lang.String option)
Set how this track deals with receiving car loads- Parameters:
option
- ALL_LOADS INCLUDE_LOADS EXCLUDE_LOADS
-
getLoadNames
public java.lang.String[] getLoadNames()
Provides a list of receive loads that the track will either service or exclude. See setLoadOption- Returns:
- Array of load names as Strings
-
addLoadName
public void addLoadName(java.lang.String load)
Add a receive load that the track will either service or exclude. See setLoadOption- Parameters:
load
- The string load name.
-
deleteLoadName
public void deleteLoadName(java.lang.String load)
Delete a receive load name that the track will either service or exclude. See setLoadOption- Parameters:
load
- The string load name.
-
isLoadNameAccepted
public boolean isLoadNameAccepted(java.lang.String load)
Determine if track will service a specific receive load name.- Parameters:
load
- the load name to check.- Returns:
- true if track will service this load.
-
isLoadNameAndCarTypeAccepted
public boolean isLoadNameAndCarTypeAccepted(java.lang.String load, java.lang.String type)
Determine if track will service a specific receive load and car type.- Parameters:
load
- the load name to check.type
- the type of car used to carry the load.- Returns:
- true if track will service this load.
-
getShipLoadOption
public java.lang.String getShipLoadOption()
Gets the car ship load option for this track.- Returns:
- ALL_LOADS INCLUDE_LOADS EXCLUDE_LOADS
-
getShipLoadOptionString
public java.lang.String getShipLoadOptionString()
-
setShipLoadOption
public void setShipLoadOption(java.lang.String option)
Set how this track deals with shipping car loads- Parameters:
option
- ALL_LOADS INCLUDE_LOADS EXCLUDE_LOADS
-
getShipLoadNames
public java.lang.String[] getShipLoadNames()
Provides a list of ship loads that the track will either service or exclude. See setShipLoadOption- Returns:
- Array of load names as Strings
-
addShipLoadName
public void addShipLoadName(java.lang.String load)
Add a ship load that the track will either service or exclude. See setShipLoadOption- Parameters:
load
- The string load name.
-
deleteShipLoadName
public void deleteShipLoadName(java.lang.String load)
Delete a ship load name that the track will either service or exclude. See setLoadOption- Parameters:
load
- The string load name.
-
isLoadNameShipped
public boolean isLoadNameShipped(java.lang.String load)
Determine if track will service a specific ship load name.- Parameters:
load
- the load name to check.- Returns:
- true if track will service this load.
-
isLoadNameAndCarTypeShipped
public boolean isLoadNameAndCarTypeShipped(java.lang.String load, java.lang.String type)
Determine if track will service a specific ship load and car type.- Parameters:
load
- the load name to check.type
- the type of car used to carry the load.- Returns:
- true if track will service this load.
-
getDropOption
public java.lang.String getDropOption()
Gets the drop option for this track. ANY means that all trains and routes can drop cars to this track. The other four options are used to restrict the track to certain trains or routes.- Returns:
- ANY, TRAINS, ROUTES, EXCLUDE_TRAINS, or EXCLUDE_ROUTES
-
setDropOption
public void setDropOption(java.lang.String option)
Set the car drop option for this track.- Parameters:
option
- ANY, TRAINS, ROUTES, EXCLUDE_TRAINS, or EXCLUDE_ROUTES
-
getPickupOption
public java.lang.String getPickupOption()
Gets the pickup option for this track. ANY means that all trains and routes can pull cars from this track. The other four options are used to restrict the track to certain trains or routes.- Returns:
- ANY, TRAINS, ROUTES, EXCLUDE_TRAINS, or EXCLUDE_ROUTES
-
setPickupOption
public void setPickupOption(java.lang.String option)
Set the car pick up option for this track.- Parameters:
option
- ANY, TRAINS, ROUTES, EXCLUDE_TRAINS, or EXCLUDE_ROUTES
-
getDropIds
public java.lang.String[] getDropIds()
-
addDropId
public void addDropId(java.lang.String id)
-
deleteDropId
public void deleteDropId(java.lang.String id)
-
isDropTrainAccepted
public boolean isDropTrainAccepted(Train train)
Determine if train can set out cars to this track. Based on the train's id or train's route id. See setDropOption(option).- Parameters:
train
- The Train to test.- Returns:
- true if the train can set out cars to this track.
-
isDropRouteAccepted
public boolean isDropRouteAccepted(Route route)
-
containsDropId
public boolean containsDropId(java.lang.String id)
-
getPickupIds
public java.lang.String[] getPickupIds()
-
addPickupId
public void addPickupId(java.lang.String id)
Add train or route id to this track.- Parameters:
id
- The string id for the train or route.
-
deletePickupId
public void deletePickupId(java.lang.String id)
-
isPickupTrainAccepted
public boolean isPickupTrainAccepted(Train train)
Determine if train can pick up cars from this track. Based on the train's id or train's route id. See setPickupOption(option).- Parameters:
train
- The Train to test.- Returns:
- true if the train can pick up cars from this track.
-
isPickupRouteAccepted
public boolean isPickupRouteAccepted(Route route)
-
containsPickupId
public boolean containsPickupId(java.lang.String id)
-
checkPickups
public java.lang.String checkPickups()
Checks to see if all car types can be pulled from this track- Returns:
- PICKUP_OKAY if any train can pull all car types from this track
-
isRollingStockAccepted
public java.lang.String isRollingStockAccepted(RollingStock rs)
Used to determine if track can service the rolling stock.- Parameters:
rs
- the car or loco to be tested- Returns:
- Error string starting with TYPE, ROAD, CAPACITY, LENGTH, DESTINATION or LOAD if there's an issue. OKAY if track can service Rolling Stock.
-
getAvailableTrackSpace
public int getAvailableTrackSpace()
Available track space. Adjusted when a track is using the planned pickups feature- Returns:
- available track space
-
getReservedLengthDrops
public int getReservedLengthDrops()
-
getMoves
public int getMoves()
-
setMoves
public void setMoves(int moves)
-
bumpMoves
public void bumpMoves()
-
getBlockingOrder
public int getBlockingOrder()
Gets the blocking order for this track. Default is zero, in that case, tracks are sorted by name.- Returns:
- the blocking order
-
setBlockingOrder
public void setBlockingOrder(int order)
-
getServiceOrder
public java.lang.String getServiceOrder()
Get the service order for this track. Yards and interchange have this feature for cars. Staging has this feature for trains.- Returns:
- Service order: Track.NORMAL, Track.FIFO, Track.LIFO
-
setServiceOrder
public void setServiceOrder(java.lang.String order)
Set the service order for this track. Only yards and interchange have this feature.- Parameters:
order
- Track.NORMAL, Track.FIFO, Track.LIFO
-
getScheduleName
public java.lang.String getScheduleName()
Returns the name of the schedule. Note that this returns the schedule name based on the schedule's id. A schedule's name can be modified by the user.- Returns:
- Schedule name
-
getSchedule
public Schedule getSchedule()
-
setSchedule
public void setSchedule(Schedule schedule)
-
getScheduleId
public java.lang.String getScheduleId()
-
setScheduleId
public void setScheduleId(java.lang.String id)
-
getScheduleItemId
public java.lang.String getScheduleItemId()
Recommend getCurrentScheduleItem() to get the current schedule item for this track. Protects against user deleting a schedule item from the schedule.- Returns:
- schedule item id
-
setScheduleItemId
public void setScheduleItemId(java.lang.String id)
-
getCurrentScheduleItem
public ScheduleItem getCurrentScheduleItem()
Get's the current schedule item for this track Protects against user deleting an item in a shared schedule. Recommend using this versus getScheduleItemId() as the id can be obsolete.- Returns:
- The current ScheduleItem.
-
bumpSchedule
public void bumpSchedule()
Increments the schedule count if there's a schedule and the schedule is running in sequential mode. Resets the schedule count if the maximum is reached and then goes to the next item in the schedule's list.
-
getNextScheduleItem
public ScheduleItem getNextScheduleItem()
-
getScheduleCount
public int getScheduleCount()
Returns how many times the current schedule item has been accessed.- Returns:
- count
-
setScheduleCount
public void setScheduleCount(int count)
-
checkScheduleValid
public java.lang.String checkScheduleValid()
Check to see if schedule is valid for the track at this location.- Returns:
- SCHEDULE_OKAY if schedule okay, otherwise an error message.
-
checkSchedule
public java.lang.String checkSchedule(Car car)
Checks to see if car can be placed on this spur using this schedule. Returns OKAY if the schedule can service the car.- Parameters:
car
- The Car to be tested.- Returns:
- Track.OKAY track.CUSTOM track.SCHEDULE
-
scheduleNext
public java.lang.String scheduleNext(Car car)
Check to see if track has schedule and if it does will schedule the next item in the list. Load the car with the next schedule load if one exists, and set the car's final destination if there's one in the schedule.- Parameters:
car
- The Car to be modified.- Returns:
- Track.OKAY or Track.SCHEDULE
-
checkScheduleAttribute
public boolean checkScheduleAttribute(java.lang.String attribute, java.lang.String carType, Car car)
-
setLoadSwapEnabled
public void setLoadSwapEnabled(boolean enable)
Enable changing the car generic load state when car arrives at this track.- Parameters:
enable
- when true, swap generic car load state
-
isLoadSwapEnabled
public boolean isLoadSwapEnabled()
-
setLoadEmptyEnabled
public void setLoadEmptyEnabled(boolean enable)
Enable setting the car generic load state to empty when car arrives at this track.- Parameters:
enable
- when true, set generic car load to empty
-
isLoadEmptyEnabled
public boolean isLoadEmptyEnabled()
-
setRemoveCustomLoadsEnabled
public void setRemoveCustomLoadsEnabled(boolean enable)
When enabled, remove Scheduled car loads.- Parameters:
enable
- when true, remove Scheduled loads from cars
-
isRemoveCustomLoadsEnabled
public boolean isRemoveCustomLoadsEnabled()
-
setAddCustomLoadsEnabled
public void setAddCustomLoadsEnabled(boolean enable)
When enabled, add custom car loads if there's a demand.- Parameters:
enable
- when true, add custom loads to cars
-
isAddCustomLoadsEnabled
public boolean isAddCustomLoadsEnabled()
-
setAddCustomLoadsAnySpurEnabled
public void setAddCustomLoadsAnySpurEnabled(boolean enable)
When enabled, add custom car loads if there's a demand by any spur/industry.- Parameters:
enable
- when true, add custom loads to cars
-
isAddCustomLoadsAnySpurEnabled
public boolean isAddCustomLoadsAnySpurEnabled()
-
setAddCustomLoadsAnyStagingTrackEnabled
public void setAddCustomLoadsAnyStagingTrackEnabled(boolean enable)
When enabled, add custom car loads to cars in staging for new destinations that are staging.- Parameters:
enable
- when true, add custom load to car
-
isAddCustomLoadsAnyStagingTrackEnabled
public boolean isAddCustomLoadsAnyStagingTrackEnabled()
-
isModifyLoadsEnabled
public boolean isModifyLoadsEnabled()
-
setDisableLoadChangeEnabled
public void setDisableLoadChangeEnabled(boolean enable)
-
isDisableLoadChangeEnabled
public boolean isDisableLoadChangeEnabled()
-
setBlockCarsEnabled
public void setBlockCarsEnabled(boolean enable)
-
isBlockCarsEnabled
public boolean isBlockCarsEnabled()
When enabled block cars from staging.- Returns:
- true if blocking is enabled.
-
getPoolName
public java.lang.String getPoolName()
-
getDestinationListSize
public int getDestinationListSize()
-
addDestination
public void addDestination(Location destination)
adds a location to the list of acceptable destinations for this track.- Parameters:
destination
- location that is acceptable
-
deleteDestination
public void deleteDestination(Location destination)
-
isDestinationAccepted
public boolean isDestinationAccepted(Location destination)
Returns true if destination is valid from this track.- Parameters:
destination
- The Location to be checked.- Returns:
- true if track services the destination
-
setDestinationIds
public void setDestinationIds(java.lang.String[] ids)
-
getDestinationIds
public java.lang.String[] getDestinationIds()
-
setDestinationOption
public void setDestinationOption(java.lang.String option)
Sets the destination option for this track. The three options are:ALL_DESTINATIONS which means this track services all destinations, the default.
INCLUDE_DESTINATIONS which means this track services only certain destinations.
EXCLUDE_DESTINATIONS which means this track does not service certain destinations.
- Parameters:
option
- Track.ALL_DESTINATIONS, Track.INCLUDE_DESTINATIONS, or Track.EXCLUDE_DESTINATIONS
-
getDestinationOption
public java.lang.String getDestinationOption()
Get destination option for interchange or staging track- Returns:
- option
-
setOnlyCarsWithFinalDestinationEnabled
public void setOnlyCarsWithFinalDestinationEnabled(boolean enable)
-
isOnlyCarsWithFinalDestinationEnabled
public boolean isOnlyCarsWithFinalDestinationEnabled()
When true the track will only accept cars that have a final destination that can be serviced by the track. See acceptsDestination(Location).- Returns:
- false if any car spotted, true if only cars with a FD.
-
isAlternate
public boolean isAlternate()
Used to determine if track has been assigned as an alternate- Returns:
- true if track is an alternate
-
dispose
public void dispose()
-
store
public org.jdom2.Element store()
Create an XML element to represent this Entry. This member has to remain synchronized with the detailed DTD in operations-location.dtd.- Returns:
- Contents in a JDOM Element
-
setDirtyAndFirePropertyChange
protected void setDirtyAndFirePropertyChange(java.lang.String p, java.lang.Object old, java.lang.Object n)
-
setReporter
public void setReporter(Reporter r)
-
getReporter
public Reporter getReporter()
-
getReporterName
public java.lang.String getReporterName()
-
-