new SetType(parameters)
- Description:
Specifies a set type, i.e. a unordered non-repetitive set of elements.
Extends: Type. This class extends Type, with all public methods available.
Type parameters
General parameters
name: ...
The type name, if specific. By default the type name isset-of-$itemType
.itemType: ...
The type elements if any. By default, "value", means any value.
Parameters for the syntactic projection
minLength: ...
The minimal number of items in the list. By default0
.maxLength: ...
The maximal number of items in the list. By default unbounded (-1
).
Parameters for the cost calculation
deleteCost: ...
The non-negative deleting cost value.- By default uses the
getDistance()
between the item and an empty data structure.
- By default uses the
insertCost: ...
The non-negative inserting cost value.- By default equals to the
deleteCost
.
- By default equals to the
editCost: ...
The non-negative editing cost value.- By default uses the
getDistance()
between each item.
- By default uses the
SetType specification
Syntactic projection - If the value is empty, it corresponds to an empty set.
- If the value is not a set, it is encapsulated in a [ value ] singleton.
- If the set length is not in the (optional) [minLength, maxLength] bounds a message is issued, but the set is neither truncated nor extended.
- Each set item is syntactically projected.
- In order to be comparable the set is put in a canonical form:
- Set elements are sorted according to the item type comparison.
- Redundant elements that compare to 0 with respect to another are erased.Semantic projection - Each set element is semantically projected. Distance value - The minimal distance is computed using the Cong Ma, 2016 matrix version of the Hugarian algorithm.
- The algorithmic complexity order of magnitude is thus cubic with respect to the set size considering the item type as basic operation.
- The editing distance can be either:
- parameterized defining fixed deletion, insertion and editing costs, or
- parameterized rederiving the cost function.Geodesic path - The geodesic path is based on the Hugarian algorithm assignment map which is scanned in the assignment list order considering the minimal cost operation of deletion, insertion or replacement. Comparison The comparison is applied on the set canonical form. - Returns 0 If each element pair compares equal and both lists have the same length.
- Returns <0 If either the value of the first item that does not match is lower in the left hand side list, or all compared items match but the left hand side list is shorter.
- Returns >0 If either the value of the first item that does not match is greater in the left hand side list, or all compared items match but the left hand side list is longer.Bounds - Considers all list lengths beetwen `minLength` and `maxLength` to calculate the bounds, from the item type bounds.
Parameters:
Name | Type | Description |
---|---|---|
parameters |
JSON | String | The type parameters. |