Resets the simulation to a complete initial state
()
| 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 |