Upload
jerome-sharp
View
215
Download
1
Embed Size (px)
Citation preview
Installing Repast in the Installing Repast in the Eclipse IDEEclipse IDE
Charlie GieselerCharlie Gieseler
6/28/046/28/04
Preliminary DownloadsPreliminary Downloads
Download and install latest release version Download and install latest release version of Eclipse from of Eclipse from http://http://eclipse.orgeclipse.org
Download and install the latest version of Download and install the latest version of RePast from RePast from http://repast.sourceforge.nethttp://repast.sourceforge.net
Download the GridIPD example code .zip Download the GridIPD example code .zip file from file from http://www.courses.fas.harvard.edu/~gov2http://www.courses.fas.harvard.edu/~gov2015/Tutorial/015/Tutorial/
Installing RePast in an Existing Installing RePast in an Existing ProjectProject
First you will need an existing projectFirst you will need an existing project
Please refer to the Eclipse documentation or Please refer to the Eclipse documentation or other Eclipse tutorials full details of setting up a other Eclipse tutorials full details of setting up a new project with existing resourcesnew project with existing resources
Here we will use the GridIPD projectHere we will use the GridIPD project
Note: GridIPD requires the cern.jet.random in Note: GridIPD requires the cern.jet.random in the “colt” library. This is located in RePast’s lib the “colt” library. This is located in RePast’s lib directory and can be added to the project in the directory and can be added to the project in the same manner as RePast.same manner as RePast.
Project PropertiesProject Properties
Open the existing projectOpen the existing project
Go to Project->PropertiesGo to Project->Properties
The Properties dialog will The Properties dialog will popuppopup
In the left pane, select “Java In the left pane, select “Java Build Path”.Build Path”.
The “Java Build Path” pane The “Java Build Path” pane will appear to the right.will appear to the right.
Make sure the “Libraries” tab Make sure the “Libraries” tab is selected.is selected.
Adding the RePast library to the Adding the RePast library to the Build PathBuild Path
Click the “Add Click the “Add External Library” External Library” buttonbutton
Use the browser Use the browser window to locate the window to locate the RePast jar file. RePast jar file.
Click “Open”Click “Open”
[RePastHome]/lib/repast.jar
RePast jar location
Verifying RePast library was addedVerifying RePast library was added
If the RePast library If the RePast library was added to the was added to the project it will now project it will now show in the library show in the library listing.listing.
Now click “OK” to Now click “OK” to complete the complete the properties setupproperties setup
Running the project with RePastRunning the project with RePast
To run GridIPD in Eclipse, first add the colt To run GridIPD in Eclipse, first add the colt library to the build path as done with RePast.library to the build path as done with RePast.
Go to Run->Run..Go to Run->Run..
Running the project with RePastRunning the project with RePast cont.cont.
Look in the Look in the “Configurations” “Configurations” panepaneUnder “Java Under “Java Applications” select Applications” select the class to run. In the class to run. In this case it is Model this case it is Model for the Model.java for the Model.java class.class.Click the “Run” Click the “Run” buttonbutton
GridIPD Runs in RePast GridIPD Runs in RePast