/** * Stops the goal execution, i.e., takes the time and stops the monitoring thread (if any). */ public void stop() { // Already stopped? if(!this.stopWatch.isRunning()) throw new IllegalStateException("Goal execution already finished"); // Stop! else { this.stopMemo(); this.stopWatch.lap("Completed execution", true); this.cleanAfterExecution(); this.stopWatch.lap("Completed clean-up", false); this.stopWatch.stop(); this.notifyObserver(); } }