public abstract class JIPipeParameterlessSimpleIteratingAlgorithm extends JIPipeAlgorithm implements JIPipeParallelizedAlgorithm, JIPipeDataBatchAlgorithm
JIPipeAlgorithm
that iterates through each data row.
This is a simplified version of JIPipeIteratingAlgorithm
that assumes that there is only one or zero input slots.
An error is thrown if there are more than one input slots.Modifier and Type | Class and Description |
---|---|
static class |
JIPipeParameterlessSimpleIteratingAlgorithm.DataBatchGenerationSettings |
JIPipeAlgorithm.StateSerializer
JIPipeGraphNode.BaseDirectoryChangedEvent, JIPipeGraphNode.Serializer
JIPipeParameterCollection.ParameterChangedEvent, JIPipeParameterCollection.ParameterStructureChangedEvent, JIPipeParameterCollection.ParameterUIChangedEvent
Constructor and Description |
---|
JIPipeParameterlessSimpleIteratingAlgorithm(JIPipeNodeInfo info)
Creates a new instance
|
JIPipeParameterlessSimpleIteratingAlgorithm(JIPipeNodeInfo info,
JIPipeSlotConfiguration slotConfiguration)
Creates a new instance
|
JIPipeParameterlessSimpleIteratingAlgorithm(JIPipeParameterlessSimpleIteratingAlgorithm other)
Copies the algorithm
|
Modifier and Type | Method and Description |
---|---|
List<JIPipeMergingDataBatch> |
generateDataBatchesDryRun(List<JIPipeInputDataSlot> slots,
JIPipeProgressInfo progressInfo)
Generates data batches.
|
JIPipeParameterlessSimpleIteratingAlgorithm.DataBatchGenerationSettings |
getDataBatchGenerationSettings() |
JIPipeDataBatchGenerationSettings |
getGenerationSettingsInterface()
Returns the batch generation settings as interface
|
int |
getParallelizationBatchSize()
Returns how many threads the actual algorithm requires.
|
boolean |
isParallelizationEnabled() |
boolean |
isParameterUIVisible(JIPipeParameterTree tree,
JIPipeParameterAccess access)
Allows to override the visibility of parameters inside the UI
|
boolean |
isParameterUIVisible(JIPipeParameterTree tree,
JIPipeParameterCollection subParameter)
Allows to override the visibility of sub-parameters inside the UI
|
void |
reportValidity(JIPipeIssueReport report)
Generates a validity report
|
void |
run(JIPipeProgressInfo progressInfo)
Runs the workload
|
protected abstract void |
runIteration(JIPipeDataBatch dataBatch,
JIPipeProgressInfo progressInfo)
Runs code on one data row
|
void |
setParallelizationEnabled(boolean parallelizationEnabled)
User-defined parameter to control if parallelization is enabled
|
boolean |
supportsParallelization()
Indicates to the algorithm base implementation if parallelization is supported.
|
canAutoPassThrough, canPassThrough, getStateId, getThreadPool, isEnabled, isPassThrough, isPostprocessor, isPreprocessor, loadExample, runPassThrough, setEnabled, setPassThrough, setThreadPool
canUserDelete, clearLocations, clearSlotData, copySlotConfiguration, duplicate, fromJson, fromJsonNode, getAliasIdInParentGraph, getBaseDirectory, getCategory, getCompartmentDisplayName, getCompartmentUUIDInGraphAsString, getCompartmentUUIDInParentGraph, getCustomDescription, getDataInputSlots, getDependencies, getDisplayName, getEventBus, getFirstInputSlot, getFirstOutputSlot, getInfo, getInputSlot, getInputSlotMap, getInputSlotOrder, getInputSlots, getInputSlotsWithRole, getInternalStoragePath, getLastInputSlot, getLastOutputSlot, getLocations, getLocationWithin, getName, getNewScratch, getOpenInputSlots, getOutputSlot, getOutputSlotMap, getOutputSlots, getOutputSlotsWithRole, getParentGraph, getProjectCompartment, getProjectDirectory, getScratchBaseDirectory, getSlotConfiguration, getStoragePath, getUUIDInParentGraph, hasInputSlot, hasOutputSlot, isBookmarked, isVisibleIn, onDeserialized, onParameterChanged, onParameterStructureChanged, onParameterUIChanged, onSlotConfigurationChanged, onSlotConnected, onSlotDisconnected, registerSubParameter, renderInputSlots, renderOutputSlots, setAllSlotsVirtual, setBaseDirectory, setBookmarked, setCustomDescription, setCustomName, setInfo, setInternalStoragePath, setLocations, setLocationWithin, setLocationWithin, setParentGraph, setProjectDirectory, setScratchBaseDirectory, setSlotConfiguration, setStoragePath, toggleSlot, toJson, triggerSlotsChangedEvent, updateGraphNodeSlots, updateSlotInheritance
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
generateValidityReport
addParameterChangeListener, addParameterChangeListener, getContextActions, getParameter, getParameterAccess, setParameter, triggerParameterChange, triggerParameterStructureChange, triggerParameterUIChange
public JIPipeParameterlessSimpleIteratingAlgorithm(JIPipeNodeInfo info, JIPipeSlotConfiguration slotConfiguration)
info
- Algorithm infoslotConfiguration
- Slot configuration overridepublic JIPipeParameterlessSimpleIteratingAlgorithm(JIPipeNodeInfo info)
info
- Algorithm infopublic JIPipeParameterlessSimpleIteratingAlgorithm(JIPipeParameterlessSimpleIteratingAlgorithm other)
other
- The originalpublic void run(JIPipeProgressInfo progressInfo)
JIPipeGraphNode
run
in class JIPipeAlgorithm
progressInfo
- progress passed from the runnerpublic void reportValidity(JIPipeIssueReport report)
JIPipeValidatable
reportValidity
in interface JIPipeValidatable
reportValidity
in class JIPipeAlgorithm
report
- the report to be added toprotected abstract void runIteration(JIPipeDataBatch dataBatch, JIPipeProgressInfo progressInfo)
dataBatch
- The data interfaceprogressInfo
- the progress info from the runpublic boolean supportsParallelization()
JIPipeParallelizedAlgorithm
supportsParallelization
in interface JIPipeParallelizedAlgorithm
public int getParallelizationBatchSize()
JIPipeParallelizedAlgorithm
getParallelizationBatchSize
in interface JIPipeParallelizedAlgorithm
public boolean isParallelizationEnabled()
isParallelizationEnabled
in interface JIPipeParallelizedAlgorithm
public void setParallelizationEnabled(boolean parallelizationEnabled)
JIPipeParallelizedAlgorithm
setParallelizationEnabled
in interface JIPipeParallelizedAlgorithm
parallelizationEnabled
- if parallelization is enabledpublic JIPipeParameterlessSimpleIteratingAlgorithm.DataBatchGenerationSettings getDataBatchGenerationSettings()
public JIPipeDataBatchGenerationSettings getGenerationSettingsInterface()
JIPipeDataBatchAlgorithm
getGenerationSettingsInterface
in interface JIPipeDataBatchAlgorithm
public boolean isParameterUIVisible(JIPipeParameterTree tree, JIPipeParameterCollection subParameter)
JIPipeParameterCollection
isParameterUIVisible
in interface JIPipeParameterCollection
tree
- the parameter tree that is used to access this parametersubParameter
- a sub parameterpublic boolean isParameterUIVisible(JIPipeParameterTree tree, JIPipeParameterAccess access)
JIPipeParameterCollection
isParameterUIVisible
in interface JIPipeParameterCollection
isParameterUIVisible
in class JIPipeAlgorithm
tree
- the parameter tree that is used to access this parameteraccess
- the parameterpublic List<JIPipeMergingDataBatch> generateDataBatchesDryRun(List<JIPipeInputDataSlot> slots, JIPipeProgressInfo progressInfo)
JIPipeDataBatchAlgorithm
generateDataBatchesDryRun
in interface JIPipeDataBatchAlgorithm
slots
- the data slotsprogressInfo
- the progressCopyright © 2020–2022 Leibniz Institute for Natural Product Research and Infection Biology - Hans Knöll Institute (HKI). All rights reserved.