{"action":"created","issue":{"url":"https://api.github.com/repos/joaofarias/csl-traffic/issues/39","labels_url":"https://api.github.com/repos/joaofarias/csl-traffic/issues/39/labels{/name}","comments_url":"https://api.github.com/repos/joaofarias/csl-traffic/issues/39/comments","events_url":"https://api.github.com/repos/joaofarias/csl-traffic/issues/39/events","html_url":"https://github.com/joaofarias/csl-traffic/issues/39","id":81321971,"number":39,"title":"Idea for performance tuning","user":{"login":"aubergine10","id":1386719,"avatar_url":"https://avatars.githubusercontent.com/u/1386719?v=3","gravatar_id":"","url":"https://api.github.com/users/aubergine10","html_url":"https://github.com/aubergine10","followers_url":"https://api.github.com/users/aubergine10/followers","following_url":"https://api.github.com/users/aubergine10/following{/other_user}","gists_url":"https://api.github.com/users/aubergine10/gists{/gist_id}","starred_url":"https://api.github.com/users/aubergine10/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aubergine10/subscriptions","organizations_url":"https://api.github.com/users/aubergine10/orgs","repos_url":"https://api.github.com/users/aubergine10/repos","events_url":"https://api.github.com/users/aubergine10/events{/privacy}","received_events_url":"https://api.github.com/users/aubergine10/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":12,"created_at":"2015-05-27T07:20:19Z","updated_at":"2015-06-05T17:32:32Z","closed_at":null,"body":"Note: This is based on my somewhat vague comprehension of how pathfinding, etc., is working.\r\n\r\nHave a status byte on each lane? (not sure of correct terminology) which can be used to determine what additional checks might be required when that lane is being considered for a route:\r\n\r\n* 1 = some customisations present (see other bits to determine which)\r\n* 2 = speed customisation\r\n* 4 = vehicle customisation\r\n* 8 = intersection lane routing\r\n\r\nUnrelated to pathfinding:\r\n* 16 = emergency protocol (see later)\r\n\r\nSo in the pathfinder, it could quickly work out if it needs to do additional checks (is first bit set or not) and if not skip all the more advanced logic.\r\n\r\nFrom what I can see the vast majority of intersections/lanes within a city are not T++ customised, people tend to be using them in mostly localised fashion to deal with specific traffic issues, so skipping extended logic should have a noticeable affect on performance?\r\n\r\n**Emergency Protocol**\r\n\r\nI threw this in randomly above... Idea is that if an emergency mode (flashing lights) vehicle is about to enter a segment, the emergency protocol bit is set on the relevant lane. AIs processing vehicles on that lane would instruct them to make way for the emergency vehicle:\r\n\r\n* vehicles pull to side of road as if parking/delivering/collecting (should already be code in AI for this sort of movement?)\r\n* vehicles also removed from 'the grid' – not sure of correct term; but ARIS Enhanced Hearse AI does something like this to prevent Hearses collecting dead from blocking traffic\r\n\r\nThe result is that vehicles move out of the way to let the emergency vehicle through. Could even go so far as to alert upcoming intersections to gain temporary 'right of way' for next leg of route."},"comment":{"url":"https://api.github.com/repos/joaofarias/csl-traffic/issues/comments/109371073","html_url":"https://github.com/joaofarias/csl-traffic/issues/39#issuecomment-109371073","issue_url":"https://api.github.com/repos/joaofarias/csl-traffic/issues/39","id":109371073,"user":{"login":"aubergine10","id":1386719,"avatar_url":"https://avatars.githubusercontent.com/u/1386719?v=3","gravatar_id":"","url":"https://api.github.com/users/aubergine10","html_url":"https://github.com/aubergine10","followers_url":"https://api.github.com/users/aubergine10/followers","following_url":"https://api.github.com/users/aubergine10/following{/other_user}","gists_url":"https://api.github.com/users/aubergine10/gists{/gist_id}","starred_url":"https://api.github.com/users/aubergine10/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aubergine10/subscriptions","organizations_url":"https://api.github.com/users/aubergine10/orgs","repos_url":"https://api.github.com/users/aubergine10/repos","events_url":"https://api.github.com/users/aubergine10/events{/privacy}","received_events_url":"https://api.github.com/users/aubergine10/received_events","type":"User","site_admin":false},"created_at":"2015-06-05T17:32:32Z","updated_at":"2015-06-05T17:32:32Z","body":"> The pathfinding does not find multiple paths and chooses one. It finds one and that's it ...\r\n\r\nIf looking at the pathfinder as a black box, yes, it returns a single path that's the fastest (-ish, taking in to account randomisation).\r\n\r\nInternally though, it must be trying different routes - this is my current comprehension of how it works (which is probably wrong in many aspects):\r\n\r\n* From starting point, find some lanes in general direction of target\r\n* Starting with the fastest lane, repeat first step with current lane as starting point\r\n * if can't use it, go back to step 2 and try with next lane in the list\r\n\r\nWhat would a more detailed / correct description look like?"}}