Syntax Proposals / Generative Nodes/Hyperedges
Is your feature request related to a problem? Please describe. Sometimes we have a number of nodes dependant on the input of the model (#PARAMETERS). Currently this cannot be done in GBOML; we can do it by using another tool to generate GBOML code or use the Python API. Being able to do it in the GBOML code would be nice.
Describe the solution you'd like I propose an extension of the language using arrays (#9) or dicts (#10), where we would authorize users to use a foor loop in the definition of a node/hyperedge:
#NODE MyNode[i] for i in [0:3]
#PARAMETERS
x = i*2;
This would be solved to be semantically equivalent to
#PARAMETERS
MyNode = {0: _anonym_MyNode_0, 1:_anonym_MyNode_1, 2:_anonym_MyNode_2, 3:_anonym_MyNode_3};
#NODE _anonym_MyNode_0
#PARAMETERS
i = 0;
x = i*2;
#NODE _anonym_MyNode_1
#PARAMETERS
i = 1;
x = i*2;
#NODE _anonym_MyNode_2
#PARAMETERS
i = 2;
x = i*2;
#NODE _anonym_MyNode_3
#PARAMETERS
i = 3;
x = i*2;