The Ms assembly is used for modeling. Programming in the Fore language using this assembly consists in creating and setting up modeling container objects designed to solve problems of mathematical modeling of dynamic systems.
The following objects are used for modeling:
Variable. It is used to get source data and load calculation algorithm results. Use the IMsVariable interface to work with a variable.
Model. This is an equivalent of a real process that reflects its most important properties in mathematical form: the laws which it obeys, links between its components, and so on. It is used to set parameters of converting input variables using statistical and mathematical methods. Use the IMsModel interface to work with a model.
Metamodel. A model that describes structure and hierarchical calculation sequence of other models. The IMsMetaModel interface is used to work with a metamodel.
Scenario. A collection of source data and assumptions used in modeling. After the calculation, a scenario series, by which the calculated data is located, is created in the output variable. The IMsScenarioTreeElement interface is used to work with a scenario.
Modeling problem. It calculates models according to the sequence determined in metamodel. It is used to get calculation results and load these results to specified variables. The IMsproblem interface is used to work with a modeling problem.
Working with these objects is made in the modeling container environment via the IMsModelSpace interface.
Modeling is executed in accordance with the scheme:
Below is the example of the sequential modeling of balance of trade. Balance of trade is the difference between export and import, that is why the modeling is quite simple:

First of all, a modeling container is required. Modeling container creation is described in the Creating a Modeling Container example. Create a custom modeling container with the MODEL_SPACE identifier. Then follow the steps:
See also:
Ms Assembly Classes | Ms Assembly Interfaces | Ms Assembly Enumerations | Examples | Ms Assembly Hierarchy