$darkmode
DENOPTIM
denoptim.ga.Population.XoverSitesAmongCandidates Class Reference

A data structure collecting crossover-compatible sites. More...

Collaboration diagram for denoptim.ga.Population.XoverSitesAmongCandidates:
[legend]

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< XoverSiteget (Candidate c1, Candidate c2)
 Gets the value corresponding to the pair of keys in the given order. More...
 
List< CandidategetMembersCompatibleWith (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
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ XoverSitesAmongCandidates()

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().

Here is the caller graph for this function:

Member Function Documentation

◆ 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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ contains()

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.

Parameters
memberAa member to be searched for.
memberBa member to be searched for.
Returns
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().

Here is the caller graph for this function:

◆ get()

List< XoverSite > denoptim.ga.Population.XoverSitesAmongCandidates.get ( Candidate  c1,
Candidate  c2 
)

Gets the value corresponding to the pair of keys in the given order.

Parameters
c1
c2
Returns
the list of compatible pairs or null.

Definition at line 270 of file Population.java.

References denoptim.ga.Population.XoverSitesAmongCandidates.data.

Referenced by denoptim.ga.Population.getXoverSites().

Here is the caller graph for this function:

◆ getMembersCompatibleWith()

List< Candidate > denoptim.ga.Population.XoverSitesAmongCandidates.getMembersCompatibleWith ( Candidate  cA)

Returns a list of items that has crossover sites with the given item.

Parameters
cAthe item that is looking for a crossover partner.
Returns
the list of crossover-compatible items.

Definition at line 285 of file Population.java.

References denoptim.ga.Population.XoverSitesAmongCandidates.data.

Referenced by denoptim.ga.Population.getXoverPartners().

Here is the caller graph for this function:

◆ put()

void denoptim.ga.Population.XoverSitesAmongCandidates.put ( Candidate  c1,
Candidate  c2,
List< XoverSite xoversite 
)

Creates the entry corresponding to the pair of given candidates.

Parameters
c1
c2
xoversitelist 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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ remove()

void denoptim.ga.Population.XoverSitesAmongCandidates.remove ( Candidate  c)

removes all references to the specified candidate.

Parameters
cthe 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().

Here is the caller graph for this function:

Member Data Documentation

◆ data


The documentation for this class was generated from the following file: