Package com.treasure.hunt.analysis
Class Statistic
- java.lang.Object
-
- com.treasure.hunt.analysis.Statistic
-
public class Statistic extends java.lang.Object
A class to calculate various statistics.
-
-
Constructor Summary
Constructors Constructor Description Statistic()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<StatisticObject>
calculate(java.util.List<Turn> turns, boolean finished)
static java.util.List<java.lang.Number>
filterBy(java.util.List<StatisticsWithId> list, StatisticObject.StatisticInfo info)
double
getGlobalOptimalSolution()
org.locationtech.jts.geom.Point
getGlobalStartPoint()
int
getHintRequests()
double
getHintTraceLengthRatio()
double
getLocalOptimalSolution()
Get the locally optimal trace length for the searcher.double
getSolutionQuotient()
Calculate the solution quotient.double
getTraceLength()
org.locationtech.jts.geom.Point
getTreasureLocation()
-
-
-
Method Detail
-
getTraceLength
public double getTraceLength()
- Returns:
- The length of the trace, the
Searcher
ran yet.
-
getLocalOptimalSolution
public double getLocalOptimalSolution()
Get the locally optimal trace length for the searcher. That's the trace length of the path visited plus the optimal distance between the last searcher position and the treasure.- Returns:
- locally optimal trace length
-
getGlobalStartPoint
public org.locationtech.jts.geom.Point getGlobalStartPoint()
- Returns:
- The
Point
where theSearcher
stood initially.
-
getTreasureLocation
public org.locationtech.jts.geom.Point getTreasureLocation()
- Returns:
- the
Point
, where the treasure is located.
-
getGlobalOptimalSolution
public double getGlobalOptimalSolution()
- Returns:
- the distance of the beeline between the
Searcher
's initial position and the treasure location.
-
getSolutionQuotient
public double getSolutionQuotient()
Calculate the solution quotient. This is the quotient between the local and the global trace length optimum.- Returns:
- solution quotient
-
getHintTraceLengthRatio
public double getHintTraceLengthRatio()
- Returns:
getHintRequests()
/getTraceLength()
, whengetTraceLength()
!= 0. Otherwise1
.
-
filterBy
public static java.util.List<java.lang.Number> filterBy(java.util.List<StatisticsWithId> list, StatisticObject.StatisticInfo info)
-
calculate
public java.util.List<StatisticObject> calculate(java.util.List<Turn> turns, boolean finished)
- Parameters:
turns
- a list, containingTurn
objects.finished
- telling, whether the game is finished yet.- Returns:
- A list, containing
StatisticObject
's.
-
-