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

Parking capacities #41

Merged
merged 8 commits into from
Jan 25, 2024
Merged

Parking capacities #41

merged 8 commits into from
Jan 25, 2024

Conversation

GregorRyb
Copy link
Contributor

No description provided.

@GregorRyb GregorRyb requested a review from tschlenther January 24, 2024 14:51
Copy link
Contributor

@tschlenther tschlenther left a comment

Choose a reason for hiding this comment

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

LGTM,
i left a few minor comments

minCapacity = usableLength /50;
}

l.getAttributes().putAttribute("maxParkingCapacity", Math.floor(maxCapacity));
Copy link
Contributor

Choose a reason for hiding this comment

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

is it intended to write the capacity as double? Did you consider an integer?


l.getAttributes().putAttribute("maxParkingCapacity", Math.floor(maxCapacity));
l.getAttributes().putAttribute("minParkingCapacity", Math.floor(minCapacity));
listOfParkingCapacities.add(new ParkingCapacityRecord(l.getId().toString(), (int) Math.floor(maxCapacity), (int) Math.floor(minCapacity)));
Copy link
Contributor

Choose a reason for hiding this comment

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

i would recommend to do the cast and the computation further above, when you set the values for maxCapacity and minCapacity, i.e. in lines 33 and 34, respectively. You'd have to convert their types to int then. This will then need fewer calls of Math.floor() and also would be more clean and intuitive (to me).

@tschlenther
Copy link
Contributor

please consider squashing the commits when merging ;)

@GregorRyb GregorRyb self-assigned this Jan 25, 2024
@rakow rakow merged commit 4054f6a into main Jan 25, 2024
4 of 5 checks passed
@rakow rakow deleted the parkingCapacities branch January 25, 2024 09:48
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.

3 participants