-
Notifications
You must be signed in to change notification settings - Fork 4
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
Feature/vdyp 305 #47
Feature/vdyp 305 #47
Conversation
…RI primary layer into VDYP primary layer
…could not be found
…wer if the solver couldn't find an exact one
… Primary processing
…ariables' into feature/VDYP-305
|
||
var resultPerSpecies = new HashMap<String, Float>(); | ||
|
||
for (float x = -3.9f; x <= 2; x += 0.01) { |
Check failure
Code scanning / CodeQL
Implicit narrowing conversion in compound assignment High test
243e705
to
851bae9
Compare
Quality Gate passedIssues Measures |
@@ -82,6 +96,17 @@ public abstract class VdypStartApplication<P extends BaseVdypPolygon<L, Optional | |||
map.put("Y", 9); | |||
}); | |||
|
|||
// TODO Should probably handle this with enums instead for clarity. |
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.
I've added ca.bc.gov.nrs.vdyp.model.DebugSettings class in common and implemented ca.bc.gov.nrs.vdyp.forward.model.ForwardDebugSettings that might prove to be a better way to implement this.
@@ -729,6 +792,16 @@ public float estimatePercentForestLand(P polygon, Optional<L> vetLayer, L primar | |||
protected static final ValueOrMarker.Builder<Float, Boolean> FLOAT_OR_BOOL = ValueOrMarker | |||
.builder(Float.class, Boolean.class); | |||
|
|||
public static final int UTIL_ALL = UtilizationClass.ALL.index; |
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.
It seems like we're duplicating these constants (this plus next three) all over the place - maybe put them in UtilizationClass?
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.
That or maybe switching to using the enum directly instead of the index. Maybe a UtilizationVector class instead of or subclassing Coefficients.
layer.getWholeStemVolumeByUtilization().setCoe(UTIL_SMALL, volumeSum); | ||
} | ||
|
||
// EMP085 |
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.
Should note that this can be called only once the ALL lh and qmd values are set for the species. A similar comment applies to each of the following methods.
float logit = // | ||
a0 + // | ||
a1 * coast + // | ||
a2 * layer.getBreastHeightAge().orElse(0f) + // |
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.
Why the check for breast height age being present? The original FORTRAN code doesn't do this, at least explicitly.
); | ||
} | ||
|
||
public void computeUtilizationComponentsPrimary( |
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.
Add comment indicating FORTRAN routine - YUC1?
/** | ||
* Apply compatibility variables to all but volume | ||
*/ | ||
NO_VOLUME, // 1 |
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.
ALL_BUT_VOLUME?
Feature/input param comp
No description provided.