$darkmode
DENOPTIM
|
A data structure collecting crossover-compatible sites. More...
Public Member Functions | |
XoverSitesAmongCandidates () | |
Initializes an empty data structure. More... | |
void | put (Candidate c1, Candidate c2, List< XoverSite > xoversite) |
Creates the entry corresponding to the pair of given candidates. More... | |
List< XoverSite > | get (Candidate c1, Candidate c2) |
Gets the value corresponding to the pair of keys in the given order. More... | |
List< Candidate > | getMembersCompatibleWith (Candidate cA) |
Returns a list of items that has crossover sites with the given item. More... | |
boolean | contains (Candidate memberA, Candidate memberB) |
Check is this data structure contains information about the combination of the given members. More... | |
void | remove (Candidate c) |
removes all references to the specified candidate. More... | |
XoverSitesAmongCandidates | clone () |
Return a somewhat-shallow clone of this object: the map and list are new objects, but the references to candidates and vertexes will point to the original instances. More... | |
Private Attributes | |
LinkedHashMap< Candidate, LinkedHashMap< Candidate, List< XoverSite > > > | data |
A data structure collecting crossover-compatible sites.
This class wants to collect information like "these two candidates cannot do crossover" (i.e., non compatible) or "they can do crossover (i.e., compatible)
and here is the list of crossover sites". This data structure user a LinkedHashMap
to ensure reproducibility in the generation of list of keys for the inner map. The order of the keys is given by insertion order.
Definition at line 210 of file Population.java.
denoptim.ga.Population.XoverSitesAmongCandidates.XoverSitesAmongCandidates | ( | ) |
Initializes an empty data structure.
Definition at line 218 of file Population.java.
References denoptim.ga.Population.XoverSitesAmongCandidates.data.
Referenced by denoptim.ga.Population.XoverSitesAmongCandidates.clone().
XoverSitesAmongCandidates denoptim.ga.Population.XoverSitesAmongCandidates.clone | ( | ) |
Return a somewhat-shallow clone of this object: the map and list are new objects, but the references to candidates and vertexes will point to the original instances.
Definition at line 337 of file Population.java.
References denoptim.ga.Population.XoverSitesAmongCandidates.data, and denoptim.ga.Population.XoverSitesAmongCandidates.XoverSitesAmongCandidates().
Referenced by denoptim.ga.Population.clone().
boolean denoptim.ga.Population.XoverSitesAmongCandidates.contains | ( | Candidate | memberA, |
Candidate | memberB | ||
) |
Check is this data structure contains information about the combination of the given members.
The order of the members does not matter.
memberA | a member to be searched for. |
memberB | a member to be searched for. |
true
if this data structure does contain information about the compatibility between the two members. Note that such information can be "they are not compatible" or "they are compatible and here is the list of crossover sites". Definition at line 312 of file Population.java.
References denoptim.ga.Population.XoverSitesAmongCandidates.data.
Referenced by denoptim.ga.Population.getXoverPartners().
List< XoverSite > denoptim.ga.Population.XoverSitesAmongCandidates.get | ( | Candidate | c1, |
Candidate | c2 | ||
) |
Gets the value corresponding to the pair of keys in the given order.
c1 | |
c2 |
Definition at line 270 of file Population.java.
References denoptim.ga.Population.XoverSitesAmongCandidates.data.
Referenced by denoptim.ga.Population.getXoverSites().
List< Candidate > denoptim.ga.Population.XoverSitesAmongCandidates.getMembersCompatibleWith | ( | Candidate | cA | ) |
Returns a list of items that has crossover sites with the given item.
cA | the item that is looking for a crossover partner. |
Definition at line 285 of file Population.java.
References denoptim.ga.Population.XoverSitesAmongCandidates.data.
Referenced by denoptim.ga.Population.getXoverPartners().
void denoptim.ga.Population.XoverSitesAmongCandidates.put | ( | Candidate | c1, |
Candidate | c2, | ||
List< XoverSite > | xoversite | ||
) |
Creates the entry corresponding to the pair of given candidates.
c1 | |
c2 | |
xoversite | list of crossover-compatible sites. The order of the vertexes is expected to be consistent to that of the arguments given to this method. |
Definition at line 232 of file Population.java.
References denoptim.ga.XoverSite.createMirror(), and denoptim.ga.Population.XoverSitesAmongCandidates.data.
Referenced by denoptim.ga.Population.getXoverPartners().
void denoptim.ga.Population.XoverSitesAmongCandidates.remove | ( | Candidate | c | ) |
removes all references to the specified candidate.
c | the candidate whose references have to be removed. |
Definition at line 322 of file Population.java.
References denoptim.ga.Population.XoverSitesAmongCandidates.data.
Referenced by denoptim.ga.Population.trim().
|
private |
Definition at line 213 of file Population.java.
Referenced by denoptim.ga.Population.XoverSitesAmongCandidates.clone(), denoptim.ga.Population.XoverSitesAmongCandidates.contains(), denoptim.ga.Population.XoverSitesAmongCandidates.get(), denoptim.ga.Population.XoverSitesAmongCandidates.getMembersCompatibleWith(), denoptim.ga.Population.XoverSitesAmongCandidates.put(), denoptim.ga.Population.XoverSitesAmongCandidates.remove(), and denoptim.ga.Population.XoverSitesAmongCandidates.XoverSitesAmongCandidates().