{"action":"closed","issue":{"url":"https://api.github.com/repos/FTSRG/trainbenchmark-ttc/issues/12","labels_url":"https://api.github.com/repos/FTSRG/trainbenchmark-ttc/issues/12/labels{/name}","comments_url":"https://api.github.com/repos/FTSRG/trainbenchmark-ttc/issues/12/comments","events_url":"https://api.github.com/repos/FTSRG/trainbenchmark-ttc/issues/12/events","html_url":"https://github.com/FTSRG/trainbenchmark-ttc/issues/12","id":82480090,"number":12,"title":"OR (NMF): return values of patterns and sortkeys","user":{"login":"szarnyasg","id":1402801,"avatar_url":"https://avatars.githubusercontent.com/u/1402801?v=3","gravatar_id":"","url":"https://api.github.com/users/szarnyasg","html_url":"https://github.com/szarnyasg","followers_url":"https://api.github.com/users/szarnyasg/followers","following_url":"https://api.github.com/users/szarnyasg/following{/other_user}","gists_url":"https://api.github.com/users/szarnyasg/gists{/gist_id}","starred_url":"https://api.github.com/users/szarnyasg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/szarnyasg/subscriptions","organizations_url":"https://api.github.com/users/szarnyasg/orgs","repos_url":"https://api.github.com/users/szarnyasg/repos","events_url":"https://api.github.com/users/szarnyasg/events{/privacy}","received_events_url":"https://api.github.com/users/szarnyasg/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-05-29T15:47:48Z","updated_at":"2015-07-29T20:31:31Z","closed_at":"2015-07-29T20:31:31Z","body":"Hi!\r\n\r\n@Develman\r\n\r\nThe patterns are a bit too simplified in the paper compared to the implementation (https://ttc2015trainbenchmarknmf.codeplex.com/SourceControl/latest#TrainBenchmarkNMF/TrainRepair.cs). Also, the implementation does not strictly adhere the case description. For example, the RouteSensor pattern is defined as \r\n\r\n```csharp\r\n                Fix(pattern: from route in rc.Routes\r\n                             from swP in route.Follows.OfType<SwitchPosition>()\r\n                             where swP.Switch.Sensor != null && !route.DefinedBy.Contains(swP.Switch.Sensor)\r\n                             select new { Route = route, Sensor = swP.Switch.Sensor, SwitchPos = swP },\r\n                     action: match => match.Route.DefinedBy.Add(match.Sensor),\r\n                    sortKey: match => string.Format(\"<route : {0}, sensor : {1}, swP : {2}, sw : {3}>\",\r\n                         match.Route.Id.GetValueOrDefault(),\r\n                         match.Sensor.Id.GetValueOrDefault(),\r\n                         match.SwitchPos.Id.GetValueOrDefault(),\r\n                         match.SwitchPos.Switch.Id.GetValueOrDefault()));\r\n```\r\n\r\nThere are two issues:\r\n1. **The paper** omits the SwitchPos value compared to the actual implementation.\r\n2. **The implementation** does not return the Switch explicitly (of course you can get it by navigating from the swP variable).\r\n\r\nThe paper also omits the sortKey but that's not really issue (and it's also explained in the text). Regarding the sortkeys, do you convert the tuples to strings? I think it will not work perfectly, for example a lexicographical sort for route 9 and 10 would result in this:\r\n\r\n```\r\n<route : 10, ...>\r\n<route : 9, ...>\r\n```\r\n\r\nJust a sidenote: I think it would be worth discussing that you had to utilize a pseudorandom generator implemented in .NET (to produce the same results as the one in Java).\r\n\r\nGabor"}}