Integrating Repast Library and Running RePast Examples using JBuilder X 07/19/2004 - PowerPoint PPT Presentation

1 / 24
About This Presentation
Title:

Integrating Repast Library and Running RePast Examples using JBuilder X 07/19/2004

Description:

Title: RePast Study Group at Iowa State University 06/28/2004 Author: Deddy Priatmodjo Koesrindartoto Last modified by: Mycomputer Created Date – PowerPoint PPT presentation

Number of Views:106
Avg rating:3.0/5.0
Slides: 25
Provided by: DeddyPria
Category:

less

Transcript and Presenter's Notes

Title: Integrating Repast Library and Running RePast Examples using JBuilder X 07/19/2004


1
Integrating Repast Library and Running RePast
Examples using JBuilder X07/19/2004
  • by
  • Deddy Koesrindartoto
  • Department of Economics
  • Iowa State University

2
Configuring RePast Library in Jbuilder X
  • To be able to be called in the program, we have
    to create references to RePast library.
  • After launching Jbuilder, choose Tools
    Configure Libraries (1) as shown in Fig. 1A.
    Configure Libraries dialog box, as in Fig. 1.B
    will appear. Select New button (2)
  • New Library Wizard as in Fig. 1.C will appear.
    Fill in Name and Location fields as shown (3).
    Then select Add to add this library to the
    JBuilderX (4).

Fig 1.A
(1)
(4)
(3)
Fig 1.B
Fig 1.C
3
Navigate through your file browser, and go to
RePast-2.2/lib directory, and select the
repast.jar file (1) and click the OK button (2).
The New Library Wizard will look like Fig.2.B,
then select the OK button (3). When Repast
library is successfully added in Jbuilder,
Configure Library dialog box will look like Fig.
2.C. Click OK to complete (4).
(1) select repast.jar file
(2)
RePast library is successfully added
Fig. 2.A
(4)
Fig. 2.B
Fig. 2.C
4
Download RePast source code examples
  • Navigate to the following link
  • http//www.courses.fas.harvard.edu/gov2015/Tutori
    al/
  • Choose and download the source code of any
    example you want in a working directory. Proceed
    with unzipping the files.

5
Running RePast examples using Jbuilder X IDE
After launching Jbuilder, select File Open
Project (1) as shown in Fig.3.A. It will bring up
to the Open Project or Project Group dialog box
as shown in Fig. 3.B. Navigate through your
file browser and select the working directory of
the example that you downloaded and unzipped
earlier and select the file with .jpx or .jpr
extension (2). (In this tutorial I select
GraphIPD.jar) Proceed by selecting OK button (3).
(1)
(2)
(3)
Fig. 3.A
Fig. 3.B
6
Fig 4.
7
Incorporating Repast-2.2 Library to a project
Errors are caused by an undefined library. To fix
this, click Project Project Properties from
the main menu (1)
Fig 5.
8
Select the Required Libraries folder (1). The
dialog box in Fig 6.A will show up. Select the
Repast-2.0 library (with red letters) (2) and
select Remove (3).
(1)
(4)
(3)
(5)
Fig 6.A.
(2)
The next step is to incorporate the RePast-2.2
library into this project. Click Add (4) button
in Fig 6.A. The dialog box as shown in Fig 6.B
will appear. Select RePast-2.2 library (we
defined earlier) (5), and click the OK button
(6). Once this process done, the error messages
shown in Fig 4. will disappear when the program
is compiled and run.
(6)
Fig 6.B.
9
Fig 7
10
To compile and run this program, select
ModelGUI.java (1) from the project pane click the
right Mouse button, and select Run using GraphIPD
(2). It will show the RePast standard GUI. An
explanation of how to use the RePast GUI can be
found in an earlier tutorial. (6/21/2004). It can
be downloaded at http//www.econ.iastate.edu/tes
fatsi/RePastTutorial.I.DK.ppt
11
Additional info on Jbuilder IDE
A complete tutorial on JBuilder X can be freely
downloaded as a zip file at (this file is
included in the commercial version but not in the
Foundation version). ftp//ftpc.borland.com/pub/j
builder/techpubs/jbuilderx/jbxpdfdocs_f.zip A
compact explanation of how to use Jbuilder ver.
9.0 can be seen at Prof. Andrew Rau-Chaplin of
Dalhousie University, Canada. http//www.cs.dal.c
a/arc/teaching/CS2110/Tutorials/introToJBuilderTu
torial.htm I found Learn Jbuilder by Charlie
Calvert and Margie Calvert, WordWare publishing,
2002, to be very easy to follow even for a
beginner. Get it cheap at http//addall.com
12
Gov 2015 Introduction to Computational Modeling
for Social Scientists
Most of these slides are taken from
  • http//www.courses.fas.harvard.edu/gov2015/
  • March 5, 2003
  • Lars-Erik Cederman

13
Iterated Prisoners Dilemma
  • Cohen, Riolo, and Axelrod. 1999. The Emergence
    of Social Organization in the Prisoner's Dilemma
    (SFI Working Paper 99-01-002)
  • http//www.santafe.edu/sfi/publications/99wplist.
    html
  • In The Evolution of Cooperation, Robert Axelrod
    (1984) created a computer tournament of IPD
  • cooperation sometimes emerges
  • Tit For Tat a particularly effective strategy

14
Prisoners Dilemma Game
  • Column
  • C D
  • C 3,3 0,5
  • Row
  • D 5,0 1,1

15
One-Step Memory Strategies
Strategy (i, p, q)
i prob. of cooperating at t 0 p prob.
of cooperating if opponent cooperated q
prob. of cooperating if opponent defected
C
p
Memory
C
D
q
C
D
D
t
t-1
16
The Four Strategies
17
TFT meets ALLD
Cumulated Payoff
p1 q0
0
1
1
1
3



i1
Row (TFT)
C
D
C
Column (ALLD)
D
i0
1
5
1
1
8



p0 q0
t
0
1
2
3
4
18
Payoffs for 4 x 4 Strategies
19
Soup-like topology
In each time period, a player interacts with
four other randomly selected players.
ALLC
ATFT
ALLD
ALLD
TFT
ALLC
TFT
20
Adaptation through imitation
Imitation
ATFT
ALLC
ALLD
ALLD
TFT
TFT?
ALLC
Neighbors at t
21
Setup()
buildModel()
step()
22
A Virtual Player
23
HW Add New Strategy
24
Next Week Get your hands dirty !!
Write a Comment
User Comments (0)
About PowerShow.com