{"id":21130640,"url":"https://github.com/choate-robotics/bayesiangame","last_synced_at":"2025-07-11T05:33:45.549Z","repository":{"id":117935098,"uuid":"183134327","full_name":"Choate-Robotics/BayesianGame","owner":"Choate-Robotics","description":"A computer challenge to test understanding of Bayesian updating.","archived":false,"fork":false,"pushed_at":"2019-04-29T16:34:06.000Z","size":130,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-21T06:11:32.577Z","etag":null,"topics":["bayesian-methods","processing","robotics-algorithms","robotics-programming"],"latest_commit_sha":null,"homepage":null,"language":"Processing","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Choate-Robotics.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-04-24T02:46:39.000Z","updated_at":"2019-04-29T16:34:07.000Z","dependencies_parsed_at":null,"dependency_job_id":"a30d7a12-6481-4b4e-ba02-ddf416fd0047","html_url":"https://github.com/Choate-Robotics/BayesianGame","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Choate-Robotics%2FBayesianGame","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Choate-Robotics%2FBayesianGame/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Choate-Robotics%2FBayesianGame/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Choate-Robotics%2FBayesianGame/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Choate-Robotics","download_url":"https://codeload.github.com/Choate-Robotics/BayesianGame/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243573495,"owners_count":20312883,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bayesian-methods","processing","robotics-algorithms","robotics-programming"],"created_at":"2024-11-20T05:36:01.696Z","updated_at":"2025-03-14T12:14:23.544Z","avatar_url":"https://github.com/Choate-Robotics.png","language":"Processing","funding_links":[],"categories":[],"sub_categories":[],"readme":"# BayesianGame\nProcessing sketches to simulate creating maps from noisy information channels.\n\nFor more information about how to succeed. **Click on the picture below to see a YouTube about how to make a Bayesian estimator**.\n\n[![Youtube Tutorial](https://img.youtube.com/vi/dHnxM7jMw6Y/0.jpg)](https://www.youtube.com/watch?v=dHnxM7jMw6Y)\n\nIn this Processing sketch, we create a Field that has a number randomly \npositioned boxes that may overlap. The Field is displayed on the left half\nof the display. There is also an MyMap object that is displayed on\nthe right hand side of the display. The MyMap object a grid that displays the\nlikelihood of there being an object in corresponding region of the Field.\nInitially the all areas of the MyMap object are set to a 20% chance of there\nbeing an object. There is a Sensor object that \nlooks at random positions in the Field and reports that it findings to the \nMyMap object by calling its ```update``` method. The\nSensor object is prone to error with the following issues:\n\n| Error type | Error strength|\n|------------|---------------|\n|Error on positive sighting| 20% of the time falsely reports nothing|\n|Error on negative sighting| 10% of the time falsely reports something|\n|Error on coordinates| Coordinates are wrong in both the x and y directions by a random error with standard deviation 5|\n\nUsing this information your challenge is to rewrite the ```update``` function within the ```MyMap``` class. **Do not change other files other than the MyMap \nfile, and you will likely only need to work within the ```update``` function. Though you can add more class variables and helper functions the MyMap class if you like. \n\nThe function currently there is the one that \ntakes the information raw and sets the corresponding part of the map to the \ninformation from the sensor. The code for that is given by:\n\n```\n void update(int myx, int myy, float value) {\n        \n    /* THIS IS WHERE YOU PUT CODE.\n    \n    update takes in an x coordinate,  a y coordinate, and a value that  \n     is either 0.0 or 1.0. Your job is to update the map array. The array \n     contains a triple array of boxes that represent square 12x12 regions of \n     the field. E.g. map[3][2][1] is the probability that there IS SOMETHING THERE \n     (because the third coordinate is 1) in the region defined by x coordinates\n     between 36 and 48 (because the first coordinate is 3) and y coordinates \n     between 24 and 36 (because the second coordinate is 2).\n    \n    \n\n     */\n\n    int newX, newY;\n\n    newX=myx/gridsize;\n    newY=myy/gridsize;\n    // If value=0 then 1-0 is 1, and 100 percent. \n    myMap[newX][newY][0]=(int)(1-value);\n    myMap[newX][newY][1]=(int)(value);\n  }\n  ```\n\n  DESCRIPTION OF VARIABLES IN ```MyMap```:\n    \n|Variable| Description|\n|--------|------------|\n|myx | the x-coordinate where the sensor has evaluated (prone to some error)|\n|myy | the x-coordinate where the sensor has evaluated (prone to some error)|\n|value | either 0 or 1. 0 means the sensor has not sensed a white object. 1 means it has.|\n|gridsize| the size of the squares that make up the map|\n|myWidth| the number of columns in the map.|\n|myHeight| the number of rows in the map.|\n|offx| a variable that is used to determine where to draw the map. *You should not need to use this variable.*|\n|offy| a variable that is used to determine where to draw the map. *You should not need to use this variable.*|\n\n  After three minutes of this code your map may look something like this.\n\n  \n\u003cimg src=\"https://github.com/Choate-Robotics/BayesianGame/blob/master/images/threeminuteraw.jpeg\" width=\"400\"\u003e\n\n  The goal is to use Bayesian updating to create a more faithful representation. For instance, one code that implemented a bayesian approach\n  was able to get these results after 3 minutes.\n\n\u003cimg src=\"https://github.com/Choate-Robotics/BayesianGame/blob/master/images/Threeminutebayesian.jpeg\" width=\"400\"\u003e\n  \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchoate-robotics%2Fbayesiangame","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchoate-robotics%2Fbayesiangame","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchoate-robotics%2Fbayesiangame/lists"}