saealib.space.GenomeCodec#

class saealib.space.GenomeCodec(*args, **kwargs)[ソース]#

ベースクラス: Protocol

Service for encoding genomes into persistable primitives and decoding back.

Methods

__init__

decode

Decode a dictionary payload back into a GenomeBatch.

encode

Encode genomes into a dictionary of persistable primitives.

Method Details

GenomeCodec.__init__(*args, **kwargs)#
GenomeCodec.decode(payload)[ソース]#

Decode a dictionary payload back into a GenomeBatch.

パラメータ:

payload (dict[str, Any])

戻り値の型:

GenomeBatch

GenomeCodec.encode(genomes)[ソース]#

Encode genomes into a dictionary of persistable primitives.

パラメータ:

genomes (GenomeBatch)

戻り値の型:

dict[str, Any]