Class RemoteRun<S extends org.eclipse.emf.ecore.EObject>

java.lang.Object
com.amalgamasimulation.studies.core.Run<S>
com.amalgamasimulation.studies.remote.RemoteRun<S>
Type Parameters:
S - scenario

public class RemoteRun<S extends org.eclipse.emf.ecore.EObject> extends Run<S>
A proxy to the experiment performed on the Amalgama Cloud Server.
  • Constructor Details

    • RemoteRun

      public RemoteRun(S scenario, int seed, String productID, String clientSuffix, String version, String computerID, BiPredicate<S,String> scenarioSaver)
      Creates a new instance of a run and assigns a unique id to it. Upon creation, the run's status is Run.Status.NOT_STARTED.

      This constructor is called for a RemoteRun that represents an experiment that the user has just created and wants it to be submitted for remote execution. The run() method in this case starts the server interaction: submits the new experiment to the server, starts polling for status and results.

      Parameters:
      scenario - EMF scenario (instance inherited from EObject that parameterizes the simulation model.
      seed - random number seed used to initialize random number sequences of the simulation model.
      productID - licensing-related application ID typically located in the singleton object of class `AppInfo` or similar
      scenarioSaver - function that accepts a scenario object and a file path (as a String), saves the scenario to the file and returns true iff saving was successful
    • RemoteRun

      public RemoteRun(ShortId runId, int seed, String productID, String clientSuffix, String version, String computerID)
      Creates a RemoteRun that represents an experiment which is a part of a study that was launched remotely, then saved to a file, and then loaded from a file.

      The RemoteRun does not submit a new task to the Cloud Server, it only fetches the experiment status and results. So, this RemoteRun has no scenario and no scenarioSaver.
      The RemoteRun accepts an existing runId and does not generate a new one.

      Parameters:
      runId - run id
      seed - random number seed used to initialize random number sequences of the simulation model.
      productID - licensing-related application ID typically located in the singleton object of class `AppInfo` or similar
  • Method Details

    • run

      public void run()
      Call server run.
      Specified by:
      run in class Run<S extends org.eclipse.emf.ecore.EObject>
    • result

      public Optional<? extends Result> result()
      Description copied from class: Run
      Returns the run result, if any, or an empty Optional.

      Can be called from any external thread, including RCP UI thread

      Specified by:
      result in class Run<S extends org.eclipse.emf.ecore.EObject>
      Returns:
      run result
    • completedFraction

      public double completedFraction()
      Description copied from class: Run
      Returns the current execution progress as a fraction between 0.0 and 1.0;

      Can be called from any external thread, including RCP UI thread

      Specified by:
      completedFraction in class Run<S extends org.eclipse.emf.ecore.EObject>
      Returns:
      the completed fraction of the run