Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Addresses #320: updates the status bar when simulations are run in parallel in batch #321

Merged
merged 3 commits into from
Sep 12, 2024

Conversation

AlexisDrogoul
Copy link
Member

In addition to addressing #320, I've taken the occasion to clean a little bit the call of the "run simulations" methods by the exploration algorithms.

I've taken the occasion to clean a little bit the call of the "run simulations" methods by the exploration algorithms.
Copy link

@codescene-delta-analysis codescene-delta-analysis bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Health Quality Gates: OK

Change in average Code Health of affected files: +0.03 (8.44 -> 8.47)

  • Improving Code Health: 15 findings(s) ✅
  • Affected Hotspots: 1 files(s) 🔥

View detailed results in CodeScene

@@ -152,27 +149,20 @@ public void explore(final IScope scope) {
if (hasFacet(Exploration.SAMPLE_SIZE)) {
sample_size = Cast.asInt(scope, getFacet(Exploration.SAMPLE_SIZE).value(scope));
}
if (sample_size < 1) {sample_size = 2;}
if (sample_size < 1) { sample_size = 2; }

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Getting better: Complex Method
explore decreases in cyclomatic complexity from 14 to 12, threshold = 9

@@ -152,27 +149,20 @@ public void explore(final IScope scope) {
if (hasFacet(Exploration.SAMPLE_SIZE)) {
sample_size = Cast.asInt(scope, getFacet(Exploration.SAMPLE_SIZE).value(scope));
}
if (sample_size < 1) {sample_size = 2;}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No longer an issue: Bumpy Road Ahead
explore is no longer above the threshold for logical blocks with deeply nested code

Comment on lines +171 to +174
String path =
FileUtils.constructAbsoluteFilePath(scope, Cast.asString(scope, path_facet.value(scope)), false);
this.solutions =
this.solutions == null ? buildParameterSetsFromCSV(scope, path, new ArrayList<>()) : this.solutions;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Getting better: Complex Method
explore decreases in cyclomatic complexity from 11 to 9, threshold = 9

Comment on lines -177 to -179
String path = FileUtils.constructAbsoluteFilePath(scope, Cast.asString(scope, path_facet.value(scope)), false);
this.solutions = this.solutions == null
? buildParameterSetsFromCSV(scope, path, new ArrayList<>()) : this.solutions;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No longer an issue: Bumpy Road Ahead
explore is no longer above the threshold for logical blocks with deeply nested code

@@ -1,7 +1,6 @@
/*******************************************************************************************************
*
* MorrisExploration.java, in gama.core, is part of the source code of the GAMA modeling and simulation platform
* .
* MorrisExploration.java, in gama.core, is part of the source code of the GAMA modeling and simulation platform .

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Getting better: Overall Code Complexity
The mean cyclomatic complexity decreases from 4.88 to 4.63, threshold = 4

Comment on lines -289 to -290
public IMap<ParametersSet, Map<String, List<Object>>> launchSimulationsWithSolution(final List<ParametersSet> sols)
throws GamaRuntimeException {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No longer an issue: Bumpy Road Ahead
launchSimulationsWithSolution is no longer above the threshold for logical blocks with deeply nested code

@@ -410,7 +423,7 @@ public IMap<ParametersSet, Map<String, List<Object>>> launchSimulationsWithSolut
* @throws GamaRuntimeException
* the gama runtime exception
*/
public Map<String, List<Object>> launchSimulationsWithSolution(final ParametersSet sol)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No longer an issue: Bumpy Road Ahead
launchSimulationsWithSolution is no longer above the threshold for logical blocks with deeply nested code

@@ -410,7 +423,7 @@ public IMap<ParametersSet, Map<String, List<Object>>> launchSimulationsWithSolut
* @throws GamaRuntimeException
* the gama runtime exception
*/
public Map<String, List<Object>> launchSimulationsWithSolution(final ParametersSet sol)
public Map<String, List<Object>> launchSimulationsWithSingleParametersSet(final ParametersSet sol)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ New issue: Bumpy Road Ahead
launchSimulationsWithSingleParametersSet has 3 blocks with nested conditional logic. Any nesting of 2 or deeper is considered. Threshold is one single, nested block per function

@@ -410,7 +423,7 @@ public IMap<ParametersSet, Map<String, List<Object>>> launchSimulationsWithSolut
* @throws GamaRuntimeException
* the gama runtime exception
*/
public Map<String, List<Object>> launchSimulationsWithSolution(final ParametersSet sol)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No longer an issue: Deep, Nested Complexity
launchSimulationsWithSolution is no longer above the threshold for nested complexity depth

Comment on lines -289 to -290
public IMap<ParametersSet, Map<String, List<Object>>> launchSimulationsWithSolution(final List<ParametersSet> sols)
throws GamaRuntimeException {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No longer an issue: Deep, Nested Complexity
launchSimulationsWithSolution is no longer above the threshold for nested complexity depth

Copy link

@codescene-delta-analysis codescene-delta-analysis bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Health Quality Gates: OK

Change in average Code Health of affected files: +0.06 (8.44 -> 8.50)

  • Improving Code Health: 15 findings(s) ✅
  • Affected Hotspots: 1 files(s) 🔥

View detailed results in CodeScene

@@ -410,7 +423,7 @@ public IMap<ParametersSet, Map<String, List<Object>>> launchSimulationsWithSolut
* @throws GamaRuntimeException
* the gama runtime exception
*/
public Map<String, List<Object>> launchSimulationsWithSolution(final ParametersSet sol)
public Map<String, List<Object>> launchSimulationsWithSingleParametersSet(final ParametersSet sol)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ New issue: Complex Method
launchSimulationsWithSingleParametersSet has a cyclomatic complexity of 24, threshold = 9

Comment on lines +302 to +303
private IMap<ParametersSet, Map<String, List<Object>>>
launchSimulationsInParallelWithParametersSets(final List<ParametersSet> sols) throws GamaRuntimeException {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ New issue: Complex Method
launchSimulationsInParallelWithParametersSets has a cyclomatic complexity of 23, threshold = 9

Comment on lines +302 to +303
private IMap<ParametersSet, Map<String, List<Object>>>
launchSimulationsInParallelWithParametersSets(final List<ParametersSet> sols) throws GamaRuntimeException {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ New issue: Bumpy Road Ahead
launchSimulationsInParallelWithParametersSets has 2 blocks with nested conditional logic. Any nesting of 2 or deeper is considered. Threshold is one single, nested block per function

@@ -34,6 +34,7 @@
import gama.core.runtime.GAMA;
import gama.core.runtime.IExperimentStateListener;
import gama.core.runtime.IScope;
import gama.core.runtime.concurrent.GamaExecutorService;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Getting better: Overall Code Complexity
The mean cyclomatic complexity decreases from 4.55 to 4.23, threshold = 4

@@ -410,7 +423,7 @@ public IMap<ParametersSet, Map<String, List<Object>>> launchSimulationsWithSolut
* @throws GamaRuntimeException
* the gama runtime exception
*/
public Map<String, List<Object>> launchSimulationsWithSolution(final ParametersSet sol)
public Map<String, List<Object>> launchSimulationsWithSingleParametersSet(final ParametersSet sol)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ New issue: Deep, Nested Complexity
launchSimulationsWithSingleParametersSet has a nested complexity depth of 5, threshold = 4

Comment on lines +302 to +303
private IMap<ParametersSet, Map<String, List<Object>>>
launchSimulationsInParallelWithParametersSets(final List<ParametersSet> sols) throws GamaRuntimeException {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ New issue: Deep, Nested Complexity
launchSimulationsInParallelWithParametersSets has a nested complexity depth of 4, threshold = 4

Copy link

@codescene-delta-analysis codescene-delta-analysis bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Health Quality Gates: OK

Change in average Code Health of affected files: +0.06 (8.44 -> 8.50)

  • Improving Code Health: 15 findings(s) ✅
  • Affected Hotspots: 1 files(s) 🔥

View detailed results in CodeScene

@lesquoyb lesquoyb merged commit ab1567d into 2024-06 Sep 12, 2024
6 checks passed
@lesquoyb lesquoyb deleted the Addresses-#320 branch September 12, 2024 04:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants