How to specify manditory arguments
Derived from discussion about parent issue #216 (closed) within LC-Types:
It should be discussed how it is possible to specify manidtory fields in an intuitive way.
The following proposal was taken from the parent issue #216 (closed), which allows taht in a python way:
# Some fields are mandatory and some are default
struct OdrExplicitPoint
odr_id: int # Mandatory to be set by user
lane_id: int # Mandatory to be set by user
# If not set, choose as default something in this range (Default range is not equal to constraints!)
offset: distance = randomize(-1..1)
# Additionally we add constraints - We want this never to happen
keep(offset < 10)
keep(offset > -10)
# This allows now to call it the following way:
# distance will be randomized within default value bounds
point_1: OdrExplicitPoint(odr_id = 1, lane_id = 2)
# distance is set (outside of default range)
point_2: OdrExplicitPoint(odr_id = 1, lane_id = 2, offset = randomize(-2..2)
# ERROR: This is not possible, as it is a contradiction to the constraints
point_3: OdrExplicitPoint(odr_id = 1, lane_id = 2, offset = 2000)