def test_reads_file(self):
     expected = [[Point(1, 2), Point(3, 4)], \
                 [Point(2, 4), Point(6, 8)], \
                 [Point(1, 3), Point(5, 7)], \
                 [Point(9, 8)]]
     res = read_test_file(os.path.dirname(__file__) +  "\\dummy_input.txt")
     exp_iter = iter(expected)
     for traj in res:
         exp_line = exp_iter.next()
         self.assertListEqual(exp_line, traj)
Exemplo n.º 2
0
 def test_reads_file(self):
     expected = [[Point(1, 2), Point(3, 4)], \
                 [Point(2, 4), Point(6, 8)], \
                 [Point(1, 3), Point(5, 7)], \
                 [Point(9, 8)]]
     res = read_test_file(os.path.dirname(__file__) +  "\\dummy_input.txt")
     exp_iter = iter(expected)
     for traj in res:
         exp_line = exp_iter.next()
         self.assertListEqual(exp_line, traj)
Exemplo n.º 3
0
def run_deer_stuff():
    file = os.path.join(os.path.dirname(__file__), "elk_1993.tra")
    points = read_test_file(file)
    traj_res = run_traclus(point_iterable_list=points, epsilon=32, min_neighbors=7, \
                                   min_num_trajectories_in_cluster=2, min_vertical_lines=7, min_prev_dist=0.0)
    print "heres the output: " + str(traj_res)
    print "about to print out the lines"
    for traj in traj_res:
        print "A new average trajectory:"
        for point in traj:
            print str(point)
    print "done"
Exemplo n.º 4
0
def run_deer_stuff():
    file = os.path.join(os.path.dirname(__file__), "elk_1993.tra")
    points = read_test_file(file)
    traj_res = run_traclus(point_iterable_list=points, epsilon=32, min_neighbors=7, \
                                   min_num_trajectories_in_cluster=2, min_vertical_lines=7, min_prev_dist=0.0)
    print "heres the output: " + str(traj_res)
    print "about to print out the lines"
    for traj in traj_res:
        print "A new average trajectory:"
        for point in traj:
            print str(point)
    print "done"
def run_deer_stuff():
    print "hello"
    file = os.path.dirname(__file__) + "\\deer_1995.tra"
    points = read_test_file(file)
    traj_res = the_whole_enchilada(point_iterable_list=points, epsilon=40, min_neighbors=7, \
                                   min_num_trajectories_in_cluster=2, min_vertical_lines=7, min_prev_dist=0.0)
    print "heres the output: " + str(traj_res)
    print "about to print out the lines"
    for traj in traj_res:
        print "A new average trajectory:"
        for point in traj:
            print "    x: " + str(point.x) + ", y: " + str(point.y)
    print "done"
Exemplo n.º 6
0
def run_deer_stuff():
    print "hello"
    file = os.path.dirname(__file__) + "\\deer_1995.tra"
    points = read_test_file(file)
    traj_res = the_whole_enchilada(point_iterable_list=points, epsilon=40, min_neighbors=7, \
                                   min_num_trajectories_in_cluster=2, min_vertical_lines=7, min_prev_dist=0.0)
    print "heres the output: " + str(traj_res)
    print "about to print out the lines"
    for traj in traj_res:
        print "A new average trajectory:"
        for point in traj:
            print "    x: " + str(point.x) + ", y: " + str(point.y)
    print "done"