Skip to content

Commit

Permalink
reduce duplication
Browse files Browse the repository at this point in the history
  • Loading branch information
tschlenther committed Jun 4, 2024
1 parent 82cad54 commit 47f8562
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public void configure(Header header, Layout layout) {

String linkDescription = "Displays the emissions for each link per meter. Be aware that emission values are provided in the simulation sample size!";
if (pathToCsvBase != null){
linkDescription += String.format("\n Base is %s", pathToCsvBase);
linkDescription += String.format("%n Base is %s", pathToCsvBase);
}
String finalLinkDescription = linkDescription;

Expand Down
20 changes: 0 additions & 20 deletions src/main/java/org/matsim/dashboard/AverageDrtDashboard.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,21 +43,18 @@ public void configure(Header header, Layout layout) {
layout.row("one")
.el(Table.class, (viz, data) -> {
viz.title = "Rides per vehicle";
viz.description = "Final demand statistics and KPI.";
viz.dataset = postProcess(data, "rides_per_veh_avg_demand_stats.csv");
viz.showAllRows = true;
viz.width = 1.;
})
.el(Table.class, (viz, data) -> {
viz.title = "Avg wait time";
viz.description = "Final demand statistics and KPI.";
viz.dataset = postProcess(data, "avg_wait_time_avg_demand_stats.csv");
viz.showAllRows = true;
viz.width = 1.;
})
.el(Table.class, (viz, data) -> {
viz.title = "Requests";
viz.description = "Final demand statistics and KPI.";
viz.dataset = postProcess(data, "requests_avg_demand_stats.csv");
viz.showAllRows = true;
viz.width = 1.;
Expand All @@ -66,21 +63,18 @@ public void configure(Header header, Layout layout) {
layout.row("two")
.el(Table.class, (viz, data) -> {
viz.title = "Avg total travel time";
viz.description = "Final demand statistics and KPI.";
viz.dataset = postProcess(data, "avg_total_travel_time_avg_demand_stats.csv");
viz.showAllRows = true;
viz.width = 1.;
})
.el(Table.class, (viz, data) -> {
viz.title = "Rides";
viz.description = "Final demand statistics and KPI.";
viz.dataset = postProcess(data, "rides_avg_demand_stats.csv");
viz.showAllRows = true;
viz.width = 1.;
})
.el(Table.class, (viz, data) -> {
viz.title = "Avg direct distance [km]";
viz.description = "Final demand statistics and KPI.";
viz.dataset = postProcess(data, "avg_direct_distance_[km]_avg_demand_stats.csv");
viz.showAllRows = true;
viz.width = 1.;
Expand All @@ -89,21 +83,18 @@ public void configure(Header header, Layout layout) {
layout.row("three")
.el(Table.class, (viz, data) -> {
viz.title = "Rejections";
viz.description = "Final demand statistics and KPI.";
viz.dataset = postProcess(data, "rejections_avg_demand_stats.csv");
viz.showAllRows = true;
viz.width = 1.;
})
.el(Table.class, (viz, data) -> {
viz.title = "95th percentile wait time";
viz.description = "Final demand statistics and KPI.";
viz.dataset = postProcess(data, "95th_percentile_wait_time_avg_demand_stats.csv");
viz.showAllRows = true;
viz.width = 1.;
})
.el(Table.class, (viz, data) -> {
viz.title = "Avg in-vehicle time";
viz.description = "Final demand statistics and KPI.";
viz.dataset = postProcess(data, "avg_in-vehicle_time_avg_demand_stats.csv");
viz.showAllRows = true;
viz.width = 1.;
Expand All @@ -112,21 +103,18 @@ public void configure(Header header, Layout layout) {
layout.row("four")
.el(Table.class, (viz, data) -> {
viz.title = "Avg ride distance [km]";
viz.description = "Final demand statistics and KPI.";
viz.dataset = postProcess(data, "avg_ride_distance_[km]_avg_demand_stats.csv");
viz.showAllRows = true;
viz.width = 1.;
})
.el(Table.class, (viz, data) -> {
viz.title = "Rejection rate";
viz.description = "Final demand statistics and KPI.";
viz.dataset = postProcess(data, "rejection_rate_avg_demand_stats.csv");
viz.showAllRows = true;
viz.width = 1.;
})
.el(Table.class, (viz, data) -> {
viz.title = "Avg fare [MoneyUnit]";
viz.description = "Final demand statistics and KPI.";
viz.dataset = postProcess(data, "avg_fare_[MoneyUnit]_avg_demand_stats.csv");
viz.showAllRows = true;
viz.width = 1.;
Expand All @@ -140,21 +128,18 @@ private void supplyTabs(Layout layout) {
layout.row("six")
.el(Table.class, (viz, data) -> {
viz.title = "Total service hours";
viz.description = "Final configuration and service KPI.";
viz.dataset = postProcess(data, "total_service_hours_avg_supply_stats.csv");
viz.showAllRows = true;
viz.width = 1.;
})
.el(Table.class, (viz, data) -> {
viz.title = "Pooling ratio";
viz.description = "Final configuration and service KPI.";
viz.dataset = postProcess(data, "pooling_ratio_avg_supply_stats.csv");
viz.showAllRows = true;
viz.width = 1.;
})
.el(Table.class, (viz, data) -> {
viz.title = "Detour ratio";
viz.description = "Final configuration and service KPI.";
viz.dataset = postProcess(data, "detour_ratio_avg_supply_stats.csv");
viz.showAllRows = true;
viz.width = 1.;
Expand All @@ -163,21 +148,18 @@ private void supplyTabs(Layout layout) {
layout.row("seven")
.el(Table.class, (viz, data) -> {
viz.title = "Total vehicle mileage [km]";
viz.description = "Final configuration and service KPI.";
viz.dataset = postProcess(data, "total_vehicle_mileage_[km]_avg_supply_stats.csv");
viz.showAllRows = true;
viz.width = 1.;
})
.el(Table.class, (viz, data) -> {
viz.title = "Empty ratio";
viz.description = "Final configuration and service KPI.";
viz.dataset = postProcess(data, "empty_ratio_avg_supply_stats.csv");
viz.showAllRows = true;
viz.width = 1.;
})
.el(Table.class, (viz, data) -> {
viz.title = "Number of stops";
viz.description = "Final configuration and service KPI.";
viz.dataset = postProcess(data, "number_of_stops_avg_supply_stats.csv");
viz.showAllRows = true;
viz.width = 1.;
Expand All @@ -186,14 +168,12 @@ private void supplyTabs(Layout layout) {
layout.row("eight")
.el(Table.class, (viz, data) -> {
viz.title = "Total pax distance [km]";
viz.description = "Final configuration and service KPI.";
viz.dataset = postProcess(data, "total_pax_distance_[km]_avg_supply_stats.csv");
viz.showAllRows = true;
viz.width = 1.;
})
.el(Table.class, (viz, data) -> {
viz.title = "Vehicles";
viz.description = "Final configuration and service KPI.";
viz.dataset = postProcess(data, "vehicles_avg_supply_stats.csv");
viz.showAllRows = true;
viz.width = 1.;
Expand Down

0 comments on commit 47f8562

Please sign in to comment.