jmbejara / comp-econ-sp18

Main Course Repository for Computational Methods in Economics (Econ 21410, Spring 2018)
16 stars 23 forks source link

Schelling's Segregation Model Q2 #16

Closed afgong closed 6 years ago

afgong commented 6 years ago

When the question asks us to "describe what is surprising about the outcome of this simulation", should we be giving our personal reactions to the outcome?

jmbejara commented 6 years ago

I suppose what I'm looking for is a summary of what the model can teach us. I think that a lot of people found the model compelling because the result didn't match up with their prior expectations. I'm looking for you try to describe why this might be the case.

afgong commented 6 years ago

This is an intuitive question about interpreting Schelling's model, but could we say that after running the cycles, the agents reach the steady state when they no longer wish to move anymore?

jmbejara commented 6 years ago

Yeah! You could think of it that way if you think the process as describing the dynamics of households over time. Also, you could also think about this process as an algorithm to find an equilibrium solution of a static game. Then you would call this "one particular equilibrium outcome." The notion of equilibrium would be that everybody is happy with their location and nobody has any incentive to move, holding everybody else's decisions fixed (think, Nash equilibrium).

afgong commented 6 years ago

For #5, since we're adding a third agent to the model, among the blocks that we should modify, should we definitely modify the def get_distance(self, other): block?

This is what I have currently because I am trying to compute the distance between the three agents, but I'm not sure if it's correct, since the code isn't running correctly.

def get_distance(self, other): "Computes euclidean distance between self and other agent." a = (self.location[0] - other.location[0])**2 b = (self.location[1] - other.location[1])**2 c = (self.location[2] - other.location[2])**2 return sqrt(a + b) return sqrt(b + c) return sqrt(a + c)

jmbejara commented 6 years ago

I don't think you need to edit the get_distance method. This merely computes the distance between one agent and another. This concept doesn't change when you go to three types.