Builtins Package
Overview
The BASE.base_types.builtins package includes interface classes that provide common utility functions. It is shown below.
Class Definitions
Env Interface
-
Definition
-
Effective
-
BMM
-
UML
Interface |
Env |
|
|---|---|---|
Description |
Class representing the real-world environment, providing basic information like current time, date, etc. |
|
Functions |
Signature |
Meaning |
1..1 |
current_date (): |
Return today’s date in the current locale. |
1..1 |
current_time (): |
Return current time in the current locale. |
1..1 |
current_date_time (): |
Return current date/time in the current locale. |
1..1 |
current_time_zone (): |
Return the timezone of the current locale. |
| Env | |
|---|---|
Class representing the real-world environment, providing basic information like current time, date, etc. |
|
Functions |
|
current_date (): |
Return today’s date in the current locale. |
current_time (): |
Return current time in the current locale. |
current_date_time (): |
Return current date/time in the current locale. |
current_time_zone (): |
Return the timezone of the current locale. |
{
"_type": "P_BMM_INTERFACE",
"name": "Env",
"documentation": "Class representing the real-world environment, providing basic information like current time, date, etc.",
"functions": {
"current_date": {
"name": "current_date",
"documentation": "Return today's date in the current locale.",
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Iso8601_date"
}
},
"current_time": {
"name": "current_time",
"documentation": "Return current time in the current locale.",
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Iso8601_time"
}
},
"current_date_time": {
"name": "current_date_time",
"documentation": "Return current date/time in the current locale.",
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Iso8601_date_time"
}
},
"current_time_zone": {
"name": "current_time_zone",
"documentation": "Return the timezone of the current locale.",
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Iso8601_timezone"
}
}
}
}
Locale Interface
-
Definition
-
Effective
-
BMM
-
UML
Interface |
Locale |
|
|---|---|---|
Description |
Class representing current Locale. |
|
Functions |
Signature |
Meaning |
1..1 |
primary_language (): |
Primary language of the current locale. |
| Locale | |
|---|---|
Class representing current Locale. |
|
Functions |
|
primary_language (): |
Primary language of the current locale. |
{
"_type": "P_BMM_INTERFACE",
"name": "Locale",
"documentation": "Class representing current Locale.",
"functions": {
"primary_language": {
"name": "primary_language",
"documentation": "Primary language of the current locale.",
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Terminology_code"
}
}
}
}
Statistical_evaluator Interface
-
Definition
-
Effective
-
BMM
-
UML
Interface |
Statistical_evaluator |
|
|---|---|---|
Description |
A basic statistical evaluator class providing common functions on collections of numbers. |
|
Functions |
Signature |
Meaning |
1..1 |
Sum of a container of values. |
|
1..1 |
Synonym for |
|
1..1 |
Mean (arithmetic average) of a container of values. |
|
1..1 |
Return numerically centre value in ordered form of container contents. |
|
1..1 |
Mode (most frequent) of a container of values. |
|
1..1 |
Maximum of a container of values. |
|
1..1 |
Minimum of a container of values. |
|
1..1 |
Return the number of items in |
|
1..1 |
Compute standard deviation of a container of values. |
|
| Statistical_evaluator | |
|---|---|
A basic statistical evaluator class providing common functions on collections of numbers. |
|
Functions |
|
Sum of a container of values. |
|
Synonym for |
|
Mean (arithmetic average) of a container of values. |
|
Return numerically centre value in ordered form of container contents. |
|
Mode (most frequent) of a container of values. |
|
Maximum of a container of values. |
|
Minimum of a container of values. |
|
Return the number of items in |
|
Compute standard deviation of a container of values. |
|
{
"_type": "P_BMM_INTERFACE",
"name": "Statistical_evaluator",
"documentation": "A basic statistical evaluator class providing common functions on collections of numbers.",
"functions": {
"sum": {
"name": "sum",
"documentation": "Sum of a container of values.",
"parameters": {
"vals": {
"_type": "P_BMM_GENERIC_FUNCTION_PARAMETER",
"name": "vals",
"type_def": {
"root_type": "Container",
"generic_parameters": [
"Numeric"
]
}
}
},
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Double"
}
},
"avg": {
"name": "avg",
"documentation": "Synonym for `_mean()_`.",
"parameters": {
"vals": {
"_type": "P_BMM_GENERIC_FUNCTION_PARAMETER",
"name": "vals",
"type_def": {
"root_type": "Container",
"generic_parameters": [
"Numeric"
]
}
}
},
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Double"
}
},
"mean": {
"name": "mean",
"documentation": "Mean (arithmetic average) of a container of values.",
"parameters": {
"vals": {
"_type": "P_BMM_GENERIC_FUNCTION_PARAMETER",
"name": "vals",
"type_def": {
"root_type": "Container",
"generic_parameters": [
"Numeric"
]
}
}
},
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Double"
}
},
"median": {
"name": "median",
"documentation": "Return numerically centre value in ordered form of container contents.",
"parameters": {
"vals": {
"_type": "P_BMM_GENERIC_FUNCTION_PARAMETER",
"name": "vals",
"type_def": {
"root_type": "Container",
"generic_parameters": [
"Numeric"
]
}
}
},
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Numeric"
}
},
"mode": {
"name": "mode",
"documentation": "Mode (most frequent) of a container of values.",
"parameters": {
"vals": {
"_type": "P_BMM_GENERIC_FUNCTION_PARAMETER",
"name": "vals",
"type_def": {
"root_type": "Container",
"generic_parameters": [
"Numeric"
]
}
}
},
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Numeric"
}
},
"max": {
"name": "max",
"documentation": "Maximum of a container of values.",
"parameters": {
"vals": {
"_type": "P_BMM_GENERIC_FUNCTION_PARAMETER",
"name": "vals",
"type_def": {
"root_type": "Container",
"generic_parameters": [
"Numeric"
]
}
}
},
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Numeric"
}
},
"min": {
"name": "min",
"documentation": "Minimum of a container of values.",
"parameters": {
"vals": {
"_type": "P_BMM_GENERIC_FUNCTION_PARAMETER",
"name": "vals",
"type_def": {
"root_type": "Container",
"generic_parameters": [
"Numeric"
]
}
}
},
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Numeric"
}
},
"count": {
"name": "count",
"documentation": "Return the number of items in `_vals_`, i.e. `_vals.count_`.",
"parameters": {
"vals": {
"_type": "P_BMM_GENERIC_FUNCTION_PARAMETER",
"name": "vals",
"type_def": {
"root_type": "Container",
"generic_parameters": [
"Numeric"
]
}
}
},
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Numeric"
}
},
"std_dev": {
"name": "std_dev",
"documentation": "Compute standard deviation of a container of values.",
"parameters": {
"vals": {
"_type": "P_BMM_GENERIC_FUNCTION_PARAMETER",
"name": "vals",
"type_def": {
"root_type": "Container",
"generic_parameters": [
"Numeric"
]
}
}
},
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Double"
}
}
}
}
Math Interface
-
Definition
-
Effective
-
BMM
-
UML
Interface |
Math |
|
|---|---|---|
Description |
Mathematical computation. |
|
Functions |
Signature |
Meaning |
1..1 |
Compute natural log of v. |
|
1..1 |
Compute base 10 log of v. |
|
1..1 |
Compute sin(v). |
|
| Math | |
|---|---|
Mathematical computation. |
|
Functions |
|
Compute natural log of v. |
|
Compute base 10 log of v. |
|
Compute sin(v). |
|
{
"_type": "P_BMM_INTERFACE",
"name": "Math",
"documentation": "Mathematical computation.",
"functions": {
"ln": {
"name": "ln",
"documentation": "Compute natural log of v.",
"parameters": {
"v": {
"_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
"name": "v",
"type": "Numeric"
}
},
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Double"
}
},
"log": {
"name": "log",
"documentation": "Compute base 10 log of v.",
"parameters": {
"v": {
"_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
"name": "v",
"type": "Numeric"
}
},
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Double"
}
},
"sin": {
"name": "sin",
"documentation": "Compute sin(v).",
"parameters": {
"(v": {
"_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
"name": "(v",
"type": "Numeric"
}
},
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Double"
}
}
}
}
Quantity_converter Interface
-
Definition
-
Effective
-
BMM
-
UML
Interface |
Quantity_converter |
|
|---|---|---|
Description |
Quantity conversion. |
|
Functions |
Signature |
Meaning |
1..1 |
convert_value ( |
Convert |
| Quantity_converter | |
|---|---|
Quantity conversion. |
|
Functions |
|
convert_value ( |
Convert |
{
"_type": "P_BMM_INTERFACE",
"name": "Quantity_converter",
"documentation": "Quantity conversion.",
"functions": {
"convert_value": {
"name": "convert_value",
"documentation": "Convert `_value_` of physical property type (e.g. 'pressure' etc) from one units to another.",
"parameters": {
"value": {
"_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
"name": "value",
"type": "Real"
},
"from_units": {
"_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
"name": "from_units",
"type": "String"
},
"to_units": {
"_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
"name": "to_units",
"type": "String"
},
"property": {
"_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
"name": "property",
"type": "Terminology_code"
}
},
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Real"
}
}
}
}