Insight can be configured, set up (using a settings file) and run using the command line.
Additional help for the command line is also available. Once in the Insight directory, enter the following:
Creating the settings file
The settings file can be created in a text editor, such as Notepad, saved as a .txt file (such as Example_InsightSettings.txt) and must include the information shown in Table 1.
Table 1. Information required to create a settings file
|Location of the Source project file|
|List of the objectives, using the Functions in the Source project|
|List of decision variables, using the Functions in the Source project, along with their constraints|
real $pipecapacity 0 200
real $demand 0 100
real $treatmentcapacity 0 100
|Advanced options - also optional||Example|
Real Var Crossover Probability
|GAExpert RealVarCrossoverProb 0.9|
|Real Var Mutation Probability||GAExpert RealVarMutationProb 0.5|
|Integer Var Crossover Probability||GAExpert IntegerVarCrossoverProb 0.9|
|Integer Var Mutation Probability||GAExpert IntegerVarMutationProb 0.5|
|Crossover Distribution Index||GAExpert CrossoverDistribIndex 5|
|Mutation Distribution Index|
GAExpert MutationDistribIndex 10
The values above are the default values. They should only be changed by expert users who know what they are doing. Invalid values may cause NSGA to fail.
Configuring the optimisation run
Once a settings file has been created, specify the following (shown in Table 2) in the command line to configure the optimisation run.
Table 2. Information required to configure an optimisation run
|Run the Insight executable file|
|Location of Insight settings file|
|Number of cores / endpoints to use|
|Number of generations|
|Output file name|
Setting up server endpoints
Server endpoints allow you to run the optimisation across several machines simultaneously. It is recommended to discuss the use of endpoints with your IT department should you wish to choose this option. They can be set up either manually, or using the Powershell script. These are discussed separately next.
Manual setup of individual machines as endpoints
For each individual computer you wish to use in the optimisation, you will need to set it up as an endpoint(s). This is setup using the command line on each machine.
- Locate the IP address (type ipconfig in the command prompt) or machine name (in the Properties section of My Computer) for each computer you are going to use in the optimisation;
- In the command prompt, change the directory to the location of Source (ie. where Source in installed); and
- Setup the endpoint using the endpoint setup command. For example, in the following case, 8593 is the unique identifier for the endpoint:
RiverSystem.CommandLine.exe -m server -a net.tcp://localhost:8593/insight
A message will then appear indicating that setup is complete.
To use additional cores on an individual machine, you will need to set up multiple endpoints.
If you wish to open up another endpoint for the same machine, open up another command prompt, change to the Source directory, and enter a similar command, this time with a different endpoint identifier. For example:
RiverSystem.CommandLine.exe -m server -a net.tcp://localhost:8594/insight
Setting up endpoints using PowerShell script
You can also set up endpoints using the included PowerShell script.
Complete the following on every machine that you wish to set up as an endpoint/s:
- Ensure that the RunSourceServersForInsight.ps1 file is in the same folder as RiverSystems.CommandLine.exe;
- Open PowerShell (Click on the Start menu (Windows 7), search for PowerShell, and press Enter);
- This method of setting up endpoints requires a change to the execution policy for each machine you wish to use as an endpoint. At the PowerShell command prompt, enter Set-ExecutionPolicy RemoteSigned. You will be asked to confirm the change (you can read more about this by selecting the relevant help topic). Choose Yes. This needs to be done only once;
- Change the directory to the location of the RunSourceServersForInsight.ps1 file;
- Run the PowerShell script with ./RunSourceServersForInsight.ps1; and
- The PowerShell script has automatically set up endpoints for you. Make a note of each endpoint, as these will be required when running the optimisation. Repeat this step across every machine that you wish to use as an endpoint. By default, the PowerShell script sets up two endpoints. To change the number of endpoints on the same computer, add the number of endpoints after the run command. For example: ./RunSourceServersForInsight.ps1 4 indicates 4 endpoints.
Finally, create an endpoints setting file using a text editor. Using the IP addresses or machine names (as located previously), specify the endpoints manually or via PowerShell. An example of such as file is shown below:
Running the optimisation
Once the settings file has been configured (along with endpoints if you are using them), you set up the optimisation run using the command line.
The location of the Source project must be in a location accessible to all endpoints. For example, a local server with a mapped drive x:\projects, or be in the same location on each machine e.g. C:\projects
Ensure that the parameters listed in Table 2 are entered. Then, press enter to begin the optimisation run.
As Insight computes the optimisation for each popluation, a completion notification is displayed in the command line.