Package ec.eda.dovs

# Class CornerMap

java.lang.Object
ec.eda.dovs.CornerMap

public class CornerMap extends Object
CornerMap can help us to quickly identify the possible individuals that is able to form a hyperbox around best individual. It has multiple key-value pairs. Each key can have multiple values. The elements in CornerMap is sorted based on the key of the elements. If two elements have the same key value, it's order is determined by their insertion time.

It stores the map between one of the coordinate of the individual to the individual. For example, we have a individual "ind" with 5 dimension (12, 3, 4, 2, 8), we should create a array "corners" with 5 CornerMap. For each of the CornerMap, we should insert the coordinate of the individual as key, and the individual itself as the value, like (12, ind), (3, ind) .... into their corresponding CornerMap.

CornerMap is essentially a mimic of multimap in C++ where keys are in sorted, but in the ArrayList for each key, the order is determined by their insertion order. Here we simplify it with only useful function such as lowerBound and upperBound.

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `class`
  `CornerMap.Pair`
  Simple structure store the key and value from this CornerMap.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `CornerMap()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `hasLarger(CornerMap.Pair pair)`
  Test if we have another key value pair after parameter pair
  `boolean`
  `hasSmaller(CornerMap.Pair pair)`
  Test if we have another key value pair before parameter pair
  `void`
  `insert(int coordindate, Individual ind)`
  Insert a key and value pair into CornerMap
  `CornerMap.Pair`
  `lowerBound(int key)`
  This returns the smallest element whose key is equal to or bigger than the argument "key".
  `CornerMap.Pair`
  `smaller(CornerMap.Pair pair)`
  Get a greatest key value pair from this CornerMap who is the immediate previous element of pair
  `CornerMap.Pair`
  `upperBound(int key)`
  This method returns the smallest element whose key is bigger than (excluding equal to) "key",

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### CornerMap

    public CornerMap()

- ## Method Details

  - ### insert

    public void insert(int coordindate, Individual ind)
    Insert a key and value pair into CornerMap

  - ### lowerBound

    public CornerMap.Pair lowerBound(int key)
    This returns the smallest element whose key is equal to or bigger than the argument "key".

  - ### upperBound

    public CornerMap.Pair upperBound(int key)
    This method returns the smallest element whose key is bigger than (excluding equal to) "key",

  - ### hasSmaller

    public boolean hasSmaller(CornerMap.Pair pair)
    Test if we have another key value pair before parameter pair

  - ### hasLarger

    public boolean hasLarger(CornerMap.Pair pair)
    Test if we have another key value pair after parameter pair

  - ### smaller

    public CornerMap.Pair smaller(CornerMap.Pair pair)
    Get a greatest key value pair from this CornerMap who is the immediate previous element of pair