]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.simulation/src/org/simantics/simulation/experiment/IDynamicExperiment.java
19dba1ee9669feef5097d94a347f1e239ef9c6df
[simantics/platform.git] / bundles / org.simantics.simulation / src / org / simantics / simulation / experiment / IDynamicExperiment.java
1 /*******************************************************************************
2  * Copyright (c) 2007, 2010 Association for Decentralized Information Management
3  * in Industry THTH ry.
4  * All rights reserved. This program and the accompanying materials
5  * are made available under the terms of the Eclipse Public License v1.0
6  * which accompanies this distribution, and is available at
7  * http://www.eclipse.org/legal/epl-v10.html
8  *
9  * Contributors:
10  *     VTT Technical Research Centre of Finland - initial API and implementation
11  *******************************************************************************/
12 package org.simantics.simulation.experiment;
13
14 import org.simantics.simulation.data.Datasource;
15
16 /**
17  * An experiment that evolves in time.
18  */
19 public interface IDynamicExperiment extends IExperiment {
20
21         /**
22          * Starts or stops simulation depending on the
23          * parameter. 
24          */
25         public void simulate(boolean enabled);
26
27         /**
28          * Simulates the experiment at lest the given period of time.
29          * Giving 0 as parameter simulates the experiment one 'step'.
30          * After the duration, the simulation is stopped.
31          */
32         public void simulateDuration(double duration);
33
34         /**
35          * Sets the simulation time to some time instance before
36          * the given time. Simulator continues running if it
37          * was already running before rewind. Many simulators don't 
38          * support arbitrary rewinds and therefore reinitialize 
39          * simulation and begin at zero.
40          */
41         public void rewindTo(double time);
42
43         /**
44          * Ensure that the current state of the experiment at the time of invocation
45          * is stored so that it can be returned to during a later session.
46          */
47         void saveState();
48
49         /**
50          * Get data source for history collection purposes.
51          */
52         Datasource getDatasource();
53
54 }