-
Notifications
You must be signed in to change notification settings - Fork 0
Description
I encountered a special case where a user wanted to modify data being used inside a rule of an existing tree. These data were captured as a closure based on one of the tutorials. It was not possible to replace the rule because closures are associated with a unique type parameter.
There might be more cases where we want mutation of rules (maybe different behavior is assigned to different graphs after a particular state, or we want to create graphs by modifying a prototype). This does not have to be a cheap operation, so a possibility is to create a new graph from the old one that contains the same data except modified rules. A potential problem is duplicating nodes will cause two graphs to exist with the same node IDs. That may be safe.
We should also modify the tutorials so that they follow good practices (this closure business would not be one as then we have parameters being used in simulations that are not contained within the graph nor are they global variables).