|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjfreerails.controller.CalcCargoSupplyRateAtStation
public class CalcCargoSupplyRateAtStation
This class probes the tiles adjacent to a station for what cargo they supply, demand, and convert and then returns a vector of these rates.
Field Summary | |
---|---|
private int[] |
converts
|
private int[] |
demand
|
private static java.util.logging.Logger |
logger
|
private static int |
PREREQUISITE_FOR_DEMAND
The threshold that demand for a cargo must exceed before the station demands the cargo. |
private int |
stationRadius
|
private java.util.Vector<CargoElementObject> |
supplies
|
private ReadOnlyWorld |
w
|
private int |
x
|
private int |
y
|
Constructor Summary | |
---|---|
CalcCargoSupplyRateAtStation(ReadOnlyWorld world,
int X,
int Y)
Call this constructor if the station already exists. |
|
CalcCargoSupplyRateAtStation(ReadOnlyWorld world,
int X,
int Y,
int trackRuleNo)
Call this constructor if the station does not exist yet. |
Method Summary | |
---|---|
StationModel |
calculations(StationModel station)
Process each existing station, updating what is supplied to it. |
private static int |
findTrackRule(int xx,
int yy,
ReadOnlyWorld w)
|
ConvertedAtStation |
getConversion()
|
Demand4Cargo |
getDemand()
|
private void |
incrementSupplyAndDemand(int i,
int j)
|
private void |
populateSuppliesVector()
|
java.util.Vector<CargoElementObject> |
scanAdjacentTiles()
|
private void |
updateSupplyRate(int type,
int rate)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final java.util.logging.Logger logger
private static final int PREREQUISITE_FOR_DEMAND
private final int[] converts
private final int[] demand
private final java.util.Vector<CargoElementObject> supplies
private final ReadOnlyWorld w
private int x
private int y
private int stationRadius
Constructor Detail |
---|
public CalcCargoSupplyRateAtStation(ReadOnlyWorld world, int X, int Y, int trackRuleNo)
trackRuleNo
- the station type.public CalcCargoSupplyRateAtStation(ReadOnlyWorld world, int X, int Y)
Method Detail |
---|
public ConvertedAtStation getConversion()
public Demand4Cargo getDemand()
private void incrementSupplyAndDemand(int i, int j)
private void populateSuppliesVector()
public java.util.Vector<CargoElementObject> scanAdjacentTiles()
private static int findTrackRule(int xx, int yy, ReadOnlyWorld w)
private void updateSupplyRate(int type, int rate)
public StationModel calculations(StationModel station)
station
- A StationModel object to be processed
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |