toJson method

Map<String, dynamic> toJson()

Convert to JSON map for state persistence (hyperedge format).

Implementation

Map<String, dynamic> toJson() => {
      'id': id,
      'sources': sources.map((s) => [s.$1, s.$2]).toList(),
      'targets': targets.map((t) => [t.$1, t.$2]).toList(),
      'hwMeta': {
        'name': name,
        if (width > 1) 'signalWidth': width,
        if (signal.address != null) 'addr': signal.address!.path,
      },
    };