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
A proxy to the experiment performed on the Amalgama Cloud Server.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.amalgamasimulation.studies.core.Run
Run.Status -
Field Summary
Fields inherited from class com.amalgamasimulation.studies.core.Run
completionActionHandler, result, scenario, seed -
Constructor Summary
ConstructorsConstructorDescriptionRemoteRun(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.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. -
Method Summary
Methods inherited from class com.amalgamasimulation.studies.core.Run
elapsedTimeMillis, errorsCount, id, isStopRequested, runCompletionActionHandlerOnce, setCompletionActionHandler, setStatus, setStopMonitor, status, stop
-
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 isRun.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 fromEObjectthat 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 similarscenarioSaver- 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 idseed- 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. -
result
Description copied from class:RunReturns the run result, if any, or an empty Optional.Can be called from any external thread, including RCP UI thread
-
completedFraction
public double completedFraction()Description copied from class:RunReturns 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:
completedFractionin classRun<S extends org.eclipse.emf.ecore.EObject>- Returns:
- the completed fraction of the run
-