Package org.baseagent.util
Class BaseAgentMath
java.lang.Object
org.baseagent.util.BaseAgentMath
-
Field Summary
Modifier and TypeFieldDescriptionstatic double
static double
static double
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
canSeeIt
(Grid grid, int x, int y, int i, int u, Predicate<GridPosition> barrierCondition) static boolean
canSeeIt
(Grid grid, HasGridPosition a, HasGridPosition b, Predicate<GridPosition> barrierCondition) static double
direction
(int x1, int y1, int x2, int y2) static double
direction
(HasGridPosition p1, int x2, int y2) static double
direction
(HasGridPosition p1, HasGridPosition p2) static double
distance
(double x1, double y1, double x2, double y2) static double
distance
(HasGridPosition p1, double x2, double y2) static double
distance
(HasGridPosition p1, HasGridPosition p2) static CellPoint2D
getPointAt
(int x, int y, double magnitude, double direction) static CellPoint2D
getPointAt
(HasGridPosition originalPoint, Vector2D vector) static int
sortByDistance
(Map<?, HasGridPosition> points, HasGridPosition origin)
-
Field Details
-
PI
public static double PI -
HALF_PI
public static double HALF_PI -
THREE_HALF_PI
public static double THREE_HALF_PI
-
-
Constructor Details
-
BaseAgentMath
public BaseAgentMath()
-
-
Method Details
-
distance
public static double distance(double x1, double y1, double x2, double y2) -
distance
-
distance
-
direction
public static double direction(int x1, int y1, int x2, int y2) -
direction
-
direction
-
getPointAt
-
getPointAt
-
sortByDistance
public static List<Pair<Object,Double>> sortByDistance(Map<?, HasGridPosition> points, HasGridPosition origin) -
normalize
-
sample
-
canSeeIt
public static boolean canSeeIt(Grid grid, int x, int y, int i, int u, Predicate<GridPosition> barrierCondition) -
canSeeIt
public static boolean canSeeIt(Grid grid, HasGridPosition a, HasGridPosition b, Predicate<GridPosition> barrierCondition)
-