$darkmode
DENOPTIM
|
Factory of combination of fragments. More...
Public Member Functions | |
FragsCombinationIterator (FragmentSpaceParameters settings, DGraph rootGraph) throws DENOPTIMException | |
Constructs a new factory for generating all the combination of fragments that can be attached on a given root graph. More... | |
void | setStartingPoint (ArrayList< Integer > nextIds) |
Sets the starting point for the iterator. More... | |
ArrayList< Integer > | getNextIds () |
Returns the list of indeces used to calculate the next iteration. More... | |
FragsCombination | next () throws NoSuchElementException |
Generate the next combination of fragments. More... | |
boolean | hasNext () |
int | getNumRootAPs () |
int | getTotNumbCombs () |
int | getNumGeneratedCombs () |
Map< IdFragmentAndAP, ArrayList< IdFragmentAndAP > > | getCandidatesMap () |
ArrayList< Integer > | getSizesOfCandidateSets () |
Private Attributes | |
boolean | finished = false |
Flag defining whether at list one more combination can be produced. More... | |
DGraph | rootGraph |
The root graph (may be a single fragment or an extended graph) More... | |
ArrayList< IdFragmentAndAP > | allSrcAps |
List of all attachment points on the root graph (source APs) More... | |
ArrayList< IdFragmentAndAP > | actvSrcAps |
List of attachment points on the root graph (source APs) for which there are one or more candidate destinies (i.e., append a frag, cap, or leave empty). More... | |
Map< IdFragmentAndAP, ArrayList< IdFragmentAndAP > > | candFragsPerAP |
Map of all possible matches for each source AP. More... | |
ArrayList< Integer > | nextIds = new ArrayList<Integer>() |
Set of indeces for the next iteration. More... | |
ArrayList< Integer > | totCandsPerAP = new ArrayList<Integer>() |
Sizes of the candidates set for each source AP. More... | |
int | totCombs = 0 |
Total number of combinations. More... | |
int | numbGenCombs = 0 |
Current number of generated combinations. More... | |
String | EOL = DENOPTIMConstants.EOL |
FragmentSpaceParameters | settings = null |
Parameters defining the fragment space. More... | |
Factory of combination of fragments.
This tool is meant to generate combinations of fragments one after the other (sequentially) in a low-memory usage fashion, that is, without generating and storing the complete list of combinations.
Definition at line 48 of file FragsCombinationIterator.java.
denoptim.fragspace.FragsCombinationIterator.FragsCombinationIterator | ( | FragmentSpaceParameters | settings, |
DGraph | rootGraph | ||
) | throws DENOPTIMException |
Constructs a new factory for generating all the combination of fragments that can be attached on a given root graph.
rootGraph |
DENOPTIMException |
Definition at line 123 of file FragsCombinationIterator.java.
References denoptim.fragspace.FragsCombinationIterator.actvSrcAps, denoptim.fragspace.FragsCombinationIterator.allSrcAps, denoptim.fragspace.FragsCombinationIterator.candFragsPerAP, denoptim.graph.Vertex.BBType.CAP, denoptim.fragspace.FragmentSpaceParameters.enforceSymmetry, denoptim.fragspace.FragsCombinationIterator.EOL, denoptim.fragspace.FragsCombinationIterator.finished, denoptim.graph.Vertex.BBType.FRAGMENT, denoptim.fragspace.FragmentSpace.getAPClassOfCappingVertex(), denoptim.graph.Vertex.getAttachmentPoints(), denoptim.fragspace.FragmentSpace.getCappingGroupsWithAPClass(), denoptim.fragspace.FragmentSpace.getForbiddenEndList(), denoptim.fragspace.FragmentSpace.getFragAPsCompatibleWithClass(), denoptim.fragspace.FragmentSpaceParameters.getFragmentSpace(), denoptim.programs.RunTimeParameters.getLogger(), denoptim.graph.DGraph.getSymSetsIterator(), denoptim.utils.GraphUtils.getUniqueVertexIndex(), denoptim.fragspace.FragmentSpace.getVertexFromLibrary(), denoptim.graph.DGraph.getVertexList(), denoptim.fragspace.FragmentSpace.imposeSymmetryOnAPsOfClass(), denoptim.fragspace.FragsCombinationIterator.nextIds, denoptim.fragspace.FragsCombinationIterator.rootGraph, denoptim.fragspace.FragsCombinationIterator.settings, denoptim.fragspace.FragmentSpaceParameters.symmetryConstraints, denoptim.fragspace.FragsCombinationIterator.totCandsPerAP, and denoptim.fragspace.FragsCombinationIterator.totCombs.
Map< IdFragmentAndAP, ArrayList< IdFragmentAndAP > > denoptim.fragspace.FragsCombinationIterator.getCandidatesMap | ( | ) |
Definition at line 722 of file FragsCombinationIterator.java.
References denoptim.fragspace.FragsCombinationIterator.candFragsPerAP.
Referenced by denoptim.combinatorial.CombinatorialExplorerByLayer.exploreCombinationsAtGivenLevel().
ArrayList< Integer > denoptim.fragspace.FragsCombinationIterator.getNextIds | ( | ) |
Returns the list of indeces used to calculate the next iteration.
Definition at line 381 of file FragsCombinationIterator.java.
References denoptim.fragspace.FragsCombinationIterator.nextIds.
Referenced by denoptim.combinatorial.CombinatorialExplorerByLayer.exploreCombinationsAtGivenLevel().
int denoptim.fragspace.FragsCombinationIterator.getNumGeneratedCombs | ( | ) |
FragsCombination
s generated Definition at line 710 of file FragsCombinationIterator.java.
References denoptim.fragspace.FragsCombinationIterator.numbGenCombs.
Referenced by denoptim.combinatorial.CombinatorialExplorerByLayer.exploreCombinationsAtGivenLevel().
int denoptim.fragspace.FragsCombinationIterator.getNumRootAPs | ( | ) |
Definition at line 685 of file FragsCombinationIterator.java.
References denoptim.fragspace.FragsCombinationIterator.actvSrcAps.
Referenced by denoptim.combinatorial.CombinatorialExplorerByLayer.exploreCombinationsAtGivenLevel().
ArrayList< Integer > denoptim.fragspace.FragsCombinationIterator.getSizesOfCandidateSets | ( | ) |
Definition at line 734 of file FragsCombinationIterator.java.
References denoptim.fragspace.FragsCombinationIterator.totCandsPerAP.
Referenced by denoptim.combinatorial.CombinatorialExplorerByLayer.exploreCombinationsAtGivenLevel().
int denoptim.fragspace.FragsCombinationIterator.getTotNumbCombs | ( | ) |
FragsCombination
s that can be generated from the set of candidates set. Definition at line 698 of file FragsCombinationIterator.java.
References denoptim.fragspace.FragsCombinationIterator.totCombs.
Referenced by denoptim.combinatorial.CombinatorialExplorerByLayer.exploreCombinationsAtGivenLevel().
boolean denoptim.fragspace.FragsCombinationIterator.hasNext | ( | ) |
true
if at least one more combinations can be produced Definition at line 667 of file FragsCombinationIterator.java.
References denoptim.fragspace.FragsCombinationIterator.finished.
Referenced by denoptim.combinatorial.CombinatorialExplorerByLayer.exploreCombinationsAtGivenLevel().
FragsCombination denoptim.fragspace.FragsCombinationIterator.next | ( | ) | throws NoSuchElementException |
Generate the next combination of fragments.
FragsCombination
NoSuchElementException | if no more combinations can be produced |
Definition at line 394 of file FragsCombinationIterator.java.
References denoptim.fragspace.FragsCombinationIterator.actvSrcAps, denoptim.fragspace.FragsCombinationIterator.candFragsPerAP, denoptim.fragspace.FragmentSpaceParameters.enforceSymmetry, denoptim.fragspace.FragsCombinationIterator.EOL, denoptim.fragspace.FragsCombinationIterator.finished, denoptim.graph.AttachmentPoint.getAPClass(), denoptim.fragspace.IdFragmentAndAP.getApId(), denoptim.graph.Vertex.getAttachmentPoints(), denoptim.graph.Vertex.getBuildingBlockId(), denoptim.graph.Vertex.getBuildingBlockType(), denoptim.fragspace.FragmentSpaceParameters.getFragmentSpace(), denoptim.graph.AttachmentPoint.getIndexInOwner(), denoptim.programs.RunTimeParameters.getLogger(), denoptim.graph.Vertex.getSymmetricAPSets(), denoptim.graph.DGraph.getSymSetsIterator(), denoptim.utils.GraphUtils.getUniqueVertexIndex(), denoptim.graph.Vertex.getVertexId(), denoptim.fragspace.IdFragmentAndAP.getVertexMolId(), denoptim.fragspace.IdFragmentAndAP.getVertexMolType(), denoptim.graph.DGraph.getVertexWithId(), denoptim.fragspace.IdFragmentAndAP.getVrtSymSetId(), denoptim.graph.DGraph.hasSymmetricAP(), denoptim.graph.Vertex.hasSymmetricAP(), denoptim.fragspace.FragmentSpace.imposeSymmetryOnAPsOfClass(), denoptim.graph.AttachmentPoint.isAvailable(), denoptim.fragspace.FragsCombinationIterator.nextIds, denoptim.fragspace.FragsCombinationIterator.numbGenCombs, denoptim.fragspace.FragsCombinationIterator.settings, denoptim.fragspace.IdFragmentAndAP.setVrtSymSetId(), denoptim.fragspace.FragmentSpaceParameters.symmetryConstraints, and denoptim.fragspace.FragsCombinationIterator.totCandsPerAP.
Referenced by denoptim.combinatorial.CombinatorialExplorerByLayer.exploreCombinationsAtGivenLevel().
void denoptim.fragspace.FragsCombinationIterator.setStartingPoint | ( | ArrayList< Integer > | nextIds | ) |
Sets the starting point for the iterator.
This method is meant for restarting the iterator from where it terminated in a previous run. The Ids are generated by the iterator itself: do not set the Ids by hand.
nextIds | the set of indeces for the next iteration. |
Definition at line 359 of file FragsCombinationIterator.java.
References denoptim.fragspace.FragsCombinationIterator.finished, denoptim.fragspace.FragsCombinationIterator.nextIds, and denoptim.fragspace.FragsCombinationIterator.totCandsPerAP.
Referenced by denoptim.combinatorial.CombinatorialExplorerByLayer.exploreCombinationsAtGivenLevel().
|
private |
List of attachment points on the root graph (source APs) for which there are one or more candidate destinies (i.e., append a frag, cap, or leave empty).
Definition at line 71 of file FragsCombinationIterator.java.
Referenced by denoptim.fragspace.FragsCombinationIterator.FragsCombinationIterator(), denoptim.fragspace.FragsCombinationIterator.getNumRootAPs(), and denoptim.fragspace.FragsCombinationIterator.next().
|
private |
List of all attachment points on the root graph (source APs)
Definition at line 63 of file FragsCombinationIterator.java.
Referenced by denoptim.fragspace.FragsCombinationIterator.FragsCombinationIterator().
|
private |
Map of all possible matches for each source AP.
Definition at line 77 of file FragsCombinationIterator.java.
Referenced by denoptim.fragspace.FragsCombinationIterator.FragsCombinationIterator(), denoptim.fragspace.FragsCombinationIterator.getCandidatesMap(), and denoptim.fragspace.FragsCombinationIterator.next().
|
private |
Definition at line 100 of file FragsCombinationIterator.java.
Referenced by denoptim.fragspace.FragsCombinationIterator.FragsCombinationIterator(), and denoptim.fragspace.FragsCombinationIterator.next().
|
private |
Flag defining whether at list one more combination can be produced.
Definition at line 53 of file FragsCombinationIterator.java.
Referenced by denoptim.fragspace.FragsCombinationIterator.FragsCombinationIterator(), denoptim.fragspace.FragsCombinationIterator.hasNext(), denoptim.fragspace.FragsCombinationIterator.next(), and denoptim.fragspace.FragsCombinationIterator.setStartingPoint().
|
private |
Set of indeces for the next iteration.
Definition at line 83 of file FragsCombinationIterator.java.
Referenced by denoptim.fragspace.FragsCombinationIterator.FragsCombinationIterator(), denoptim.fragspace.FragsCombinationIterator.getNextIds(), denoptim.fragspace.FragsCombinationIterator.next(), and denoptim.fragspace.FragsCombinationIterator.setStartingPoint().
|
private |
Current number of generated combinations.
Definition at line 98 of file FragsCombinationIterator.java.
Referenced by denoptim.fragspace.FragsCombinationIterator.getNumGeneratedCombs(), and denoptim.fragspace.FragsCombinationIterator.next().
|
private |
The root graph (may be a single fragment or an extended graph)
Definition at line 58 of file FragsCombinationIterator.java.
Referenced by denoptim.fragspace.FragsCombinationIterator.FragsCombinationIterator().
|
private |
Parameters defining the fragment space.
Definition at line 105 of file FragsCombinationIterator.java.
Referenced by denoptim.fragspace.FragsCombinationIterator.FragsCombinationIterator(), and denoptim.fragspace.FragsCombinationIterator.next().
|
private |
Sizes of the candidates set for each source AP.
Definition at line 88 of file FragsCombinationIterator.java.
Referenced by denoptim.fragspace.FragsCombinationIterator.FragsCombinationIterator(), denoptim.fragspace.FragsCombinationIterator.getSizesOfCandidateSets(), denoptim.fragspace.FragsCombinationIterator.next(), and denoptim.fragspace.FragsCombinationIterator.setStartingPoint().
|
private |
Total number of combinations.
Definition at line 93 of file FragsCombinationIterator.java.
Referenced by denoptim.fragspace.FragsCombinationIterator.FragsCombinationIterator(), and denoptim.fragspace.FragsCombinationIterator.getTotNumbCombs().