1 setting up for repast, and running a repast stand alone example 06/21/2004 by deddy koesrindartoto...

16
1 Setting Up for RePast, and Running a Repast Stand Alone Example 06/21/2004 by Deddy Koesrindartoto Department of Economics Iowa State University

Upload: erick-riley

Post on 14-Dec-2015

219 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 1 Setting Up for RePast, and Running a Repast Stand Alone Example 06/21/2004 by Deddy Koesrindartoto Department of Economics Iowa State University

1

Setting Up for RePast, and Running a Repast Stand Alone Example

06/21/2004

by

Deddy Koesrindartoto

Department of Economics Iowa State University

Page 2: 1 Setting Up for RePast, and Running a Repast Stand Alone Example 06/21/2004 by Deddy Koesrindartoto Department of Economics Iowa State University

2

BASIC SETUP : Requirements, Software, and Setup Process

Systems requirements: • Windows• Intel Pentium III/800 MHz or higher (or compatible)• Microsoft Windows 2003/XP/2000/NT 4.0 SP6a• Linux• Intel Pentium III/800 MHz or higher (or compatible)• Red Hat Linux Fedora/9.x/8.x (Debian, SuSe, Mandrake, Slackware, Gentoo • and other distributions with JDK 1.4.2 should also work)• GNOME or KDE desktop• MacOS X• 1 GHz G4, G5 recommended• Mac OS X 10.3 (Panther)

Software sufficient to use Repast library:– Java SDK 1.4.*– Java IDE : JBuilder or Eclipse – Repast

Page 3: 1 Setting Up for RePast, and Running a Repast Stand Alone Example 06/21/2004 by Deddy Koesrindartoto Department of Economics Iowa State University

3Obtaining Java SDK

Download java SDK http://java.sun.com/j2se/1.4.2/download.html

Page 4: 1 Setting Up for RePast, and Running a Repast Stand Alone Example 06/21/2004 by Deddy Koesrindartoto Department of Economics Iowa State University

4

Obtaining JAVA IDE : JBUILDER X FoundationGo to : http://www.borland.com/products/downloads/download_jbuilder.html

Page 5: 1 Setting Up for RePast, and Running a Repast Stand Alone Example 06/21/2004 by Deddy Koesrindartoto Department of Economics Iowa State University

5

Obtaining JAVA IDE : Eclipse• Information about eclipse can be found at : http://eclipse.org• To download eclipse IDE, go to http://www.eclipse.org/downloads/index.php

Page 6: 1 Setting Up for RePast, and Running a Repast Stand Alone Example 06/21/2004 by Deddy Koesrindartoto Department of Economics Iowa State University

6

Obtaining Repast … (1)• Information about RePast can be found at : http://repast.sourceforge.net/

Page 7: 1 Setting Up for RePast, and Running a Repast Stand Alone Example 06/21/2004 by Deddy Koesrindartoto Department of Economics Iowa State University

7

Obtaining Repast … (2)

Page 8: 1 Setting Up for RePast, and Running a Repast Stand Alone Example 06/21/2004 by Deddy Koesrindartoto Department of Economics Iowa State University

8

How to run the Repast example program• To run repast, click the repast.jar file at the assigned directory: …repast-2.20\lib\repast.jar

Page 9: 1 Setting Up for RePast, and Running a Repast Stand Alone Example 06/21/2004 by Deddy Koesrindartoto Department of Economics Iowa State University

9

Load Model Start Step Initialize Stop Pause Setup Exit

Load Model: pops up a dialog allowing the user to choose any model .Start: starts the simulation, or continues the simulation after pause button is pressed. Step: runs the simulation through a single iteration /loop of the scheduled behavior or activities.Initialize : executes only initializing code.Stop : stops the simulation.Pause : pauses the simulation.Setup : executes the user defined setup code. Only can be accessed after the simulations is stopped by stop button. Usually used for changing some parameters.

The following main GUI will be shown:

Page 10: 1 Setting Up for RePast, and Running a Repast Stand Alone Example 06/21/2004 by Deddy Koesrindartoto Department of Economics Iowa State University

10

Running Repast Example

Select any model and click the Load button (1). Note: The directory of any necessary file related to the model (config, data, etc) can be assigned here (2).

To load particular model, click the Load Model button from the main GUI (see slide # 9, first button). This will show :

(2)

(1)

Page 11: 1 Setting Up for RePast, and Running a Repast Stand Alone Example 06/21/2004 by Deddy Koesrindartoto Department of Economics Iowa State University

11

Running Repast Example (contd.)

• Once loading process is done, (for example choose SugarScape model) , main GUI appears with SugarSpace tag:

• GUI for model setting is also shown. The following show different GUI for different settings folders : Parameters (default view), Repast Actions, and Custom Actions

Page 12: 1 Setting Up for RePast, and Running a Repast Stand Alone Example 06/21/2004 by Deddy Koesrindartoto Department of Economics Iowa State University

12

Make a Movie

• Repast Actions Folder : Creating a movie

• From Repast Actions folder (slide # 11, picture in the middle), select Make Movie. It shows the following dialog box (left side). Fill in the file name and the directory (SSmovie) (1), and choose what kind of movie to display. In this case I choose “SugarScape” simulation (2). Other possible choices are “Histogram” and “Plot” . Click the Next button (3).

• The next dialog box (right side) will ask when and how the movie is recorded. Click the Finished button (4) after choosing the way movie being recorded .

• When the simulation is executed, SSmovie.mov is created. The file is located in the assigned directory (1).

(1) (2)

(3) (4)

Page 13: 1 Setting Up for RePast, and Running a Repast Stand Alone Example 06/21/2004 by Deddy Koesrindartoto Department of Economics Iowa State University

13

Take a Snapshot• Repast Actions Folder : Take a Snapshot

• From Repast Actions folder (slide # 11, picture in the middle), select Snap Shot . It shows the following dialog box (left side). Fill in the file name and the directory (TestHist) (1), then choose what kind of information wanted to be captured. In this case I choose Histogram (2). Other possible choices are SugarScape and Plot. Click the Next button (3).

• The next dialog box (right side) will ask when and how the snap shot is taken. Click the

Finished button to proceed (4).

(1) (2)

(3) (4)

Page 14: 1 Setting Up for RePast, and Running a Repast Stand Alone Example 06/21/2004 by Deddy Koesrindartoto Department of Economics Iowa State University

14

Create/Edit Charts• Repast Actions Folder : Create / Edit Charts

• From repast actions folder, (slide # 11, picture in the middle), select Create / Edit Charts. The following dialog box (left side) will appear. Click the Add button (1), the dialog box (right side) will appear. In this dialog box, fill in the new chart information i.e. title name, axis’ name and their axis’ range.

• Click Next button to proceed (2) the dialog box in the next slide will appear.

(1)

(2)

Page 15: 1 Setting Up for RePast, and Running a Repast Stand Alone Example 06/21/2004 by Deddy Koesrindartoto Department of Economics Iowa State University

15

Create/Edit Charts (contd.)

While the previous slide is to set up the name and the range of the new chart, this slide is to select the source of data that will be used in the new chart.

The list on the left side column shows the available data to use for the new chart. Select particular data (1) from the left column list and click . (2)

To remove added data, select the data (3) from the right column list and click (4)

To proceed select the Next button (5). The dialog box shown in the next slide will appear :

(1) (2) (3)

(4)

(5)

Page 16: 1 Setting Up for RePast, and Running a Repast Stand Alone Example 06/21/2004 by Deddy Koesrindartoto Department of Economics Iowa State University

16Create/Edit Charts (contd.)

This dialog box can be used to set up the color and mark style on the chart. Choose your preferred style by selecting (1) and (2).

Click Finished button (3). A new dialog box will appear, confirming a new graph has been created (4).

Up to this point we can add a new graph (5) and edit (6) or delete(7) the existing one. Click the OK button (8) to finish the charts creation process.

This Test Chart 1 will be created when the simulation is run.

(1) (2)

(3)

(4)

(5)(6)(7)

(8)