Skip to content

Commit

Permalink
multiply losses by sum duration steps (#520)
Browse files Browse the repository at this point in the history
## Issue addressed
Solves #<issue number>

## Code of conduct
- [x] I HAVE NOT added sensitive or compromised (test) data to the
repository.
- [x] I HAVE NOT added vulnerabilities to the repository.
- [x] I HAVE discussed my solution with (other) members of the RA2CE
team.

## What has been done?
Explain how you addressed the resolution of the related issue, what
choices you made and why.

### Checklist
- [x] Code is formatted using our custom `black` and `isort`
definitions.
- [x] Tests are either added or updated.
- [x] Branch is up to date with `master`.
- [x] Updated documentation if needed.

## Additional Notes (optional)
Add any additional notes or information that may be helpful.
  • Loading branch information
MatthiasHauthDeltares authored Jul 12, 2024
2 parents 4bca575 + 98e983b commit 88a4350
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion ra2ce/analysis/losses/losses_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ def _calculate_production_loss_per_capita(
vlh_trip_type_event = sum(
(
intensity_trip_type
* duration
* duration**2
* loss_ratio
* occupancy_trip_type
* self.production_loss_per_capita_per_hour
Expand All @@ -443,6 +443,7 @@ def _calculate_production_loss_per_capita(
duration_steps, functionality_loss_ratios
)
)

vehicle_loss_hours.loc[
[vlh_row.name], f"vlh_{trip_type}_{hazard_col_name}"
] = vlh_trip_type_event
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ link_id,link_type,vlh_business_EV1_ma,vlh_commute_EV1_ma,vlh_EV1_ma_total
3,motorway,196291.6,448666.6,0.0
4,motorway,458916.6,1835666.6,0.0
5,motorway,729750.0,729750.0,0.0
6,motorway,3.333333e+01,3.333333e+01,0.0
6,motorway,126.66666666666666,126.66666666666666,0.0

0 comments on commit 88a4350

Please sign in to comment.