Class StatisticalHider

    • Field Detail

      • relativeAreaCutoffWeight_Preference

        public static final java.lang.String relativeAreaCutoffWeight_Preference
        See Also:
        Constant Field Values
      • DistanceFromNormalAngleLineToTreasureWeight_Preference

        public static final java.lang.String DistanceFromNormalAngleLineToTreasureWeight_Preference
        See Also:
        Constant Field Values
      • DistanceFromResultingCentroidToTreasureWeight_Preference

        public static final java.lang.String DistanceFromResultingCentroidToTreasureWeight_Preference
        See Also:
        Constant Field Values
      • badHintWeight_Preference

        public static final java.lang.String badHintWeight_Preference
        See Also:
        Constant Field Values
      • gf

        protected org.locationtech.jts.geom.GeometryFactory gf
      • startingPoint

        protected org.locationtech.jts.geom.Point startingPoint
      • currentPossibleArea

        protected org.locationtech.jts.geom.Geometry currentPossibleArea
      • centroidDistanceToTreasure

        protected double centroidDistanceToTreasure
      • absoluteAreaCutoff

        protected double absoluteAreaCutoff
      • relativeAreaCutoff

        protected double relativeAreaCutoff
      • counterStrategyGeometryCutoff

        protected double counterStrategyGeometryCutoff
      • distanceFromNormalAngleRay

        protected double distanceFromNormalAngleRay
      • treasure

        protected org.locationtech.jts.geom.Point treasure
      • preferredHintSize

        protected double preferredHintSize
    • Constructor Detail

      • StatisticalHider

        public StatisticalHider()
    • Method Detail

      • init

        public void init​(org.locationtech.jts.geom.Point searcherStartPosition)
      • eval

        public AngleHint eval​(java.util.List<AngleHint> hints,
                              SearchPath searchPath)
        Evaluates the Hints by generating some statistics on them, rating the Hints, and returning the best.
        Parameters:
        hints - the list of AngleHints to evaluate
        searchPath - the SearchPath
        Returns:
        the chosen AngleHint with the best rating
      • rateHint

        protected abstract double rateHint​(AngleHintStatistic ahs)
        Rates the Given Hint with a custom function, saves the result in the AngleHintStatistic - Wrapper and returns the result
        Parameters:
        ahs - The AngleHint - Wrapper , in which the result is saved
        Returns:
        the rating of the hint
      • fillDistanceToNormalLine

        protected double fillDistanceToNormalLine​(AngleHintStatistic ahs)
        Inspects the given Hint in AngleHintStatistic and computes the distance between the angle-bisector and the treasure. The result is written into the corresponding AngleHintStatistic
        Parameters:
        ahs - the AngleHintStatistic Wrapper containing the Hint
        Returns:
        the distance
      • fillDistanceToCentroid

        protected double fillDistanceToCentroid​(AngleHintStatistic ahs)
        Inspects the given Hint in AngleHintStatistic and computes the distance between the angle-bisector and the treasure. The result is written into the corresponding AngleHintStatistic
        Parameters:
        ahs - the AngleHintStatistic Wrapper containing the Hint
        Returns:
        the distance
      • generateHints

        protected java.util.List<AngleHint> generateHints​(int samples,
                                                          org.locationtech.jts.geom.Point hintCenter)
        Todo: if hint is 180degree make it an explicit HalfPlaneHint/ hack it such that StrategyFromPaper receives a halfplaneHint Generates samples evenly spaced AngleHints. Generated hints are not always exactly the preferred hint Size, the diverge about 3 * e-13
        Parameters:
        samples - determines how many Hints are returned
        hintCenter - the center Point, the AngleHints should lie on.
        Returns:
        a list of samples many AngleHints
      • getTreasureLocation

        public org.locationtech.jts.geom.Point getTreasureLocation()