Builtins Package

Overview

The BASE.base_types.builtins package includes interface classes that provide common utility functions. It is shown below.

BASE base types.builtins
Figure 1. base.base_types.builtins Package

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 (): Iso8601_date

Return today’s date in the current locale.

1..1

current_time (): Iso8601_time

Return current time in the current locale.

1..1

current_date_time (): Iso8601_date_time

Return current date/time in the current locale.

1..1

current_time_zone (): Iso8601_timezone

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 (): Iso8601_date [1..1]

Return today’s date in the current locale.

current_time (): Iso8601_time [1..1]

Return current time in the current locale.

current_date_time (): Iso8601_date_time [1..1]

Return current date/time in the current locale.

current_time_zone (): Iso8601_timezone [1..1]

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"
            }
        }
    }
}
Env

Locale Interface

  • Definition

  • Effective

  • BMM

  • UML

Interface

Locale

Description

Class representing current Locale.

Functions

Signature

Meaning

1..1

primary_language (): Terminology_code

Primary language of the current locale.

Locale

Class representing current Locale.

Functions

primary_language (): Terminology_code [1..1]

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"
            }
        }
    }
}
Locale

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 (
vals: Container<Numeric>[1]
): Double

Sum of a container of values.

1..1

avg (
vals: Container<Numeric>[1]
): Double

Synonym for mean().

1..1

mean (
vals: Container<Numeric>[1]
): Double

Mean (arithmetic average) of a container of values.

1..1

median (
vals: Container<Numeric>[1]
): Numeric

Return numerically centre value in ordered form of container contents.

1..1

mode (
vals: Container<Numeric>[1]
): Numeric

Mode (most frequent) of a container of values.

1..1

max (
vals: Container<Numeric>[1]
): Numeric

Maximum of a container of values.

1..1

min (
vals: Container<Numeric>[1]
): Numeric

Minimum of a container of values.

1..1

count (
vals: Container<Numeric>[1]
): Numeric

Return the number of items in vals, i.e. vals.count.

1..1

std_dev (
vals: Container<Numeric>[1]
): Double

Compute standard deviation of a container of values.

Statistical_evaluator

A basic statistical evaluator class providing common functions on collections of numbers.

Functions

sum (
vals: Container<Numeric>[1]
): Double [1..1]

Sum of a container of values.

avg (
vals: Container<Numeric>[1]
): Double [1..1]

Synonym for mean().

mean (
vals: Container<Numeric>[1]
): Double [1..1]

Mean (arithmetic average) of a container of values.

median (
vals: Container<Numeric>[1]
): Numeric [1..1]

Return numerically centre value in ordered form of container contents.

mode (
vals: Container<Numeric>[1]
): Numeric [1..1]

Mode (most frequent) of a container of values.

max (
vals: Container<Numeric>[1]
): Numeric [1..1]

Maximum of a container of values.

min (
vals: Container<Numeric>[1]
): Numeric [1..1]

Minimum of a container of values.

count (
vals: Container<Numeric>[1]
): Numeric [1..1]

Return the number of items in vals, i.e. vals.count.

std_dev (
vals: Container<Numeric>[1]
): Double [1..1]

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"
            }
        }
    }
}
Statistical_evaluator

Math Interface

  • Definition

  • Effective

  • BMM

  • UML

Interface

Math

Description

Mathematical computation.

Functions

Signature

Meaning

1..1

ln (
v: Numeric[1]
): Double

Compute natural log of v.

1..1

log (
v: Numeric[1]
): Double

Compute base 10 log of v.

1..1

sin (
(v: Numeric[1]
): Double

Compute sin(v).

Math

Mathematical computation.

Functions

ln (
v: Numeric[1]
): Double [1..1]

Compute natural log of v.

log (
v: Numeric[1]
): Double [1..1]

Compute base 10 log of v.

sin (
(v: Numeric[1]
): Double [1..1]

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"
            }
        }
    }
}
Math

Quantity_converter Interface

  • Definition

  • Effective

  • BMM

  • UML

Interface

Quantity_converter

Description

Quantity conversion.

Functions

Signature

Meaning

1..1

convert_value (
value: Real[1],
from_units: String[1],
to_units: String[1],
property: Terminology_code[1]
): Real

Convert value of physical property type (e.g. 'pressure' etc) from one units to another.

Quantity_converter

Quantity conversion.

Functions

convert_value (
value: Real[1],
from_units: String[1],
to_units: String[1],
property: Terminology_code[1]
): Real [1..1]

Convert value of physical property type (e.g. 'pressure' etc) from one units to another.

{
    "_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"
            }
        }
    }
}
Quantity_converter