public class TrafficArea
extends java.lang.Object
Constructor and Description |
---|
TrafficArea(Area area)
Construct a TrafficArea.
|
Modifier and Type | Method and Description |
---|---|
void |
addAgent(TrafficAgent agent)
Add an agent to this area.
|
void |
addBlockade(TrafficBlockade block)
Add a TrafficBlockade.
|
void |
clearBlockadeCache()
Clear any cached blockade information.
|
boolean |
contains(double x,
double y)
Find out whether this area contains a point (x, y).
|
java.util.Collection<TrafficAgent> |
getAgents()
Get all agents in this area.
|
java.util.List<Line2D> |
getAllBlockingLines()
Get all lines that block movement.
|
Area |
getArea()
Get the wrapped area.
|
java.util.List<Line2D> |
getAreaLines() |
java.util.List<Line2D> |
getBlockadeLines()
Get the lines that describe blockades in this area.
|
java.util.Collection<TrafficBlockade> |
getBlockades()
Get all TrafficBlockades inside this area.
|
java.util.List<Line2D> |
getBlockingLines()
Get all lines around this area that block movement.
|
com.infomatiq.jsi.Rectangle |
getBounds()
Get the bounding rectangle.
|
int[][] |
getGraph() |
int |
getNearestLineIndex(Point2D point) |
java.util.List<Line2D> |
getOpenLines() |
void |
removeAgent(TrafficAgent agent)
Remove an agent from this area.
|
void |
removeBlockade(TrafficBlockade block)
Remove a TrafficBlockade.
|
java.lang.String |
toString() |
public TrafficArea(Area area)
area
- The Area to wrap.public Area getArea()
public com.infomatiq.jsi.Rectangle getBounds()
public java.util.List<Line2D> getBlockingLines()
public java.util.List<Line2D> getAreaLines()
public java.util.List<Line2D> getBlockadeLines()
public java.util.List<Line2D> getAllBlockingLines()
public boolean contains(double x, double y)
x
- The X coordinate to test.y
- The Y coordinate to test.public void addAgent(TrafficAgent agent)
agent
- The agent to add.public void removeAgent(TrafficAgent agent)
agent
- The agent to remove.public java.util.Collection<TrafficAgent> getAgents()
public void addBlockade(TrafficBlockade block)
block
- The blockade to add.public void removeBlockade(TrafficBlockade block)
block
- The blockade to remove.public void clearBlockadeCache()
public java.util.Collection<TrafficBlockade> getBlockades()
public java.lang.String toString()
toString
in class java.lang.Object
public int getNearestLineIndex(Point2D point)
public int[][] getGraph()
public java.util.List<Line2D> getOpenLines()