{"action":"created","issue":{"url":"https://api.github.com/repos/chrsmith/bwapi/issues/291","labels_url":"https://api.github.com/repos/chrsmith/bwapi/issues/291/labels{/name}","comments_url":"https://api.github.com/repos/chrsmith/bwapi/issues/291/comments","events_url":"https://api.github.com/repos/chrsmith/bwapi/issues/291/events","html_url":"https://github.com/chrsmith/bwapi/issues/291","id":58649381,"number":291,"title":"Restart Game after end match (onEnd Event)","user":{"login":"GoogleCodeExporter","id":9614759,"avatar_url":"https://avatars.githubusercontent.com/u/9614759?v=3","gravatar_id":"","url":"https://api.github.com/users/GoogleCodeExporter","html_url":"https://github.com/GoogleCodeExporter","followers_url":"https://api.github.com/users/GoogleCodeExporter/followers","following_url":"https://api.github.com/users/GoogleCodeExporter/following{/other_user}","gists_url":"https://api.github.com/users/GoogleCodeExporter/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleCodeExporter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleCodeExporter/subscriptions","organizations_url":"https://api.github.com/users/GoogleCodeExporter/orgs","repos_url":"https://api.github.com/users/GoogleCodeExporter/repos","events_url":"https://api.github.com/users/GoogleCodeExporter/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleCodeExporter/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/chrsmith/bwapi/labels/auto-migrated","name":"auto-migrated","color":"ededed"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-02-23T21:14:35Z","updated_at":"2015-02-23T21:14:37Z","closed_at":"2015-02-23T21:14:35Z","body":"```\nWhat steps will reproduce the problem?\n1.Call restartGame in the onEnd Event...\n\nWhat is the expected output? What do you see instead?\nWant to run a Generic Algorithm, where I calculate fitness after end match and \nrestart it afterwards.\nExpected that the game would restart after calling restartGame in the onEnd \nevent.\nIt looks like it restart the game twice very fast and the second time it \ncrashes (see attached error file).\nIt should be possible to restart the game from code after the game ended right?\n\nWhat version of the product are you using? On what operating system?\nBWAPI 3.2Beta\nbwapi-mono-bridge 3.2b\nWindows 7 x64\nStarcraft 1.16.1\n\nPlease provide any additional information below.\nIf I try to restart the game atter for instance 120 Game frames, it works as it \nshould.\n```\n\n-----\nOriginal issue reported on code.google.com by `twsandb...@gmail.com` on 11 Nov 2010 at 1:55\n\nAttachments:\n* [RestartGameError.jpg](https://storage.googleapis.com/google-code-attachments/bwapi/issue-291/comment-0/RestartGameError.jpg)\n"},"comment":{"url":"https://api.github.com/repos/chrsmith/bwapi/issues/comments/75634668","html_url":"https://github.com/chrsmith/bwapi/issues/291#issuecomment-75634668","issue_url":"https://api.github.com/repos/chrsmith/bwapi/issues/291","id":75634668,"user":{"login":"GoogleCodeExporter","id":9614759,"avatar_url":"https://avatars.githubusercontent.com/u/9614759?v=3","gravatar_id":"","url":"https://api.github.com/users/GoogleCodeExporter","html_url":"https://github.com/GoogleCodeExporter","followers_url":"https://api.github.com/users/GoogleCodeExporter/followers","following_url":"https://api.github.com/users/GoogleCodeExporter/following{/other_user}","gists_url":"https://api.github.com/users/GoogleCodeExporter/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleCodeExporter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleCodeExporter/subscriptions","organizations_url":"https://api.github.com/users/GoogleCodeExporter/orgs","repos_url":"https://api.github.com/users/GoogleCodeExporter/repos","events_url":"https://api.github.com/users/GoogleCodeExporter/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleCodeExporter/received_events","type":"User","site_admin":false},"created_at":"2015-02-23T21:14:37Z","updated_at":"2015-02-23T21:14:37Z","body":"```\nI think I have found a solution that don't require any use of Files when \nrunning the GA. Of course it is still recommended to save the end result and \nfor safety some of the subresults (if the game should crash).\n\nThe solution that seems to work is to use the Example AI Client (that has it's \nown Main method) instead of the Example AI Module and use the bwapi.ini file to \nrestart the match as you suggested.\n\nIn the end of the while(true) loop I can do all the GA stuff like sorting \nfitness, mutate, crossover, saving and loading the results into the next run. \n\nI have tested it with a modification of the testbot combined with the \nClrAIModuleLoader in bwapi-mono-bridge 3.2B \n(http://code.google.com/p/bwapi-mono-bridge/downloads/detail?name=bwapi-mono-bri\ndge_3.2b.zip&can=2&q=) and I can save values in code between the runs without \nusing files.\n\nBut it still seems like there is a problem with the buiild in RestartGame \nfunction in BWAPI. The game will crash now and then, when using the method \noften. \n\n \n```\n\n-----\nOriginal comment by `twsandb...@gmail.com` on 15 Nov 2010 at 11:37"}}