Presentation is loading. Please wait.

Presentation is loading. Please wait.

Building the CarryDrop simulation in Eclipse Creating a new project with existing code from John Murphy’s RePast tutorial.

Similar presentations


Presentation on theme: "Building the CarryDrop simulation in Eclipse Creating a new project with existing code from John Murphy’s RePast tutorial."— Presentation transcript:

1 Building the CarryDrop simulation in Eclipse Creating a new project with existing code from John Murphy’s RePast tutorial

2 Preparation For these slides you will need: For these slides you will need: – The Eclipse IDE installed and running. –Access to the source code from John Murphy’s RePast tutorial, step 14. tutorial14tutorial14

3 Creating a new project Start Eclipse Start Eclipse Go to File -> Project Go to File -> Project In the New Project dialog box select “Java Project” and hit the Next button In the New Project dialog box select “Java Project” and hit the Next button In the next screen, name the project and choose a location. In the next screen, name the project and choose a location. Leave the default setting for the project layout. Leave the default setting for the project layout.

4 Creating a new project cont. Add RePast to the build path under the “Libraries” tab. Add RePast to the build path under the “Libraries” tab. Click the “Finish” button. Click the “Finish” button. Please refer to Installing Repast in the Eclipse IDE under section IV.B of the RePast Study Group homepage for details on adding the RePast jar to a project build path.homepage

5 Creating a new class Now that we have the project established we can add the first new class. Now that we have the project established we can add the first new class. Go to File->New->Class. Go to File->New->Class. A New Class window should appear. A New Class window should appear. For the Package, enter “demo” For the Package, enter “demo” For Name, enter CarryDropModel. For Name, enter CarryDropModel. Leave all other settings at default values. Leave all other settings at default values. Hit the “Finish” button. Hit the “Finish” button.

6 The first class: CarryDropModel Go to step 14 of Murphy’s tutorial. Go to step 14 of Murphy’s tutorial. In your browser, select all the Java code for the CarryDropModel class and go to Edit- >Copy In your browser, select all the Java code for the CarryDropModel class and go to Edit- >Copy In Eclipse, select all the pre-written code in the new CarryDropModel In Eclipse, select all the pre-written code in the new CarryDropModel

7 The first class: CarryDropModel Go to Edit->Paste. Go to Edit->Paste. The code from the tutorial webpage should have now replaced the pre-written code. The code from the tutorial webpage should have now replaced the pre-written code.

8 Adding the other classes Save the CarryDropModel in Eclipse and it is done Save the CarryDropModel in Eclipse and it is done Repeat the previous steps to create new classes, copy code from the tutorial, and paste it in Eclipse for both CarryDropAgent and CarryDropSpace. Repeat the previous steps to create new classes, copy code from the tutorial, and paste it in Eclipse for both CarryDropAgent and CarryDropSpace. The CarryDrop simulation is now in Eclipse and ready to be run. The CarryDrop simulation is now in Eclipse and ready to be run.

9 The CaryyDrop simulation To start the simulation, go to Run->Run… To start the simulation, go to Run->Run… In the Run dialog box CarryDropModel, In the Run dialog box CarryDropModel, –make sure the Project name is correct –the Main Class box has demo.CarryDropModel Hit the “Run” button Hit the “Run” button

10 The CarryDrop Simulation RePast will start RePast will start Press the Initialize button Press the Initialize button The CarryDropModel window will appear with the initialized money space. The CarryDropModel window will appear with the initialized money space.


Download ppt "Building the CarryDrop simulation in Eclipse Creating a new project with existing code from John Murphy’s RePast tutorial."

Similar presentations


Ads by Google