2 title: Rule Based Arbitrator (RBA)
7 Rule Based Arbitrator decides which of the content to display when a large number of contents to be displayed on the cockpit display device (CID, meter, HUD, etc.) occur simultaneously under a certain rule (arbitration).
11 #### 1.1 Purpose of this document
13 This document describes the syntax of the Rule-based Arbitration Model.
17 The basic syntax of the Rule-based Arbitration Model is as follows.
19 ![Basic syntax](images/rba/Basic_syntax.png)
21 Define the properties of the model element in {} after declaration of Model element keyword, Model element ID. Each property depends on the element. The properties of the model element may also define other model elements.
23 #### 1.3 Relationship between files and Model definitions
25 The Rule-based Arbitration Model can be defined in multiple files. (The extension of the file will be ".rba") Firstly, define the Package model element in the file.
29 Package AreasPackage {
35 Package ContentsPackage {
40 #### 1.4 Structure of Rule-based Arbitration Model
42 The elements of the Rule-based Arbitration Model are as follows. Each inheritance relationship between elements is defined and expresses elements that can be described in PackagableElement.
44 ![model](images/rba/model.png)
46 #### 1.5 Notation of Syntax Definition
60 | Syntax element | Description |
62 | description: 0..1 | Description |
63 | [PackagableElement] * | Child element Package,Display,Size,Constraint,PostConstraint,Scene,Event,Rule,Area,AreaSet,ViewContent,ViewContentSet|
65 The multiplicity is expressed as follows:
67 | Expression of multiplicity | Description |
74 Description of [] notation is as follows:
76 | Syntax element | Description |
78 | [ID] | ID. A character string in which the first character is not a number. Only _ can be used for symbols, Space cannot be used.
79 | [String] | An arbitrary character string. specify it by enclosing with "". |
80 | [Number] | An integer that is greater than equal 0. |
81 | [expression] | An expression whose return value is a property type. |
82 | [<Model element keyword\>] | Definition of other Model elements. Sometimes an abstract class is specified. |
83 | [ID of A] | Reference to other Model elements. A represents an element. |
84 | [X\|Y] | Indicates that you can describe X or Y. |
90 The Package element is the root element in the file. It has PackagableElement as a Child element and groups PackagableElements in arbitrary units.
100 | Syntax element | Description |
102 | description: 0..1 | Description |
103 | [PackagableElement] * | Child element Package,Display,Size,Constraint,PostConstraint,Scene,Event,Rule,Area,AreaSet,ViewContent,ViewContentSet|
107 Package SamplePackage {
108 description: "This is a sample Packege"
110 arbitrationPolicy: DEFAULT
111 sizeReference: SampleSize1
112 visibility: NONE_VALUE
115 ViewContent SampleContent {
116 allocatable: [SampleArea1]
118 priority: STANDARD_VALUE
126 Size is the size of Area and ViewContent.
132 description: [String]
138 | Syntax element | Description |
140 | description: 0..1 | Description of Size element |
142 | height: 1 | height |
147 description: " Screen size"
155 The Project element is an element that can be defined only once in one project.
156 Like The Package element, it can be defined directly under the file.
165 | Syntax element | Description |
167 |version: 1| Version of the Project|
172 version: "version 1.0"
179 Area is a frame to display the ViewContent on the screen. Only one ViewContent is allocated to one Area at most. Since Arbitration is executed for each Area, the Arbitration Policy is defined.
185 description: [String]
186 arbitrationPolicy: [DEFAULT | FIRST_COME_FIRST | LAST_COME_FIRST | PRIORITY_FIRST_COME_FIRST | PRIORITY_LAST_COME_FIRST]
187 [[Size]| sizeReference:[ID of Size]]
188 [visibility|priority]:[Number|Expression]
189 zorder:[Number|Expression]
193 | Syntax element | Description |
195 | description: 0..1 | Description |
196 | arbitrationPolicy: 0..1 | Arbitration Policy for Area. Refer to "Types of Arbitration Policy" for the policies which can be specified. If not specified, consider it as "DEFAULT".
197 | [Size\|sizeReference:] 1..* | Size: Size definition.|
198 || sizeReference: Reference to Size definition.|
199 || ※One or more definitions of either Size or sizeReference are needed. Multiple definitions should be defined consecutively.|
200 | [visibility\|priority]: 1 | Value of Area. Describe the relative value for other Areas as an expression or set a numerical value.|
201 || The following predefined value can be set as a String. NONE_VALUE, STANDARD_VALUE, MIN_VALUE, MAX_VALUE See " Value / Z order definition" for details. |
202 | zorder: 1 | Z order of Area. Describe the relative Z order for other Areas as an expression or set a numerical value. The following predefined value can be set as a String. |
203 ||NONE_VALUE, STANDARD_VALUE, MIN_VALUE, MAX_VALUE See " Value / Z order definition" for details. |
207 Types of Arbitration Policy
209 | Arbitration Policy | Description |
211 | DEFAULT | Same as Priority and First Come First Arbitration. If the Arbitration Policy is not specified, it will be this type.|
212 | FIRST_COME_FIRST | First Come First Arbitration. Give priority to the request which occurred first. |
213 | LAST_COME_FIRST | Last Come First Arbitration. Give priority to the request which occurred later. |
214 | PRIORITY_FIRST_COME_FIRST | Priority and First Come First Arbitration. It follows the priority set to the Content. If the priority is the same, give priority to the request which occurred first. |
215 | PRIORITY_LAST_COME_FIRST | Priority and Last Come First Arbitration. It follows the priority set to the Content. If the priority is the same, give priority to the request which occurred later.|
220 description: "This is a sample Area."
221 arbitrationPolicy: DEFAULT
226 sizeReference: SampleSize1
227 visibility: NONE_VALUE
232 ### 4. Value / Z order definition
234 Values (visibility or priority) of area is the order of arbitrating of the area. The higher is arbitrated first. You can describe only one of the visibility or priority.
235 For the Z order (zorder), the higher one will be on the front of the screen. You can define values absolutely by number or define relatively to other areas by expressions. You can use comparison operators (> and <), equality operator (=) and That-of operator for the expressions.
237 - Description example of value :
238 Visibility of SampleArea2 is 10, zorder is 5.
245 - Description example of comparison operator:
246 Priority of SampleArea1 is greater than SampleArea2. Zorder of SampleArea1 is less than SampleArea3.
249 priority: > That-of SampleArea1
250 zorder: < That-of SampleArea3
253 - Description example of range:
254 Visibility of SampleArea1 is greater than 1 and less than SampleArea2. Zorder of SampleArea1 is greater than SampleArea3 and less than SampleArea4.
257 visibility: (> 1 AND < That-of SampleArea2)
258 zorder: (> That-of SampleArea3 AND < That-of SampleArea4)
262 - Description example of equality operator:
265 visibility: = That-of SampleArea2
266 zorder: = That-of SampleArea3 + That-of SampleArea2
270 - Equality operator can be omitted.
273 visibility: That-of SampleArea2
274 zorder: That-of SampleArea3 + That-of SampleArea2
278 ### 5. ViewContent definition
282 ViewContent is an object to be displayed in the Area. ViewContent has multiple states. When ViewContent is allocated to an Area, active state of theViewContent is displayed. Define the Area which can display ViewContent to the ViewContent. You can define several Areas.
287 description: [String]
288 allocatable: [ [ID of Area] | [ID of Set] ]
290 [[Size]|sizeReference: [ID of Size]]
291 loserType: [GOOD_LOSER | DO_NOT_GIVEUP_UNTIL_WIN | NEVER_GIVEUP]
295 |Syntax element | Description|
297 |description: 0..1 | Description|
298 |allocatable: 0..* | Displayable Area. Specify the ID of displayable Areas or Sets with comma-separated.If don’t specify allocatable, should specify allocatable in the ViewContentSet that includes this ViewContent. |
299 | [ViewContentState] 1..* |Define the State of ViewContent.|
300 |[Size\|sizeReference:] 1..*|Size: Size definition|
301 ||sizeReference: Reference to Size definition.|
302 ||※One or more definitions of either Size or sizeReference are needed. Multiple definitions should be defined consecutively.|
303 |loserType: 0..1| Action on lost. Specify whether to cancel a request, if ViewContent is not displayed after arbitration. See "Types of Action on lost" for details. If not defined, consider it as "NEVER_GIVEUP".|
305 Types of Action on lost
307 |loserType | Description|
309 |GOOD_LOSER |When losing arbitration, cancel a request.|
310 |DO_NOT_GIVEUP_UNTIL_WIN |When the state is changed visible to invisible , cancel a request.|
311 |NEVER_GIVEUP|Keep a request.|
316 description: " Warning from power management"
318 MessageArea, HUDMessageArea
321 priority: > That-of Power.Attention
324 priority: > That-of TEL.Incoming
327 description: "Default size"
331 sizeReference: InterruptMessageSize
332 loserType: GOOD_LOSER
335 #### 5.2 State(ViewContent)
337 State is the state of the ViewContent.
342 description: [String]
343 [priority|value]: [Number|Expression]
347 |Syntax element | Description|
349 |description: 0..1 | Description
350 |[priority\|value]: 1 | Priority of ViewContent. |
351 ||Describe the relative value for other State under ViewContent as an expression, or set a numerical value. |
352 ||The following predefined value can be set as a String.NONE_VALUE, STANDARD_VALUE, MIN_VALUE, MAX_VALUE See "Priority definition"for details. |
357 description: "Display warning message"
358 priority: > That-of Attention
361 description: " Display attention message "
362 priority: > That-of TEL.Incoming
365 ### 6. Priority definition
367 Define the priority of Content to the State under ViewContent or SoundContent (hereinafter, Content). The priority is used when the area / zone arbitration policy is "Priority and First Come First Arbitration" or "Priority and Last Come First Arbitration", the higher one is allocated first. Values can be defined absolutely by number or relative to other areas by expressions. You can describe only one of the visibility or priority. You can use comparison operators (> and <), equality operator (=) and That-of operator for the expressions.
369 - Description example of value:
370 Priority of Warning is 10.
373 description: " Display warning message "
377 - Description example of comparison operator:
378 Value of Warning is greater than Attention.
379 <br>Value of Attention is greater than State Incoming of TEL of other Content.
380 <br>Value of Notice is less than Attention.
381 <br>※When referring to the State of another Content, refer to the Content ID and State ID by connecting with “.”.
384 value: > That-of Attention
388 value: > That-of TEL.Incoming
392 value: < That-of Attention
396 - Description example of range: Priority of Attention is greater than Incoming of TEL and less than Warning.
397 <br>※When referring to the State of another Content, refer to the Content ID and State ID by connecting with “.”.
400 priority: (> That-of TEL.Incoming AND < That-of Warning)
404 - Description example of equality operator:Value of Attention is equal to State Incoming of TEL of other Content.
407 priority: = That-of TEL.Incoming
410 - Equality operator can be omitted.
413 priority: That-of TEL.Incoming
417 ### 7. Screen layout definition
421 Display represents one screen. When defined more than one, it will be Multi-screen layout.
422 The Display defines the set of Areas to be allocated on the screen.
427 description: [String]
429 [[Size]|sizeReference:[ID of Size]]
433 |Syntax element | Description|
435 | description: 0..1 | Description|
436 |[CompositeArea] 1 | Component of the screen|
437 |[Size\|sizeReference:] 1 | Size: Size definition|
438 || sizeReference: Reference to Size definition|
439 || ※One or more definitions of either Size or sizeReference are needed. |
444 description:"Meter display definition"
449 CompositeArea METER_Root {
450 layout: FixedPositionLayout {
455 areaReference: SpeedMeterArea
462 #### 7.2. CompositeArea
464 CompositeArea specifies an Area that becomes a component of Display.
469 description: [String]
470 layout: [FixedPositionLayout]
474 |Syntax element | Description|
476 |description: 0..1 | Description |
477 |layout: [FixedPositionLayout] 1| Layout type of Area|
481 CompositeArea METER_Root {
482 description:" Definition of Area’s layout method"
483 layout: FixedPositionLayout {
488 areaReference: SpeedMeterArea
494 #### 7.3. FixedPositionLayout
496 FixedPositionLayout declares that areas are laid out with fixed values. The specific position define by PositionContainer.
500 FixedPositionLayout {
505 |Syntax element | Description|
507 |[PositionContainer] 1..*| Position information.|
510 FixedPositionLayout {
515 areaReference: SpeedMeterArea
519 #### 7.4. PositionContainer
521 PositionContainer specifies the display position of the Area.
529 areaReference: [ID of Area]
534 |Syntax element | Description|
538 |basePoint: 1 | Defined x, y position. The following predefined value can be set.|
539 || CENTER_BOTTOM (Define x, y as the lower center position)|
540 || CENTER_MIDDLE(Define x, y as center position)|
541 || CENTER_TOP (Define x, y as the upper center position)|
542 ||LEFT_BOTTOM (Define x, y as the lower left position)|
543 ||LEFT_MIDDLE (Define x, y as the left center position)|
544 ||LEFT_TOP (Define x, y as the upper left position)|
545 ||RIGHT_BOTTOM (Define x, y as the lower right position)|
546 ||RIGHT_MIDDLE (Define x, y as right center position)|
547 ||RIGHT_TOP (Define x, y as the upper right position)|
548 |areaReference: 1| Area to be placed in Display. Specify ID of the Area.|
549 |[Offset] 0..*| Display position offset of AreaSpecify the position of the Area for each size.|
554 FixedPositionLayout {
559 areaReference: SpeedMeterArea
560 Offset { x:-50 y:20 sizeReference: SpeedMeterArea }
566 Offset is the offset position for each size.
571 description: [String]
574 sizeReference: [ID of Size]
578 |Syntax element | Description|
580 |description: 0..1| Description|
581 |x: 1| Offset from x position of PositionContainer.|
582 |y: 1| Offset from y position of PositionContainer.|
583 |sizeReference: 1| Size to apply the offset. Specify ID of Size.|
584 ||※ This Size must be specified in Area.|
592 sizeReference: SpeedMeterSize
596 ### 8. Constraint defination
598 Constraints can be defined according to the state of the Area/Zone and the state of the ViewContent/SoundContent. The syntax can be used for Constraints is shown below.
600 - State reference of Area:
602 |Name | Notation |Meaning|
603 | :--- | :---- | :---- |
604 |IsDisplayed | <Area\>.isDisplayed()| The Area is displayed. (At this time, the ViewContent is necessarily allocated to the Area) True if the Area is displayed.|
605 |DisplayingContent| <Area\>.displayingContent()| ViewContent which is displayed in the Area. When the Area is hidden or ViewContent is not allocated, it is not evaluated.
606 |AllocatedContent| <Area\>.allocatedContent()| ViewContent which is allocated to the Area. Even if the Area is hidden after allocation, it is possible to refer to the allocated ViewContent.|
607 |IsHidden| <Area\>.isHidden() |The Area is hidden. Regardless of whether the ViewContent is allocated to the Area or not,true if the Area is hidden.|
608 |ContentValue| <Area\>.contentValue()| The value of the ViewContentState allocated to the Area. If ViewContent is not allocated to the Area, it is not evaluated.|
609 |ContentsList| <Area\>.contentsList()| A set of ViewContent which is allocatable to the Area.|
610 |activeContents| <Area\>.activeContents() |The set of active content amang the ViewContent which is allocatable to the Area|
612 - State reference of ViewContent:
614 |Name | Notation |Meaning|
615 | :--- | :---- | :---- |
616 |IsActive| <ViewContent\>.isActive()| True if there is a Content request of ViewContent.|
617 |IsVisible| <ViewContent\>.isVisible()| The ViewContent is displayed. True if the ViewContent is allocated to any Area.|
618 |StateValue |<ViewContent\>.stateValue() |Priority/value that is defined in active state of the ViewContent. When the ViewContent has no active state, it does not evaluate.|
619 |HasComeEarlierThan| <ViewContentA\>.hasComeEarlierThan(<ViewContentB\>)| True if the ViewContentA’s request has come earlier than the ViewContentB’s. When the either ViewContent has been not requested, it does not evaluate.|
620 |HasComeLaterThan| <ViewContentA\>.hasComeLaterThan(<ViewContentB\>) |True if the ViewContentA’s request has come later than the ViewContentB’s. When the either ViewContent has been not requested, it does not evaluate.|
621 |Allocatables| <ViewContent\>.allocatables()| A set of Areas where the ViewContent can be displayed.|
625 |Name | Notation |Meaning|
626 | :--- | :---- | :---- |
627 |IsOn| <Scene\>.isOn()| True if the Scene is valid.|
628 |Get| <Scene\>.<Property\>.get()| Get scene property value.|
632 |Name | Notation |Meaning|
633 | :--- | :---- | :---- |
634 |isTypeOf| <Model\>.isTypeOf(“<ID of Stereotype\>”)| Whether or not “<ID of Stereotype\>” is used in the <Model\> |
635 |||It can be applied to the following models Area,ViewContent|
639 |Name | Notation |Meaning|
640 | :--- | :---- | :---- |
641 |AND| <Bool expression\> AND <Bool expression\>| True if all Bool expressions are true.|
642 |OR| <Bool expression\> OR <Bool expression\> |True if any Bool expression is true.|
643 |Negation| ! <Bool expression\>| True if Bool expression is false.|
644 |Implication| <Bool expression\> -> <Bool expression\> | A -> B is equivalent to ((A AND B) OR !A).|
645 |Equal sign (Comparison of values)| <Expression\> = <Expression\>| True if the values shown on the left-hand side and the right-hand side are identical.The type of left-hand side and the right-hand side expressions must match.|
646 |Equal sign (Comparison of objects) |<Expression\> == <Expression\>| True if the values shown on the left-hand side and the right-hand side are identical.The type of left-hand side and the right-hand side expressions must match.|
647 |Comparison (greater than) |<Number\> \> <Number\>|True if the Number on the left-hand side is greater than the Number on the right-hand side.|
648 |Comparison (greater than)| <Number\> \>= <Number\>|True if the Number on the left-hand side is greater than equal to the Number on the right-hand side.|
649 |Comparison (less than)| <Number\> < <Number\>| True if the Number on the left-hand side is less than the Number on the right-hand side.|
650 |Comparison (less than)| <Number\> <= <Number\>| True if the Number on the left-hand side is less than the equal to Number on the right-hand side.|
652 - Quantization symbol:
654 |Name | Notation |Meaning|
655 | :--- | :---- | :---- |
656 |∀(For All) |For-All<Set\>{ <x\> \| <Expression\> } |<Set\> contains the ViewContentSet or the SoundContentSet, the AreaSet, the ZoneSet, and the One-time Set. True if <Expression\> is true for all set element <x\>.|
657 |∃(Exists)| Exists< Set\>{ <x\> \| <Expression\> } |<Set\> contains the ViewContentSet or the SoundContentSet, the AreaSet, the ZoneSet, and the One-time Set. True if < Set\> has one or more elements that satisfy <Expression\>.|
659 - Built-in defined Expression:
661 |Name | Notation |Meaning|
662 | :--- | :---- | :---- |
663 |All Area| ALL_AREAS| A set of all the Areas defined in the Model.|
664 |All ViewContent| ALL_VIEWCONTENTS| A set of all the ViewContents defined in the Model.|
665 |IF-THEN-ELSE Syntax| IF (<Bool expression\>)THEN <Expression\>ELSE <Expression\>| The type of the expression must be identical, for the THEN clause, if the Bool expression is true, for THEN and ELSE clause ,if the Bool expression is false.|
666 |Let Expression| let <Variable name\> = <Object expression\>| Evaluate <Object expression\> as variable <variabl name>, which can then be referenced in subsequent expressions|
667 |||Can only be used inside the expression. For-All, Exists, Max, Min, Select|
668 |Pre-arbitration value specifier| (pre)<Area \| ViewContent \| Scene\| Scene.Property\> | Refere to the state before arbitration of Area, ViewContent, Property.|
670 **The syntax precedence and associativity are shown below:**
672 |Priority| Name| Notation| Connectivity|
673 | :--- | :---- | :---- | :---- |
674 |1 |Parentheses| (<Expression\>) |-|
675 |2| ∃(Exists)| Exists<Set\>{ <x\> \| <Expression\> }|-|
676 || ∀(For All)| For-All<Set\>{ <x\> \| <Expression\> }| -|
677 || IF-THEN-ELSE Syntax| IF (<Bool expressinon\>) THEN <Expressinon\> ELSE <Expressinon\>| -|
678 ||SetOf operator| { <Expression\>, <Expression\> }| -|
679 || Pre-arbitration value specifier| (pre)<Area\| ViewContent\| Scene\| Scene.Property\>| -|
680 |3|Predicate connector |<Object\>.<Predicate expression\>| Left|
681 |4 |Negation| ! <Bool expression\>| Right|
682 |5| Comparison (less than)| <Number\> < <Number\>| Left|
683 || Comparison (greater than)|<Number\> \> <Number\>|Left|
684 || Comparison (less than)| <Number\> <= <Number\>| Left|
685 || Comparison (greater than)| <Number\> \>= <Number\>| Left|
686 |6| Equal sign (Comparison of values)| <Expressinon\> = <Expressinon\>| Left|
687 || Equal sign (Comparison of objects)| <Expressinon\> == <Expressinon\>| Left|
688 |7| AND| <BoolExpressinon\> AND <BoolExpressinon\> |Left|
689 |8 |OR| <BoolExpressinon\> OR <BoolExpressinon\>| Left|
690 |9 |Implication| <BoolExpressinon\> -\> <BoolExpressinon\>| Left|
695 Constraint describes constraint expressions. There are two types of constraint expressions Runtime constraints and Offline constraints. A Runtime constraint is a constraint expression that should be be true at the time of arbitration and controls the behavior of arbitration. An Offline constraint is a constraint expression that should be satisfied after arbitration and tests the arbitration result.
700 description: [String]
701 runtime: [true|false]
706 |Syntax element |Description|
708 |description: 0..1| Description|
709 |runtime: 1 |true: Runtime constraint|
710 ||Arbitrate each Area / Zone to be true this constraint.|
711 ||false: Offline constraint|
712 ||Verify that this constraint is true after all Area arbitration.|
713 |[expression] 1| Constraint expression|
718 <br>In the constraint expression, it is possible to express logical AND, logical OR, negation, which is a general logical operator, with AND, OR, and !. By using () you can also use in combination.
720 Example: Content1 is displayed or Content2 and Content3 are not displayed at the same time.
722 Constraint SampleConstraint1 {
724 Content1.isVisible() OR !(Content2.isVisible() AND Content3.isVisible())
727 Example: SampleContent1 is displayed or SampleContent2 is not displayed.
729 Constraint SampleConstraint1 {
730 description: "Sample Constraint Expression"
732 SampleContent1.isVisible() OR !SampleContent2.isVisible()
738 Implications are false only if the left-hand side is true and the right-hand side is false, otherwise it is true.
740 Example: SampleContent4 is displayed if there is a request of SampleContent4.
742 Constraint SampleConstraint3 {
744 SampleContent4.isActive() -> SampleContent4.isVisible()
748 Example: If SampleArea1 displays SampleContent3, SampleArea2 does not display SampleContent3.
750 Constraint SampleConstraint2 {
752 (SampleArea1.displayingContent() == SampleContent3)
753 -> !(SampleArea2.displayingContent() == SampleContent3)
757 Example: If the value of the content displayed on SampleArea1 is higher than the value of the content displayed in SampleArea2, hide SampleArea2.
759 Constraint SampleConstraint2 {
761 (SampleArea1.contentValue() > SampleArea2.contentValue())
762 -> SampleArea2.isHidden())
766 Example: If the value of property1 of the information received from other RBAModel (Project) is 1, Content10 is not displayed.
768 Constraint SampleConstraint {
769 (SampleScene1.isOn() AND SampleScene1.property1.get() = 1)
770 -> ! Content10.isVisible()
776 For-All targets a set, and it is true if all element of the set satisfies a lambda expression ({element name declaration | element condition}).
777 For the set, you can specify a defined set or an One-time set. (Refer to “Group definition” for more informations.)
778 <br>Example: If SampleContent1 is displayed, all Areas of AreaGroup1 is not displayed.
779 <br> It is assumed that "AreaGroup1" is defined as AreaSet.
782 Constraint SampleConstraint {
784 SampleContent1.isVisible() ->
785 For-All AreaGroup1 { x | x.isHidden() }
791 Exists targets a set, and it is true if even one element of the set satisfies a Lambda expression ({element name declaration | element condition}).
792 <br>For the set, you can specify a defined set or an One-time set. (Refer to “Group definition” for more informations.)
793 <br>Example: If any Content of ContentGroup1 is displayed, all Areas of AreaGroup1 is not displayed.
794 <br> It is assumed that "ContentGroup1" is defined as ContentSet.
795 <br> It is assumed that "AreaGroup1" is defined as AreaSet.
797 Constraint SampleConstraint {
799 Exists ContentGroup1{ x | x.isVisible() } ->
800 For-All AreaGroup1 { x | x.isHidden() }
805 Example: If the scene is SampleScene1, SampleContent4 is displayed, otherwise SampleContent4 is not displayed.
808 Constraint SampleConstraint4 {
810 IF(SampleScene1.isOn())
812 SampleContent4.isVisible()
814 !SampleContent4.isVisible()
819 Example: If SampleContent 1 is displayed (before arbitration), SampleContent 2 is not displayed.
821 Constraint SampleConstraint {
823 (pre)SampleContent1.isVisible() -> !SampleContent2.isVisible()
827 - HasComeEarlierThan/HasComeLaterThan
828 Example: If request SampleContent 1 has come earlier then SampleContent 2, SampleContent 2 does not displayed.
830 Constraint SampleConstraint {
832 SampleContent1.hasComeEarlierThan(SampleContent2) -> !SampleContent2.isVisible()
835 Below constraint behave as same as above.
837 Constraint SampleConstraint {
839 SampleContent2.hasComeLaterThan(SampleContent1) -> !SampleContent2.isVisible()
843 #### 8.2 Syntax sugar
845 This syntax sugar simplifies the constraint expressions and improves their readability. You can use them like the existing constraint expressions.
846 Below are the syntax sugars that can be used.
849 <br>It means that the left side value and the right side value are not equal. You can use this to compare objects.
850 True if the left side value and the right side value are not equal.
851 The types of expressions on the left and the right sides must match.
855 |Notation| <Expression1\> != <Expression2\>|
856 |ECE*| !(<Expression1\> == <Expression2\>)|
858 *ECE: Equivalent constraint expression
860 Description example: The ViewContent allocated to AreaA is not Content1.
864 |Notation| AreaA.allocatedContent() != Content1|
865 |ECE| !( AreaA.allocatedContent() == Content1)|
867 - Allocation of Area/Zone
868 <br>It indicates that ViewContent/SoundContent is allocated to the Area/Zone.
869 True if theViewConten/SoundContentt is allocated to the Area/Zone.
871 |Type| State reference of ViewContent|
873 |Notation| <ViewContent\>.isAllocatedTo(<Area\>)|
874 |ECE| <Area\>.allocatedContent() == <ViewContent\>|
876 Description example: The Content1 is allocated to the AreaA.
880 |Notation| Content1.isAllocatedTo(AreaA)|
881 |ECE| AreaA.allocatedContent() == Content1|
883 - Allocation changing of Area/Zone
884 <br>It indicates a changing of the ViewContent’s/SoundContent’s allocated to the Area/Zone.
885 True if the changing happens.
887 |Type |State reference of Area|
889 |Notation| <Area\>.isChanged()|
890 |ECE| !((pre)<Area\>.allocatedContent() == <Area\>.allocatedContent())|
892 Description example: The ViewContent allocated to AreaA has changed.
896 |Notation| AreaA.isChanged()|
897 |ECE| !((pre)AreaA.allocatedContent() == AreaA.allocatedContent())|
899 - Changing of a content allocated to Area/Zone
900 <br>It indicates whether a ViewContent/SoundContent allocated to the Area/Zone has changed to the specified ViewContent/SoundContent.True if the changing happens
902 |Type |State reference of Area|
904 |Notation| <Area\>.isTranslatedTo(<ViewContent\>)|
905 |ECE| !((pre)<Area\>.allocatedContent() == <ViewContent\>) AND (<Area\>.allocatedContent() == <ViewContent\>)|
907 Description example: A ViewContent allocated to the AreaA has changed to Content1.
911 |Notation| AreaA.isTranslatedTo(Content1)|
912 |ECE |!((pre)AreaA.allocatedContent() == Content1) AND (AreaA.allocatedContent() == Content1)|
914 - Displaying in the Area
915 <br>It indicates whether the ViewContent displayed or not in the Area.
916 True if the ViewContent is displayed in the Area.
918 |Type| State reference of ViewContent|
920 |Notation| <ViewContent\>.isDisplayedOn(<Area\>)|
921 |ECE| <Area\>.isDisplayed() AND (<Area\>.displayingContent() == <ViewContent\>)|
923 Description example: The Content1 is displayed in the AreaA.
927 |Notation| Content1.isDisplayedOn(AreaA)|
928 |ECE| AreaA.isDisplayed() AND (AreaA.displayingContent() == Content1)|
930 - Display changing of the Area
931 <br>It indicates whether the display of the Area changes or not.
932 True if the change happens.
934 |Type |State reference of Area|
936 |Notation| <Area\>.isChangedDisplay()|
937 |ECE |!((pre)<Area\>.displayingContent() == <Area\>.displayingContent()) OR ((pre)<Area\>.isDisplayed() AND !<Area\>.isDisplayed()) OR (!(pre)<Area\>.isDisplayed() AND <Area\>.isDisplayed())|
939 Description example: The display of the AreaA has changed.
943 |Notation |AreaA.isChangedDisplay()|
944 |ECE |!((pre)AreaA.displayingContent() == AreaA.displayingContent()) OR((pre)AreaA.isDisplayed() AND !AreaA.isDisplayed()) OR(!(pre)AreaA.isDisplayed() AND AreaA.isDisplayed())|
946 - Changing of the displayed ViewContent to the specified ViewContent
947 <br>It indicates whether the ViewContent displayed in the Area has changed to anther specified ViewContent.
948 True if the change happens.
950 |Type |State reference of Area|
952 |Notation| <Area\>.isTranslatedViewTo(<ViewContent\>)|
953 |ECE |(<Area\>.isDisplayed()) AND (<Area\>.displayingContent() == <ViewContent\>) AND (!((pre)<Area\>.displayingContent() == <ViewContent\>) OR !(pre) <Area\>.isDisplayed())|
955 Description example: A ViewContent displayed in the AreaA has changed to another Content1.
959 |Notation| AreaA.isTranslatedViewTo(Content1)|
960 |ECE| (AreaA.isDisplayed()) AND (AreaA.displayingContent() == Content1) AND (!((pre)AreaA.displayingContent() == Content1) OR !(pre)AreaA.isDisplayed())|
962 - Hide a lower priority Area
963 <br>Compare the two Areas and hide the Area displaying a ViewContent with lower priority.
965 |Type| State reference of Area|
967 |Notation| HideLowerPriority(<Area1\>, <Area2\>)|
968 |ECE| ((<Area1\>.contentValue() < <Area2\>.contentValue() -\> <Area1\>.isHidden()) AND (<Area1\>.contentValue() \> <Area2\>.contentValue() -\> <Area2\>.isHidden()))|
970 Description example: AreaA and AreaB are compared to hide the Area which displays a ViewContent with lower priority.
974 |Notation| HideLowerPriority(AreaA, AreaB)|
975 |ECE| ((AreaA.contentValue() < AreaB.contentValue() -\> AreaA.isHidden()) AND (AreaA.contentValue() \> AreaB.contentValue() -\> AreaB.isHidden()))|
977 ### 9. Group definition
981 When dealing with multiple Areas in the Constraint expression, in order to describe it simply, you can define multiple Areas together in one group.
986 description: [String]
987 target: [ [ID of Area] ]
991 |Syntax element | Description|
993 |description: | 0..1 Description|
994 |target: 0..* | Areas or AreaSets which compose the group. Specify the ID of the Area or the AreaSet with comma-separated.|
999 description: "Area constituting the main screen"
1000 target: [SampleArea, SampleArea1, OtherAreaSet]
1003 #### 9.2 ViewContentSet
1005 When dealing with multiple ViewContents in the Constraint expression, in order to describe it simply, you can define multiple ViewContents together in one group.
1009 ViewContentSet [ID] {
1010 description: [String]
1011 allocatable: [ [ID of Area] ]
1012 target: [ [ID of ViewContent] ]
1016 |Syntax element | Description|
1018 |description: | 0..1 Description|
1019 |allocatable: 0..*| Displayable Areas or AreaSets.Specify the ID of the Areas or the AreaSets with comma-separated.|
1020 |target: 0..*| ViewContents or ViewContentSets which compose the group. Specify the ID of the ViewContents or ViewContentSets with comma-separated.|
1022 Description example:
1024 ViewContentSet InterruptContent{
1026 MessageArea, HUDMessageArea, InterruptAreaGroup
1029 TEL,Power, ViewContentGroup
1034 #### 9.3 One-time Set
1036 Specify an set in the For-All or the Exists constraint, you can define the One-time set.
1043 |Syntax element | Description|
1045 |[ID] 1..* |Element of the set. Specify the IDs of elements with comma-separated.
1046 ||The type of elements should be same.|
1047 ||At this time, Area and AreaSet regard it as the same type.( ViewContent and ViewContentSet are treat similarly.)
1049 - Description example: Define the One-time set as AreaSet.
1051 Constraint SampleConstraint {
1053 SampleContent1.isVisible() ->
1054 For-All {Area1, Area2, Area3} { x | x.isHidden() }
1058 - Description example: Define the One-time set as ViewContentSet.
1060 Constraint SampleConstraint {
1062 Exists {ViewContent1, ViewContentSet1} { x | x.isActive() -> x.isVisible() }
1065 ### 10. Scene definition
1067 Scene comprehensively expresses the state at the time including the system, and it is used to switch the status of Area/Zone, View/Sound Content by Scene. You can also define the Global scene and share the results of arbitration among multiple RBA Models (Projects).
1072 description: [String]
1073 global: [true|false]
1078 |Syntax element | Description|
1080 |description: 0..1| Description|
1081 |global: 0..1| true: Global Scene for sharing arbitration results with other RBA Models (Projects).|
1082 ||false: Local Scene.|
1083 ||If not defined, consider it as "false".|
1084 |[Property] 0..*| Information for sharing arbitration results with other RBA models (Projects).|
1085 ||Can define only if global is true.|
1087 Description example:
1089 Scene AutoDrivingScene {
1090 description: "In auto driving mode"
1093 Scene DisplayEventNotification {
1095 int OverallPriority: 6
1102 Property is arbitrary properties which is defined in the Scene.
1106 int [String]: [Number]
1109 |Syntax element | Description|
1111 |[String] 1 |Arbitrary Property name|
1112 |[Number] 1 |Default value of Property. Positive integer can be specified.|
1114 Description example:
1123 StereoType<[Target Model Name]> [ID] ([valiable]) @BEGIN@
1124 description: [String]
1125 [Propaties of Element]
1129 |Syntax element | Description|
1131 |description: 0..1| Description|
1132 |[Target Model Name] 1| Identify the applicable model by describing the model element keywords|
1133 ||It can be applied to the Area, ViewContent models|
1134 |[valiable] 0..*| Describe an arbitrary variable as the parameter to be replaced, which will be set in the property of the model element specified in [Target Model Name].If there are multiple variables, separate them with commas.|
1135 |[Properties of Element] 1..*| Describe the properties of the model element specified in [Target Model Name].In the property, the value to be replaced is written in @{[variable]} .|
1136 ||The variables must match the variables described in ().|
1138 Description example:
1140 Stereotype<ViewContent> display_warnning (name,allocatable,priority) @BEGIN@
1141 description: “@{name}”
1142 allocatable: [@{allocatable}]
1147 State NORMAL { piority: @{priority} }
1156 <<[Stereotype ID]>> | <<[Stereotype ID]>>{“[String]”}
1159 |Syntax element | Description|
1161 |[ID of Stereotype] 0..*| Can be assigned to Area, ViewContent|
1162 ||If StereoType is defined, then the child elements and attributes defined there will be expanded as child elements and attributes of this object|
1163 ||Multiple definitions can be made for a single model. To define more than one, define them consecutively.|
1164 |[String] 0..* |Argument value|
1165 ||If there is no argument, it can be omitted|
1167 Description example:
1169 ViewContent Warning_1 {
1170 <<display_warning>>{ “Warning_01”,”Area1”,“1” }
1173 ViewContent Warning_2 {
1174 <<display_warning>>{ “Warning_02”,”Area2”,”2” }
1177 Stereotype<ViewContent> display_warnning (name,allocatable,priority) @BEGIN@
1178 description: “@{name}”
1179 allocatable: [@{allocatable}]
1184 State NORMAL { piority: @{priority} }
1188 ## Generate .json from .rba file
1189 Download [prebuilt package](https://git.automotivelinux.org/staging/rba-tool/tree/tool_bin)
1191 - If some errors occur, RBAModel.json is not generated (exit code 1).
1193 java -cp ./ -jar JSONGenerator.jar "[path to model directory]" "[path to output directory]"
1198 - RBAModel.json file is generated in directory same as JSONGenerator.jar
1200 java -cp ./ -jar JSONGenerator.jar "./RBAModel.rba"
1203 - RBAModel.json file is generated in ~/ directory
1205 java -cp ./ -jar JSONGenerator.jar "./RBAModel.rba" "~/"
1207 Note: For the reference .rba file is given under the path [prebuilt package/sample_model](https://git.automotivelinux.org/staging/rba-tool/tree/tool_bin/sample_model)