Installing the ActorSim Development Environment¶

Mark Roberts (mark.roberts.ctr@nrl.navy.mil)

Installing ActorSim on Eclipse

Software Installations and Setup¶

• Install (or update) Oracle Java JDK

• For Windows
• Unpack zip file in c:sworkspace directory on root of drive (so the paths are not too long)
• Navagate to the bin folder and Run Eclipse, accepting any defaults
• You may want to pin eclipse to your start bar at this point
• For Linux (Ubuntu)
• Use the Help->Install New Software.. menu to install:
• If you work best with Emacs keybindings, I highly recommend the Emacs+ plugin

Obtaining the ActorSim Repository¶

There are three ways to obtain the ActorSim code:

• A local copy via a USB drive, CD-ROM, or a .zip archive release from the ActorSim website.

Follow the the details in ActorSim Install - local copy.rtf

• By cloning the git repository using a tool outside of git, or

Follow the the details in ActorSim Install - local copy.rtf

• By cloning the git repository using eclipse. - Newer versions of Eclipse (developer versions) have git bundled. Older versions of eclipse may need you to install egit, which you can

• Open the File->Import Dialog and select Git->Projects From Git

• Select Next and click “Clone URI”

• Select Next and fill in with the following information, filling in the host, path, and credentials as appropriate

• If a screen pops up concerning “Branch Selection”, select all branches (the default).

Set up a Linked Resource in eclipse¶

NOTE Before you import projects you must create a linked resource or eclipse will not be able to identify relative paths for ActorSim.

• Open the menu item “Window->Preferences”, type “linked” in the search bar, and select “Linked Resources” in the results

• Create a new Linked Resource that points to where you installed ActorSim

Unpacking Libraries¶

NOTE Before you import projects you must unpack some common libraries or you will get compilation errors related to these libraries.

• Unpack commons-cli as below

• Unpack slf4j and logback per below

Importing Projects¶

• It is best to begin by importing a single project at a time to ensure a smooth installation

NOTE The most common problems at this point result from missing the steps above to (1) set up a linked resource or (2) unpack the libraries.

• Select Import existing Eclipse Projects, it may take a moment to pull the latest clone

• Locate ACTORSIM_HOME on your drive and select the GoalRefinement project

• Ensure that you have source code in the Package Explorer and that you have no compile errors

• Locate ACTORSIM_HOME on your drive and select the ActorSim project

• Ensure that you have source code in the Package Explorer for this new project and that you have no compile errors

Code Formatting Settings¶

Please ensure all code in ActorSim follows a similar style by using the adjusting the formatting elements as follows.

If you spot code that does not follow formatting, feel free to make small changes. But please avoid committing functional code changes mixed with large (more than a few lines) of formatting code changes as this defeats the blame and assign facilities of code repositories. For example, if you spot an entire class that’s uses tabs instead of spaces in its formatting, create a separate commit to fix the formatting separate from any functional changes.

• Update the settings for the text editor

• Update the settings for code formatting

• Import the code style

TBD - discuss the FDR connector

Running the Integration Test¶

Once you have it installed and compiling, you’ll want to run mil.navy.nrl.ncarai.actorsim.fdr.FDRConnectorRunner with the arguments: “-test=integration”. It should show several screens (note that some screens are incorrectly labeled “GridCraft”, the former name of ActorSim. These screens from the bottom up include:

• Goal memory views for the internal and domain memory.
• A display on the left that shows vehicles with two areas and VIPs randomly placed on the left area. The simulation is paused when it starts.
• An Integration Scenario Test UI, which emulates a user entering goal choices. It should be in the center. You do not need to interact with this for this test.
• A MASON controller window in the top center with a Play (‘|>’), Pause (‘||’), and stop (‘|-|’) buttons and the text stating “At Start”

To run the example, press the Pause button after the Test UI has moved to the right buttons. The vehicles should begin to clear the areas, with some stopping at the VIPs.

Install TestNG into Eclipse¶

If you plan to push your commits to the repository, you will need to run the test suite to ensure you haven’t broken core ActorSim code. At a minimum, you need to run the GoalRefinementTests project.

To do so, you’ll need to install TestNG, the testing suite used in ActorSim. Detailed instructions can be found at http://testng.org/doc/download.html (scroll down to the section for installing to Eclipse).

Extra Tips and Tricks in Windows and Eclipse¶

• You can make shortcuts to your favorite directories by dragging them to the quick bar
• Install Git for Windows (https://msysgit.github.io/)
• but don’t use the integrated context menu (because you’ll install TortoiseGit below):