Record Class GrammarEncoding

java.lang.Object
java.lang.Record
com.knezevic.edaf.v3.repr.grammar.encoding.GrammarEncoding

public record GrammarEncoding(int maxDepth, int maxNodes, int bitsPerDecision, int bitsPerErc, int genomeLength) extends Record
Deterministic fixed-length encoding metadata for grammar derivation decisions.
  • Constructor Summary

    Constructors
    Constructor
    Description
    GrammarEncoding(int maxDepth, int maxNodes, int bitsPerDecision, int bitsPerErc, int genomeLength)
    Creates an instance of a GrammarEncoding record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Returns the value of the bitsPerDecision record component.
    int
    Returns the value of the bitsPerErc record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    from(Grammar grammar, GrammarConfig config)
    Creates encoding plan from grammar and config.
    int
    Returns the value of the genomeLength record component.
    final int
    Returns a hash code value for this object.
    int
    Returns the value of the maxDepth record component.
    int
    Returns the value of the maxNodes record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • GrammarEncoding

      public GrammarEncoding(int maxDepth, int maxNodes, int bitsPerDecision, int bitsPerErc, int genomeLength)
      Creates an instance of a GrammarEncoding record class.
      Parameters:
      maxDepth - the value for the maxDepth record component
      maxNodes - the value for the maxNodes record component
      bitsPerDecision - the value for the bitsPerDecision record component
      bitsPerErc - the value for the bitsPerErc record component
      genomeLength - the value for the genomeLength record component
  • Method Details

    • from

      public static GrammarEncoding from(Grammar grammar, GrammarConfig config)
      Creates encoding plan from grammar and config.
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • maxDepth

      public int maxDepth()
      Returns the value of the maxDepth record component.
      Returns:
      the value of the maxDepth record component
    • maxNodes

      public int maxNodes()
      Returns the value of the maxNodes record component.
      Returns:
      the value of the maxNodes record component
    • bitsPerDecision

      public int bitsPerDecision()
      Returns the value of the bitsPerDecision record component.
      Returns:
      the value of the bitsPerDecision record component
    • bitsPerErc

      public int bitsPerErc()
      Returns the value of the bitsPerErc record component.
      Returns:
      the value of the bitsPerErc record component
    • genomeLength

      public int genomeLength()
      Returns the value of the genomeLength record component.
      Returns:
      the value of the genomeLength record component