$darkmode
DENOPTIM
|
An utility class to encapsulate the search for an AttachmentPoint
-AttachmentPoint
mapping.
More...
Public Member Functions | |
APMapFinder (FragmentSpace fragSpace, Vertex vA, Vertex vB, boolean screenAll) | |
Constructor that launches the search for a mapping between the AttachmentPoint s on the first vertex to those of the second. More... | |
APMapFinder (FragmentSpace fragSpace, Vertex vA, Vertex vB, APMapping fixedRootAPs, boolean screenAll, boolean onlyCompleteMappings, boolean compatibleIfFree) | |
Constructor that launches the search for a mapping between the AttachmentPoint s on the first vertex to those of the second. More... | |
APMapFinder (FragmentSpace fragSpace, List< AttachmentPoint > lstA, List< AttachmentPoint > needyAPsA, List< AttachmentPoint > lstB, List< AttachmentPoint > needyAPsB, APMapping fixedRootAPs, boolean screenAll, boolean onlyCompleteMappings, boolean compatibleIfFree) | |
Constructor that launches the search for a mapping between the AttachmentPoint s on two lists. More... | |
boolean | foundMapping () |
Returns true if any mapping has been found. More... | |
APMapping | getChosenAPMapping () |
Returns the AttachmentPoint -AttachmentPoint mapping chosen among the possible mappings. More... | |
List< APMapping > | getAllAPMappings () |
Returns all AttachmentPoint -AttachmentPoint mapping found. More... | |
Static Public Member Functions | |
static LinkedHashMap< AttachmentPoint, List< AttachmentPoint > > | findMappingCompatibileAPs (List< AttachmentPoint > lstA, List< AttachmentPoint > lstB, boolean compatibleIfFree, FragmentSpace fragSpace) |
Compares the AttachmentPoint of two lists searching for all the APs of the second list that are "compatible" with each of the APs of the first list. More... | |
Private Member Functions | |
void | findAllMappings (List< AttachmentPoint > lstA, List< AttachmentPoint > needyAPsA, List< AttachmentPoint > lstB, List< AttachmentPoint > needyAPsB, APMapping fixedRootAPs, boolean screenAll, boolean onlyCompleteMappings, boolean compatibleIfFree) |
Searches for mappings between the AttachmentPoint s on the two lists. More... | |
Private Attributes | |
APMapping | chosenAPMap |
The chosen AttachmentPoint -AttachmentPoint mapping. More... | |
List< APMapping > | allAPMappings = new ArrayList<APMapping>() |
The collection of all AttachmentPoint -AttachmentPoint mappings that have been found. More... | |
FragmentSpace | fragSpace = null |
Program-specific fragment space. More... | |
Static Private Attributes | |
static int | maxCombs = 250 |
Maximum number of combinations. More... | |
An utility class to encapsulate the search for an AttachmentPoint
-AttachmentPoint
mapping.
Ignores symmetry, which is a potential thing to improve.
Definition at line 41 of file APMapFinder.java.
denoptim.fragspace.APMapFinder.APMapFinder | ( | FragmentSpace | fragSpace, |
Vertex | vA, | ||
Vertex | vB, | ||
boolean | screenAll | ||
) |
Constructor that launches the search for a mapping between the AttachmentPoint
s on the first vertex to those of the second.
Note that if APs are available throughout any template barrier we consider only the existence of an AP to be a reason for a compatible AP-AP mapping, irrespectively of the APClass
. All APs that are available (i.e., available throughout the templates barriers) will be considered compatible because they do not have any requirement from APClass compatibility rules or bond types. The present status of the APs on each vertex (i.e., whether they are used or available as defined by the DGraph#getInterfaceAPs(List)
method when considering a single-vertex subgraph) determines which APs will be required to have a mapping.
fragSpace | the fragment space to use. |
vA | the first vertex. |
vB | the second vertex. |
screenAll | use true to NOT stop at the first compatible combinations. |
Definition at line 94 of file APMapFinder.java.
References denoptim.fragspace.APMapFinder.fragSpace.
denoptim.fragspace.APMapFinder.APMapFinder | ( | FragmentSpace | fragSpace, |
Vertex | vA, | ||
Vertex | vB, | ||
APMapping | fixedRootAPs, | ||
boolean | screenAll, | ||
boolean | onlyCompleteMappings, | ||
boolean | compatibleIfFree | ||
) |
Constructor that launches the search for a mapping between the AttachmentPoint
s on the first vertex to those of the second.
Note that if APs are available throughout any template barrier we consider only the existence of an AP to be a reason for a compatible AP-AP mapping, irrespectively of the APClass
. The present status of the APs on each vertex (i.e., whether they are used or available as defined by the DGraph#getInterfaceAPs(List)
method when considering a single-vertex subgraph) determines which APs will be required to have a mapping.
fragSpace | the fragment space to use. |
vA | the first vertex. |
vB | the second vertex. |
fixedRootAPs | if not null , sets a required mapping that must be present in the all the AP mappings. |
screenAll | use true to NOT stop at the first compatible combinations. |
onlyCompleteMappings | use true to collect only mappings that include all of the APs on the first vertex. |
compatibleIfFree | use true to make APs that are available (i.e., available throughout the template barriers) be compatible. |
Definition at line 125 of file APMapFinder.java.
References denoptim.fragspace.APMapFinder.findAllMappings(), denoptim.fragspace.APMapFinder.fragSpace, denoptim.graph.Vertex.getAttachmentPoints(), denoptim.graph.Vertex.getGraphOwner(), and denoptim.graph.DGraph.getInterfaceAPs().
denoptim.fragspace.APMapFinder.APMapFinder | ( | FragmentSpace | fragSpace, |
List< AttachmentPoint > | lstA, | ||
List< AttachmentPoint > | needyAPsA, | ||
List< AttachmentPoint > | lstB, | ||
List< AttachmentPoint > | needyAPsB, | ||
APMapping | fixedRootAPs, | ||
boolean | screenAll, | ||
boolean | onlyCompleteMappings, | ||
boolean | compatibleIfFree | ||
) |
Constructor that launches the search for a mapping between the AttachmentPoint
s on two lists.
Note that if APs are available throughout any template barrier we consider only the existence of an AP to be a reason for a compatible AP-AP mapping, irrespectively of the APClass
.
lstA | the first list. |
needyAPsA | a subset of the attachment points in the first list and that are required to have appear in any mapping. |
lstB | the second list. |
needyAPsB | a subset of the attachment points in the second list and that are required to have appear in any mapping. |
fixedRootAPs | if not null , sets a required mapping that must be present in the all the AP mappings. |
screenAll | use true to NOT stop at the first compatible combinations. |
onlyCompleteMappings | use true to collect only mappings that include all of the APs on the first vertex. |
compatibleIfFree | use true to make APs that are available (i.e., available throughout the template barriers) be compatible. |
Definition at line 174 of file APMapFinder.java.
References denoptim.fragspace.APMapFinder.findAllMappings(), and denoptim.fragspace.APMapFinder.fragSpace.
|
private |
Searches for mappings between the AttachmentPoint
s on the two lists.
Note that is APs are available throughout any template barrier we consider only the existence of an AP to be a reason for a compatible AP-AP mapping, irrespectively of the APClass
.
lstA | the first list |
lstB | the second list. |
fixedRootAPs | if not null , sets a required mapping that will be added to all the AP mappings. |
screenAll | use true to NOT stop at the first compatible combinations. |
onlyCompleteMappings | use true to collect only mappings that include all of the APs on the first vertex. |
compatibleIfFree | use true to make APs that are available (i.e., available throughout the template barriers) be compatible. |
Definition at line 206 of file APMapFinder.java.
References denoptim.fragspace.APMapFinder.allAPMappings, denoptim.fragspace.APMapFinder.chosenAPMap, denoptim.graph.APMapping.clone(), denoptim.fragspace.APMapFinder.findMappingCompatibileAPs(), denoptim.fragspace.APMapFinder.fragSpace, denoptim.fragspace.FragmentSpace.getRandomizer(), denoptim.fragspace.APMapFinder.maxCombs, denoptim.utils.Randomizer.randomlyChooseOne(), and denoptim.fragspace.FragmentSpaceUtils.recursiveCombiner().
Referenced by denoptim.fragspace.APMapFinder.APMapFinder().
|
static |
Compares the AttachmentPoint
of two lists searching for all the APs of the second list that are "compatible" with each of the APs of the first list.
Note that "compatible" does not mean APClass
- compatible to form connection, but that can be interchanges, i.e., one AP from the second list is compatible with one from the first list, if it can replace the latter in whatever role that AP has.
lstA | the first list of APs. |
lstB | the second list ofAPs. |
compatibleIfFree | use true to make APs that are available (i.e., available throughout the template barriers) be compatible. |
Definition at line 404 of file APMapFinder.java.
References denoptim.fragspace.APMapFinder.fragSpace, denoptim.graph.AttachmentPoint.getAPClass(), denoptim.graph.AttachmentPoint.getLinkedAPThroughout(), denoptim.graph.AttachmentPoint.isAvailableThroughout(), denoptim.graph.APClass.isCPMapCompatibleWith(), and denoptim.fragspace.FragmentSpace.useAPclassBasedApproach().
Referenced by denoptim.fragspace.APMapFinder.findAllMappings(), and denoptim.fragspace.APMapFinderTest.testFindMappingCompatibileAPs().
boolean denoptim.fragspace.APMapFinder.foundMapping | ( | ) |
Returns true
if any mapping has been found.
true
if any mapping has been found. Definition at line 542 of file APMapFinder.java.
References denoptim.fragspace.APMapFinder.allAPMappings.
Referenced by denoptim.ga.GraphOperations.checkAndAddXoverSites(), denoptim.fragspace.GraphLinkFinder.GraphLinkFinder(), denoptim.ga.GraphOperations.performCrossover(), denoptim.fragspace.APMapFinderTest.testAPMapFinder(), denoptim.fragspace.APMapFinderTest.testAPMapFinder_ConstrainAll(), and denoptim.fragspace.APMapFinderTest.testAPMapFinder_Constrained().
List< APMapping > denoptim.fragspace.APMapFinder.getAllAPMappings | ( | ) |
Returns all AttachmentPoint
-AttachmentPoint
mapping found.
Definition at line 572 of file APMapFinder.java.
References denoptim.fragspace.APMapFinder.allAPMappings.
Referenced by denoptim.fragspace.GraphLinkFinder.GraphLinkFinder(), denoptim.fragspace.APMapFinderTest.testAPMapFinder(), denoptim.fragspace.APMapFinderTest.testAPMapFinder_ConstrainAll(), and denoptim.fragspace.APMapFinderTest.testAPMapFinder_Constrained().
APMapping denoptim.fragspace.APMapFinder.getChosenAPMapping | ( | ) |
Returns the AttachmentPoint
-AttachmentPoint
mapping chosen among the possible mappings.
If more than one possible mapping exist, then this will return a randomly chosen one.
Definition at line 557 of file APMapFinder.java.
References denoptim.fragspace.APMapFinder.chosenAPMap.
Referenced by denoptim.fragspace.GraphLinkFinder.GraphLinkFinder(), denoptim.ga.GraphOperations.performCrossover(), denoptim.fragspace.APMapFinderTest.testAPMapFinder(), and denoptim.fragspace.APMapFinderTest.testAPMapFinder_ConstrainAll().
The collection of all AttachmentPoint
-AttachmentPoint
mappings that have been found.
Definition at line 56 of file APMapFinder.java.
Referenced by denoptim.fragspace.APMapFinder.findAllMappings(), denoptim.fragspace.APMapFinder.foundMapping(), and denoptim.fragspace.APMapFinder.getAllAPMappings().
|
private |
The chosen AttachmentPoint
-AttachmentPoint
mapping.
In case of multiple possible AP mappings, the result reported here is a randomly chosen one among the possible ones.
Definition at line 49 of file APMapFinder.java.
Referenced by denoptim.fragspace.APMapFinder.findAllMappings(), and denoptim.fragspace.APMapFinder.getChosenAPMapping().
|
private |
Program-specific fragment space.
Definition at line 70 of file APMapFinder.java.
Referenced by denoptim.fragspace.APMapFinder.APMapFinder(), denoptim.fragspace.APMapFinder.findAllMappings(), and denoptim.fragspace.APMapFinder.findMappingCompatibileAPs().
|
staticprivate |
Maximum number of combinations.
This prevents combinatorial explosion, but it is ignored if the constructor is required to screen all. Remember that the combinations are anyway randomized, so even with the maximum limit on the number of combination to consider, there is no systematic exclusion of specific combinations.
Definition at line 65 of file APMapFinder.java.
Referenced by denoptim.fragspace.APMapFinder.findAllMappings().