Created
December 16, 2011 16:45
-
-
Save abyrd/1486806 to your computer and use it in GitHub Desktop.
three-case epsilon dominance
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private boolean eDominates(State s0, State s1) { | |
final double EPSILON1 = 0.05; | |
final double EPSILON2 = 0.25; | |
if (s0.similarTripSeq(s1)) { | |
return s0.getWeight() <= s1.getWeight() * (1 + EPSILON1) && | |
s0.getElapsedTime() <= s1.getElapsedTime() * (1 + EPSILON1) && | |
s0.getWalkDistance() <= s1.getWalkDistance() * (1 + EPSILON1) && | |
s0.getNumBoardings() <= s1.getNumBoardings(); | |
} else if (s0.getTripId() != null && s0.getTripId() == s1.getTripId()) { | |
return s0.getNumBoardings() < s1.getNumBoardings() && | |
s0.getWeight() < s1.getWeight() * (1 + EPSILON2) && | |
s0.getElapsedTime() < s1.getElapsedTime() * (1 + EPSILON2) && | |
s0.getWalkDistance() < s1.getWalkDistance() * (1 + EPSILON2); | |
} else { | |
return false; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment