Skip to content

Commit

Permalink
Add attributes of built-in types
Browse files Browse the repository at this point in the history
  • Loading branch information
henrikt-ma committed Dec 3, 2020
1 parent 477f945 commit c1073f5
Showing 1 changed file with 28 additions and 8 deletions.
36 changes: 28 additions & 8 deletions chapters/classes.tex
Original file line number Diff line number Diff line change
Expand Up @@ -1299,24 +1299,33 @@ \section{Predefined Types and Classes}\label{predefined-types-and-classes}
It also follows that the only way to declare a subtype of e.g.\ \lstinline!Real! is to use the \lstinline!extends! mechanism.
\end{nonnormative}

The definitions use \lstinline!RealType!, \lstinline!IntegerType!, \lstinline!BooleanType!, \lstinline!StringType!, \lstinline!EnumType!
as mnemonics corresponding to machine representations.
The definitions use \lstinline!RealType!\indexinline{RealType}, \lstinline!IntegerType!\indexinline{IntegerType}, \lstinline!BooleanType!\indexinline{BooleanType}, \lstinline!StringType!\indexinline{StringType}, \lstinline!EnumType!\indexinline{EnumType} as mnemonics corresponding to machine representations.

\subsection{Real Type}\label{real-type}

The following is the predefined \lstinline!Real!\index{Real@\robustinline{Real}} type:
The following is the predefined \lstinline!Real!\index{Real@\robustinline{Real}} type:%
\index{quantity@\robustinline{quantity}!attribute of \robustinline{Real}}%
\index{unit@\robustinline{unit}!attribute of \robustinline{Real}}%
\index{displayUnit@\robustinline{displayUnit}!attribute of \robustinline{Real}}%
\index{min@\robustinline{min}!attribute of \robustinline{Real}}%
\index{max@\robustinline{max}!attribute of \robustinline{Real}}%
\index{start@\robustinline{start}!attribute of \robustinline{Real}}%
\index{fixed@\robustinline{fixed}!attribute of \robustinline{Real}}%
\index{nominal@\robustinline{nominal}!attribute of \robustinline{Real}}%
\index{unbounded@\robustinline{unbounded}!attribute of \robustinline{Real}}%
\index{stateSelect@\robustinline{stateSelect}!attribute of \robustinline{Real}}%
\begin{lstlisting}[language=modelica]
type Real // Note: Defined with Modelica syntax although predefined
RealType value; // Accessed without dot-notation
parameter StringType quantity = "";
parameter StringType unit = "" "Unit used in equations";
parameter StringType displayUnit = "" "Default display unit";
parameter RealType min=-Inf, max=+Inf; // Inf denotes a large value
parameter RealType min = -Inf, max = +Inf; // Inf denotes a large value
parameter RealType start = 0; // Initial value
parameter BooleanType fixed = true, // default for parameter/constant;
= false; // default for other variables
parameter RealType nominal; // Nominal value
parameter BooleanType unbounded=false; // For error control
parameter BooleanType unbounded = false; // For error control
parameter StateSelect stateSelect = StateSelect.default;
equation
assert(value >= min and value <= max, "Variable value out of limit");
Expand All @@ -1333,7 +1342,12 @@ \subsection{Real Type}\label{real-type}

\subsection{Integer Type}\label{integer-type}

The following is the predefined \lstinline!Integer!\index{Integer@\robustinline{Integer}} type:
The following is the predefined \lstinline!Integer!\index{Integer@\robustinline{Integer}} type:%
\index{quantity@\robustinline{quantity}!attribute of \robustinline{Integer}}%
\index{min@\robustinline{min}!attribute of \robustinline{Integer}}%
\index{max@\robustinline{max}!attribute of \robustinline{Integer}}%
\index{start@\robustinline{start}!attribute of \robustinline{Integer}}%
\index{fixed@\robustinline{fixed}!attribute of \robustinline{Integer}}%
\begin{lstlisting}[language=modelica]
type Integer // Note: Defined with Modelica syntax although predefined
IntegerType value; // Accessed without dot-notation
Expand All @@ -1351,7 +1365,10 @@ \subsection{Integer Type}\label{integer-type}

\subsection{Boolean Type}\label{boolean-type}

The following is the predefined \lstinline!Boolean!\index{Boolean@\robustinline{Boolean}} type:
The following is the predefined \lstinline!Boolean!\index{Boolean@\robustinline{Boolean}} type:%
\index{quantity@\robustinline{quantity}!attribute of \robustinline{Boolean}}%
\index{start@\robustinline{start}!attribute of \robustinline{Boolean}}%
\index{fixed@\robustinline{fixed}!attribute of \robustinline{Boolean}}%
\begin{lstlisting}[language=modelica]
type Boolean // Note: Defined with Modelica syntax although predefined
BooleanType value; // Accessed without dot-notation
Expand All @@ -1364,7 +1381,10 @@ \subsection{Boolean Type}\label{boolean-type}

\subsection{String Type}\label{string-type}

The following is the predefined \lstinline!String!\index{String@\robustinline{String}} type:
The following is the predefined \lstinline!String!\index{String@\robustinline{String}} type:%
\index{quantity@\robustinline{quantity}!attribute of \robustinline{String}}%
\index{start@\robustinline{start}!attribute of \robustinline{String}}%
\index{fixed@\robustinline{fixed}!attribute of \robustinline{String}}%
\begin{lstlisting}[language=modelica]
type String // Note: Defined with Modelica syntax although predefined
StringType value; // Accessed without dot-notation
Expand Down

0 comments on commit c1073f5

Please sign in to comment.