# automatically generated by the FlatBuffers compiler, do not modify

# namespace: aghast_generated

import flatbuffers

class Variation(object):
    __slots__ = ['_tab']

    @classmethod
    def GetRootAsVariation(cls, buf, offset):
        n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
        x = Variation()
        x.Init(buf, n + offset)
        return x

    # Variation
    def Init(self, buf, pos):
        self._tab = flatbuffers.table.Table(buf, pos)

    # Variation
    def Assignments(self, j):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
        if o != 0:
            x = self._tab.Vector(o)
            x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4
            x = self._tab.Indirect(x)
            from .Assignment import Assignment
            obj = Assignment()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

    # Variation
    def AssignmentsLength(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
        if o != 0:
            return self._tab.VectorLen(o)
        return 0

    # Variation
    def Systematic(self, j):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
        if o != 0:
            a = self._tab.Vector(o)
            return self._tab.Get(flatbuffers.number_types.Float64Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 8))
        return 0

    # Variation
    def SystematicAsNumpy(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
        if o != 0:
            return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Float64Flags, o)
        return 0

    # Variation
    def SystematicLength(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
        if o != 0:
            return self._tab.VectorLen(o)
        return 0

    # Variation
    def CategorySystematic(self, j):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
        if o != 0:
            a = self._tab.Vector(o)
            return self._tab.String(a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 4))
        return ""

    # Variation
    def CategorySystematicLength(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
        if o != 0:
            return self._tab.VectorLen(o)
        return 0

def VariationStart(builder): builder.StartObject(3)
def VariationAddAssignments(builder, assignments): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(assignments), 0)
def VariationStartAssignmentsVector(builder, numElems): return builder.StartVector(4, numElems, 4)
def VariationAddSystematic(builder, systematic): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(systematic), 0)
def VariationStartSystematicVector(builder, numElems): return builder.StartVector(8, numElems, 8)
def VariationAddCategorySystematic(builder, categorySystematic): builder.PrependUOffsetTRelativeSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(categorySystematic), 0)
def VariationStartCategorySystematicVector(builder, numElems): return builder.StartVector(4, numElems, 4)
def VariationEnd(builder): return builder.EndObject()
