Package io.jenetics

Class AbstractChromosome<G extends Gene<?,​G>>

    • Field Detail

      • _genes

        protected final transient ISeq<G extends Gene<?,​G>> _genes
        Array of genes which forms the chromosome. This array must be initialized by the derived classes.
      • _valid

        protected transient Boolean _valid
        Indicates whether this chromosome is valid or not. If the variable is null the validation state hasn't been calculated yet.
    • Constructor Detail

    • Method Detail

      • get

        public G get​(int index)
        Description copied from interface: BaseSeq
        Return the value at the given index.
        Specified by:
        get in interface BaseSeq<G extends Gene<?,​G>>
        Parameters:
        index - index of the element to return.
        Returns:
        the value at the given index.
      • length

        public int length()
        Description copied from interface: BaseSeq
        Return the length of this sequence. Once the sequence is created, the length can't be changed.
        Specified by:
        length in interface BaseSeq<G extends Gene<?,​G>>
        Returns:
        the length of this sequence.
      • isValid

        public boolean isValid()
        Description copied from interface: Verifiable
        Check if this object is valid.
        Specified by:
        isValid in interface Chromosome<G extends Gene<?,​G>>
        Specified by:
        isValid in interface Verifiable
        Returns:
        true if this object is valid, false otherwise.