NetLogo - PowerPoint PPT Presentation

About This Presentation
Title:

NetLogo

Description:

... development at the Center for Connected Learning and Computer-Based Modeling. More Information ... to move-to-empty-one-of. end. to update-plots. end. to ... – PowerPoint PPT presentation

Number of Views:837
Avg rating:3.0/5.0
Slides: 35
Provided by: valued210
Category:

less

Transcript and Presenter's Notes

Title: NetLogo


1
NetLogo
  • Uri Wilensky
  • Tutorial by Bin-Tzong Chie
  • AI-Econ Research Center, National Chengchi
    University
  • Department of Industrial Economics, Tamkang
    University

2
Outline
  • Introduction
  • Build a Model
  • Applets
  • HubNet

3
NetLogo
  • NetLogo is a programmable modeling environment
    for simulating natural and social phenomena. It
    was authored by Uri Wilensky in 1999 and is in
    continuous development at the Center for
    Connected Learning and Computer-Based Modeling.
  • More Information
  • http//ccl.northwestern.edu/netlogo/docs/

4
Download and Install
  • http//ccl.northwestern.edu/netlogo/

5
Initial the NetLogo
6
Exemplify a Model
7
Example of El Farol Problem
8
Three Main Tabs of a Model
  • Interface Tab
  • Information Tab
  • Procedure Tab

9
Interface Tab
World
The Interface
10
The World Setting
11
Information Tab
12
Procedure Tab
13
Initial the Model
14
Run the Model
15
How does the Model work?
  • Global Variables
  • Agents Variables
  • Defined Procedures
  • Linked with Interface
  • Sub procedure
  • Without return values
  • With return values

16
Global Variables
  • globals
  • attendance the current attendance at
    the bar
  • history list of past values of
    attendance
  • home-patches agentset of green patches
  • bar-patches agentset of blue patches
  • crowded-patch patch where we show the
    "CROWDED" label

17
Agents Variables
  • turtles-own
  • strategies list of strategies
  • best-strategy index of the current best
    strategy
  • attend? true if the agent currently
    plans to attend the bar
  • prediction current prediction of the
    bar attendance

18
Procedures Linked with Interface
  • to setup
  • ...
  • ...
  • end
  • to go
  • ...
  • ...
  • end

Event Trigger
19
Procedures as Sub-Procedureswithout return values
  • to move-to-empty-one-of
  • ...
  • end
  • to update-plots
  • ...
  • end
  • to update-strategies
  • ...
  • end

20
Procedures as Sub-Procedures with return values
  • to-report predict-attendance
  • ...
  • report ...
  • end
  • to-report random-strategy
  • ...
  • report ...
  • end

21
Lets Play
22
Instance Interactive with the agents
23
(No Transcript)
24
(No Transcript)
25
(No Transcript)
26
Stalk an Agent
27
Save as Applet
28
HubNet
29
(No Transcript)
30
(No Transcript)
31
How to apply HubNet
  • to startup
  • setup
  • hubnet-set-client-interface "COMPUTER"
  • hubnet-reset
  • end
  • to go
  • every 0.1
  • listen-clients
  • display
  • end

32
to listen-clients
  • to listen-clients
  • as long as there are more messages from the
    clients
  • keep processing them.
  • while hubnet-message-waiting?
  • get the first message in the queue
  • hubnet-fetch-message
  • ifelse hubnet-enter-message? when clients
    enter we get a special message
  • create-new-student
  • ifelse hubnet-exit-message? when clients
    exit we get a special message
  • remove-student
  • ask students with user-id
    hubnet-message-source
  • execute-command hubnet-message-tag
    otherwise the message means that the user has

  • done something in the interface
    hubnet-message-tag

  • is the name of the widget that was changed
  • end

33
HubNet Client Editor
34
Do you want to go to the Bar
Write a Comment
User Comments (0)
About PowerShow.com