{"action":"created","issue":{"url":"https://api.github.com/repos/jmmcd/PonyGE2/issues/67","repository_url":"https://api.github.com/repos/jmmcd/PonyGE2","labels_url":"https://api.github.com/repos/jmmcd/PonyGE2/issues/67/labels{/name}","comments_url":"https://api.github.com/repos/jmmcd/PonyGE2/issues/67/comments","events_url":"https://api.github.com/repos/jmmcd/PonyGE2/issues/67/events","html_url":"https://github.com/jmmcd/PonyGE2/issues/67","id":235620612,"number":67,"title":"NSGA-II implementation has a few loose ends","user":{"login":"mikefenton","id":6707266,"avatar_url":"https://avatars3.githubusercontent.com/u/6707266?v=3","gravatar_id":"","url":"https://api.github.com/users/mikefenton","html_url":"https://github.com/mikefenton","followers_url":"https://api.github.com/users/mikefenton/followers","following_url":"https://api.github.com/users/mikefenton/following{/other_user}","gists_url":"https://api.github.com/users/mikefenton/gists{/gist_id}","starred_url":"https://api.github.com/users/mikefenton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikefenton/subscriptions","organizations_url":"https://api.github.com/users/mikefenton/orgs","repos_url":"https://api.github.com/users/mikefenton/repos","events_url":"https://api.github.com/users/mikefenton/events{/privacy}","received_events_url":"https://api.github.com/users/mikefenton/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-06-13T16:56:07Z","updated_at":"2017-06-13T17:28:47Z","closed_at":null,"body":"The latest commit (https://github.com/jmmcd/PonyGE2/commit/a3bc8c12cb3b2db11abb0cdfc4cca058e6deb30f) has NSGA-II implemented, adapted from Luiz's code (https://github.com/luizvbo/PonyGE2). All seems to be mostly in order, but there are a few loose ends/issues that need attention (in order of most to least important):\r\n\r\n1. Luiz's implementation of multi-objective fitness functions is very cool in that it can re-use existing single-objective fitness functions through inheritance. However, this presents an issue: the default fitness for these multi objective fitness functions is the default fitness of the super class, which is a single objective. I'm not sure if we can set the default fitness for the multi-objective fitness function class without over-writing the default fitness of the super class. If we over-write the default fitness for the super class, then we will get errors as the super class was designed for a single objective, and has checks to that extent. If we could separate the default fitness from the super class and the default fitness from the actual MOO fitness function class, then all would be fine.\r\n\r\nMinimum working example code that shows what the problem is:\r\n\r\n    class c1:\r\n        def __init__(self):\r\n            self.test = \"One\"\r\n        \r\n        def __call__(self):\r\n            print(\"Original test is\", self.test)\r\n        \r\n    class c2(c1):\r\n        def __init__(self):\r\n            super().__init__()\r\n            self.test = \"Two\"\r\n    \r\n        def __call__(self):\r\n            print(\"New test is\", self.test)\r\n            super().__call__()\r\n\r\nNow we test the code out...\r\n\r\n    a = c1()\r\n    a()\r\n> `Original test is One`\r\n\r\n    b = c2()\r\n    b()\r\n> `New test is Two`\r\n> `Original test is Two`\r\n\r\nIn the above case, we would like the call to `b()` to output:\r\n> `New test is Two`\r\n> `Original test is One`\r\n\r\nDoes anyone know how this can be accomplished without having to change the implementation of class `c1` above? If it can't, then we probably can't inherit from other fitness function classes, and will have to write specific MOO fitness functions for specific MOO problems. \r\n\r\n2. Stats are slightly different with MOO problems. Obviously with MOO problems there is no \"best\" individual, so instead the first pareto front is stored as the \"best\" solution. Printing of best solutions results in the printing of info about the first pareto front, which is grand I suppose. However, I haven't optimised any of the existing file saving stuff yet for NSGA-II, i.e. the stats file and \"best.txt\" file. For saving a front of individuals, I will change the code to save an different file for each individual on the front (current it just dumps everything into one file which isn't great).\r\n\r\n3. We may need to have a brainstorm on visualisation of pareto fronts. For single objective optimisation, we save a graph of best fitness vs generations. How should we do this with pareto fronts? We could save an individual pdf of the first front at each generation (could get hefty), or we could try to represent all generations of the first front on a single 3D graph (this will only work for 2 objectives). Suggestions welcome."},"comment":{"url":"https://api.github.com/repos/jmmcd/PonyGE2/issues/comments/308189980","html_url":"https://github.com/jmmcd/PonyGE2/issues/67#issuecomment-308189980","issue_url":"https://api.github.com/repos/jmmcd/PonyGE2/issues/67","id":308189980,"user":{"login":"t-h-e","id":999552,"avatar_url":"https://avatars2.githubusercontent.com/u/999552?v=3","gravatar_id":"","url":"https://api.github.com/users/t-h-e","html_url":"https://github.com/t-h-e","followers_url":"https://api.github.com/users/t-h-e/followers","following_url":"https://api.github.com/users/t-h-e/following{/other_user}","gists_url":"https://api.github.com/users/t-h-e/gists{/gist_id}","starred_url":"https://api.github.com/users/t-h-e/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/t-h-e/subscriptions","organizations_url":"https://api.github.com/users/t-h-e/orgs","repos_url":"https://api.github.com/users/t-h-e/repos","events_url":"https://api.github.com/users/t-h-e/events{/privacy}","received_events_url":"https://api.github.com/users/t-h-e/received_events","type":"User","site_admin":false},"created_at":"2017-06-13T17:28:47Z","updated_at":"2017-06-13T17:28:47Z","body":"@mikefenton you might want to define the variables as class variables rather than as instance variables\r\n\r\n```\r\nclass c1:\r\n    test = 'One'\r\n    def __init__(self):\r\n        pass\r\n\r\n    def __call__(self):\r\n        print(\"Original test is\", c1.test)\r\n\r\n\r\nclass c2(c1):\r\n    test = 'Two'\r\n    def __init__(self):\r\n        super().__init__()\r\n\r\n    def __call__(self):\r\n        print(\"New test is\", c2.test)\r\n        super().__call__()\r\n```\r\n```\r\na = c1()\r\na()\r\n```\r\n\r\n> Original test is One\r\n\r\n```\r\nb = c2()\r\nb()\r\n```\r\n\r\n> New test is Two\r\n> Original test is One"}}
{"actor":{"display_login":"t-h-e"}}