Class LastHintBadSubroutine
- java.lang.Object
-
- com.treasure.hunt.strategy.searcher.impl.strategyFromPaper.LastHintBadSubroutine
-
public class LastHintBadSubroutine extends java.lang.Object
Implements the "else"-part of the first if-condition in Algorithm 3 (Function ReduceRectangle(R)) in the paper "Deterministic Treasure Hunt in the Plane with Angular Hints" from Bouchard et al.
-
-
Constructor Summary
Constructors Constructor Description LastHintBadSubroutine(StrategyFromPaper strategy)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getBasicTransformation()
org.locationtech.jts.geom.Coordinate[]
getCurrentRectangle()
org.locationtech.jts.geom.LineSegment
getL1DoubleApos()
StrategyFromPaper
getStrategy()
SearchPath
lastHintBadSubroutine(HalfPlaneHint currentHint, HalfPlaneHint lastBadHint, SearchPath move, boolean changeABCD)
If the last hint was bad, this function can be called and lastBadHint has to be set accordingly.
-
-
-
Constructor Detail
-
LastHintBadSubroutine
public LastHintBadSubroutine(StrategyFromPaper strategy)
-
-
Method Detail
-
lastHintBadSubroutine
public SearchPath lastHintBadSubroutine(HalfPlaneHint currentHint, HalfPlaneHint lastBadHint, SearchPath move, boolean changeABCD)
If the last hint was bad, this function can be called and lastBadHint has to be set accordingly. The function equals the "else"-part of the first if-condition in Algorithm 3 (Function ReduceRectangle(R)) in the paper.- Parameters:
currentHint
- the hint gotten last by the calling strategylastBadHint
- the hint gotten before the currentHint by the calling strategymove
- the move the steps get added tochangeABCD
- true if ABCD should be changed, false if the strategy does so by itself- Returns:
- The move to scan various areas so that A,B,C and D can be updated to a smaller rectangle (or the treasure is found)
-
getBasicTransformation
public int getBasicTransformation()
-
getCurrentRectangle
public org.locationtech.jts.geom.Coordinate[] getCurrentRectangle()
-
getL1DoubleApos
public org.locationtech.jts.geom.LineSegment getL1DoubleApos()
-
getStrategy
public StrategyFromPaper getStrategy()
-
-