def write(self, proto):
<EOL>proto.columnDimensions = list(self.columnDimensions)<EOL>proto.cellsPerColumn = self.cellsPerColumn<EOL>proto.activationThreshold = self.activationThreshold<EOL>proto.initialPermanence = round(self.initialPermanence, EPSILON_ROUND)<EOL>proto.connectedPermanence = round(self.connectedPermanence, EPSILON_ROUND)<EOL>proto.minThreshold = self.minThreshold<EOL>proto.maxNewSynapseCount = self.maxNewSynapseCount<EOL>proto.permanenceIncrement = round(self.permanenceIncrement, EPSILON_ROUND)<EOL>proto.permanenceDecrement = round(self.permanenceDecrement, EPSILON_ROUND)<EOL>proto.predictedSegmentDecrement = self.predictedSegmentDecrement<EOL>proto.maxSegmentsPerCell = self.maxSegmentsPerCell<EOL>proto.maxSynapsesPerSegment = self.maxSynapsesPerSegment<EOL>self.connections.write(proto.connections)<EOL>self._random.write(proto.random)<EOL>proto.activeCells = list(self.activeCells)<EOL>proto.winnerCells = list(self.winnerCells)<EOL>protoActiveSegments = proto.init("<STR_LIT>", len(self.activeSegments))<EOL>for i, segment in enumerate(self.activeSegments):<EOL><INDENT>protoActiveSegments[i].cell = segment.cell<EOL>idx = self.connections.segmentsForCell(segment.cell).index(segment)<EOL>protoActiveSegments[i].idxOnCell = idx<EOL><DEDENT>protoMatchingSegments = proto.init("<STR_LIT>",<EOL>len(self.matchingSegments))<EOL>for i, segment in enumerate(self.matchingSegments):<EOL><INDENT>protoMatchingSegments[i].cell = segment.cell<EOL>idx = self.connections.segmentsForCell(segment.cell).index(segment)<EOL>protoMatchingSegments[i].idxOnCell = idx<EOL><DEDENT>protoNumActivePotential = proto.init(<EOL>"<STR_LIT>",<EOL>len(self.numActivePotentialSynapsesForSegment))<EOL>for i, numActivePotentialSynapses in enumerate(<EOL>self.numActivePotentialSynapsesForSegment):<EOL><INDENT>segment = self.connections.segmentForFlatIdx(i)<EOL>if segment is not None:<EOL><INDENT>protoNumActivePotential[i].cell = segment.cell<EOL>idx = self.connections.segmentsForCell(segment.cell).index(segment)<EOL>protoNumActivePotential[i].idxOnCell = idx<EOL>protoNumActivePotential[i].number = numActivePotentialSynapses<EOL><DEDENT><DEDENT>proto.iteration = self.iteration<EOL>protoLastUsedIteration = proto.init(<EOL>"<STR_LIT>",<EOL>len(self.numActivePotentialSynapsesForSegment))<EOL>for i, lastUsed in enumerate(self.lastUsedIterationForSegment):<EOL><INDENT>segment = self.connections.segmentForFlatIdx(i)<EOL>if segment is not None:<EOL><INDENT>protoLastUsedIteration[i].cell = segment.cell<EOL>idx = self.connections.segmentsForCell(segment.cell).index(segment)<EOL>protoLastUsedIteration[i].idxOnCell = idx<EOL>protoLastUsedIteration[i].number = lastUsed<EOL><DEDENT><DEDENT>
Writes serialized data to proto object.

:param proto: (DynamicStructBuilder) Proto object