Difference between revisions of "Extensions.Util.Min"

From emotive
Jump to navigation Jump to search
(Created page with "{{DISPLAYTITLE: '''Min'''}}Category:Util == Classification == {{ClassificationActivity | Min | UPDATING...<!--Create an event source for change event--> | Term | Ex...")
 
(Edited by Ngoc Tran.)
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
{{DISPLAYTITLE:  '''Min'''}}[[Category:Util]]
 
{{DISPLAYTITLE:  '''Min'''}}[[Category:Util]]
 
== Classification ==
 
== Classification ==
{{ClassificationActivity | Min | UPDATING...<!--Create an event source for change event--> | [[Term]] | [[Extensions.Util|OTX Util extension]] | UPDATING... | UPDATING... | UPDATING... }}
+
{{ClassificationActivity | Min|Gets the min of all operands. | [[Term]] | [[Extensions.Util|OTX Util extension]] | [[Extensions.Util#Terms|Util related terms]] | - | - }}
  
 
== OTL Syntax ==
 
== OTL Syntax ==
UPDATING...<!--
 
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
EventSourceTerm = EventHandling.MonitorChangeEventSource(Variable);
+
NumericTerm Util.Min({NumericTerm[ ] numeral});
 
</syntaxhighlight>
 
</syntaxhighlight>
-->
 
  
 
== Description ==
 
== Description ==
UPDATING...<!--
+
The OTX '''Min''' term is a NumericTerm which returns the '''Min''' of all its operands.
The OTX '''MonitorChangeEventSource''' term creates an event source that monitors the value of a variable and an event triggers when the value changed. Event queue should start immediately as soon as the event source is created.
 
  
{{Note|The case when a value to a previously uninitialized variable is assigned to count as a change event and make no mistake.}}
+
{{Important|The actual return data type of the '''Min''' term depends on the data types of the operands: If one of the operands is Float, all Integer operands are automatically promoted to Float prior to the operation and the returned value is Float. Otherwise, the returned value is Integer.}}
  
{{TermReturnValue| [[Extensions.EventHandling.EventSource|EventSource]] | '''The EventSource''', the changes in the value of a variable monitored.}}
+
{{TermReturnValue| [[Numeric]] | The min of all its operands.}}
  
 
== Properties ==
 
== Properties ==
UPDATING...//
 
 
{| {{TableHeader}}
 
{| {{TableHeader}}
 
{{TableRowPropertiesHeader}}
 
{{TableRowPropertiesHeader}}
{{TableRowPropertie1| Variable | - | [[Variable]] | - | [1] | The variable which has to be monitored.}}
+
{{TableRowPropertie2| Numeral | [[Numeric]] | [[Term]] | - | [2..*] | The numeric operands of the Min Term.}}
 
|}
 
|}
-->
 
  
 
== OTL Examples ==
 
== OTL Examples ==
UPDATING...<!--
 
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
Boolean Bool1 = false;
+
/// Local Declarations
EventHandling.EventSource EventSource1;
 
EventHandling.Event Event1;
 
  
EventSource1 = EventHandling.MonitorChangeEventSource(Bool1);
+
Float Float1;
parallel
+
 
{
+
/// Flow
  lane
+
 
  {
+
// Result: Float1 = 0.9
      Bool1 = true;
+
Float1 = Util.Min({0.99, 0.97, 0.93, 0.91, 0.9});
  }
 
  lane
 
  {
 
      EventHandling.WaitForEvent({EventSource1}, Event1);
 
  }
 
}
 
 
</syntaxhighlight>
 
</syntaxhighlight>
-->
 
  
 
== See also ==
 
== See also ==
 
[[Extensions.Util.Compare|Compare]] <br/>
 
[[Extensions.Util.Compare|Compare]] <br/>
 
[[Extensions.Util.CopyByteField|CopyByteField]] <br/>
 
[[Extensions.Util.CopyByteField|CopyByteField]] <br/>
 +
[[Extensions.Util.GetRandomNumber|GetRandomNumber]] <br/>
 
[[Extensions.Util.IsInitialized|IsInitialized]] <br/>
 
[[Extensions.Util.IsInitialized|IsInitialized]] <br/>
 
[[Extensions.Util.ListIndexOf|ListIndexOf]] <br/>
 
[[Extensions.Util.ListIndexOf|ListIndexOf]] <br/>

Latest revision as of 04:57, 17 February 2020

Classification

Name Min
Short Description Gets the min of all operands.
Class Term
Extension OTX Util extension
Group Util related terms
Exceptions -
Checker Rules -
Standard Compliant Yes

OTL Syntax

NumericTerm Util.Min({NumericTerm[ ] numeral});

Description

The OTX Min term is a NumericTerm which returns the Min of all its operands.

Exclamation.png Important: The actual return data type of the Min term depends on the data types of the operands: If one of the operands is Float, all Integer operands are automatically promoted to Float prior to the operation and the returned value is Float. Otherwise, the returned value is Integer.

Return Value

The Term returns the value, see table below.

Icons Note.png In OTX, Terms are categorized according to its return data type!
Data Type Description
Numeric The min of all its operands.

Properties

Name Data Type Class Default Cardinality Description
Numeral Numeric Term - [2..*] The numeric operands of the Min Term.

OTL Examples

/// Local Declarations

Float Float1;

/// Flow

// Result: Float1 = 0.9
Float1 = Util.Min({0.99, 0.97, 0.93, 0.91, 0.9});

See also

Compare
CopyByteField
GetRandomNumber
IsInitialized
ListIndexOf
ListIndexOfAny
ListReverse
ListSort
Max
StringFormat