I’d spent two weeks on Netlogo Manual and a tutorial on youtube before I wrote this program. Netlogo is a good agent based simulation platform while its math calculation ability is poor which can be compensated by R-extension.

This program is to simulate the video recommendation on Video sites such as Youtube. It’s only a simple fram and a lot need to be done after this.

And here is the process:
input:
m users, n videos
p[x, y]means the user y’s inclination to video x
all the users accept a video at possibility a

first module:
create a list R containing the top ten videos for user x
all the users x accept R video at possibility a
output popularity of each video, print

second module:
modify the watched videos of a user’s p[x, y] to 0
recommend again
output Pi of each video, print

repeat second module

Netlogo has a terrific visualization and allows us to monitor the process conveniently. You can see how many videos has an user watched and how many times has a video be watched. A link will emergy from the user to the video he choose to watch. And note that the color of a video can also suggest its popularity. 🙂