Package com.treasure.hunt.analysis
Class Statistic
- java.lang.Object
-
- com.treasure.hunt.analysis.Statistic
-
public class Statistic extends java.lang.ObjectA 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)doublegetGlobalOptimalSolution()org.locationtech.jts.geom.PointgetGlobalStartPoint()intgetHintRequests()doublegetHintTraceLengthRatio()doublegetLocalOptimalSolution()Get the locally optimal trace length for the searcher.doublegetSolutionQuotient()Calculate the solution quotient.doublegetTraceLength()org.locationtech.jts.geom.PointgetTreasureLocation()
-
-
-
Method Detail
-
getTraceLength
public double getTraceLength()
- Returns:
- The length of the trace, the
Searcherran 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
Pointwhere theSearcherstood 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, containingTurnobjects.finished- telling, whether the game is finished yet.- Returns:
- A list, containing
StatisticObject's.
-
-