diff --git a/src/main/java/org/nusco/narjillos/application/PetriDish.java b/src/main/java/org/nusco/narjillos/application/PetriDish.java index 953f9bd1..ebd75464 100644 --- a/src/main/java/org/nusco/narjillos/application/PetriDish.java +++ b/src/main/java/org/nusco/narjillos/application/PetriDish.java @@ -30,12 +30,18 @@ public class PetriDish implements Dish { public PetriDish(String version, CommandLineOptions options, int size) { experiment = createExperiment(version, options, size); experimentLog = new ExperimentLog(experiment.getId()); + if (isNewExperiment(experiment)) + experimentLog.save(experiment); reportPersistenceOptions(options); persistent = options.isPersistent(); System.out.println("Ticks:\tNarji:\tFood:"); } + private boolean isNewExperiment(Experiment experiment) { + return experiment.getTicksChronometer().getTotalTicks() == 0; + } + public Environment getEnvironment() { return experiment.getEcosystem(); }