Question: Agent Based Modelling in python. All instructions are in the pictures themselves. Please also add comment were comment are needed. Please help me with the

Agent Based Modelling in python. All instructions are in the pictures themselves. Please also add comment were comment are needed.Agent Based Modelling in python. All instructions are in the pictures themselves.Please also add comment were comment are needed.Please help me with thecode. Most of it is just filling in comments which is whati understand. Really need help with the coding aspect mostly The 2DSchelling Model For this part of the assignment, you're going to workon an implementation of a simple version of the 2D Schelling model.Two kinds of polygons (triangles and squares) are living on a 2-dimensionalgrid. You're essentially going to be coding up a version of theParable of Polyogons that you've reviewed previously. To run this model, you'llset it up and solve it as follows Create a 2D Numpyarray that is 20x20 cells. In this implementation, the number 0 willrepresent an empty cell, 1 will represent a triangle, and 2 willrepresent a square. Initialize the array with approximately 1/3 empty cells, 1/3Please help me with the code. Most of it is just filling in comments which is what i understand. Really need help with the coding aspect mostly

The 2D Schelling Model For this part of the assignment, you're going to work on an implementation of a simple version of the 2D Schelling model. Two kinds of polygons (triangles and squares) are living on a 2-dimensional grid. You're essentially going to be coding up a version of the Parable of Polyogons that you've reviewed previously. To run this model, you'll set it up and solve it as follows Create a 2D Numpy array that is 20x20 cells. In this implementation, the number 0 will represent an empty cell, 1 will represent a triangle, and 2 will represent a square. Initialize the array with approximately 1/3 empty cells, 1/3 triangles, and 1/3 squares, with each cell having a random chance of being one of these options. Then, evolve this model using the following rules: A polygon's neighbors are the polygons in any cell that is adjacent to i. This could be either a Moore neighborhood (left/right/up/down and the diagonals) or a von Neumann neighborhood Gust left/right/up/down). .A polygon is happy if at least 1/3 of its neighbors are like it A polygon is considered to be segregated if all of its neighbors are like it, or if it has no neighbors. The board is evolved by randomly selecting a single unhappy polygon and moving it to a random empty cell. This continues until every polygon is happy. The level of segregation of the board is tracked with each step Before you start coding Before you dive into the coding part of this assignment, you might want to spend some time thinking about how you world set up this problem and attempt to solve it. Coming up with a plan before you start trying to turn your thoughts into code can help to make your coding more productive. The 2D Schelling Model For this part of the assignment, you're going to work on an implementation of a simple version of the 2D Schelling model. Two kinds of polygons (triangles and squares) are living on a 2-dimensional grid. You're essentially going to be coding up a version of the Parable of Polyogons that you've reviewed previously. To run this model, you'll set it up and solve it as follows Create a 2D Numpy array that is 20x20 cells. In this implementation, the number 0 will represent an empty cell, 1 will represent a triangle, and 2 will represent a square. Initialize the array with approximately 1/3 empty cells, 1/3 triangles, and 1/3 squares, with each cell having a random chance of being one of these options. Then, evolve this model using the following rules: A polygon's neighbors are the polygons in any cell that is adjacent to i. This could be either a Moore neighborhood (left/right/up/down and the diagonals) or a von Neumann neighborhood Gust left/right/up/down). .A polygon is happy if at least 1/3 of its neighbors are like it A polygon is considered to be segregated if all of its neighbors are like it, or if it has no neighbors. The board is evolved by randomly selecting a single unhappy polygon and moving it to a random empty cell. This continues until every polygon is happy. The level of segregation of the board is tracked with each step Before you start coding Before you dive into the coding part of this assignment, you might want to spend some time thinking about how you world set up this problem and attempt to solve it. Coming up with a plan before you start trying to turn your thoughts into code can help to make your coding more productive

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!