generated from matsim-scenarios/matsim-scenario-template
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
road pricing dashboard first version
- Loading branch information
Showing
4 changed files
with
136 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
77 changes: 77 additions & 0 deletions
77
src/main/java/org/matsim/dashboard/RoadPricingDashboard.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
package org.matsim.dashboard; | ||
|
||
import org.matsim.analysis.roadpricing.RoadPricingAnalysis; | ||
import org.matsim.prepare.MexicoCityUtils; | ||
import org.matsim.simwrapper.Dashboard; | ||
import org.matsim.simwrapper.Header; | ||
import org.matsim.simwrapper.Layout; | ||
import org.matsim.simwrapper.viz.*; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* Shows information about an optional road pricing policy case. | ||
*/ | ||
public class RoadPricingDashboard implements Dashboard { | ||
String roadPricingAreaPath; | ||
String share = "share"; | ||
|
||
RoadPricingDashboard(String roadPricingAreaPath) { | ||
this.roadPricingAreaPath = roadPricingAreaPath; | ||
} | ||
@Override | ||
public void configure(Header header, Layout layout) { | ||
header.title = "Road Pricing"; | ||
header.description = "General information about the simulated road pricing policy case."; | ||
|
||
layout.row("first").el(Tile.class, (viz, data) -> { | ||
viz.dataset = data.compute(RoadPricingAnalysis.class, "roadPricing_tolled_agents.csv"); | ||
viz.height = 0.1; | ||
}); | ||
|
||
layout.row("second") | ||
.el(Bar.class, (viz, data) -> { | ||
viz.title = "Tolled agents"; | ||
viz.description = "income groups"; | ||
viz.stacked = false; | ||
viz.dataset = data.compute(RoadPricingAnalysis.class, "roadPricing_income_groups.csv"); | ||
viz.x = "incomeGroup"; | ||
viz.xAxisName = "income group"; | ||
viz.yAxisName = share; | ||
viz.columns = List.of(share); | ||
}) | ||
.el(Bar.class, (viz, data) -> { | ||
viz.title = "Tolled agents"; | ||
viz.description = "per hour"; | ||
viz.stacked = false; | ||
viz.dataset = data.compute(RoadPricingAnalysis.class, "roadPricing_daytime_groups.csv"); | ||
viz.x = "hour"; | ||
viz.xAxisName = "hour"; | ||
viz.yAxisName = share; | ||
viz.columns = List.of(share); | ||
}); | ||
|
||
layout.row("third") | ||
.el(Hexagons.class, (viz, data) -> { | ||
|
||
viz.title = "Tolled agents home locations"; | ||
viz.center = data.context().getCenter(); | ||
viz.zoom = data.context().mapZoomLevel; | ||
viz.height = 7.5; | ||
viz.width = 2.0; | ||
|
||
viz.file = data.compute(RoadPricingAnalysis.class, "roadPricing_tolled_agents_home_locations.csv"); | ||
viz.projection = MexicoCityUtils.CRS; | ||
viz.addAggregation("home locations", "person", "home_x", "home_y"); | ||
}) | ||
.el(MapPlot.class, (viz, data) -> { | ||
viz.title = "Toll area"; | ||
viz.center = data.context().getCenter(); | ||
viz.zoom = data.context().mapZoomLevel; | ||
viz.height = 7.5; | ||
viz.width = 2.0; | ||
// TODO: parsing of roadPricingAreaPath does not work yet | ||
viz.setShape(roadPricingAreaPath); | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters