$darkmode
DENOPTIM
denoptim.fragspace.FragsCombinationIterator Class Reference

Factory of combination of fragments. More...

Collaboration diagram for denoptim.fragspace.FragsCombinationIterator:
[legend]

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< IdFragmentAndAPallSrcAps
 List of all attachment points on the root graph (source APs) More...
 
ArrayList< IdFragmentAndAPactvSrcAps
 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...
 

Detailed Description

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.

Author
Marco Foscato

Definition at line 48 of file FragsCombinationIterator.java.

Constructor & Destructor Documentation

◆ FragsCombinationIterator()

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.

Parameters
rootGraph
Exceptions
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.

Here is the call graph for this function:

Member Function Documentation

◆ getCandidatesMap()

Map< IdFragmentAndAP, ArrayList< IdFragmentAndAP > > denoptim.fragspace.FragsCombinationIterator.getCandidatesMap ( )
Returns
the set of candidate attachment points per each of the usable attachment point on the root system.

Definition at line 722 of file FragsCombinationIterator.java.

References denoptim.fragspace.FragsCombinationIterator.candFragsPerAP.

Referenced by denoptim.combinatorial.CombinatorialExplorerByLayer.exploreCombinationsAtGivenLevel().

Here is the caller graph for this function:

◆ getNextIds()

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

Here is the caller graph for this function:

◆ getNumGeneratedCombs()

int denoptim.fragspace.FragsCombinationIterator.getNumGeneratedCombs ( )
Returns
the current total number of FragsCombinations generated

Definition at line 710 of file FragsCombinationIterator.java.

References denoptim.fragspace.FragsCombinationIterator.numbGenCombs.

Referenced by denoptim.combinatorial.CombinatorialExplorerByLayer.exploreCombinationsAtGivenLevel().

Here is the caller graph for this function:

◆ getNumRootAPs()

int denoptim.fragspace.FragsCombinationIterator.getNumRootAPs ( )
Returns
the number of attachment points un the root system.

Definition at line 685 of file FragsCombinationIterator.java.

References denoptim.fragspace.FragsCombinationIterator.actvSrcAps.

Referenced by denoptim.combinatorial.CombinatorialExplorerByLayer.exploreCombinationsAtGivenLevel().

Here is the caller graph for this function:

◆ getSizesOfCandidateSets()

ArrayList< Integer > denoptim.fragspace.FragsCombinationIterator.getSizesOfCandidateSets ( )
Returns
the vector with the size of the set of candidates per each usable attachment point

Definition at line 734 of file FragsCombinationIterator.java.

References denoptim.fragspace.FragsCombinationIterator.totCandsPerAP.

Referenced by denoptim.combinatorial.CombinatorialExplorerByLayer.exploreCombinationsAtGivenLevel().

Here is the caller graph for this function:

◆ getTotNumbCombs()

int denoptim.fragspace.FragsCombinationIterator.getTotNumbCombs ( )
Returns
the total number of FragsCombinations 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().

Here is the caller graph for this function:

◆ hasNext()

boolean denoptim.fragspace.FragsCombinationIterator.hasNext ( )
Returns
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().

Here is the caller graph for this function:

◆ next()

FragsCombination denoptim.fragspace.FragsCombinationIterator.next ( ) throws NoSuchElementException

Generate the next combination of fragments.

Returns
the next FragsCombination
Exceptions
NoSuchElementExceptionif 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().

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

◆ setStartingPoint()

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.

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

Here is the caller graph for this function:

Member Data Documentation

◆ actvSrcAps

ArrayList<IdFragmentAndAP> denoptim.fragspace.FragsCombinationIterator.actvSrcAps
private
Initial value:
=
new ArrayList<IdFragmentAndAP>()

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

◆ allSrcAps

ArrayList<IdFragmentAndAP> denoptim.fragspace.FragsCombinationIterator.allSrcAps
private
Initial value:
=
new ArrayList<IdFragmentAndAP>()

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

◆ candFragsPerAP

Map<IdFragmentAndAP,ArrayList<IdFragmentAndAP> > denoptim.fragspace.FragsCombinationIterator.candFragsPerAP
private
Initial value:
=
new HashMap<IdFragmentAndAP,ArrayList<IdFragmentAndAP>>()

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

◆ EOL

String denoptim.fragspace.FragsCombinationIterator.EOL = DENOPTIMConstants.EOL
private

◆ finished

boolean denoptim.fragspace.FragsCombinationIterator.finished = false
private

◆ nextIds

ArrayList<Integer> denoptim.fragspace.FragsCombinationIterator.nextIds = new ArrayList<Integer>()
private

◆ numbGenCombs

int denoptim.fragspace.FragsCombinationIterator.numbGenCombs = 0
private

◆ rootGraph

DGraph denoptim.fragspace.FragsCombinationIterator.rootGraph
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().

◆ settings

FragmentSpaceParameters denoptim.fragspace.FragsCombinationIterator.settings = null
private

◆ totCandsPerAP

ArrayList<Integer> denoptim.fragspace.FragsCombinationIterator.totCandsPerAP = new ArrayList<Integer>()
private

◆ totCombs

int denoptim.fragspace.FragsCombinationIterator.totCombs = 0
private

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