Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
lesson_10 [2019/08/13 17:51]
argemiro created
lesson_10 [2019/10/07 11:08]
britaldo
Line 1: Line 1:
 {{ :​logo_logo.png?​400 |}} {{ :​logo_logo.png?​400 |}}
 \\ \\
- 
 \\ \\
-=====LESSON 10: What are submodels, what types of submodels, and where are the submodels in Dinamica EGO.=====  ​+====LESSON 10: Submodels on Dinamica EGO?====  ​ 
 +\\ 
 +Submodels enable the reusing of parts of a model to perform specific operations inside other models. By using them, we can reduce the amount of work we have to put on when creating models that share similar functionalities. They are also an important tool for abstraction,​ hiding unnecessary details and making easier to reason about the model concept and its implementation. Conceptually,​ a submodel is a combination of functors exporting inputs and outputs to be bound externally, but, from the user point of view, a submodel is used just like any other ordinary functor.
 \\ \\
 \\ \\
-Submodels are a way of reusing parts of a model to perform specific operations inside other models. 
- 
-By using them, we can reduce the amount of work we have to put on when creating models that share similar functionalities. They are also an important tool for abstraction,​ hiding unnecessary details and making easier to reason about the model concept and its implementation. 
- 
-Conceptually,​ a submodel is a combination of functors exporting inputs and outputs to be bound externally, but, from the user point of view, a submodel is used just like any other ordinary functor. 
- 
 [{{ :​submodels:​basic_overview_submodels.png?​1200 |Submodel Overview}}] [{{ :​submodels:​basic_overview_submodels.png?​1200 |Submodel Overview}}]
 +\\
 Submodels are also first class citizen that can be transferred from one model to another. They can also be modified and updated at any time without breaking the model where they are being used. They can also depend on other submodels, as long as their definition do not form a cycle. Submodels are also first class citizen that can be transferred from one model to another. They can also be modified and updated at any time without breaking the model where they are being used. They can also depend on other submodels, as long as their definition do not form a cycle.
- +\\ 
-===== Submodel Types ===== +\\ 
 +=== Submodel Types === 
 +\\
 Basically, we have three different types of submodels in Dinamica EGO: system submodels, user submodels and local submodels. The different types of submodels are identified by different icon badges on the representation of the corresponding functors on the model. Basically, we have three different types of submodels in Dinamica EGO: system submodels, user submodels and local submodels. The different types of submodels are identified by different icon badges on the representation of the corresponding functors on the model.
 +\\
 [{{ :​submodels:​submodel_with_badge.png |Functor icon is decorated by badge representing local submodel}}] [{{ :​submodels:​submodel_with_badge.png |Functor icon is decorated by badge representing local submodel}}]
 +\\
 ^ Type  ^ Badge/​Decoration ​ ^ Documentation ​ ^ ^ Type  ^ Badge/​Decoration ​ ^ Documentation ​ ^
 | System Submodel ​ | {{ :​submodels:​systembadge16.png |}}  | System submodels are submodels provided by Dinamica itself and cannot be changed by the user. System submodels can be used in models created by any user. Usually, system submodels are located at ''​C:​\Program Files\Dinamica EGO\Submodels''​. ​ | | System Submodel ​ | {{ :​submodels:​systembadge16.png |}}  | System submodels are submodels provided by Dinamica itself and cannot be changed by the user. System submodels can be used in models created by any user. Usually, system submodels are located at ''​C:​\Program Files\Dinamica EGO\Submodels''​. ​ |
 | User Submodel ​ | {{ :​submodels:​userbadge16.png |}}  | User submodels are submodels created by each user and are available only for that specific user. User submodels can be used in models created only by that user. Usually, user submodels are located at ''​C:​\Users\<​User>​\Documents\Dinamica EGO\Submodels''​. ​ | | User Submodel ​ | {{ :​submodels:​userbadge16.png |}}  | User submodels are submodels created by each user and are available only for that specific user. User submodels can be used in models created only by that user. Usually, user submodels are located at ''​C:​\Users\<​User>​\Documents\Dinamica EGO\Submodels''​. ​ |
 | Local Submodel ​ | {{ :​submodels:​localbadge16.png |}}  | Local submodels are submodels that are related to a specific model. They are bound to that model and cannot be used in a different model unless they are explicitly transferred to it.  | | Local Submodel ​ | {{ :​submodels:​localbadge16.png |}}  | Local submodels are submodels that are related to a specific model. They are bound to that model and cannot be used in a different model unless they are explicitly transferred to it.  |
- +\\ 
-System and user submodels are presented ​in the "​Submodels"​ tab while local submodels are presented ​in the "Local Submodels"​ tab of the Functor Library. Local submodels are only presented ​when their associated model is opened. +System and user submodels are displayed ​in the "​Submodels"​ tab while local submodels are shown in the "Local Submodels"​ tab of the Functor Library. Local submodels are only available ​when their associated model is opened. 
 +\\
 [{{ :​submodels:​submodel_functor_library.png |System and user submodels on the functor library tab (left) and local submodels on the functor library tab (right)}}] [{{ :​submodels:​submodel_functor_library.png |System and user submodels on the functor library tab (left) and local submodels on the functor library tab (right)}}]
 +\\ 
 +\\
 In practice, users can only create local submodels. These local submodels can later be promoted to user submodels making them a definitive part of the user's tool set. In practice, users can only create local submodels. These local submodels can later be promoted to user submodels making them a definitive part of the user's tool set.
 +\\ 
 +\\
 [{{ :​submodels:​submodel_types.png?​900 |Different Types of Submodels}}] [{{ :​submodels:​submodel_types.png?​900 |Different Types of Submodels}}]
- +\\ 
-<​note ​tip>​Changing the definition of **user submodels** may break existent models that use that definition, making those models useless unless the user manually updates each one of them. On the other hand, **local submodels** can be safely updated since their updates are propagated to all local submodels ​from the same model and to the main model itself.</​note>​ +<​note>​ 
- +Changing the definition of **user submodels** may break existent models that make use of that definition, making those models useless unless the user manually updates each one of them. On the other hand, **local submodels** can be safely updated since their updates are propagated to all the local submodels ​of the same model and to the main model itself. 
- +</​note>​ 
-==== Where Local Submodels Are Stored ​==== +\\ 
- +=== Where Local Submodels Are Stored === 
-Local submodels are stored in a folder based on the model name. If the model containing the local submodel is named ''​simulation model.egoml'',​ its local submodels will be stored in a subfolder called ''​simulation model_egoml_Submodels''​. Basically, the name construction ​algorithm just replaces "​."​ with "​_"​ and appends "​_Submodels"​ to the name. Using a unique submodel folder for each model guarantees that submodels from one model are completely independent from the submodels from any other model. Local submodels can also be defined in a folder called "​Submodels"​ located in the same folder where the model file is located, and shared ​shared among all the models located in that folder. However, the folder is automatically converted into an unique submodel folder when the model is saved by the graphical interface. +\\ 
 +Local submodels are stored in a folder based on the model name. If the model containing the local submodel is named ''​simulation model.egoml'',​ its local submodels will be stored in a subfolder called ''​simulation model_egoml_Submodels''​. Basically, the naming ​algorithm just replaces "​."​ with "​_"​ and appends "​_Submodels"​ to the file name. Using a unique submodel folder for each model guarantees that submodels from one model are completely independent from the submodels from any other model. Local submodels can also be defined in a folder called "​Submodels"​ located in the same folder where the model file is located, and shared among all the models located in that folder. However, the folder is automatically converted into an unique submodel folder when the model is saved by the graphical interface. 
 +\\
 User submodels are stored typically in the folder ''​c:​\<​User>​\Documents\Dinamica EGO\Submodels''​. User submodels are stored typically in the folder ''​c:​\<​User>​\Documents\Dinamica EGO\Submodels''​.
 +\\
 Store submodels are stored typically in the folder ''​c:​\<​User>​\AppData\Local\Dinamica EGO\StoreSubmodels''​. Store submodels are stored typically in the folder ''​c:​\<​User>​\AppData\Local\Dinamica EGO\StoreSubmodels''​.
 +\\
 +\\
 +===Congratulations,​ you have successfully completed this lesson!===
 +\\
 +\\
 +☞[[:​lesson_11 | Next Lesson]]
 +\\
 +☞[[:​guidebook_start| Back to Guidebook Start]]
 +