1 / 11

Building the CarryDrop Simulation in JBuilderX

Building the CarryDrop Simulation in JBuilderX. By Deddy Koesrindartoto 08/16/2004. This tutorial will explain, step by step, how to create a new project using existing RePast/Java code for a RePast Tutorial by John Murphy.

fritz
Download Presentation

Building the CarryDrop Simulation in JBuilderX

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Building the CarryDrop Simulation in JBuilderX By Deddy Koesrindartoto 08/16/2004

  2. This tutorial will explain, step by step, how to create a new project using existing RePast/Java code for a RePast Tutorial by John Murphy. To be consistent with Murphy’s Tutorial, the project name will be Demo.jpx, and it will contain three Java class : CarryDropModel.java; CarryDropSpace.java; CarryDropAgent.java. To follow this tutorial you will need: JBuilder X installed and running RePast library installed Access to the source code of John Murphy’s RePast Tutorial at : http://www.u.arizona.edu/~jtmurphy/H2R/HowTo01.htm Introduction

  3. Creating a Demo Project • Start JBuilder X • Go to File -> NewProject • In the Project Wizard dialog box (Fig 2.A) fill in the project name. • Use Demo as project name. In JBuilder, this project name will also be used as the package name. • Leave the default settings for the rest of the fields. Fig 1

  4. Creating a project Demo…continued: (3) (2) (1) Fig 2.A Fig 2.B In Fig 2.A click the Next button (1) to configure the library/libraries that will be used in Demo project. Dialog box (Fig 2.B) will appear. Press the Required Libraries (2), and press Add button to proceed (3). Leave the default settings for the rest of the fields.

  5. Setting up required libraries: (1) (3) (2) Fig 3.B Fig 3.A (4) Navigate through the list of libraries shown in Fig 3.A. Select RePast-2.2 library (1) and press the OK button (2). The new dialog box (Fig. 3.B) will acknowledge that the RePast-2.2 library has been added (3) to the Demo project. Leave the default settings for the rest of the fields, and click the Finish button(4).

  6. Setting up required libraries … Continued: (1) Fig 4 At this point, the process of creating the Demoproject is finished. Demo.jpx is now listed at the JBuilder project pane (1). However, the project is still empty. There are no classes associated with this project. The next steps will explain how to add classes to this project.

  7. Adding a Java class to the Demo project: • The next steps will show how to add CarryDropModel.java classes to the Demo project. • Go to File->New Class… • A Class Wizard dialog box should appear. Fig 5

  8. (1) (5) (4) (2) (3) Fig 6.B Adding a Java class to the Demo project... continued: Fig 6.A • As shown in Fig 6.A, type CarryDropModel (1) as the Class name, and leave all other settings at default values. Note that, if nothing is checked in the Options choices (2), it will generate an empty class which contains only the class name and the respective package used in this class. Hit the “OK” button (3) • Fig 6.B shows how the CarryDropModel class now appears in the structure pane (4). Meanwhile, the CarryDropModel source code appears in content pane (5).

  9. Copying Murphy’s source code for CarryDropModel.java from his website: Open your browser, and go to: http://www.u.arizona.edu/~jtmurphy/H2R/HowTo03.htm . Select and copy the whole source code for the CarryDropModel to the clipboard.

  10. (2) (1) Copying Murphy’s source code for CarryDropModel.java…continued: Go to JBuilder content pane of CarryDropModel.java. Press Edit -> Select All (1) and then Edit -> Paste (2) . It will automatically paste the code you copied earlier from the website for CarryDropModel.java into the content pane.

  11. Adding other classes to the Demo project…continued: (2) (1) Repeat the same process for adding code for the CarryDropSpace and CarryDropAgent Java classes from Murphy’s website. When all three classes are added, they will be listed by name in project pane (1) and their code will be shown in content pane (2). Follow the Murphy Tutorial and modify these three .java classes as needed.

More Related