Class Boundary
java.lang.Object
com.JayPi4c.NeuroEvolution.plugins.util.Boundary
Class to represent a boundary on the track. Boundaries can be deadly walls,
that restrict the area of the track. But they can also be used as
checkpoints.
- Author:
- JayPi4c
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
Boundary
public Boundary(double x1, double y1, double x2, double y2) Creates a new Boundary as a line from (x1, y1) to (x2, y2).- Parameters:
x1- first point xy1- first point yx2- second point xy2- second point y
-
Boundary
Creates a new Boundary as a line from a to b.- Parameters:
a- first pointb- second point
-
-
Method Details
-
midPoint
Calculats the middle point of the boundary.- Returns:
- the middle point
-
createBoundaries
Creates a list of Boundaries from a list of points. The points in the list will be sequentially connected, so the order of the points is important. If the closed flag is set to true, the last point will be connected to the first point.- Parameters:
points- the list of pointsclosed- whether the list is closed- Returns:
- the list of connected Boundaries
-
getA
Getter for the first point.- Returns:
- the first point
-
getB
Getter for the second point.- Returns:
- the second point
-