Network models in NetLogo - Stanford...

23
Network models in NetLogo CS224W

Transcript of Network models in NetLogo - Stanford...

Page 1: Network models in NetLogo - Stanford Universitysnap.stanford.edu/class/cs224w-2015/slides/13-NetLogo.pdf · Why model with agents?!Agents are more cooperative and less expensive than

Network models in NetLogo

CS224W

Page 2: Network models in NetLogo - Stanford Universitysnap.stanford.edu/class/cs224w-2015/slides/13-NetLogo.pdf · Why model with agents?!Agents are more cooperative and less expensive than

Outline

¤Why model? Why with agents?

¤NetLogo: the Agent Based Modeling (ABM) language we will be using

¤ Issues in ABMs:¤ updating¤ robustness/sensitivity¤ reproducibility

Page 3: Network models in NetLogo - Stanford Universitysnap.stanford.edu/class/cs224w-2015/slides/13-NetLogo.pdf · Why model with agents?!Agents are more cooperative and less expensive than

Software: NetLogo

¤a language built specifically for agent based modeling

¤a modeling environment¤ interactively adjust parameters¤ feedback through plots & visualizations

Page 4: Network models in NetLogo - Stanford Universitysnap.stanford.edu/class/cs224w-2015/slides/13-NetLogo.pdf · Why model with agents?!Agents are more cooperative and less expensive than

What is a complex system?

¤A large population of interacting agents

¤No centralized control

¤Emergent global dynamics (e.g. coordination) from distributed interactions

Page 5: Network models in NetLogo - Stanford Universitysnap.stanford.edu/class/cs224w-2015/slides/13-NetLogo.pdf · Why model with agents?!Agents are more cooperative and less expensive than

Why model?

¤Gain understanding of system

¤Make predictions about what system will do when parameters reach yet-unseen values

¤Re-run the past

Page 6: Network models in NetLogo - Stanford Universitysnap.stanford.edu/class/cs224w-2015/slides/13-NetLogo.pdf · Why model with agents?!Agents are more cooperative and less expensive than

Why model with agents?

¤Agents are more cooperative and less expensive than human subjects J

¤Some systems cannot be solved analytically¤ or the interesting part is the path

dependence and not the average behavior

¤Flexibility:¤ different agent types, behaviors, constraints

Page 7: Network models in NetLogo - Stanford Universitysnap.stanford.edu/class/cs224w-2015/slides/13-NetLogo.pdf · Why model with agents?!Agents are more cooperative and less expensive than

Example: threads¤Colleague asks: why is the distribution of

replies per thread so skewed? Are some better than others? Or could it be random?

http://web.stanford.edu/class/cs224w/NetLogo/nonnetwork/threads.nlogo

Page 8: Network models in NetLogo - Stanford Universitysnap.stanford.edu/class/cs224w-2015/slides/13-NetLogo.pdf · Why model with agents?!Agents are more cooperative and less expensive than

Example: segregation

In models library

Page 9: Network models in NetLogo - Stanford Universitysnap.stanford.edu/class/cs224w-2015/slides/13-NetLogo.pdf · Why model with agents?!Agents are more cooperative and less expensive than

Example: standing ovation

http://web.stanford.edu/class/cs224w/NetLogo/nonnetwork/StandingOvation2.nlogo

Page 10: Network models in NetLogo - Stanford Universitysnap.stanford.edu/class/cs224w-2015/slides/13-NetLogo.pdf · Why model with agents?!Agents are more cooperative and less expensive than

model types

¤deterministic

¤stochastic (contain randomness)

¤evolving

Page 11: Network models in NetLogo - Stanford Universitysnap.stanford.edu/class/cs224w-2015/slides/13-NetLogo.pdf · Why model with agents?!Agents are more cooperative and less expensive than

Deterministic: flocking

In model library

Page 12: Network models in NetLogo - Stanford Universitysnap.stanford.edu/class/cs224w-2015/slides/13-NetLogo.pdf · Why model with agents?!Agents are more cooperative and less expensive than

Stochastic: network growth

http://web.stanford.edu/class/cs224w/NetLogo/RAndPrefAttachment.nlogo

Page 13: Network models in NetLogo - Stanford Universitysnap.stanford.edu/class/cs224w-2015/slides/13-NetLogo.pdf · Why model with agents?!Agents are more cooperative and less expensive than

Stochastic: termites

In models library

Page 14: Network models in NetLogo - Stanford Universitysnap.stanford.edu/class/cs224w-2015/slides/13-NetLogo.pdf · Why model with agents?!Agents are more cooperative and less expensive than

stochastic: cow cooperation

In models library

Page 15: Network models in NetLogo - Stanford Universitysnap.stanford.edu/class/cs224w-2015/slides/13-NetLogo.pdf · Why model with agents?!Agents are more cooperative and less expensive than

Evolving: genetic algorithms

In models library: simple genetic algorithms

Page 16: Network models in NetLogo - Stanford Universitysnap.stanford.edu/class/cs224w-2015/slides/13-NetLogo.pdf · Why model with agents?!Agents are more cooperative and less expensive than

What is a model?

¤A simplified mathematical representation of a system.

¤Only include features essential to explaining phenomenon of interest

Page 17: Network models in NetLogo - Stanford Universitysnap.stanford.edu/class/cs224w-2015/slides/13-NetLogo.pdf · Why model with agents?!Agents are more cooperative and less expensive than

Modeling vs. simulation

¤simulation: add detail to make the simulation as realistic as possible

¤model: simplify as much as possible to glean essential behavior of system

Page 18: Network models in NetLogo - Stanford Universitysnap.stanford.edu/class/cs224w-2015/slides/13-NetLogo.pdf · Why model with agents?!Agents are more cooperative and less expensive than

example of simulation: Episims

Page 19: Network models in NetLogo - Stanford Universitysnap.stanford.edu/class/cs224w-2015/slides/13-NetLogo.pdf · Why model with agents?!Agents are more cooperative and less expensive than
Page 20: Network models in NetLogo - Stanford Universitysnap.stanford.edu/class/cs224w-2015/slides/13-NetLogo.pdf · Why model with agents?!Agents are more cooperative and less expensive than

Using Episims to model a smallpox outbreak in Portland, OR

Page 21: Network models in NetLogo - Stanford Universitysnap.stanford.edu/class/cs224w-2015/slides/13-NetLogo.pdf · Why model with agents?!Agents are more cooperative and less expensive than

What a model in NetLogo looks like

Page 22: Network models in NetLogo - Stanford Universitysnap.stanford.edu/class/cs224w-2015/slides/13-NetLogo.pdf · Why model with agents?!Agents are more cooperative and less expensive than

other example applications

¤urban models

¤opinion dynamics

¤consumer behavior¤ network effects and lock-in¤ market for lemons

¤networks of firms

¤ supply chain management

¤electricity markets

Page 23: Network models in NetLogo - Stanford Universitysnap.stanford.edu/class/cs224w-2015/slides/13-NetLogo.pdf · Why model with agents?!Agents are more cooperative and less expensive than

wrap up

¤complex networks are complex systems

¤modeling lets you get to the heart of the matter (or the complex system) cheaply

¤you specify simple micro rules and gain an understanding of the target macro behavior