The SEDRIS Data Representation Model
APPENDIX A - Classes Pseudo Code Function |
---|
An instance of this DRM class specifies the behaviour of a function that does not correspond to an entry of SE_Predefined_Function.
Consider a <Translation> instance representing the current position of a lift cage in a lift shaft. Since the translation_amount varies, the <Translation> instance has a <Translation Control Link> component with a <Pseudo Code Function> component specifying the translation_amount. The name field of the <Pseudo Code Function> component is set to {SE_LOCALE_DEFAULT, 26, "lift cage control function"} and the pseudo_code field content is "Let B be the <Variable> component representing the button that summons the lift cage. If B is on and the lift cage is present, open the door. If B is on and the lift cage is not present, translate the lift cage into position at a speed of one metre per second and open the door when the lift cage is in position."
The decision to support <Pseudo Code Function> was based on three primary concerns. First, we felt that it would be nearly impossible to capture every possible function that would be used to define the behaviour of <Control Link> instances. Second, <Expression> instances lack the expressive power to define functions that require looping, branching, etc. Finally, given the first two, it is recognized that many functions that are relatively simple when viewed as pseudo code or code fragments, would become overly complicated when converted into an expression tree. It is important to keep in mind, that while any valid <Expression> instances could be converted into executable code or structures that could be directly used by a consuming system, most systems will not use them that way. Currently, the majority of consuming systems would require that the expression be recoded into the consuming system. For complex functions, pseudo code may be easier to convert.
EDCS_Attribute_Value_Type | value_type; | 2 |
---|
SE_String | name; | 3 |
---|---|---|
SE_String | pseudo_code; | 4 |
The value_type of a <Function> instance specifies the type of value returned.
The name field specifies the name of the function being represented.
The pseudo_code field specifies the pseudo code describing the behaviour of the function represented by the <Pseudo Code Function> instance.
|