Wednesday, February 27, 2013

Evolutionary Dynamics

Replicator Dynamics are a math formula meant to simplify the dynamics of evolution. But, we can code, we don't have to simplify.

In this video I show how to simulate simple evolutionary dynamics with more detail than before. The program, it turns out, is simpler than before.

Tuesday, February 26, 2013

Replicator Dynamics Implementation

In tomorrow's lecture I will be talking about replicator dynamics in games. The video below shows you how to implement it:

Saturday, February 23, 2013

Fictitious Play

Next week we will finish with cooperative games and start with 'learning in games'.

Fictitious play is very easy and fun to implement in NetLogo. See how in this video:

Thursday, February 21, 2013

Preferential Attachement Graphs and Stochastic Choice

I noticed in the last homework that some of you had problems getting a preferential attachment graph to work, or making stochastic choice. The video below shows how to do this. This will also be useful for HW3.

The code I wrote in that video is prefattachvideo.nlogo.

Wednesday, February 20, 2013

HW3: Stability in Cooperative Games

We have discussed cooperative games, the core, the nucleolus, and excess. For this homework you will implement a simulation of agents participating in a cooperative game and acting selfishly to join their preferred coalition. The simulation will show how long it takes for the system to achieve a stable solution where no one agent has an excess.

Specifically, your simulation will have number-agents agents, all of which start out in their own coalition, that is, alone.

An agent can have any one of the colors: red, blue, black, green, cyan
An agent can have any one of the shapes: circle, square, triangle

These are assigned randomly on setup.

The value function v(S) is defined as: the number of different colors in the coalition + 3 - number of different shapes - (size of the coalition / 2).

Each time the 'go' button is pressed each agent will: check the value of the coalition where he joins one of the other existing coalitions, for all other coalitions. Of these, he finds the one with the highest value. If that value is bigger than the value of his current coalition then he will leave his current coalition and join the new one. In other words, each agent asks himself: "what would the value be if I joined this other coalition? what about this one? and this one? and so on to find the biggest value. If that value is bigger than his current coalition then he joins that coalition. If the biggest value is less than the value of his current coalition, the agent does not do anything.

The coalitions are represented as fully-connected graphs. That is, an agent has a link to all the other agents in his coalition, and to no one else.

You will then plot the number of agents that change coalition on each tick, the total number of coalitions over time, and a histogram of the current size of coalitions.

Anyway, all this is easier to see in a video:

Email me your finished program by Monday, March 11 @10am.

Tuesday, February 12, 2013

Spatial Prisoner's Dilemma

In the video below I show how to implement the Spatial Prisoner's Dilemma in NetLogo. This game, and variations of it, is often studied as it is a good model of how 'traits' might move through a population. Note that the 'space' need not be physical: it could be a social network (where the space is how close people are to each other), a computer network (hops), etc.

Game Theory Famous Games

There are certain 2-player games that come up a lot in the real world and have thus been much studied. They are:

The Prisoner's Dilemma:

The Battle of the Sexes:

The Pig and the Piglet:

Monday, February 11, 2013

Stanford Game Theory Course

If you don't like my lectures you can also take the Stanford Game Theory class offered free by Coursera and taught by some of the same guys that wrote the other Multiagent Systems textbook, Shoham and Leyton-Brown. I have watched many of their video lectures and they seem to cover pretty much the same material we will be covering in this section of the class.

I also found this youtube playlist which has all the videos from the class.

Game Theory Solution Concepts

What is the 'correct' solution to a strategic-form game? Well, there are many viable solution concepts.

There is the Pareto Optimal solution (aka 'efficient')

There is the social welfare solution:

There is the maxmin strategy:

And, there is everyone's favorite, the Nash equilibrium:

Game Theory

This week we start our discussion of Game Theory. Here is a quick intro:

Monday, February 4, 2013

Distributed Constraint Optimization

In today's class I will finish explaining how distributed breakout works, and we will probably also cover Distributed Constraint Optimization (DCOP)

Most of the DCOP algorithms are improvements (or parallelizations, if that's a word) on the basic branch-and-bound search algorithm, which I implement below: