-
Notifications
You must be signed in to change notification settings - Fork 8
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
Conversation
I've taken the occasion to clean a little bit the call of the "run simulations" methods by the exploration algorithms.
There was a problem hiding this 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) 🔥
@@ -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; } |
There was a problem hiding this comment.
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;} |
There was a problem hiding this comment.
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
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; |
There was a problem hiding this comment.
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
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; |
There was a problem hiding this comment.
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 . |
There was a problem hiding this comment.
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
public IMap<ParametersSet, Map<String, List<Object>>> launchSimulationsWithSolution(final List<ParametersSet> sols) | ||
throws GamaRuntimeException { |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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
public IMap<ParametersSet, Map<String, List<Object>>> launchSimulationsWithSolution(final List<ParametersSet> sols) | ||
throws GamaRuntimeException { |
There was a problem hiding this comment.
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
There was a problem hiding this 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) 🔥
@@ -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) |
There was a problem hiding this comment.
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
private IMap<ParametersSet, Map<String, List<Object>>> | ||
launchSimulationsInParallelWithParametersSets(final List<ParametersSet> sols) throws GamaRuntimeException { |
There was a problem hiding this comment.
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
private IMap<ParametersSet, Map<String, List<Object>>> | ||
launchSimulationsInParallelWithParametersSets(final List<ParametersSet> sols) throws GamaRuntimeException { |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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
private IMap<ParametersSet, Map<String, List<Object>>> | ||
launchSimulationsInParallelWithParametersSets(final List<ParametersSet> sols) throws GamaRuntimeException { |
There was a problem hiding this comment.
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
There was a problem hiding this 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) 🔥
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.