Class StudyStep

java.lang.Object
com.amalgamasimulation.studies.core.StudyStep
Direct Known Subclasses:
ScenarioStudyStep, Study

public abstract class StudyStep extends Object
  • Constructor Details

    • StudyStep

      protected StudyStep(StudyStep parent)
  • Method Details

    • name

      public abstract String name()
    • completedFraction

      public double completedFraction()
    • errorsFraction

      public double errorsFraction()
    • isRunning

      public boolean isRunning()
    • elapsedTimeMillis

      public int elapsedTimeMillis()
    • errorsCount

      public int errorsCount()
    • childrenReplicationSteps

      public List<ReplicationStudyStep> childrenReplicationSteps()
    • correctChildrenResults

      public ResultsList correctChildrenResults()
    • estimatedRemainingTimeMillis

      public int estimatedRemainingTimeMillis()
    • run

      public void run(BiFunction<org.eclipse.emf.ecore.EObject,Integer,Run<?>> runSupplier, Supplier<Boolean> cancellationMonitor, Runnable runCompletionHandler)
    • hasReattachableRemoteRuns

      public boolean hasReattachableRemoteRuns(Predicate<ShortId> remoteRunAwarenessChecker)
      Returns true if any of descendants() represents a run that had been executed remotely before this study was saved to a file.
    • reattachToRemoteRuns

      public void reattachToRemoteRuns(Predicate<ShortId> remoteRunAwarenessChecker, BiFunction<ShortId,Integer,Run<?>> runSupplier, Supplier<Boolean> cancellationMonitor, Runnable runCompletionHandler)
      Creates remote runs 'attached' to remotely running experiments that had been submitted to the Cloud Server earlier.
      Parameters:
      remoteRunAwarenessChecker - checks that the Cloud Server knows a run with the provided id
      runSupplier - creates a run attached to the remotely executing run
      cancellationMonitor - object to check if user has requested a stop
      runCompletionHandler - callback to be called when a Run is completed
    • parentStudy

      public Optional<Study> parentStudy()
    • parent

      public Optional<StudyStep> parent()
    • children

      public List<StudyStep> children()
      Returns immediate children of this study step.
    • descendants

      public List<StudyStep> descendants()
      Returns the result of the depth-first traversal of the study step tree, starting with the current study step.
      See Also:
    • replicationsCount

      public int replicationsCount()
    • parentScenarioStudyStep

      public Optional<ScenarioStudyStep> parentScenarioStudyStep()
    • addChild

      public void addChild(StudyStep childToAdd)
    • addChild

      public void addChild(StudyStep childToAdd, int index)
    • removeChild

      public void removeChild(StudyStep childToRemove)
    • changeReplicationsCount

      public abstract void changeReplicationsCount(int newReplicationsCount)