Determine the Optimal Maintenance Policy
Overview
The maintenance policy example has two main parts.
First, using Visual Basic, we wrote an ActiveX DLL and installed it on our server. This DLL references the @RISK Developer's Kit ActiveX library, and contains all the model logic for simulating the average profit for the different maintenance policies. It also contains code for generating progress and output graphs, and the formatted table of statistics that you see in the example's result window.
Second, we wrote a sequence of web pages to retrieve the model's input parameters from the user, to dynamically show the progress of the simulation, and to display the output results. One of the web pages in the sequence uses VBScript to call our DLL, passing it the model parameters specified by the user. When the simulation is complete, the results page combines together the statistics and graphs generated by the DLL into a nicely formatted page, suitable for display.
RDKX_MaintenancePolicy.DLL
This DLL contains only a single publicly accessible method,
called Simulate. The function
takes as arguments all the input model parameters, as well
as an output directory to which it will write graphs and results.
The Simulate method performs
the following five steps:
1. Initializes the RDK
2. Sets up the Model
3. Runs the Simulation
4. Generates the Results
5. Shuts Down the RDK
The function generates two files in the output directory specified, "\GRAPH.JPG" and "\STATISTICS.HTML". The files are combined together by the calling .ASP page to make the final page that is displayed to the user.
There are three code modules that make up the RDKX_MaintenancePolicy.DLL
form goes here