MCPcopy Create free account
hub / github.com/OpenSourcePhysics/osp / reset

Method reset

src/org/opensourcephysics/ejs/Simulation.java:205–221  ·  view source on GitHub ↗

Resets the simulation to a complete initial state

()

Source from the content-addressed store, hash-verified

203 * Resets the simulation to a complete initial state
204 */
205 public void reset() {
206 pause();
207 if (model != null) {
208 model.reset();
209 model.initialize();
210 model.update();
211 }
212 if (view != null) {
213 view.reset();
214 view.initialize();
215 view.update();
216 }
217 System.gc();
218 if (autoplay) {
219 play();
220 }
221 }
222
223 /**
224 * Initialize model using user interface changes

Callers

nothing calls this directly

Calls 6

pauseMethod · 0.95
playMethod · 0.95
gcMethod · 0.80
resetMethod · 0.65
initializeMethod · 0.65
updateMethod · 0.65

Tested by

no test coverage detected