Skip to content

Commit

Permalink
Merge pull request #336 from gama-platform/URGENT-patch-for-#344
Browse files Browse the repository at this point in the history
Working now indeed
  • Loading branch information
lesquoyb authored Sep 24, 2024
2 parents ae76d31 + 0617122 commit b12208e
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ public void dispose() {
if (dying || dead) return;
dying = true;
getSpecies().getArchitecture().abort(ownScope);
closeSimulations(true);
closeSimulations(!getSpecies().isReloading());
GAMA.releaseScope(ownScope);
super.dispose();
}
Expand Down
16 changes: 15 additions & 1 deletion gama.core/src/gama/core/kernel/experiment/ExperimentPlan.java
Original file line number Diff line number Diff line change
Expand Up @@ -771,12 +771,26 @@ public synchronized void open() {
open(seed);
}

// Horrible workaround for #334
// ----------------------------------------------------------------------------------
private volatile boolean reloading;

@Override
public void reload() {
agent.dispose();
try {

reloading = true;
agent.dispose();
} finally {
reloading = false;
}
open();
}

@Override
public boolean isReloading() { return reloading; }
// ----------------------------------------------------------------------------------

@Override
public boolean hasParametersOrUserCommands() {
return !displayables.isEmpty() || GamaPreferences.Runtime.CORE_MONITOR_PARAMETERS.getValue()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -342,4 +342,11 @@ default void setStopCondition(final String cond) {
* @date 15 oct. 2023
*/
void setParameterValues(IList params);

/**
* Whether the current experiment is reloading or not (see #344)
*
* @return
*/
boolean isReloading();
}
4 changes: 2 additions & 2 deletions gama.core/src/gama/core/outputs/AbstractOutputManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ public abstract class AbstractOutputManager extends Symbol implements IOutputMan
LayoutStatement layout;

/** The outputs. */
protected final Map<String, IOutput> outputs = GamaMapFactory.create();
// GamaMapFactory.synchronizedOrderedMap();
protected final Map<String, IOutput> outputs = // GamaMapFactory.create();
GamaMapFactory.synchronizedOrderedMap();

// protected final IList<MonitorOutput> monitors = GamaListFactory.create();

Expand Down

0 comments on commit b12208e

Please sign in to comment.