Using Analytica modules with the Result database
Jump to navigation
Jump to search
Moderator:Nobody (see all) Click here to sign up. |
|
Upload data
|
Scope
How can Analytica models be used in such a way that
- Their variables are coherent with the variables in Opasnet wiki
- Their variables are coherent with the variable results in the Result database
- Both the formula and the result of the variable are readily usable and re-calculable?
Definition
- The basic rule is that if an object does not have a variable page in Opasnet, it is not a variable. Creating this page gives the variable a unique identifier, which should be used in all systems (Opasnet, Result database, and Analytica models).
- Models are divided into separate modules. Often there is a fairly large module for calculating a single variable. For example, the composite traffic model v 1.0.1[1] contains 410 nodes but actually only Adjusted_trip_rate and Scenarios_output are nodes that I would turn into variables from the deterministic part of the model. All other nodes are basically either data nodes or parts of formula, but they are not interesting as such.
- Each module is saved as a separate file, either to the file management system or Opasnet Image namespace. When results are stored into the Result database, the exactly same version of the module should be found from Opasnet as well.
- Also a shell model must be created. It contains the whole of the model, including placeholder nodes for variables in other modules. The placeholders must have an identical identifier to the actual variables. Whole models are built by opening the modules into the shell model with options "Embed a copy" and "Merge contents (overwrite)". When adding modules, Analytica replaces the placeholder nodes with the actual variables from modules.
- A model is described by listing links to each module (and the shell model) file in Opasnet. When someone wants to run the model, the files are first downloaded and then opened as described above.
- A "current" model is built by making links to the current versions of all module files.
- A model with a defined version is made by making links ("permanent links") to a particular (not the current) version of each file.
- Using external data only accessible with Analytica Enterprise.
- Computing may require external data that is only accessible to the Analytica Enterprise version (such as the database function DBquery or file import function Readtextfile). In such a case, the user must have access to both the code and the actual result (but not necessarily to the original data!). Then, two versions of the module should be made:
- The model file with formulas used to make the calculations. (This cannot be run without Enterprise but the code can be opened and evaluated with any version of Analytica).
- The model file with the variable results as values. (This can be used in further calculations.) This is done by creating a button and running code (Va1:= Va1) for the variable Va1. This transforms the formula into an edit table.
- Both of these module versions are uploaded into Opasnet, one by one WITH THE SAME NAME. They are thus two versions of the same object. Of course, the upload summary must be clear about what these versions are so that they can be effectively found afterwards.
- Computing may require external data that is only accessible to the Analytica Enterprise version (such as the database function DBquery or file import function Readtextfile). In such a case, the user must have access to both the code and the actual result (but not necessarily to the original data!). Then, two versions of the module should be made: