Skip to content

Commit

Permalink
Merge branch 'GAMA_1.9.1' of github.com:gama-platform/gama into GAMA_…
Browse files Browse the repository at this point in the history
…1.9.1
  • Loading branch information
RoiArthurB committed Apr 15, 2023
2 parents 0e25656 + 33681ab commit 16fdb2d
Show file tree
Hide file tree
Showing 33 changed files with 616 additions and 272 deletions.
2 changes: 1 addition & 1 deletion msi.gama.application/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
</property>
<property
name="aboutText"
value="GAMA Platform - V1.9.0 http://gama-platform.org&#x0A;&#x0A;(c) 2007-2008 IRD-UR GEODES (France) &amp; IFI-MSI (Vietnam)&#x0A;(c) 2009-2011 UMI 209 UMMISCO IRD/UPMC - MSI (Vietnam)&#x0A;(c) 2012-2017 UMI 209 UMMISCO IRD/UPMC &amp; Partners&#x0A;(c) 2018-2023 UMI 209 UMMISCO IRD/SU &amp; Partners">
value="GAMA Platform - V1.9.1 http://gama-platform.org&#x0A;&#x0A;(c) 2007-2008 IRD-UR GEODES (France) &amp; IFI-MSI (Vietnam)&#x0A;(c) 2009-2011 UMI 209 UMMISCO IRD/UPMC - MSI (Vietnam)&#x0A;(c) 2012-2017 UMI 209 UMMISCO IRD/UPMC &amp; Partners&#x0A;(c) 2018-2023 UMI 209 UMMISCO IRD/SU &amp; Partners">
</property>
<property
name="aboutImage"
Expand Down
2 changes: 1 addition & 1 deletion msi.gama.core/src/msi/gama/runtime/GAMA.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public class GAMA {
}

/** The Constant VERSION_NUMBER. */
public static final String VERSION_NUMBER = "1.9.0";
public static final String VERSION_NUMBER = "1.9.1";

/** The Constant VERSION. */
public static final String VERSION = "GAMA " + VERSION_NUMBER;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ public void uncaughtException(final Thread t, final Throwable e) {

/** The Constant CONCURRENCY_SIMULATIONS_ALL. */
public static final Pref<Boolean> CONCURRENCY_SIMULATIONS_ALL = create("pref_parallel_simulations_all",
"In batch mode, allows to run as many simulations as possible with available threads/core "
+ "\n[WARNING: if true, disabled reflexes and permanent displays of batch experiments]", false, IType.BOOL,
true).in(GamaPreferences.Runtime.NAME, GamaPreferences.Runtime.CONCURRENCY);
"In batch, allows to run simulations with all available processors"
+ "[WARNING: disables reflexes and permanent displays of batch experiments]",
false, IType.BOOL, true).in(GamaPreferences.Runtime.NAME, GamaPreferences.Runtime.CONCURRENCY);

/** The Constant CONCURRENCY_GRID. */
public static final Pref<Boolean> CONCURRENCY_GRID = create("pref_parallel_grids",
Expand Down
2 changes: 1 addition & 1 deletion msi.gama.core/src/msi/gama/util/GamaColor.java
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public static GamaColor getNamed(final String rgb) {
colors.put((String) array[i], color);
int_colors.put(color.getRGB(), color);
}
// A.G add the GAMA Color corresponding to the GAMA1.7 Logo
// A.G add the GAMA Color corresponding to the GAMA 1.9 Logo
final GamaColor orange = new NamedGamaColor("gamaorange", new int[] { 244, 165, 40, 1 });
colors.put("gamaorange", orange);
int_colors.put(orange.getRGB(), orange);
Expand Down
2 changes: 1 addition & 1 deletion msi.gama.core/src/msi/gaml/operators/Maths.java
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ public static Double pow(final Double a, final Double b) {
examples = { @example (
value = "abs (200 * -1 + 0.5)",
equals = "199.5") }) })
@test ("abs(1.7) = 1.7")
@test ("abs(1.9) = 1.9")
@test ("abs(-2.0) = 2.0")
@test ("abs(0.0) = 0.0")
@test ("abs(-0.0) = 0.0")
Expand Down
2 changes: 1 addition & 1 deletion msi.gama.documentation/files/input/toc/toc1.9.0.xml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?xml version="1.0" encoding="UTF-8"?><toc title="Full Documentation of GAMA 1.9.0"><part name="Home"><subpart file="Home" name="Home"/><subpart file="WikiOnly/Overview" name="Introduction"/></part><part name="Platform"><subpart file="References/PlatformDocumentation" name="Platform"/><subpart file="References/PlatformDocumentation/InstallationAndLaunching" name="Installation and Launching"/><subpart file="References/PlatformDocumentation/WorkspaceProjectsAndModels" name="Workspace, Projects and Models"/><subpart file="References/PlatformDocumentation/EditingModels" name="Editing Models"/><subpart file="References/PlatformDocumentation/RunningExperiments" name="Running Experiments"/><subpart file="References/PlatformDocumentation/Preferences" name="Preferences"/><subpart file="References/PlatformDocumentation/InstallationAndLaunching/Troubleshooting" name="Troubleshooting"/></part><part name="Learn GAML step by step"><subpart file="Tutorials/LearnGAMLStepByStep" name="Learn GAML step by step"/><subpart file="Tutorials/LearnGAMLStepByStep/Introduction" name="Introduction"/><subpart file="Tutorials/LearnGAMLStepByStep/ManipulateBasicSpecies" name="Manipulate basic Species"/><subpart file="Tutorials/LearnGAMLStepByStep/ManipulateBasicSpecies/GlobalSpecies" name="Global Species"/><subpart file="Tutorials/LearnGAMLStepByStep/DefiningAdvancedSpecies" name="Defining Advanced Species"/><subpart file="Tutorials/LearnGAMLStepByStep/DefiningGUIExperiment" name="Defining GUI Experiment"/><subpart file="Tutorials/LearnGAMLStepByStep/ExploringModels" name="Exploring Models"/><subpart file="Tutorials/LearnGAMLStepByStep/OptimizingModelsSection" name="Optimizing Model Section"/><subpart file="Tutorials/LearnGAMLStepByStep/MultiParadigmModeling" name="Multi-Paradigm Modeling"/></part><part name="Recipes"><subpart file="Tutorials/Recipes" name="Recipes"/><subpart file="Tutorials/Recipes/ManipulateOSMDatas" name="Manipulate OSM Data"/><subpart file="Tutorials/Recipes/Diffusion" name="Diffusion"/><subpart file="Tutorials/Recipes/UsingDatabase" name="Using Database"/><subpart file="Tutorials/Recipes/CallingR" name="Calling R"/><subpart file="Tutorials/Recipes/UsingFIPAACL" name="Using FIPA ACL"/><subpart file="Tutorials/Recipes/GamAnalyzer" name="Using GamAnalyzer"/><subpart file="Tutorials/Recipes/Using-BEN-simple-bdi" name="Using BDI with BEN"/><subpart file="Tutorials/Recipes/UsingDrivingSkill" name="Using Driving Skill"/><subpart file="Tutorials/Recipes/ManipulateDates" name="Manipulate dates"/><subpart file="Tutorials/Recipes/ManipulateLight" name="Manipulate lights"/><subpart file="Tutorials/Recipes/Comodel" name="Using comodel"/><subpart file="Save-and-restore-simulations" name="Save and restore Simulations"/><subpart file="Tutorials/Recipes/UsingNetwork" name="Using network"/><subpart file="Headless-mode-for-dummies" name="Headless mode"/><subpart file="G__GraphicalEditor" name="Using Graphical Editor"/><subpart file="Tutorials/Recipes/Using_Git" name="Using Git from GAMA"/><subpart file="Writing_Tests" name="Writing Unit Tests"/><subpart file="Tutorials/Recipes/KnownIssues" name="Known Issues"/></part><part name="GAML References"><subpart file="References/GamlReference" name="GAML References"/><subpart file="References/GAMLReferences/BuiltInSpecies" name="Built-in Species"/><subpart file="References/GAMLReferences/BuiltInSkills" name="Built-in Skills"/><subpart file="References/GAMLReferences/BuiltInArchitectures" name="Built-in Architecture"/><subpart file="References/GAMLReferences/Statements" name="Statements"/><subpart file="References/GAMLReferences/DataTypes" name="Data Type"/><subpart file="References/GAMLReferences/FileTypes" name="File Type"/><subpart file="References/GAMLReferences/Expressions" name="Expressions"/><subpart file="Index" name="Index"/></part><part name="Tutorials"><subpart file="Tutorials/Tutorials" name="Tutorials"><chapter file="Pedagogical-Materials" name="Pedagogical materials"/></subpart><subpart file="Tutorials/Tutorials/PredatorPrey" name="Predator Prey"/><subpart file="Tutorials/Tutorials/RoadTrafficModel" name="Road Traffic"/><subpart file="Tutorials/Tutorials/ThreeD" name="3D Tutorial"/><subpart file="Tutorials/Tutorials/IncrementalModel" name="Incremental Model"/><subpart file="Tutorials/Tutorials/LuneraysFlu" name="Luneray's flu"/><subpart file="Tutorials/Tutorials/BDIAgents" name="BDI Agents"/></part><part name="Developing GAMA"><subpart file="developingGAMA" name="Developing GAMA"/><subpart file="Introduction-To-Gama-Java-API" name="Introduction to GAMA Java API"/><subpart file="WikiOnly/DevelopingExtensions" name="Developing Extensions"/><subpart file="CreatingAReleaseOfGama" name="Creating a release of GAMA"/><subpart file="WikiOnly/DevelopingExtensions/Documentation" name="Documentation generation"/></part><part name="Projects using GAMA"><subpart file="Community/Projects" name="Projects using GAMA"/><subpart file="WikiOnly/References" name="Scientific References"/><subpart file="Community/TrainingSession" name="Training Session"/><subpart file="WikiOnly/Events" name="Events"/></part></toc>
<?xml version="1.0" encoding="UTF-8"?><toc title="Full Documentation of GAMA 1.9.1"><part name="Home"><subpart file="Home" name="Home"/><subpart file="WikiOnly/Overview" name="Introduction"/></part><part name="Platform"><subpart file="References/PlatformDocumentation" name="Platform"/><subpart file="References/PlatformDocumentation/InstallationAndLaunching" name="Installation and Launching"/><subpart file="References/PlatformDocumentation/WorkspaceProjectsAndModels" name="Workspace, Projects and Models"/><subpart file="References/PlatformDocumentation/EditingModels" name="Editing Models"/><subpart file="References/PlatformDocumentation/RunningExperiments" name="Running Experiments"/><subpart file="References/PlatformDocumentation/Preferences" name="Preferences"/><subpart file="References/PlatformDocumentation/InstallationAndLaunching/Troubleshooting" name="Troubleshooting"/></part><part name="Learn GAML step by step"><subpart file="Tutorials/LearnGAMLStepByStep" name="Learn GAML step by step"/><subpart file="Tutorials/LearnGAMLStepByStep/Introduction" name="Introduction"/><subpart file="Tutorials/LearnGAMLStepByStep/ManipulateBasicSpecies" name="Manipulate basic Species"/><subpart file="Tutorials/LearnGAMLStepByStep/ManipulateBasicSpecies/GlobalSpecies" name="Global Species"/><subpart file="Tutorials/LearnGAMLStepByStep/DefiningAdvancedSpecies" name="Defining Advanced Species"/><subpart file="Tutorials/LearnGAMLStepByStep/DefiningGUIExperiment" name="Defining GUI Experiment"/><subpart file="Tutorials/LearnGAMLStepByStep/ExploringModels" name="Exploring Models"/><subpart file="Tutorials/LearnGAMLStepByStep/OptimizingModelsSection" name="Optimizing Model Section"/><subpart file="Tutorials/LearnGAMLStepByStep/MultiParadigmModeling" name="Multi-Paradigm Modeling"/></part><part name="Recipes"><subpart file="Tutorials/Recipes" name="Recipes"/><subpart file="Tutorials/Recipes/ManipulateOSMDatas" name="Manipulate OSM Data"/><subpart file="Tutorials/Recipes/Diffusion" name="Diffusion"/><subpart file="Tutorials/Recipes/UsingDatabase" name="Using Database"/><subpart file="Tutorials/Recipes/CallingR" name="Calling R"/><subpart file="Tutorials/Recipes/UsingFIPAACL" name="Using FIPA ACL"/><subpart file="Tutorials/Recipes/GamAnalyzer" name="Using GamAnalyzer"/><subpart file="Tutorials/Recipes/Using-BEN-simple-bdi" name="Using BDI with BEN"/><subpart file="Tutorials/Recipes/UsingDrivingSkill" name="Using Driving Skill"/><subpart file="Tutorials/Recipes/ManipulateDates" name="Manipulate dates"/><subpart file="Tutorials/Recipes/ManipulateLight" name="Manipulate lights"/><subpart file="Tutorials/Recipes/Comodel" name="Using comodel"/><subpart file="Save-and-restore-simulations" name="Save and restore Simulations"/><subpart file="Tutorials/Recipes/UsingNetwork" name="Using network"/><subpart file="Headless-mode-for-dummies" name="Headless mode"/><subpart file="G__GraphicalEditor" name="Using Graphical Editor"/><subpart file="Tutorials/Recipes/Using_Git" name="Using Git from GAMA"/><subpart file="Writing_Tests" name="Writing Unit Tests"/><subpart file="Tutorials/Recipes/KnownIssues" name="Known Issues"/></part><part name="GAML References"><subpart file="References/GamlReference" name="GAML References"/><subpart file="References/GAMLReferences/BuiltInSpecies" name="Built-in Species"/><subpart file="References/GAMLReferences/BuiltInSkills" name="Built-in Skills"/><subpart file="References/GAMLReferences/BuiltInArchitectures" name="Built-in Architecture"/><subpart file="References/GAMLReferences/Statements" name="Statements"/><subpart file="References/GAMLReferences/DataTypes" name="Data Type"/><subpart file="References/GAMLReferences/FileTypes" name="File Type"/><subpart file="References/GAMLReferences/Expressions" name="Expressions"/><subpart file="Index" name="Index"/></part><part name="Tutorials"><subpart file="Tutorials/Tutorials" name="Tutorials"><chapter file="Pedagogical-Materials" name="Pedagogical materials"/></subpart><subpart file="Tutorials/Tutorials/PredatorPrey" name="Predator Prey"/><subpart file="Tutorials/Tutorials/RoadTrafficModel" name="Road Traffic"/><subpart file="Tutorials/Tutorials/ThreeD" name="3D Tutorial"/><subpart file="Tutorials/Tutorials/IncrementalModel" name="Incremental Model"/><subpart file="Tutorials/Tutorials/LuneraysFlu" name="Luneray's flu"/><subpart file="Tutorials/Tutorials/BDIAgents" name="BDI Agents"/></part><part name="Developing GAMA"><subpart file="developingGAMA" name="Developing GAMA"/><subpart file="Introduction-To-Gama-Java-API" name="Introduction to GAMA Java API"/><subpart file="WikiOnly/DevelopingExtensions" name="Developing Extensions"/><subpart file="CreatingAReleaseOfGama" name="Creating a release of GAMA"/><subpart file="WikiOnly/DevelopingExtensions/Documentation" name="Documentation generation"/></part><part name="Projects using GAMA"><subpart file="Community/Projects" name="Projects using GAMA"/><subpart file="WikiOnly/References" name="Scientific References"/><subpart file="Community/TrainingSession" name="Training Session"/><subpart file="WikiOnly/Events" name="Events"/></part></toc>
84 changes: 63 additions & 21 deletions msi.gama.ext/src/msi/gama/ext/webb/Request.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
/*******************************************************************************************************
*
* msi.gama.util.file.http.Request.java, in plugin msi.gama.core, is part of the source code of the GAMA modeling and
* simulation platform (v. 1.8.1)
* Request.java, in msi.gama.ext, is part of the source code of the GAMA modeling and simulation platform (v.1.9.1).
*
* (c) 2007-2020 UMI 209 UMMISCO IRD/SU & Partners
* (c) 2007-2023 UMI 209 UMMISCO IRD/SU & Partners (IRIT, MIAT, TLU, CTU)
*
* Visit https://github.com/gama-platform/gama for license information and contacts.
*
Expand All @@ -23,29 +22,83 @@
* @author hgoebl
*/
public class Request {

/**
* The Enum Method.
*/
public enum Method {
GET, POST, PUT, DELETE

/** The get. */
GET,
/** The post. */
POST,
/** The put. */
PUT,
/** The delete. */
DELETE
}

/** The webb. */
private final Webb webb;

/** The method. */
final Method method;

/** The uri. */
final String uri;

/** The params. */
Map<String, Object> params;

/** The multiple values. */
boolean multipleValues;

/** The headers. */
Map<String, Object> headers;

/** The payload. */
Object payload;

/** The stream payload. */
boolean streamPayload;

/** The use caches. */
boolean useCaches;

/** The connect timeout. */
Integer connectTimeout;

/** The read timeout. */
Integer readTimeout;

/** The if modified since. */
Long ifModifiedSince;

/** The follow redirects. */
Boolean followRedirects;

/** The ensure success. */
boolean ensureSuccess;

/** The compress. */
boolean compress;

/** The retry count. */
int retryCount;

/** The wait exponential. */
boolean waitExponential;

/**
* Instantiates a new request.
*
* @param webb
* the webb
* @param method
* the method
* @param uri
* the uri
*/
Request(final Webb webb, final Method method, final String uri) {
this.webb = webb;
this.method = method;
Expand All @@ -58,9 +111,7 @@ public enum Method {
*
* @return URI
*/
public String getUri() {
return uri;
}
public String getUri() { return uri; }

/**
* Set (or overwrite) a HTTP header value. <br>
Expand All @@ -83,9 +134,7 @@ public String getUri() {
* @return <code>this</code> for method chaining (fluent API)
*/
public Request header(final String name, final Object value) {
if (headers == null) {
headers = new LinkedHashMap<>();
}
if (headers == null) { headers = new LinkedHashMap<>(); }
headers.put(name, value);
return this;
}
Expand Down Expand Up @@ -119,9 +168,8 @@ public Request header(final String name, final Object value) {
* @return <code>this</code> for method chaining (fluent API)
*/
public Request body(final Object body) {
if (method == Method.GET || method == Method.DELETE) {
if (method == Method.GET || method == Method.DELETE)
throw new IllegalStateException("body not allowed for request method " + method);
}
this.payload = body;
this.streamPayload = body instanceof File || body instanceof InputStream;
return this;
Expand Down Expand Up @@ -183,15 +231,9 @@ public Request ensureSuccess() {
*/
public Request retry(final int rc, final boolean waitExponential) {
int retryCount = rc;
if (retryCount < 0) {
retryCount = 0;
}
if (retryCount > 10) {
retryCount = 10;
}
if (retryCount > 3 && !waitExponential) {
throw new IllegalArgumentException("retries > 3 only valid with wait");
}
if (retryCount < 0) { retryCount = 0; }
if (retryCount > 10) { retryCount = 10; }
if (retryCount > 3 && !waitExponential) throw new IllegalArgumentException("retries > 3 only valid with wait");
this.retryCount = retryCount;
this.waitExponential = waitExponential;
return this;
Expand Down
Loading

0 comments on commit 16fdb2d

Please sign in to comment.