Skip to content

Commit

Permalink
sync heuristic with CUDA code
Browse files Browse the repository at this point in the history
  • Loading branch information
xspanger3770 committed Apr 21, 2024
1 parent 114aba2 commit 0a0aace
Showing 1 changed file with 2 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -805,7 +805,7 @@ public static List<ExactPickedEvent> createListOfExactPickedEvents(List<PickedEv
}

public static double calculateHeuristic(PreliminaryHypocenter hypocenter) {
return Math.pow(hypocenter.correctStations, 2) / Math.pow(hypocenter.err, 3);
return Math.pow(hypocenter.correctStations, 2) / Math.pow(hypocenter.err, 2);
}

private static PreliminaryHypocenter selectBetterHypocenter(PreliminaryHypocenter hypocenter1, PreliminaryHypocenter hypocenter2) {
Expand All @@ -815,13 +815,7 @@ private static PreliminaryHypocenter selectBetterHypocenter(PreliminaryHypocente
return hypocenter1;
}

if (hypocenter1.correctStations > (int) (hypocenter2.correctStations * 1.3)) {
return hypocenter1;
} else if (hypocenter2.correctStations > (int) (hypocenter1.correctStations * 1.3)) {
return hypocenter2;
} else {
return calculateHeuristic(hypocenter1) > calculateHeuristic(hypocenter2) ? hypocenter1 : hypocenter2;
}
return calculateHeuristic(hypocenter1) > calculateHeuristic(hypocenter2) ? hypocenter1 : hypocenter2;
}

@SuppressWarnings("SameParameterValue")
Expand Down

0 comments on commit 0a0aace

Please sign in to comment.