def evaluateDirections(fileName, findRepeatVisit=False): pos = 0 t = cartesian.TaxiTracker() t.readDirections(fileName) if not findRepeatVisit: pos = t.pos else: pos = t.firstIntersection() return t.distanceManhattan(pos)
def test_TaxiTracker_task2_fTestTaxiA(self): t = cartesian.TaxiTracker() t.readDirections(self.fTestTaxiD) self.assertEqual(4, t.distanceManhattan(t.firstIntersection()))
def test_TaxiTracker_fTestTaxiD(self): t = cartesian.TaxiTracker() t.readDirections(self.fTestTaxiD) self.assertEqual(8, t.getDistance())
def test_TaxiTracker_fInputTaxiA(self): t = cartesian.TaxiTracker() t.readDirections(self.fInputTaxiA) self.assertEqual(231, t.getDistance())