$darkmode
DENOPTIM
|
Generates all combinators of fragments by means of asynchronous threads. More...
Public Member Functions | |
CombinatorialExplorerByLayer (CEBLParameters settings) | |
Constructor. More... | |
void | stopRun () |
Stops all subtasks and shutdown executor. More... | |
void | run () throws DENOPTIMException |
Run the combinatorial exploration. More... | |
Package Attributes | |
final Map< GraphBuildingTask, Future< Object > > | submittedAndFutures |
Submitted subtasks and their futures. More... | |
final List< GraphBuildingTask > | submitted |
Sorted list of subtasks. More... | |
final ThreadPoolExecutor | tpe |
Asynchronous tasks manager. More... | |
Private Member Functions | |
boolean | subtaskHasException () |
Looks for exceptions in the subtasks and, if any, store its reference locally to allow reporting it back from the main thread. More... | |
boolean | allTasksCompleted () |
Check for completion of all subtasks. More... | |
void | makeCheckPoint () throws DENOPTIMException |
Identify the task preceding the earliest non-completed task and use it to create a checkpoint file. More... | |
int | countSubTasks () |
int | exploreCombinationsAtGivenLevel (int level) throws DENOPTIMException |
Generate graphs by exploring all combination of fragments at a given level of a growing graph. More... | |
DGraph | startNewGraphFromScaffold (int scafIdx) throws DENOPTIMException |
void | cleanup () |
clean all reference to submitted tasks More... | |
Private Attributes | |
int | verbosity = 0 |
Verbosity level. More... | |
boolean | restartFromChkPt = false |
Flag indicating to restart from checkpoint file. More... | |
int | serFromChkRestart = 0 |
Number of serialized graphs recovered from previous run database upon restart from checkpoint file. More... | |
int | totSubmittedTasks = 0 |
Number of tasks submitted directly of by subtasks. More... | |
Throwable | thrownByTask |
If any, here we stores the exception returned by a subtask. More... | |
boolean | firstAfterRestart = false |
Flag identifying the first iteration after restart from checkpoint. More... | |
CEBLParameters | settings = null |
All settings controlling the tasks executed by this class. More... | |
FragmentSpaceParameters | fsSettings = null |
Settings and definition of the fragment space. More... | |
Generates all combinators of fragments by means of asynchronous threads.
Combinations are produced by layer of fragments on root graphs, which can be single fragments (i.e., scaffolds) or complex graphs.
Definition at line 61 of file CombinatorialExplorerByLayer.java.
denoptim.combinatorial.CombinatorialExplorerByLayer.CombinatorialExplorerByLayer | ( | CEBLParameters | settings | ) |
Constructor.
Definition at line 127 of file CombinatorialExplorerByLayer.java.
References denoptim.combinatorial.CombinatorialExplorerByLayer.cleanup(), denoptim.programs.RunTimeParameters.containsParameters(), denoptim.programs.RunTimeParameters.ParametersType.FS_PARAMS, denoptim.combinatorial.CombinatorialExplorerByLayer.fsSettings, denoptim.programs.RunTimeParameters.getLogger(), denoptim.programs.combinatorial.CEBLParameters.getNumberOfCPU(), denoptim.programs.RunTimeParameters.getParameters(), denoptim.programs.RunTimeParameters.getVerbosity(), denoptim.programs.combinatorial.CEBLParameters.restartFromCheckPoint(), denoptim.combinatorial.CombinatorialExplorerByLayer.run(), denoptim.combinatorial.CombinatorialExplorerByLayer.settings, denoptim.combinatorial.CombinatorialExplorerByLayer.submitted, denoptim.combinatorial.CombinatorialExplorerByLayer.submittedAndFutures, denoptim.combinatorial.CombinatorialExplorerByLayer.tpe, and denoptim.combinatorial.CombinatorialExplorerByLayer.verbosity.
|
private |
Check for completion of all subtasks.
true
if all subtasks are completed Definition at line 247 of file CombinatorialExplorerByLayer.java.
References denoptim.combinatorial.CombinatorialExplorerByLayer.submitted.
Referenced by denoptim.combinatorial.CombinatorialExplorerByLayer.run().
|
private |
clean all reference to submitted tasks
Definition at line 886 of file CombinatorialExplorerByLayer.java.
References denoptim.combinatorial.CombinatorialExplorerByLayer.submitted, denoptim.combinatorial.CombinatorialExplorerByLayer.submittedAndFutures, and denoptim.combinatorial.CombinatorialExplorerByLayer.tpe.
Referenced by denoptim.combinatorial.CombinatorialExplorerByLayer.CombinatorialExplorerByLayer(), denoptim.combinatorial.CombinatorialExplorerByLayer.exploreCombinationsAtGivenLevel(), denoptim.combinatorial.CombinatorialExplorerByLayer.run(), and denoptim.combinatorial.CombinatorialExplorerByLayer.stopRun().
|
private |
Definition at line 332 of file CombinatorialExplorerByLayer.java.
References denoptim.combinatorial.CombinatorialExplorerByLayer.submitted, and denoptim.combinatorial.CombinatorialExplorerByLayer.totSubmittedTasks.
Referenced by denoptim.combinatorial.CombinatorialExplorerByLayer.run().
|
private |
Generate graphs by exploring all combination of fragments at a given level of a growing graph.
Note that in this context the 'level' is related to the initial root graph, which is considered to be level -1 no matter its size.
level | the current relative level |
DENOPTIMException |
Definition at line 584 of file CombinatorialExplorerByLayer.java.
References denoptim.combinatorial.CombinatorialExplorerByLayer.cleanup(), denoptim.constants.DENOPTIMConstants.EOL, denoptim.combinatorial.CombinatorialExplorerByLayer.firstAfterRestart, denoptim.combinatorial.CombinatorialExplorerByLayer.fsSettings, denoptim.fragspace.FragsCombinationIterator.getCandidatesMap(), denoptim.programs.combinatorial.CEBLParameters.getCheckPoint(), denoptim.programs.combinatorial.CEBLParameters.getCheckPointStep(), denoptim.fragspace.FragmentSpaceParameters.getFragmentSpace(), denoptim.programs.RunTimeParameters.getLogger(), denoptim.combinatorial.CEBLUtils.getNameOfStorageDir(), denoptim.combinatorial.CheckPoint.getNextIds(), denoptim.fragspace.FragsCombinationIterator.getNextIds(), denoptim.fragspace.FragsCombinationIterator.getNumGeneratedCombs(), denoptim.fragspace.FragsCombinationIterator.getNumRootAPs(), denoptim.programs.combinatorial.CEBLParameters.getRootGraphs(), denoptim.fragspace.FragsCombinationIterator.getSizesOfCandidateSets(), denoptim.fragspace.FragsCombinationIterator.getTotNumbCombs(), denoptim.utils.GraphUtils.getUniqueGraphIndex(), denoptim.programs.RunTimeParameters.getVerbosity(), denoptim.programs.RunTimeParameters.getWorkDirectory(), denoptim.fragspace.FragsCombinationIterator.hasNext(), denoptim.combinatorial.CombinatorialExplorerByLayer.makeCheckPoint(), denoptim.fragspace.FragsCombinationIterator.next(), denoptim.programs.combinatorial.CEBLParameters.prepareFilesForTests(), denoptim.io.DenoptimIO.readDENOPTIMGraphsFromJSONFile(), denoptim.combinatorial.CombinatorialExplorerByLayer.restartFromChkPt, denoptim.combinatorial.CheckPoint.serFileAlreadyUsed(), denoptim.constants.DENOPTIMConstants.SERGFILENAMEEXT, denoptim.combinatorial.GraphBuildingTask.setNextIds(), denoptim.fragspace.FragsCombinationIterator.setStartingPoint(), denoptim.combinatorial.CombinatorialExplorerByLayer.settings, denoptim.combinatorial.CombinatorialExplorerByLayer.startNewGraphFromScaffold(), denoptim.combinatorial.CombinatorialExplorerByLayer.stopRun(), denoptim.combinatorial.CEBLUtils.storeAllGraphsOfLevel(), denoptim.combinatorial.CombinatorialExplorerByLayer.submitted, denoptim.combinatorial.CombinatorialExplorerByLayer.submittedAndFutures, denoptim.combinatorial.CombinatorialExplorerByLayer.subtaskHasException(), denoptim.combinatorial.CombinatorialExplorerByLayer.thrownByTask, denoptim.combinatorial.CombinatorialExplorerByLayer.tpe, denoptim.programs.combinatorial.CEBLParameters.useGivenRoots, and denoptim.combinatorial.CombinatorialExplorerByLayer.verbosity.
Referenced by denoptim.combinatorial.CombinatorialExplorerByLayer.run().
|
private |
Identify the task preceding the earliest non-completed task and use it to create a checkpoint file.
Definition at line 269 of file CombinatorialExplorerByLayer.java.
References denoptim.programs.combinatorial.CEBLParameters.getCheckPoint(), denoptim.combinatorial.GraphBuildingTask.getGraphId(), denoptim.combinatorial.GraphBuildingTask.getLevel(), denoptim.combinatorial.GraphBuildingTask.getNextIds(), denoptim.combinatorial.GraphBuildingTask.getRootId(), denoptim.utils.GraphUtils.getUniqueGraphIndex(), denoptim.utils.GraphUtils.getUniqueMoleculeIndex(), denoptim.utils.GraphUtils.getUniqueVertexIndex(), denoptim.task.Task.isCompleted(), denoptim.combinatorial.CEBLUtils.serializeCheckPoint(), denoptim.combinatorial.CheckPoint.setLevel(), denoptim.combinatorial.CheckPoint.setNextIds(), denoptim.combinatorial.CheckPoint.setRootId(), denoptim.combinatorial.CheckPoint.setSafelyCompletedGraphId(), denoptim.combinatorial.CombinatorialExplorerByLayer.settings, denoptim.combinatorial.CheckPoint.setUnqGraphId(), denoptim.combinatorial.CheckPoint.setUnqMolId(), denoptim.combinatorial.CheckPoint.setUnqVrtId(), denoptim.combinatorial.CombinatorialExplorerByLayer.submitted, denoptim.combinatorial.CombinatorialExplorerByLayer.submittedAndFutures, and denoptim.combinatorial.CombinatorialExplorerByLayer.totSubmittedTasks.
Referenced by denoptim.combinatorial.CombinatorialExplorerByLayer.exploreCombinationsAtGivenLevel().
void denoptim.combinatorial.CombinatorialExplorerByLayer.run | ( | ) | throws DENOPTIMException |
Run the combinatorial exploration.
Definition at line 349 of file CombinatorialExplorerByLayer.java.
References denoptim.combinatorial.CombinatorialExplorerByLayer.allTasksCompleted(), denoptim.combinatorial.CombinatorialExplorerByLayer.cleanup(), denoptim.combinatorial.CombinatorialExplorerByLayer.countSubTasks(), denoptim.constants.DENOPTIMConstants.EOL, denoptim.combinatorial.CombinatorialExplorerByLayer.exploreCombinationsAtGivenLevel(), denoptim.combinatorial.CombinatorialExplorerByLayer.firstAfterRestart, denoptim.programs.combinatorial.CEBLParameters.getCheckPoint(), denoptim.combinatorial.CheckPoint.getLatestSafelyCompletedGraphId(), denoptim.combinatorial.CheckPoint.getLevel(), denoptim.programs.RunTimeParameters.getLogger(), denoptim.programs.combinatorial.CEBLParameters.getMaxLevel(), denoptim.programs.combinatorial.CEBLParameters.getMaxWait(), denoptim.combinatorial.CEBLUtils.getNameOfStorageDir(), denoptim.combinatorial.CheckPoint.getUnqGraphId(), denoptim.combinatorial.CheckPoint.getUnqMolId(), denoptim.combinatorial.CheckPoint.getUnqVrtId(), denoptim.programs.combinatorial.CEBLParameters.getWaitStep(), denoptim.utils.GraphUtils.resetUniqueGraphCounter(), denoptim.utils.GraphUtils.resetUniqueMoleculeCounter(), denoptim.utils.GraphUtils.resetUniqueVertexCounter(), denoptim.combinatorial.CombinatorialExplorerByLayer.restartFromChkPt, denoptim.combinatorial.CombinatorialExplorerByLayer.serFromChkRestart, denoptim.constants.DENOPTIMConstants.SERGFILENAMEEXT, denoptim.constants.DENOPTIMConstants.SERGFILENAMEROOT, denoptim.combinatorial.CombinatorialExplorerByLayer.settings, denoptim.combinatorial.CombinatorialExplorerByLayer.stopRun(), denoptim.combinatorial.CombinatorialExplorerByLayer.subtaskHasException(), denoptim.combinatorial.CombinatorialExplorerByLayer.thrownByTask, denoptim.combinatorial.CombinatorialExplorerByLayer.tpe, and denoptim.combinatorial.CombinatorialExplorerByLayer.verbosity.
Referenced by denoptim.combinatorial.CombinatorialExplorerByLayer.CombinatorialExplorerByLayer(), and denoptim.programs.combinatorial.FragSpaceExplorer.runProgram().
|
private |
scafIdx | the molID (i.e., the index of the molecule in the library of scaffolds) |
Definition at line 863 of file CombinatorialExplorerByLayer.java.
References denoptim.graph.DGraph.addVertex(), denoptim.combinatorial.CombinatorialExplorerByLayer.fsSettings, denoptim.fragspace.FragmentSpaceParameters.getFragmentSpace(), denoptim.utils.GraphUtils.getUniqueGraphIndex(), denoptim.utils.GraphUtils.getUniqueVertexIndex(), denoptim.graph.Vertex.newVertexFromLibrary(), denoptim.graph.Vertex.BBType.SCAFFOLD, denoptim.graph.DGraph.setGraphId(), and denoptim.graph.DGraph.setLocalMsg().
Referenced by denoptim.combinatorial.CombinatorialExplorerByLayer.exploreCombinationsAtGivenLevel().
void denoptim.combinatorial.CombinatorialExplorerByLayer.stopRun | ( | ) |
Stops all subtasks and shutdown executor.
Definition at line 210 of file CombinatorialExplorerByLayer.java.
References denoptim.combinatorial.CombinatorialExplorerByLayer.cleanup(), and denoptim.combinatorial.CombinatorialExplorerByLayer.tpe.
Referenced by denoptim.combinatorial.CombinatorialExplorerByLayer.exploreCombinationsAtGivenLevel(), denoptim.programs.combinatorial.FragSpaceExplorer.handleThrowable(), and denoptim.combinatorial.CombinatorialExplorerByLayer.run().
|
private |
Looks for exceptions in the subtasks and, if any, store its reference locally to allow reporting it back from the main thread.
true
if any of the subtasks has thrown an exception Definition at line 224 of file CombinatorialExplorerByLayer.java.
References denoptim.combinatorial.CombinatorialExplorerByLayer.submitted, and denoptim.combinatorial.CombinatorialExplorerByLayer.thrownByTask.
Referenced by denoptim.combinatorial.CombinatorialExplorerByLayer.exploreCombinationsAtGivenLevel(), and denoptim.combinatorial.CombinatorialExplorerByLayer.run().
|
private |
Flag identifying the first iteration after restart from checkpoint.
Definition at line 108 of file CombinatorialExplorerByLayer.java.
Referenced by denoptim.combinatorial.CombinatorialExplorerByLayer.exploreCombinationsAtGivenLevel(), and denoptim.combinatorial.CombinatorialExplorerByLayer.run().
|
private |
Settings and definition of the fragment space.
Definition at line 118 of file CombinatorialExplorerByLayer.java.
Referenced by denoptim.combinatorial.CombinatorialExplorerByLayer.CombinatorialExplorerByLayer(), denoptim.combinatorial.CombinatorialExplorerByLayer.exploreCombinationsAtGivenLevel(), and denoptim.combinatorial.CombinatorialExplorerByLayer.startNewGraphFromScaffold().
|
private |
Flag indicating to restart from checkpoint file.
Definition at line 87 of file CombinatorialExplorerByLayer.java.
Referenced by denoptim.combinatorial.CombinatorialExplorerByLayer.exploreCombinationsAtGivenLevel(), and denoptim.combinatorial.CombinatorialExplorerByLayer.run().
|
private |
Number of serialized graphs recovered from previous run database upon restart from checkpoint file.
Definition at line 93 of file CombinatorialExplorerByLayer.java.
Referenced by denoptim.combinatorial.CombinatorialExplorerByLayer.run().
|
private |
All settings controlling the tasks executed by this class.
Definition at line 113 of file CombinatorialExplorerByLayer.java.
Referenced by denoptim.combinatorial.CombinatorialExplorerByLayer.CombinatorialExplorerByLayer(), denoptim.combinatorial.CombinatorialExplorerByLayer.exploreCombinationsAtGivenLevel(), denoptim.combinatorial.CombinatorialExplorerByLayer.makeCheckPoint(), and denoptim.combinatorial.CombinatorialExplorerByLayer.run().
|
package |
Sorted list of subtasks.
Definition at line 72 of file CombinatorialExplorerByLayer.java.
Referenced by denoptim.combinatorial.CombinatorialExplorerByLayer.allTasksCompleted(), denoptim.combinatorial.CombinatorialExplorerByLayer.cleanup(), denoptim.combinatorial.CombinatorialExplorerByLayer.CombinatorialExplorerByLayer(), denoptim.combinatorial.CombinatorialExplorerByLayer.countSubTasks(), denoptim.combinatorial.CombinatorialExplorerByLayer.exploreCombinationsAtGivenLevel(), denoptim.combinatorial.CombinatorialExplorerByLayer.makeCheckPoint(), and denoptim.combinatorial.CombinatorialExplorerByLayer.subtaskHasException().
|
package |
Submitted subtasks and their futures.
Definition at line 67 of file CombinatorialExplorerByLayer.java.
Referenced by denoptim.combinatorial.CombinatorialExplorerByLayer.cleanup(), denoptim.combinatorial.CombinatorialExplorerByLayer.CombinatorialExplorerByLayer(), denoptim.combinatorial.CombinatorialExplorerByLayer.exploreCombinationsAtGivenLevel(), and denoptim.combinatorial.CombinatorialExplorerByLayer.makeCheckPoint().
|
private |
If any, here we stores the exception returned by a subtask.
Definition at line 103 of file CombinatorialExplorerByLayer.java.
Referenced by denoptim.combinatorial.CombinatorialExplorerByLayer.exploreCombinationsAtGivenLevel(), denoptim.combinatorial.CombinatorialExplorerByLayer.run(), and denoptim.combinatorial.CombinatorialExplorerByLayer.subtaskHasException().
|
private |
Number of tasks submitted directly of by subtasks.
Definition at line 98 of file CombinatorialExplorerByLayer.java.
Referenced by denoptim.combinatorial.CombinatorialExplorerByLayer.countSubTasks(), and denoptim.combinatorial.CombinatorialExplorerByLayer.makeCheckPoint().
|
package |
Asynchronous tasks manager.
Definition at line 77 of file CombinatorialExplorerByLayer.java.
Referenced by denoptim.combinatorial.CombinatorialExplorerByLayer.cleanup(), denoptim.combinatorial.CombinatorialExplorerByLayer.CombinatorialExplorerByLayer(), denoptim.combinatorial.CombinatorialExplorerByLayer.exploreCombinationsAtGivenLevel(), denoptim.combinatorial.CombinatorialExplorerByLayer.run(), and denoptim.combinatorial.CombinatorialExplorerByLayer.stopRun().
|
private |
Verbosity level.
Definition at line 82 of file CombinatorialExplorerByLayer.java.
Referenced by denoptim.combinatorial.CombinatorialExplorerByLayer.CombinatorialExplorerByLayer(), denoptim.combinatorial.CombinatorialExplorerByLayer.exploreCombinationsAtGivenLevel(), and denoptim.combinatorial.CombinatorialExplorerByLayer.run().