Package ec.eda.dovs
Class CornerMap
java.lang.Object
ec.eda.dovs.CornerMap
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 ClassesModifier and TypeClassDescriptionclassSimple structure store the key and value from this CornerMap. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanhasLarger(CornerMap.Pair pair) Test if we have another key value pair after parameter pairbooleanhasSmaller(CornerMap.Pair pair) Test if we have another key value pair before parameter pairvoidinsert(int coordindate, Individual ind) Insert a key and value pair into CornerMaplowerBound(int key) This returns the smallest element whose key is equal to or bigger than the argument "key".smaller(CornerMap.Pair pair) Get a greatest key value pair from this CornerMap who is the immediate previous element of pairupperBound(int key) This method returns the smallest element whose key is bigger than (excluding equal to) "key",
-
Constructor Details
-
CornerMap
public CornerMap()
-
-
Method Details
-
insert
Insert a key and value pair into CornerMap -
lowerBound
This returns the smallest element whose key is equal to or bigger than the argument "key". -
upperBound
This method returns the smallest element whose key is bigger than (excluding equal to) "key", -
hasSmaller
Test if we have another key value pair before parameter pair -
hasLarger
Test if we have another key value pair after parameter pair -
smaller
Get a greatest key value pair from this CornerMap who is the immediate previous element of pair
-