Setting up for Business Scenario Simulation
Perform these steps to prepare for being able to simulate real data through your AIM model. Once you’ve completed this, go here to begin creating business scenarios.
Step 1 – Download and install the AIM Server
Get the AIM Server from downloads and install it.Change AIM Server to run as admin by right-clicking on the AIM Server icon on your desktop, choose Properties (last item on the popup menu), then select the Compatibility tab, then check the Run this program as an administrator checkbox at the bottom, then choose OK.
Double-click on the AIM Server icon to start it. A DOS Window will open and you should see some text appear like this:
working ... AIM Server watching for JScript (.js) changes in folder: . Watch for .js script changes Listening... http://*:8080/
What this means is that the AIM Server is watching for changes in the folder (.), which is the current folder in which AIM was started.
If it detects JScript files (.js files) then it will automatically try to compile them so that they can be used by AIM.
It also shows that AIM Server is listening (by default) on port 8080.
If you want to change this, you can either change the app config file where AIM Server is installed, or start AIM Server with a -f (for folder) command line parameter. e.g.
c:>jscriptserver.exe -f c:/projects/aim-scripts
You can also change the port on which AIM Server listens with a -p parameter, e.g.
c:>jscriptserver.exe -p http://*:8888/
Make sure that you follow the format exactly. Use a colon in between the asterisk and the port number, and put a forward slash at the end of the port number.
Why does AIM Server need to run as admin?
AIM Server needs to run as admin because it runs as a separate program and communicates with AIM over HTTP.
Admin permissions are needed to open a port to listen over HTTP.
In future releases (when the Unity game engine on which AIM is built supports a more recent version of .NET), we may likely collapse AIM Server back into the main AIM application so that you do not need to do a separate install, however due to some requirements for doing macro data simulation, e.g. compiling JScript so that it runs in the .NET platform, we need AIM Server to be separate to AIM for now.
Step 2 – Make sure AIM can talk to the AIM Server
We need to now make sure that AIM can communicate with the AIM Server.
This is so that as AIM runs the simulation of your Enterprise, it can offload data processing to the AIM Server. The AIM server receives data from AIM, executes your scripts, and then passes the outputs back to AIM to propagate through your Enterprise model.
- Start AIM
- Go to File > Options
- In the Script Server URL field, enter http://localhost:8080, or use whatever port number you used when starting the AIM Server. You should also be able to change localhost to an IP number of machine name if you are running AIM Server on a separate machine.
- In the Script Path field, enter a path value that will be passed to AIM Server to indicate where it should look for .js files, e.g. C:/AIM models/jscript/ins-script. This value is relative to the machine on which the AIM Server was started.
- Click Save Options. This saves your preferences and passes any update Script Path value to the AIM Server so it’s looking in the right place for your .js files.
If you then switch over to look at the AIM Server console, you should see something like the following:
Received request - URL=http://localhost:8080/ChangeFolder/
Change JScript folder to: C:/AIM models/jscript/ins-script
AIM Server watching for JScript (.js) changes in folder: C:/AIM models/jscript/ins-script