Sometimes a certain part of an object's code may need to be repeated many times. Even the number of repetitions may be required to be determined by the user. In short, the Repeat Object is used to clone a series of objects multiple times.
Many structures consist of repetitions of structural components. For example;
Multiple beams with different bracing locations in a bridge.
Multiple stem rigidity bars in a bridge.
Multiple panels for one tower.
Multiple floors for one building.
A previously defined content can be placed in the Repeat Object and cloned and positioned at certain geometric intervals. Any content inside the Repeat object is repeated as many times as the specified parameter.
All Repeat Objects must contain the following parameters:
S (start)
E (end)
I (increment)
CTRL (control parameter)
Syntax
...
...
<O T="Repeat"
...
</O>
Example
<ON="Replicate"T="Project"Category="Core Objects"><!-- created by ParamML Examples on 26.01.2023 --><ON="Recap"T="Repeat"S="0"E="3"I="1"CTRL="j"j="0"><PN="Result"V="pow(3,j)"/></O><OT="Design Code"><PN="RecapObjectList"V="Recap"/><PN="RecapResult0"V="Recap[0].Result"/><PN="RecapResult1"V="Recap[1].Result"/><PN="RecapResult2"V="Recap[2].Result"/><PN="RecapResult3"V="Recap[3].Result"/><!-- -l- --><PN="Result0"V="pow(3,0)"/><PN="Result1"V="pow(3,1)"/><PN="Result2"V="pow(3,2)"/><PN="Result3"V="pow(3,3)"/></O></O>
The Repeat Object also allows for counting elements in a list and separating them as needed. This can be useful in situations where specific elements within the list need to be grouped or separated based on certain criteria.
Example:
In the above example, there are two nested repeat objects. In these objects, when it gets i=0 first, the object inside will repeat from j=0 to j=4 5 times and clone the 3D object within 5 of them.
Later, when the inside repetitions are completed, i = 1 will be and the inside object will be 5 again and will be created once.
ParamML is a programming language that employs lazy evaluation (https://en.wikipedia.org/wiki/Lazy_evaluation ), where each parameter is only computed when it is called. Unlike sequential programming (e.g., http://VB.NET ), where each line is executed one by one, ParamML doesn't compute every parameter upfront. However, a drawback is that if a parameter is called a thousand times, it needs to be computed a thousand times, which can be a significant performance issue.
To address this problem, caching is used (https://en.wikipedia.org/wiki/Cache_(computing) )."Repeat" is a specific object, and under normal circumstances, due to software limitations, we cannot employ caching within "repeat." This is where "StaticParams" comes into play. StaticParams overrides this rule. The parameters written within StaticParams are computed, and their values are manually added to the cache. As a result, when attempting to access these parameters within "repeat," there is no need to reevaluate the parameters; their values are readily available in the cache.
D="Control Variable: The name of the variable that holds the repeat number as the contained objects repeated."V="0"
Role="Input"
Start
Yes
N="S"
D="Start: Starting repeat number (default 0)" V="0"
Role="Input"
End
Yes
N="E"
D="End: Ending repeat number (default 9)"V="0"
Role="Input"
Increment
(Each Step) | Yes | N="I" | D="Increment: Increment used to go from start to end (default 1)"V="0" | Role="Input" | | StaticParams | No | N=”StaticParams” | D=”Parameter list which are used in repeat iterations but no need to calculate at each step” | Role="Input" |