initial_data_function and timestep_function. They are not designed for production use.
genInitialData
id between 1 and 100 (inclusive).
This function matches the signature required by set_initial_data_function: it accepts the model instance and returns a dictionary that is merged into the node’s attribute store.
The model instance. Passed automatically by
initialize_graph when this function is registered as the initial data function. The function does not read any data from the model, but the signature is required by the framework.A dictionary of the form
{"id": int} where id is a random integer between 1 and 100.This is a reference implementation. For real simulations, write your own initial data function that returns the attributes relevant to your model.
genTimestepData
nodeData["id"] by 1 and returns the updated dictionary.
The model instance. Not used by this function, but included to reflect a common pattern where per-node helpers receive the model for access to parameters.
The current attribute dictionary for a single node. Must contain an
"id" key with a numeric value.The same
nodeData dictionary with nodeData["id"] incremented by 1.