Serializes an object
@override Map<String, dynamic> toJson() => {'a': a.toJson(), 'b': b.toJson(), 'weight': weight};