Running your agent AI on your local machine
Before creating an agent AI to run on your laptop you need to setup Eclipse so that it knows about the WebSphere Liberty server that is installed as part of the game.
Firstly you need to go to the Code Rally perspective in Eclipse. You should see the servers view in the bottom left of the screen:
Right-click in the servers view and select new> server to see the new server window:
Select the "WebSphere Application Server Liberty Profile" and click next - you should now see the runtime environment view:
Under "choose an existing installation" click on the "Browse" button and find the location you installed the game to. Under that installation directory is a folder called "wlp" - select that and click "ok". Click next to move to the new server dialog and click "finish":
Once that is done you will have a WebSphere Application Server Liberty profile Java EE runtime environment (which is needed for your agent AI to run, as agent AIs are part of a Java EE 7 web application that runs on the Liberty runtime. Now you can go to the new AI window by clicking the green "+" above your vehicles list:
In the new AI window give your AI a name (this is a Java class name so class naming rules apply), change the radio button to "agent", make sure the Liberty profile server is in the dropdown and click "submit":
Your AI will now appear in the "vehicles" list on the left side of Eclipse:
Double-left click on your agent in the list and it will open the code for your agent AI. You can find out more about what you can do with the code in our creating your AI article.
One of big changes when running races with an Agent AI is that races with agents in them run in real time (so you can watch a race live when entering) and you can change your code as the race is running - as long as it compiles hit save and the change will impact all races the AI is currently racing in (note: the live race window can be a few seconds behind what is happening). This is possible thanks to WAS Liberty being able to dynamically update web applications on the fly without restarting the runtime. The other advantage is that you can use System.out and System.err logging to print out information to your local Eclipse client. Don't use debug mode though as the game will not wait for your AI to respond if it's paused waiting for you in debug mode.