Class HeterogeneousLattice

  • All Implemented Interfaces:
    Lattice

    public class HeterogeneousLattice
    extends java.lang.Object
    implements Lattice
    Same as a normal lattice, except no supracontext is deemed heterogeneous and hence everything is kept. Represents a lattice which is to be combined with other sublattices to determine predictions later on. When a sublattice is filled, there are two main differences:
    1. Only a part of a an exemplar's features are used to assign lattice locations.
    2. No supracontext is ever determined to be heterogeneous. This is, of course, less efficient in some ways.
    Inefficiencies brought about by not eliminating heterogeneous supracontexts and by having to combine sublattices are a compromise to the alternative, using a single lattice for any size exemplars. Remember that the underlying structure of a lattice is an array of size 2^n, n being the size of the exemplars contained. So if the exemplars are 20 features long, a single lattice would be 2^20 or 1M elements long. On the other hand, if the exemplars are split in 4, then 4 sublattices of size 2^5, or 32, can be used instead, making for close to 100,000 times less memory used.

    In terms of processing power, more is required to use sublattices. However, using threads the processing of each can be done in parallel.

    • Constructor Summary

      Constructors 
      Constructor Description
      HeterogeneousLattice​(int partitionIndex)
      Initializes Supracontextual lattice to a 2^n length array of Supracontexts, as well as the empty and the heterogeneous supracontexts.
    • Constructor Detail

      • HeterogeneousLattice

        public HeterogeneousLattice​(int partitionIndex)
        Initializes Supracontextual lattice to a 2^n length array of Supracontexts, as well as the empty and the heterogeneous supracontexts.
        Parameters:
        partitionIndex - which label partition to use in assigning subcontexts to supracontexts
    • Method Detail

      • fill

        public void fill​(SubcontextList subList)
        Description copied from interface: Lattice
        Fill the lattice with given subcontexts. This is meant to be done only once for a given Lattice instance.
        Specified by:
        fill in interface Lattice
      • insert

        public void insert​(Subcontext sub,
                           Label label)
        Inserts sub into the lattice, into location given by label
        Parameters:
        sub - Subcontext to be inserted
        label - label to be assigned to the subcontext
      • getSupracontexts

        public java.util.Set<Supracontext> getSupracontexts()
        Specified by:
        getSupracontexts in interface Lattice
        Returns:
        The list of supracontexts that were created by filling the supracontextual lattice. From this, you can compute the analogical set.
      • supraListToString

        public java.lang.String supraListToString()
        Returns:
        A string representation of the list of Supracontexts created when the Lattice was filled