{"action":"created","issue":{"url":"https://api.github.com/repos/e-mission/e-mission-server/issues/352","repository_url":"https://api.github.com/repos/e-mission/e-mission-server","labels_url":"https://api.github.com/repos/e-mission/e-mission-server/issues/352/labels{/name}","comments_url":"https://api.github.com/repos/e-mission/e-mission-server/issues/352/comments","events_url":"https://api.github.com/repos/e-mission/e-mission-server/issues/352/events","html_url":"https://github.com/e-mission/e-mission-server/issues/352","id":171329630,"number":352,"title":"Trips are sometimes incorrectly \"joined\" even if the gap between sections is close to an hour long","user":{"login":"shankari","id":2423263,"avatar_url":"https://avatars.githubusercontent.com/u/2423263?v=3","gravatar_id":"","url":"https://api.github.com/users/shankari","html_url":"https://github.com/shankari","followers_url":"https://api.github.com/users/shankari/followers","following_url":"https://api.github.com/users/shankari/following{/other_user}","gists_url":"https://api.github.com/users/shankari/gists{/gist_id}","starred_url":"https://api.github.com/users/shankari/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shankari/subscriptions","organizations_url":"https://api.github.com/users/shankari/orgs","repos_url":"https://api.github.com/users/shankari/repos","events_url":"https://api.github.com/users/shankari/events{/privacy}","received_events_url":"https://api.github.com/users/shankari/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-08-16T05:46:21Z","updated_at":"2016-08-17T19:49:33Z","closed_at":null,"body":"We have just started our trip, yay! Now we still don't have enough points to make a decision.\r\n\r\n```\r\n2016-08-15 12:10:17,370:DEBUG:------------------------------2016-08-10T09:54:31-07:00------------------------------\r\n2016-08-15 12:10:17,372:DEBUG:last5MinsDistances = [ 52.82764235] with length 1\r\n2016-08-15 12:10:17,374:DEBUG:last10PointsDistances = [ 52.82764235   0.        ] with length 2, shape (2,)\r\n2016-08-15 12:10:17,374:DEBUG:len(last10PointsDistances) = 2, len(last5MinsDistances) = 1\r\n2016-08-15 12:10:17,375:DEBUG:last5MinsTimes.max() = 31.5750000477, time_threshold = 300\r\n2016-08-15 12:10:17,375:DEBUG:Too few points to make a decision, continuing\r\n...\r\n2016-08-15 12:10:17,435:DEBUG:------------------------------2016-08-10T09:58:13-07:00------------------------------\r\n2016-08-15 12:10:17,440:DEBUG:last5MinsDistances = [ 329.2908086   280.89265787  245.2010695   184.71648394  189.02429048\r\n  142.74543776   87.77772771   43.01575703   56.99527453] with length 9\r\n2016-08-15 12:10:17,444:DEBUG:last10PointsDistances = [ 329.2908086   280.89265787  245.2010695   184.71648394  189.02429048\r\n  142.74543776   87.77772771   43.01575703   56.99527453    0.        ] with length 10, shape (10,)\r\n2016-08-15 12:10:17,446:DEBUG:len(last10PointsDistances) = 10, len(last5MinsDistances) = 9\r\n2016-08-15 12:10:17,446:DEBUG:last5MinsTimes.max() = 253.575000048, time_threshold = 300\r\n2016-08-15 12:10:17,447:DEBUG:Too few points to make a decision, continuing\r\n```\r\n\r\nNow we finally have enough points\r\n\r\n```\r\n2016-08-15 12:10:17,447:DEBUG:------------------------------2016-08-10T09:58:52-07:00------------------------------\r\n2016-08-15 12:10:17,454:DEBUG:last5MinsDistances = [ 368.82243137  323.60485982  289.21766655  230.01780163  235.70421315\r\n  192.31601923  144.97574662   96.48072959   89.58728643   59.109117  ] with length 10\r\n2016-08-15 12:10:17,457:DEBUG:last10PointsDistances = [ 323.60485982  289.21766655  230.01780163  235.70421315  192.31601923\r\n  144.97574662   96.48072959   89.58728643   59.109117      0.        ] with length 10, shape (10,)\r\n2016-08-15 12:10:17,460:DEBUG:len(last10PointsDistances) = 10, len(last5MinsDistances) = 10\r\n2016-08-15 12:10:17,461:DEBUG:last5MinsTimes.max() = 292.575000048, time_threshold = 300\r\n2016-08-15 12:10:17,461:DEBUG:last5MinsDistances.max() = 368.822431372, last10PointsDistance.max() = 323.604859817\r\n...\r\n2016-08-15 12:10:17,609:DEBUG:------------------------------2016-08-10T10:03:53-07:00------------------------------\r\n2016-08-15 12:10:17,615:DEBUG:last5MinsDistances = [ 131.22779511  122.19976408   77.28623256   51.39123828   36.04130693\r\n   39.82444342   25.54539197   14.229786     34.26178107   25.54539197\r\n   36.07236258] with length 11\r\n2016-08-15 12:10:17,619:DEBUG:last10PointsDistances = [ 77.28623256  51.39123828  36.04130693  39.82444342  25.54539197\r\n  14.229786    34.26178107  25.54539197  36.07236258   0.        ] with length 10, shape (10,)\r\n2016-08-15 12:10:17,622:DEBUG:len(last10PointsDistances) = 10, len(last5MinsDistances) = 11\r\n2016-08-15 12:10:17,622:DEBUG:last5MinsTimes.max() = 271.786000013, time_threshold = 300\r\n2016-08-15 12:10:17,622:DEBUG:last5MinsDistances.max() = 131.227795112, last10PointsDistance.max() = 77.2862325602\r\n```\r\n\r\nHere's where we should segment. Here, we have enough points, and the\r\nlast10PointsDistance.max() is only 77, but the last 5 mins distances > 100\r\n\r\nAnd then we only get a point on the return trip.\r\n\r\n```\r\n2016-08-15 12:10:17,623:DEBUG:------------------------------2016-08-10T11:07:05.684000-07:00------------------------------\r\n2016-08-15 12:10:17,625:DEBUG:last5MinsDistances = [] with length 0\r\n2016-08-15 12:10:17,629:DEBUG:last10PointsDistances = [ 109.66159855  129.1706589   118.45003771  131.19699388  146.88650462\r\n  122.53046402  131.19699388  120.7937173   156.72206388    0.        ] with length 10, shape (10,)\r\n2016-08-15 12:10:17,629:DEBUG:len(last10PointsDistances) = 10, len(last5MinsDistances) = 0\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/e-mission/e-mission-server/issues/comments/240526292","html_url":"https://github.com/e-mission/e-mission-server/issues/352#issuecomment-240526292","issue_url":"https://api.github.com/repos/e-mission/e-mission-server/issues/352","id":240526292,"user":{"login":"shankari","id":2423263,"avatar_url":"https://avatars.githubusercontent.com/u/2423263?v=3","gravatar_id":"","url":"https://api.github.com/users/shankari","html_url":"https://github.com/shankari","followers_url":"https://api.github.com/users/shankari/followers","following_url":"https://api.github.com/users/shankari/following{/other_user}","gists_url":"https://api.github.com/users/shankari/gists{/gist_id}","starred_url":"https://api.github.com/users/shankari/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shankari/subscriptions","organizations_url":"https://api.github.com/users/shankari/orgs","repos_url":"https://api.github.com/users/shankari/repos","events_url":"https://api.github.com/users/shankari/events{/privacy}","received_events_url":"https://api.github.com/users/shankari/received_events","type":"User","site_admin":false},"created_at":"2016-08-17T19:49:32Z","updated_at":"2016-08-17T19:49:32Z","body":"I think that we can handle this with the 80-20 rule.\r\n\r\n1. We should only really mark points that we have processed as processed. That is almost a bug fix. If you have looked at points, but have not been able to classify them as \"belonging to a trip\", or need to skip, then they are unclassified, and you need to look at them next time. Note that this means that glommed on points should also be included in the list of processed points.\r\n2. When we have finished looking at all points, if we haven't ended a trip, then:\r\n  1. if there is a transition, end the trip\r\n 2. else, let the points be handled during the next run\r\n\r\nThis seems to cover all cases:\r\n- mismatch\r\n- continuous collection\r\n- glommed points"}}
{"actor":{"display_login":"shankari"}}