|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object jsim.process.Transport
public class Transport
The Transport class implements the connecting links between the nodes. Any two nodes can be connected only by a Transport. The transport can be a straight line (determined by 2 points) or a quad curve (determined by 3 points).
Field Summary | |
---|---|
protected static double |
DEFAULT_STEP_SIZE
Default step size for entities moving on transport. |
protected static double |
DEFAULT_STEP_TIME
Default step time for entities moving on transport. |
protected QCurve |
edge
The quad curve representing the transport edge. |
protected java.awt.geom.Point2D.Double |
end
The last point of the edge. |
protected java.awt.geom.Point2D.Double |
start
The first point of the edge. |
protected double |
stepSize
The size of each step. |
protected double |
stepTime
The time between steps. |
protected double |
totalTime
|
protected static java.util.logging.Logger |
trc
Tracing messages. |
Constructor Summary | |
---|---|
Transport(double x1,
double y1,
double ctrlx,
double ctrly,
double x2,
double y2,
Variate timeDist)
Construct a transport as a quad curve. |
|
Transport(double x1,
double y1,
double x2,
double y2,
Variate timeDist)
Construct a transport as a straight line (degenerate quad curve). |
Method Summary | |
---|---|
void |
adjustSpeed(double stepTime,
double stepSize)
Adjust the speed of the transport by reseting the stepTime and/or stepSize. |
void |
join(SimObject entity)
Place entity at start of transport. |
boolean |
move(SimObject entity)
This method implements the logic for a SimObject stepping through the transport. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final double DEFAULT_STEP_TIME
protected static final double DEFAULT_STEP_SIZE
protected final QCurve edge
protected final java.awt.geom.Point2D.Double start
protected final java.awt.geom.Point2D.Double end
protected static java.util.logging.Logger trc
protected double stepTime
protected double stepSize
protected double totalTime
Constructor Detail |
---|
public Transport(double x1, double y1, double x2, double y2, Variate timeDist)
x1
- x coordinate of start pointy1
- y coordinate of start pointx2
- x coordinate of end pointy2
- y coordinate of end pointpublic Transport(double x1, double y1, double ctrlx, double ctrly, double x2, double y2, Variate timeDist)
x1
- x coordinate of start pointy1
- y coordinate of start pointctrlx
- x coordinate of control pointctrly
- y coordinate of control pointx2
- x coordinate of end pointy2
- y coordinate of end pointMethod Detail |
---|
public void join(SimObject entity)
entity
- SimObject/entity joining the transportpublic boolean move(SimObject entity)
entity
- SimObject/entity stepping through the transport
public void adjustSpeed(double stepTime, double stepSize)
stepTime
- new step time (ignored if not positive)stepSize
- new step size (ignored if not positive)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |