Closed qiemem closed 6 years ago
It occurs to me that the above syntax does not specify the target child model(s). The obvious syntax would then be:
ls:set child-model param1 param1
ls:set child-model param2 param2
ls:set child-model param3 param3
where child-model
could alternatively be a list of models.
However, having to refer to the models repeatedly is pretty annoying, so how about:
(ls:set child-model
param1 param1
param2 param2
param3 param3)
@arthurhjorth objected to the use of set
since this works pretty different that NetLogo's set
(since it has to take a model id). How about ls:assign-globals
? ls:set-globals
? Downside is that the plurality contradicts when only doing a single var.
For example, if you have
in your child model, you could do
ls:set child-global count turtles
to set it to the number of turtles in your parent model.The primary use case I see of this primitive is setting child model parameters. Currently, to pass parameters from the parent model to the child, you have to do something like:
This would let you do: