{"action":"opened","issue":{"url":"https://api.github.com/repos/CSC591-MASE/x9115YSS/issues/12","labels_url":"https://api.github.com/repos/CSC591-MASE/x9115YSS/issues/12/labels{/name}","comments_url":"https://api.github.com/repos/CSC591-MASE/x9115YSS/issues/12/comments","events_url":"https://api.github.com/repos/CSC591-MASE/x9115YSS/issues/12/events","html_url":"https://github.com/CSC591-MASE/x9115YSS/issues/12","id":108738246,"number":12,"title":"HW4","user":{"login":"rahlk","id":1433964,"avatar_url":"https://avatars.githubusercontent.com/u/1433964?v=3","gravatar_id":"","url":"https://api.github.com/users/rahlk","html_url":"https://github.com/rahlk","followers_url":"https://api.github.com/users/rahlk/followers","following_url":"https://api.github.com/users/rahlk/following{/other_user}","gists_url":"https://api.github.com/users/rahlk/gists{/gist_id}","starred_url":"https://api.github.com/users/rahlk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rahlk/subscriptions","organizations_url":"https://api.github.com/users/rahlk/orgs","repos_url":"https://api.github.com/users/rahlk/repos","events_url":"https://api.github.com/users/rahlk/events{/privacy}","received_events_url":"https://api.github.com/users/rahlk/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-09-28T20:18:37Z","updated_at":"2015-09-28T20:18:37Z","closed_at":null,"body":"Your neighbor function is incorrect. In [Line 78](https://github.com/CSC591-MASE/x9115YSS/blob/master/hw/code/4/Schaffer.py#L78), you call the neighbor function. And in [Line \r\n15](https://github.com/CSC591-MASE/x9115YSS/blob/master/hw/code/4/Schaffer.py#L15), you use `random.random()`. Note that `random.random()` only generates values between 0 and 1. We need values between x_min and x_max. I'd rather you use `random.uniform(x_min,x_max)`. \r\n\r\nOr, you may also use the current soultion to generate it's neighbor. For instance,\r\n``` python\r\ndef neigh(x,xmax=1e-5,xmin=1e+5):\r\n  rad = min(x-xmin, xmax-x)\r\n  return random.uniform(x-rad,x+rad)\r\n```\r\n"}}