Revision | 0ea264aff68f7ed684d29045d69242ebb498b40e (tree) |
---|---|
Time | 2010-09-14 07:18:41 |
Author | lorenzo |
Commiter | lorenzo |
I cleaned up a bit the code and removed unnecessary tests/calculations
carried out on a single tag id.
@@ -15,36 +15,36 @@ | ||
15 | 15 | |
16 | 16 | let dat :: [[Integer]] |
17 | 17 | |
18 | - dat = convert txt | |
18 | + dat = convert txt -- Now dat is a list where every element is a row of the original data table | |
19 | 19 | |
20 | - let dat_col = transpose dat | |
20 | + let dat_col = transpose dat -- now every entry of data_col is a column of the original data table | |
21 | 21 | |
22 | 22 | let tag_list = get_tag_list dat_col |
23 | 23 | |
24 | 24 | -- putStrLn "tag_list is, " |
25 | 25 | -- print tag_list |
26 | 26 | |
27 | - let tag_1080_pos = get_single_tag_story dat_col 1080 | |
27 | + -- let tag_1080_pos = get_single_tag_story dat_col 1080 | |
28 | 28 | |
29 | 29 | -- putStrLn "positions of tag 1080, " |
30 | 30 | -- print tag_1080_pos |
31 | 31 | |
32 | - let t_1080= get_sel (dat_col!!1) tag_1080_pos | |
32 | + -- let t_1080= get_sel (dat_col!!1) tag_1080_pos | |
33 | 33 | |
34 | 34 | -- writeFile "ini_1080.dat" t_1080 |
35 | 35 | |
36 | 36 | |
37 | 37 | |
38 | - putStrLn "the times of the begin of the contacts of tag 1080 are, " | |
39 | - print (take 30 t_1080 ) | |
38 | + -- putStrLn "the times of the begin of the contacts of tag 1080 are, " | |
39 | + -- print (take 30 t_1080 ) | |
40 | 40 | |
41 | - let t_1080_2 = single_tag_unique_contact_times dat_col 1080 | |
41 | + -- let t_1080_2 = single_tag_unique_contact_times dat_col 1080 | |
42 | 42 | |
43 | - putStrLn "or also " | |
44 | - print (take 30 t_1080_2 ) | |
43 | + -- putStrLn "or also " | |
44 | + -- print (take 30 t_1080_2 ) | |
45 | 45 | |
46 | 46 | |
47 | - save "1080_hs.dat" t_1080 | |
47 | + -- save "1080_hs.dat" t_1080 | |
48 | 48 | |
49 | 49 | -- putStrLn "nub t_1080==nub (sort t_1080) is," |
50 | 50 | -- print (( t_1080)==( (sort t_1080) )) |
@@ -58,36 +58,36 @@ | ||
58 | 58 | |
59 | 59 | -- print (unique_time_long) |
60 | 60 | |
61 | - let ctime = count t_1080 | |
61 | + -- let ctime = count t_1080 | |
62 | 62 | |
63 | 63 | -- putStrLn "the repeated times are, " |
64 | 64 | -- print (take 10 ctime ) |
65 | 65 | |
66 | 66 | |
67 | - let n_occ = count_occurrencies t_1080 | |
67 | + -- let n_occ = count_occurrencies t_1080 | |
68 | 68 | -- putStrLn "the occurrencies are, " |
69 | 69 | -- print ( n_occ ) |
70 | 70 | |
71 | 71 | |
72 | - let times_multi_contacts = find_repeated_times n_occ t_1080 | |
72 | + -- let times_multi_contacts = find_repeated_times n_occ t_1080 | |
73 | 73 | |
74 | 74 | -- putStrLn "the times at which multiple contacts are established are, " |
75 | 75 | -- print ( times_multi_contacts ) |
76 | 76 | |
77 | 77 | |
78 | - let duration_times = get_single_tag_contact_durations dat_col tag_1080_pos | |
78 | + -- let duration_times = get_single_tag_contact_durations dat_col tag_1080_pos | |
79 | 79 | |
80 | - putStrLn "contact durations are" | |
81 | - print (take 30 duration_times ) | |
80 | + -- putStrLn "contact durations are" | |
81 | + -- print (take 30 duration_times ) | |
82 | 82 | |
83 | - let summed_times = sum_corresponding_unique t_1080 duration_times | |
83 | + -- let summed_times = sum_corresponding_unique t_1080 duration_times | |
84 | 84 | |
85 | - putStrLn "the summed duration times for multiple contacts starting at the same time are" | |
86 | - print (take 30 summed_times ) | |
85 | + -- putStrLn "the summed duration times for multiple contacts starting at the same time are" | |
86 | + -- print (take 30 summed_times ) | |
87 | 87 | |
88 | - let summed_times_2 = single_tag_unique_contact_durations dat_col 1080 | |
89 | - putStrLn "or also" | |
90 | - print (take 30 summed_times_2 ) | |
88 | + -- let summed_times_2 = single_tag_unique_contact_durations dat_col 1080 | |
89 | + -- putStrLn "or also" | |
90 | + -- print (take 30 summed_times_2 ) | |
91 | 91 | |
92 | 92 | |
93 | 93 | let summed_durations_long = map (single_tag_unique_contact_durations dat_col) tag_list |
@@ -113,9 +113,9 @@ | ||
113 | 113 | |
114 | 114 | let data_comb = zip unique_time_long summed_durations_long |
115 | 115 | |
116 | - let summed_durations_long_ordered = genericIndex data_comb 2 | |
116 | + -- let summed_durations_long_ordered = genericIndex data_comb 2 | |
117 | 117 | |
118 | - let ms = argsort_only (unique_time_long!!1) (summed_durations_long!!1) | |
118 | + -- let ms = argsort_only (unique_time_long!!1) (summed_durations_long!!1) | |
119 | 119 | |
120 | 120 | |
121 | 121 | let summed_durations_long_ordered = map (argsort_tuple . genericIndex data_comb) [0,1..length(data_comb)-1] |
@@ -126,8 +126,8 @@ | ||
126 | 126 | putStrLn "summed_durations_long_ordered is, " |
127 | 127 | print (summed_durations_long_ordered ) |
128 | 128 | |
129 | - putStrLn "ms is, " | |
130 | - print (ms) | |
129 | + -- putStrLn "ms is, " | |
130 | + -- print (ms) | |
131 | 131 | |
132 | 132 | |
133 | 133 |
@@ -251,6 +251,6 @@ | ||
251 | 251 | save_vector_flat filename list = writeFile filename $ unlines (map show $ concat list) |
252 | 252 | |
253 | 253 | |
254 | --- Now I need a function which combines several ones | |
255 | 254 | |
256 | 255 | |
256 | + |