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

Initial validation test #144

Merged
merged 2 commits into from
Oct 17, 2024
Merged

Initial validation test #144

merged 2 commits into from
Oct 17, 2024

Conversation

macano
Copy link
Contributor

@macano macano commented Oct 17, 2024

Part of #137
Contracted capacity test

Contracted capacity test
@@ -17,7 +17,7 @@ data class GridConnection(
// Is always set when object comes from the database.
val sequence: Int? = null,

val electricity: Electricity = Electricity(),
val electricity: Electricity? = Electricity(),
Copy link
Member

Choose a reason for hiding this comment

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

Better keep it non-nullable because in AnyLogic/Java there is no null-safe navigation operator "?." so the modellers will have to write extra null checks.

val contractedConnectionCapacity = gridConnection.electricity.getContractedConnectionCapacityKw()
val physicalConnectionCapacity = gridConnection.electricity.getPhysicalConnectionCapacityKw()
val contractedConnectionCapacity = gridConnection.electricity?.getContractedConnectionCapacityKw()
val physicalConnectionCapacity = gridConnection.electricity?.grootverbruik?.physicalCapacityKw
Copy link
Member

Choose a reason for hiding this comment

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

With this code, in the case of kleinverbruik, it will say Status.MISSING_DATA. But this is not true.

I think the previous version was good.

@macano macano merged commit 16d9c9d into main Oct 17, 2024
1 check passed
@macano macano deleted the 137-test-validations branch October 17, 2024 14:56
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