Skip to content

Commit

Permalink
use trigger instead of condition in CSwitcher
Browse files Browse the repository at this point in the history
  • Loading branch information
Evgeny Metelkin committed Aug 18, 2020
1 parent 47617d0 commit fe22a8e
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 10 deletions.
2 changes: 1 addition & 1 deletion cases.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
| [one compartment](cases/one-compartment) | One compartment PK model example. |
| [annotation](cases/annotation) | Annotation of components in MM model. |
| [time switcher](cases/time-switcher) | Model describes one-reaction model with periodic event. |
| ~~[cond switcher](cases/cond-switcher)~~ | Event with conditional switch |
| ~~[continuous switcher](cases/c-switcher)~~ | Event with continuous switch |
| [using units](cases/using-units) | using default units and creating another ones |
| [Heta modules](cases/heta-modules) | Combining Heta type modules in one platform |
| ~~[namespaces](cases/several)~~ | Using namespaces to write several models in one platforms |
Expand Down
4 changes: 4 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change Log

## 0.3.2

- use `trigger` property with MathExpr in `CSwitcher` (continuous switcher) instead of condition reffered to Record

## 0.3.1

- rename `CondSwitcher` to `CSwitcher` (continuous switcher)
Expand Down
11 changes: 5 additions & 6 deletions classes.md
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ sw2 @TimeSwitcher {

```heta
sw2 @DSwitcher {
condition: (x > 1) and (y != x)
trigger: (x > 1) and (y != x)
};
```

Expand All @@ -342,18 +342,17 @@ sw2 @DSwitcher {

**Parent:** [_Switcher](#_switcher)

`CSwitcher` (continuous switcher) switches based on record reffered in `condition` property. The switcher is triggered when the value of the record hits 0 changing from negative to positive value.
`CSwitcher` (continuous switcher) switches based on expression in `trigger` property. The switcher is triggered when the value of the record hits 0 changing from negative to positive value.

| property | type | required | default | ref | description |
| ---------|------|----------|---------|-----|-------------|
| condition | ID | true | | `Record` | Reference to identifier of Record to estimate the moment of switching |
| trigger | MathExpr | true | | | Expression to estimate the moment of switching |

### Example

```heta
evt1 @Record .= x * y;
sw2 @CSwitcher {
condition: evt1
trigger: x * y
};
```

Expand All @@ -370,7 +369,7 @@ It substites partially usage of `TimeSwitcher` and was included to support expor
| start | Number/ID | | 0 | - / `Const` | time to run the first switch |
| period | Number/ID | | | - / `Const` | period of repeated switching |
| repeatCount | Number/ID | | | - / `Const` | number of dose addition after the first dose |
| target | ID | true | | Species | traget species to add the dose |
| target | ID | true | | Species | target species to add the dose |
| amount | Number/ID | true | | - / `Const` | amount which should be added to the reffered species |
| units | UnitsExpr *or* [UnitsComponent](#unitscomponent)[] | | | | units of `amount` |

Expand Down
Binary file modified heta-cheatsheet.docx
Binary file not shown.
6 changes: 3 additions & 3 deletions heta.uml.graphml
Original file line number Diff line number Diff line change
Expand Up @@ -176,12 +176,12 @@ aux: &lt;Dictionary&gt; {use: "optional"}</y:AttributeLabel>
<data key="d4" xml:space="preserve"/>
<data key="d6">
<y:UMLClassNode>
<y:Geometry height="63.16736828619105" width="147.83479426263978" x="1137.3692452070163" y="-515.1690413283227"/>
<y:Geometry height="63.16736828619105" width="171.49999999999966" x="1113.7040394696564" y="-515.1690413283227"/>
<y:Fill color="#00FFFF" transparent="false"/>
<y:BorderStyle color="#000000" type="line" width="2.0"/>
<y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="13" fontStyle="bold" hasBackgroundColor="false" hasLineColor="false" height="19.92626953125" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="67.57177734375" x="40.13150845944489" xml:space="preserve" y="3.0">CSwitcher<y:LabelModel><y:SmartNodeLabelModel distance="4.0"/></y:LabelModel><y:ModelParameter><y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="0.0" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/></y:ModelParameter></y:NodeLabel>
<y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="13" fontStyle="bold" hasBackgroundColor="false" hasLineColor="false" height="19.92626953125" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="67.57177734375" x="51.96411132812483" xml:space="preserve" y="3.0">CSwitcher<y:LabelModel><y:SmartNodeLabelModel distance="4.0"/></y:LabelModel><y:ModelParameter><y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="0.0" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/></y:ModelParameter></y:NodeLabel>
<y:UML clipContent="true" constraint="" hasDetailsColor="false" omitDetails="false" stereotype="" use3DEffect="false">
<y:AttributeLabel xml:space="preserve">condition: &lt;ID&gt;</y:AttributeLabel>
<y:AttributeLabel xml:space="preserve">trigger: &lt;MathExpr&gt;(numeric)</y:AttributeLabel>
<y:MethodLabel xml:space="preserve"/>
</y:UML>
</y:UMLClassNode>
Expand Down
Binary file modified heta.uml.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit fe22a8e

Please sign in to comment.