Defines the abstract base Node class for graph-based structures. Each Node is assigned a unique identifier via an external IdGenerator. The class provides an interface for managing execution state and generating DOT graph representations using Jinja2 templates.
NodeAttributes
id: int: A unique identifier assigned to each instance upon initialization.Methods
get_idint, The unique node ID
Retrieves the unique identifier of the node.
generate_stack_frameint, The ID of the execution context.None
Initializes a new state frame for a specific execution context. Designed to be overridden in subclasses that use execution state.
delete_stack_frameint, The ID of the execution context.None
Deletes the state frame for a specific execution context. Designed to be overridden in subclasses that use execution state.
generate_dotlist[str], A list to append DOT node definitions to.list[str], A list to append DOT edges definitions to.set[str], A set of already visited node IDs to avoid duplicates or recursion.list[str], A Jinja2 template used to format the node's DOT representation.None
Generates the DOT graph representation for this node and its relationships. Must be implemented in subclasses.