public abstract class JIPipeSimpleIteratingAlgorithm extends JIPipeParameterSlotAlgorithm implements JIPipeParallelizedAlgorithm, JIPipeIterationStepAlgorithm, JIPipeAdaptiveParametersAlgorithm
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.JIPipeGraphNode.BaseDirectoryChangedEvent, JIPipeGraphNode.BaseDirectoryChangedEventEmitter, JIPipeGraphNode.BaseDirectoryChangedEventListener, JIPipeGraphNode.NodeSlotsChangedEvent, JIPipeGraphNode.NodeSlotsChangedEventEmitter, JIPipeGraphNode.NodeSlotsChangedEventListener, JIPipeGraphNode.Serializer
JIPipeParameterCollection.ParameterChangedEvent, JIPipeParameterCollection.ParameterChangedEventEmitter, JIPipeParameterCollection.ParameterChangedEventListener, JIPipeParameterCollection.ParameterStructureChangedEvent, JIPipeParameterCollection.ParameterStructureChangedEventEmitter, JIPipeParameterCollection.ParameterStructureChangedEventListener, JIPipeParameterCollection.ParameterUIChangedEvent, JIPipeParameterCollection.ParameterUIChangedEventEmitter, JIPipeParameterCollection.ParameterUIChangedEventListener
SLOT_PARAMETERS
Constructor and Description |
---|
JIPipeSimpleIteratingAlgorithm(JIPipeNodeInfo info)
Creates a new instance
|
JIPipeSimpleIteratingAlgorithm(JIPipeNodeInfo info,
JIPipeSlotConfiguration slotConfiguration)
Creates a new instance
|
JIPipeSimpleIteratingAlgorithm(JIPipeSimpleIteratingAlgorithm other)
Copies the algorithm
|
Modifier and Type | Method and Description |
---|---|
void |
createUIInputSlotIconDescriptionMenuItems(String slotName,
List<ViewOnlyMenuItem> target)
Explanations added to the slot menu
Can be null
|
JIPipeDataBatchGenerationResult |
generateDataBatchesGenerationResult(List<JIPipeInputDataSlot> slots,
JIPipeProgressInfo progressInfo)
Generates iteration steps.
|
JIPipeAdaptiveParameterSettings |
getAdaptiveParameterSettings() |
JIPipeSimpleIteratingAlgorithmIterationStepGenerationSettings |
getDataBatchGenerationSettings() |
JIPipeIterationStepGenerationSettings |
getGenerationSettingsInterface()
Returns the batch generation settings as interface
|
int |
getParallelizationBatchSize()
Returns how many threads the actual algorithm requires.
|
protected boolean |
isAllowEmptyIterationStep()
If true, allow the execution of an empty iteration step if all inputs are optional and are empty
|
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(JIPipeValidationReportContext reportContext,
JIPipeValidationReport report)
Generates a validity report
|
protected abstract void |
runIteration(JIPipeSingleIterationStep iterationStep,
JIPipeIterationContext iterationContext,
JIPipeGraphNodeRunContext runContext,
JIPipeProgressInfo progressInfo)
Runs code on one data row
|
void |
runParameterSet(JIPipeGraphNodeRunContext runContext,
JIPipeProgressInfo progressInfo,
List<JIPipeTextAnnotation> parameterAnnotations)
Runs a parameter set iteration
|
protected void |
runPassThrough(JIPipeProgressInfo progressInfo,
JIPipeSingleIterationStep iterationStep)
A pass-through variant for iterating algorithms.
|
boolean |
supportsParallelization()
Indicates to the algorithm base implementation if parallelization is supported.
|
getDataInputSlotCount, getDataInputSlots, getFirstInputSlot, getNonParameterInputSlots, getParameterSlot, getParameterSlotAlgorithmSettings, getUIInputSlotIcon, getUIInputSlotIconBaseDimensions, onParameterChanged, run
canAutoPassThrough, canPassThrough, functionallyEquals, getDefaultCustomExpressionVariables, getRuntimePartition, isEnabled, isEnableDefaultCustomExpressionVariables, isPassThrough, isPostprocessor, isPreprocessor, isSkipped, loadExample, onDeserialized, runPassThrough, setEnabled, setPassThrough, setRuntimePartition, setSkipped
archiveTo, canUserDelete, clearLocations, clearSlotData, copySlotConfiguration, duplicate, emitNodeSlotsChangedEvent, fromJson, getAliasIdInParentGraph, getBaseDirectory, getBaseDirectoryChangedEventEmitter, getCategory, getCompartmentDisplayName, getCompartmentUUIDInGraphAsString, getCompartmentUUIDInParentGraph, getCustomDescription, getCustomName, getDependencies, getDisplayName, getEnvironmentDependencies, getFirstOutputSlot, getInfo, getInputSlot, getInputSlotMap, getInputSlotOrder, getInputSlots, getInputSlotsWithRole, getInternalStoragePath, getLastInputSlot, getLastOutputSlot, getName, getNewScratch, getNodeSlotsChangedEventEmitter, getNodeUILocationPerViewModePerCompartment, getNodeUILocationWithin, getOpenInputSlots, getOutputSlot, getOutputSlotMap, getOutputSlots, getOutputSlotsWithRole, getParentGraph, getProject, getProjectCompartment, getProjectDataDirs, getProjectDirectory, getRuntimeProject, getScratchBaseDirectory, getSlotConfiguration, getStoragePath, getTextDescription, getUUIDInParentGraph, hasInputSlot, hasOutputSlot, isBookmarked, isUiLocked, isVisibleIn, onSlotConfigurationChanged, renderInputSlots, renderOutputSlots, setBaseDirectory, setBookmarked, setCustomDescription, setCustomName, setInfo, setInternalStoragePath, setNodeUILocationPerViewModePerCompartment, setNodeUILocationWithin, setNodeUILocationWithin, setParentGraph, setProjectDirectory, setRuntimeProject, setScratchBaseDirectory, setSlotConfiguration, setStoragePath, setUiLocked, toggleSlot, toJson, updateGraphNodeSlots
getParameterChangedEventEmitter, getParameterStructureChangedEventEmitter, getParameterUIChangedEventEmitter, onParameterStructureChanged, onParameterUIChanged, registerSubParameter, registerSubParameters
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
generateDataBatchesDryRun
installUIOverrideParameterEditor, installUIParameterOptions
deserializeFromJsonNode, emitParameterChangedEvent, emitParameterStructureChangedEvent, emitParameterUIChangedEvent, getContextActions, getParameter, getParameterAccess, getParameterChangedEventEmitter, getParameterStructureChangedEventEmitter, getParameterUIChangedEventEmitter, serializeToJsonFile, serializeToJsonGenerator, serializeToJsonString, setParameter
generateValidityReport
onParameterUIChanged
onParameterStructureChanged
public JIPipeSimpleIteratingAlgorithm(JIPipeNodeInfo info, JIPipeSlotConfiguration slotConfiguration)
info
- Algorithm infoslotConfiguration
- Slot configuration overridepublic JIPipeSimpleIteratingAlgorithm(JIPipeNodeInfo info)
info
- Algorithm infopublic JIPipeSimpleIteratingAlgorithm(JIPipeSimpleIteratingAlgorithm other)
other
- The originalprotected void runPassThrough(JIPipeProgressInfo progressInfo, JIPipeSingleIterationStep iterationStep)
progressInfo
- progress infoiterationStep
- the iteration stepprotected boolean isAllowEmptyIterationStep()
public void runParameterSet(JIPipeGraphNodeRunContext runContext, JIPipeProgressInfo progressInfo, List<JIPipeTextAnnotation> parameterAnnotations)
JIPipeParameterSlotAlgorithm
runParameterSet
in class JIPipeParameterSlotAlgorithm
runContext
- the run contextprogressInfo
- progress info from the runparameterAnnotations
- parameter annotationspublic void createUIInputSlotIconDescriptionMenuItems(String slotName, List<ViewOnlyMenuItem> target)
JIPipeGraphNode
createUIInputSlotIconDescriptionMenuItems
in class JIPipeParameterSlotAlgorithm
slotName
- the slot nametarget
- the list of menu itemspublic void reportValidity(JIPipeValidationReportContext reportContext, JIPipeValidationReport report)
JIPipeValidatable
reportValidity
in interface JIPipeValidatable
reportValidity
in class JIPipeAlgorithm
reportContext
- the report contextreport
- the report to be added toprotected abstract void runIteration(JIPipeSingleIterationStep iterationStep, JIPipeIterationContext iterationContext, JIPipeGraphNodeRunContext runContext, JIPipeProgressInfo progressInfo)
iterationStep
- The data interfaceiterationContext
- the iteration contextrunContext
- the run contextprogressInfo
- the progress info from the runpublic boolean supportsParallelization()
JIPipeParallelizedAlgorithm
supportsParallelization
in interface JIPipeParallelizedAlgorithm
public int getParallelizationBatchSize()
JIPipeParallelizedAlgorithm
getParallelizationBatchSize
in interface JIPipeParallelizedAlgorithm
public JIPipeSimpleIteratingAlgorithmIterationStepGenerationSettings getDataBatchGenerationSettings()
public boolean isParameterUIVisible(JIPipeParameterTree tree, JIPipeParameterCollection subParameter)
JIPipeParameterCollection
isParameterUIVisible
in interface JIPipeParameterCollection
isParameterUIVisible
in class JIPipeParameterSlotAlgorithm
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 JIPipeIterationStepGenerationSettings getGenerationSettingsInterface()
JIPipeIterationStepAlgorithm
getGenerationSettingsInterface
in interface JIPipeIterationStepAlgorithm
public JIPipeAdaptiveParameterSettings getAdaptiveParameterSettings()
getAdaptiveParameterSettings
in interface JIPipeAdaptiveParametersAlgorithm
public JIPipeDataBatchGenerationResult generateDataBatchesGenerationResult(List<JIPipeInputDataSlot> slots, JIPipeProgressInfo progressInfo)
JIPipeIterationStepAlgorithm
generateDataBatchesGenerationResult
in interface JIPipeIterationStepAlgorithm
slots
- the data slotsprogressInfo
- the progressCopyright © 2020–2025 Leibniz Institute for Natural Product Research and Infection Biology - Hans Knöll Institute (HKI). All rights reserved.