{"action":"created","comment":{"url":"https://api.github.com/repos/vantas/tc1/pulls/comments/43585018","id":43585018,"diff_hunk":"@@ -5,4 +5,68 @@ \\chapter{\\label{chap:ai}Algoritmos de Inteligência Artificial para Elevadores}\n \\begin{itemize}\n \\item Detalhar o(s) algoritmo(s) selecionados e justificar a sua escolha perante o problema;\n \\item Apresentar em detalhe o algoritmo e descrever como esperamos que seja o resultado de seu uso junto ao sistema.\n-\\end{itemize}\n\\ No newline at end of file\n+\\end{itemize}\n+\n+\\section{\\label{sec:ai:nn}Nearest Neighbour}\n+\n+O algoritmo de \\textit{Nearest Neighbour} é o mais ingênuo de todos, e servirá\n+de base para a avaliação dos demais algoritmos.\n+\n+Seu funcionamento é muito trivial: o elevador mais próximo do chamado sempre\n+atenderá este.\n+\n+\\section{\\label{sec:ai:nnm}Nearest Neighbour Melhorado}\n+\n+Uma melhoria óbvia que pode ser feita ao algoritmo de \\textit{Nearest Neighbour}\n+é considerar o sentido em que o elevador está indo para atender o chamado.\n+\n+\\section{\\label{sec:ai:minimize-cost-function}Minimização da Função de Custo}\n+\n+O primeiro algoritmo de IA a ser testado é bastante simples: definimos uma\n+função de custo, que descreve matematicamente quão vantajoso é atender um\n+pedido, comparado a não atendê-lo. A decisão de qual elevador é escolhido para\n+atender o pedido é feita com base única e exclusivamente em qual deles terá o\n+menor valor da função de custo.\n+\n+Várias funções de custo podem ser experimentadas e comparadas.\n+\n+Um exemplo de função de custo é:\n+\n+\\[\n+  J(f) = \\sum_{i=0}^{i=n} g_{i}f\n+\\]\n+\n+Onde $g_{i}$ é cada grupo no sistema e $f$ é a distância, em número de andares,\n+entre a posição atual do elevador e o pedido que se está avaliando.\n+\n+Outras funções de custo levariam em consideração mudanças de direção de viagem\n+\\footnote{\\textit{e.g.}, pode ser vantajoso um elevador mudar de direção para atender um\n+pedido a um andar de distância, caso a alternativa seja fazer o pedido esperar\n+um deslocamendo de dezenas de andares de outro elevador.}, ou ainda tentar\n+manter todos os custos o mais baixo possível, ao mesmo tempo que sejam todos o\n+mais próximos um dos outro.\\footnote{Podemos elevar cada termo do somatório ao\n+  quadrado para obermos isto.}\n+\n+\\section{Planning}\n+\n+% TODO: essa explicação tá uma merda\n+\n+A idéia do algoritmo de planning é extender o de função de custo, calculando a","path":"chap-ai.tex","position":52,"original_position":52,"commit_id":"d885894fd43e10dc2f4e55573f45e49061916af2","original_commit_id":"d885894fd43e10dc2f4e55573f45e49061916af2","user":{"login":"taschetto","id":5279182,"avatar_url":"https://avatars.githubusercontent.com/u/5279182?v=3","gravatar_id":"","url":"https://api.github.com/users/taschetto","html_url":"https://github.com/taschetto","followers_url":"https://api.github.com/users/taschetto/followers","following_url":"https://api.github.com/users/taschetto/following{/other_user}","gists_url":"https://api.github.com/users/taschetto/gists{/gist_id}","starred_url":"https://api.github.com/users/taschetto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/taschetto/subscriptions","organizations_url":"https://api.github.com/users/taschetto/orgs","repos_url":"https://api.github.com/users/taschetto/repos","events_url":"https://api.github.com/users/taschetto/events{/privacy}","received_events_url":"https://api.github.com/users/taschetto/received_events","type":"User","site_admin":false},"body":"estender","created_at":"2015-11-01T17:36:08Z","updated_at":"2015-11-01T17:36:08Z","html_url":"https://github.com/vantas/tc1/pull/77#discussion_r43585018","pull_request_url":"https://api.github.com/repos/vantas/tc1/pulls/77","_links":{"self":{"href":"https://api.github.com/repos/vantas/tc1/pulls/comments/43585018"},"html":{"href":"https://github.com/vantas/tc1/pull/77#discussion_r43585018"},"pull_request":{"href":"https://api.github.com/repos/vantas/tc1/pulls/77"}}},"pull_request":{"url":"https://api.github.com/repos/vantas/tc1/pulls/77","id":49375565,"html_url":"https://github.com/vantas/tc1/pull/77","diff_url":"https://github.com/vantas/tc1/pull/77.diff","patch_url":"https://github.com/vantas/tc1/pull/77.patch","issue_url":"https://api.github.com/repos/vantas/tc1/issues/77","number":77,"state":"open","locked":false,"title":"Add chap-ai text","user":{"login":"pedrovanzella","id":245602,"avatar_url":"https://avatars.githubusercontent.com/u/245602?v=3","gravatar_id":"","url":"https://api.github.com/users/pedrovanzella","html_url":"https://github.com/pedrovanzella","followers_url":"https://api.github.com/users/pedrovanzella/followers","following_url":"https://api.github.com/users/pedrovanzella/following{/other_user}","gists_url":"https://api.github.com/users/pedrovanzella/gists{/gist_id}","starred_url":"https://api.github.com/users/pedrovanzella/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pedrovanzella/subscriptions","organizations_url":"https://api.github.com/users/pedrovanzella/orgs","repos_url":"https://api.github.com/users/pedrovanzella/repos","events_url":"https://api.github.com/users/pedrovanzella/events{/privacy}","received_events_url":"https://api.github.com/users/pedrovanzella/received_events","type":"User","site_admin":false},"body":"\n\n<!-- Reviewable:start -->\n[<img src=\"https://reviewable.io/review_button.png\" height=40 alt=\"Review on Reviewable\"/>](https://reviewable.io/reviews/vantas/tc1/77)\n<!-- Reviewable:end -->\n","created_at":"2015-11-01T16:50:03Z","updated_at":"2015-11-01T17:36:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"484a4ffb214ae56b0b21c2fdede74b43fc6a6eba","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/vantas/tc1/pulls/77/commits","review_comments_url":"https://api.github.com/repos/vantas/tc1/pulls/77/comments","review_comment_url":"https://api.github.com/repos/vantas/tc1/pulls/comments{/number}","comments_url":"https://api.github.com/repos/vantas/tc1/issues/77/comments","statuses_url":"https://api.github.com/repos/vantas/tc1/statuses/d885894fd43e10dc2f4e55573f45e49061916af2","head":{"label":"pedrovanzella:master","ref":"master","sha":"d885894fd43e10dc2f4e55573f45e49061916af2","user":{"login":"pedrovanzella","id":245602,"avatar_url":"https://avatars.githubusercontent.com/u/245602?v=3","gravatar_id":"","url":"https://api.github.com/users/pedrovanzella","html_url":"https://github.com/pedrovanzella","followers_url":"https://api.github.com/users/pedrovanzella/followers","following_url":"https://api.github.com/users/pedrovanzella/following{/other_user}","gists_url":"https://api.github.com/users/pedrovanzella/gists{/gist_id}","starred_url":"https://api.github.com/users/pedrovanzella/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pedrovanzella/subscriptions","organizations_url":"https://api.github.com/users/pedrovanzella/orgs","repos_url":"https://api.github.com/users/pedrovanzella/repos","events_url":"https://api.github.com/users/pedrovanzella/events{/privacy}","received_events_url":"https://api.github.com/users/pedrovanzella/received_events","type":"User","site_admin":false},"repo":{"id":40843005,"name":"proposta-tc1","full_name":"pedrovanzella/proposta-tc1","owner":{"login":"pedrovanzella","id":245602,"avatar_url":"https://avatars.githubusercontent.com/u/245602?v=3","gravatar_id":"","url":"https://api.github.com/users/pedrovanzella","html_url":"https://github.com/pedrovanzella","followers_url":"https://api.github.com/users/pedrovanzella/followers","following_url":"https://api.github.com/users/pedrovanzella/following{/other_user}","gists_url":"https://api.github.com/users/pedrovanzella/gists{/gist_id}","starred_url":"https://api.github.com/users/pedrovanzella/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pedrovanzella/subscriptions","organizations_url":"https://api.github.com/users/pedrovanzella/orgs","repos_url":"https://api.github.com/users/pedrovanzella/repos","events_url":"https://api.github.com/users/pedrovanzella/events{/privacy}","received_events_url":"https://api.github.com/users/pedrovanzella/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/pedrovanzella/proposta-tc1","description":"","fork":true,"url":"https://api.github.com/repos/pedrovanzella/proposta-tc1","forks_url":"https://api.github.com/repos/pedrovanzella/proposta-tc1/forks","keys_url":"https://api.github.com/repos/pedrovanzella/proposta-tc1/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pedrovanzella/proposta-tc1/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pedrovanzella/proposta-tc1/teams","hooks_url":"https://api.github.com/repos/pedrovanzella/proposta-tc1/hooks","issue_events_url":"https://api.github.com/repos/pedrovanzella/proposta-tc1/issues/events{/number}","events_url":"https://api.github.com/repos/pedrovanzella/proposta-tc1/events","assignees_url":"https://api.github.com/repos/pedrovanzella/proposta-tc1/assignees{/user}","branches_url":"https://api.github.com/repos/pedrovanzella/proposta-tc1/branches{/branch}","tags_url":"https://api.github.com/repos/pedrovanzella/proposta-tc1/tags","blobs_url":"https://api.github.com/repos/pedrovanzella/proposta-tc1/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pedrovanzella/proposta-tc1/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pedrovanzella/proposta-tc1/git/refs{/sha}","trees_url":"https://api.github.com/repos/pedrovanzella/proposta-tc1/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pedrovanzella/proposta-tc1/statuses/{sha}","languages_url":"https://api.github.com/repos/pedrovanzella/proposta-tc1/languages","stargazers_url":"https://api.github.com/repos/pedrovanzella/proposta-tc1/stargazers","contributors_url":"https://api.github.com/repos/pedrovanzella/proposta-tc1/contributors","subscribers_url":"https://api.github.com/repos/pedrovanzella/proposta-tc1/subscribers","subscription_url":"https://api.github.com/repos/pedrovanzella/proposta-tc1/subscription","commits_url":"https://api.github.com/repos/pedrovanzella/proposta-tc1/commits{/sha}","git_commits_url":"https://api.github.com/repos/pedrovanzella/proposta-tc1/git/commits{/sha}","comments_url":"https://api.github.com/repos/pedrovanzella/proposta-tc1/comments{/number}","issue_comment_url":"https://api.github.com/repos/pedrovanzella/proposta-tc1/issues/comments{/number}","contents_url":"https://api.github.com/repos/pedrovanzella/proposta-tc1/contents/{+path}","compare_url":"https://api.github.com/repos/pedrovanzella/proposta-tc1/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pedrovanzella/proposta-tc1/merges","archive_url":"https://api.github.com/repos/pedrovanzella/proposta-tc1/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pedrovanzella/proposta-tc1/downloads","issues_url":"https://api.github.com/repos/pedrovanzella/proposta-tc1/issues{/number}","pulls_url":"https://api.github.com/repos/pedrovanzella/proposta-tc1/pulls{/number}","milestones_url":"https://api.github.com/repos/pedrovanzella/proposta-tc1/milestones{/number}","notifications_url":"https://api.github.com/repos/pedrovanzella/proposta-tc1/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pedrovanzella/proposta-tc1/labels{/name}","releases_url":"https://api.github.com/repos/pedrovanzella/proposta-tc1/releases{/id}","created_at":"2015-08-16T21:45:54Z","updated_at":"2015-11-01T16:49:07Z","pushed_at":"2015-11-01T16:49:06Z","git_url":"git://github.com/pedrovanzella/proposta-tc1.git","ssh_url":"git@github.com:pedrovanzella/proposta-tc1.git","clone_url":"https://github.com/pedrovanzella/proposta-tc1.git","svn_url":"https://github.com/pedrovanzella/proposta-tc1","homepage":null,"size":452,"stargazers_count":0,"watchers_count":0,"language":"TeX","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"vantas:master","ref":"master","sha":"e3e27a8471540848e156abaab02e7098dc35208a","user":{"login":"vantas","id":13756848,"avatar_url":"https://avatars.githubusercontent.com/u/13756848?v=3","gravatar_id":"","url":"https://api.github.com/users/vantas","html_url":"https://github.com/vantas","followers_url":"https://api.github.com/users/vantas/followers","following_url":"https://api.github.com/users/vantas/following{/other_user}","gists_url":"https://api.github.com/users/vantas/gists{/gist_id}","starred_url":"https://api.github.com/users/vantas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vantas/subscriptions","organizations_url":"https://api.github.com/users/vantas/orgs","repos_url":"https://api.github.com/users/vantas/repos","events_url":"https://api.github.com/users/vantas/events{/privacy}","received_events_url":"https://api.github.com/users/vantas/received_events","type":"Organization","site_admin":false},"repo":{"id":40820943,"name":"tc1","full_name":"vantas/tc1","owner":{"login":"vantas","id":13756848,"avatar_url":"https://avatars.githubusercontent.com/u/13756848?v=3","gravatar_id":"","url":"https://api.github.com/users/vantas","html_url":"https://github.com/vantas","followers_url":"https://api.github.com/users/vantas/followers","following_url":"https://api.github.com/users/vantas/following{/other_user}","gists_url":"https://api.github.com/users/vantas/gists{/gist_id}","starred_url":"https://api.github.com/users/vantas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vantas/subscriptions","organizations_url":"https://api.github.com/users/vantas/orgs","repos_url":"https://api.github.com/users/vantas/repos","events_url":"https://api.github.com/users/vantas/events{/privacy}","received_events_url":"https://api.github.com/users/vantas/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/vantas/tc1","description":"","fork":false,"url":"https://api.github.com/repos/vantas/tc1","forks_url":"https://api.github.com/repos/vantas/tc1/forks","keys_url":"https://api.github.com/repos/vantas/tc1/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vantas/tc1/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vantas/tc1/teams","hooks_url":"https://api.github.com/repos/vantas/tc1/hooks","issue_events_url":"https://api.github.com/repos/vantas/tc1/issues/events{/number}","events_url":"https://api.github.com/repos/vantas/tc1/events","assignees_url":"https://api.github.com/repos/vantas/tc1/assignees{/user}","branches_url":"https://api.github.com/repos/vantas/tc1/branches{/branch}","tags_url":"https://api.github.com/repos/vantas/tc1/tags","blobs_url":"https://api.github.com/repos/vantas/tc1/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vantas/tc1/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vantas/tc1/git/refs{/sha}","trees_url":"https://api.github.com/repos/vantas/tc1/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vantas/tc1/statuses/{sha}","languages_url":"https://api.github.com/repos/vantas/tc1/languages","stargazers_url":"https://api.github.com/repos/vantas/tc1/stargazers","contributors_url":"https://api.github.com/repos/vantas/tc1/contributors","subscribers_url":"https://api.github.com/repos/vantas/tc1/subscribers","subscription_url":"https://api.github.com/repos/vantas/tc1/subscription","commits_url":"https://api.github.com/repos/vantas/tc1/commits{/sha}","git_commits_url":"https://api.github.com/repos/vantas/tc1/git/commits{/sha}","comments_url":"https://api.github.com/repos/vantas/tc1/comments{/number}","issue_comment_url":"https://api.github.com/repos/vantas/tc1/issues/comments{/number}","contents_url":"https://api.github.com/repos/vantas/tc1/contents/{+path}","compare_url":"https://api.github.com/repos/vantas/tc1/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vantas/tc1/merges","archive_url":"https://api.github.com/repos/vantas/tc1/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vantas/tc1/downloads","issues_url":"https://api.github.com/repos/vantas/tc1/issues{/number}","pulls_url":"https://api.github.com/repos/vantas/tc1/pulls{/number}","milestones_url":"https://api.github.com/repos/vantas/tc1/milestones{/number}","notifications_url":"https://api.github.com/repos/vantas/tc1/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vantas/tc1/labels{/name}","releases_url":"https://api.github.com/repos/vantas/tc1/releases{/id}","created_at":"2015-08-16T13:59:29Z","updated_at":"2015-10-27T22:46:38Z","pushed_at":"2015-11-01T17:10:13Z","git_url":"git://github.com/vantas/tc1.git","ssh_url":"git@github.com:vantas/tc1.git","clone_url":"https://github.com/vantas/tc1.git","svn_url":"https://github.com/vantas/tc1","homepage":null,"size":828,"stargazers_count":0,"watchers_count":0,"language":"TeX","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":1,"forks":2,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/vantas/tc1/pulls/77"},"html":{"href":"https://github.com/vantas/tc1/pull/77"},"issue":{"href":"https://api.github.com/repos/vantas/tc1/issues/77"},"comments":{"href":"https://api.github.com/repos/vantas/tc1/issues/77/comments"},"review_comments":{"href":"https://api.github.com/repos/vantas/tc1/pulls/77/comments"},"review_comment":{"href":"https://api.github.com/repos/vantas/tc1/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/vantas/tc1/pulls/77/commits"},"statuses":{"href":"https://api.github.com/repos/vantas/tc1/statuses/d885894fd43e10dc2f4e55573f45e49061916af2"}}}}