Skip to content

Commit

Permalink
Addresses #3376. Please test !
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexisDrogoul committed May 8, 2022
1 parent bcffa29 commit 0b00905
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 191 deletions.
21 changes: 5 additions & 16 deletions msi.gama.headless/src/msi/gama/headless/runtime/Application.java
Expand Up @@ -10,14 +10,11 @@
********************************************************************************************************/
package msi.gama.headless.runtime;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.net.UnknownHostException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
Expand Down Expand Up @@ -60,6 +57,7 @@
import msi.gama.kernel.model.IModel;
import msi.gama.lang.gaml.validation.GamlModelBuilder;
import msi.gama.runtime.GAMA;
import msi.gama.runtime.concurrent.GamaExecutorService;
import msi.gaml.compilation.GamlCompilationError;
import ummisco.gama.dev.utils.DEBUG;

Expand Down Expand Up @@ -180,17 +178,6 @@ private static void showHelp() {
DEBUG.OFF();
}

/**
* Check parameters.
*
* @param args
* the args
* @return true, if successful
*/
private boolean checkParameters(final List<String> args) {
return checkParameters(args, false);
}

/**
* Check parameters.
*
Expand Down Expand Up @@ -368,8 +355,8 @@ public Object start(final IApplicationContext context) throws Exception {
} else if (args.contains(BUILD_XML_PARAMETER)) {
buildXML(args);
} else if (args.contains(SOCKET_PARAMETER)) {
// GamaListener.newInstance(this.socket, this);
GamaListener gl=new GamaListener(this.socket,this);
// GamaListener.newInstance(this.socket, this);
GamaListener gl = new GamaListener(this.socket, this);
} else {
runSimulation(args);
}
Expand Down Expand Up @@ -589,6 +576,8 @@ public void runBatchSimulation(final String experimentName, final String pathToM
final List<GamlCompilationError> errors = new ArrayList<>();
final IModel mdl = builder.compile(URI.createFileURI(pathToModel), errors);

GamaExecutorService.CONCURRENCY_THRESHOLD.set(processorQueue.getNumberOfThreads());

final IExperimentPlan expPlan = mdl.getExperiment(experimentName);

expPlan.setHeadless(true);
Expand Down

This file was deleted.

Expand Up @@ -59,7 +59,7 @@ public void close() throws IOException {
* the s
*/
void execute(final Runnable r);

/**
* Push simulation.
*
Expand All @@ -83,4 +83,6 @@ public void close() throws IOException {
*/
void setNumberOfThreads(int numberOfThread);

int getNumberOfThreads();

}

0 comments on commit 0b00905

Please sign in to comment.