mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-12-25 23:43:25 +03:00
Manually move mod block after the use block, to match what CLion does.
This commit is contained in:
parent
41ecd62e69
commit
27d94945c6
@ -5,14 +5,6 @@
|
|||||||
// - A/B Street-specific filesystem paths
|
// - A/B Street-specific filesystem paths
|
||||||
// - true utility functions (collections, prettyprinting, CLI parsing
|
// - true utility functions (collections, prettyprinting, CLI parsing
|
||||||
|
|
||||||
mod abst_paths;
|
|
||||||
mod cli;
|
|
||||||
mod collections;
|
|
||||||
mod io;
|
|
||||||
mod serde;
|
|
||||||
mod time;
|
|
||||||
mod utils;
|
|
||||||
|
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate log;
|
extern crate log;
|
||||||
|
|
||||||
@ -33,4 +25,10 @@ pub use collections::*;
|
|||||||
pub use time::*;
|
pub use time::*;
|
||||||
pub use utils::*;
|
pub use utils::*;
|
||||||
|
|
||||||
|
mod cli;
|
||||||
|
mod collections;
|
||||||
|
mod io;
|
||||||
|
mod random;
|
||||||
|
mod time;
|
||||||
|
|
||||||
const PROGRESS_FREQUENCY_SECONDS: f64 = 0.2;
|
const PROGRESS_FREQUENCY_SECONDS: f64 = 0.2;
|
||||||
|
@ -1,3 +1,8 @@
|
|||||||
|
use abstutil::Timer;
|
||||||
|
use geom::{Distance, FindClosest, GPSBounds, LonLat, Pt2D, Ring};
|
||||||
|
use map_model::raw::RawMap;
|
||||||
|
use map_model::{osm, MapConfig, NamePerLanguage};
|
||||||
|
|
||||||
mod clip;
|
mod clip;
|
||||||
mod extract;
|
mod extract;
|
||||||
mod parking;
|
mod parking;
|
||||||
@ -7,11 +12,6 @@ mod split_ways;
|
|||||||
mod srtm;
|
mod srtm;
|
||||||
mod transit;
|
mod transit;
|
||||||
|
|
||||||
use abstutil::Timer;
|
|
||||||
use geom::{Distance, FindClosest, GPSBounds, LonLat, Pt2D, Ring};
|
|
||||||
use map_model::raw::RawMap;
|
|
||||||
use map_model::{osm, MapConfig, NamePerLanguage};
|
|
||||||
|
|
||||||
pub struct Options {
|
pub struct Options {
|
||||||
pub osm_input: String,
|
pub osm_input: String,
|
||||||
pub city_name: String,
|
pub city_name: String,
|
||||||
|
@ -1,11 +1,3 @@
|
|||||||
mod city_picker;
|
|
||||||
mod colors;
|
|
||||||
mod heatmap;
|
|
||||||
mod isochrone;
|
|
||||||
mod minimap;
|
|
||||||
mod navigate;
|
|
||||||
mod warp;
|
|
||||||
|
|
||||||
pub use self::city_picker::CityPicker;
|
pub use self::city_picker::CityPicker;
|
||||||
pub use self::colors::{ColorDiscrete, ColorLegend, ColorNetwork, ColorScale, DivergingScale};
|
pub use self::colors::{ColorDiscrete, ColorLegend, ColorNetwork, ColorScale, DivergingScale};
|
||||||
pub use self::heatmap::{make_heatmap, HeatmapOptions};
|
pub use self::heatmap::{make_heatmap, HeatmapOptions};
|
||||||
@ -24,6 +16,14 @@ use widgetry::{
|
|||||||
ScreenDims, ScreenPt, ScreenRectangle, Text, VerticalAlignment, Widget,
|
ScreenDims, ScreenPt, ScreenRectangle, Text, VerticalAlignment, Widget,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
mod city_picker;
|
||||||
|
mod colors;
|
||||||
|
mod heatmap;
|
||||||
|
mod isochrone;
|
||||||
|
mod minimap;
|
||||||
|
mod navigate;
|
||||||
|
mod warp;
|
||||||
|
|
||||||
// TODO This is now just used in two modes...
|
// TODO This is now just used in two modes...
|
||||||
pub struct CommonState {
|
pub struct CommonState {
|
||||||
// TODO Better to express these as mutex
|
// TODO Better to express these as mutex
|
||||||
|
@ -1,9 +1,3 @@
|
|||||||
mod floodfill;
|
|
||||||
mod objects;
|
|
||||||
pub mod path_counter;
|
|
||||||
mod polygons;
|
|
||||||
pub mod shared_row;
|
|
||||||
|
|
||||||
use crate::app::{App, ShowLayers, ShowObject};
|
use crate::app::{App, ShowLayers, ShowObject};
|
||||||
use crate::common::{tool_panel, CommonState, ContextualActions};
|
use crate::common::{tool_panel, CommonState, ContextualActions};
|
||||||
use crate::game::{ChooseSomething, DrawBaselayer, PopupMsg, PromptInput, State, Transition};
|
use crate::game::{ChooseSomething, DrawBaselayer, PopupMsg, PromptInput, State, Transition};
|
||||||
@ -21,6 +15,12 @@ use widgetry::{
|
|||||||
HorizontalAlignment, Key, Line, Outcome, Panel, Text, UpdateType, VerticalAlignment, Widget,
|
HorizontalAlignment, Key, Line, Outcome, Panel, Text, UpdateType, VerticalAlignment, Widget,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
mod floodfill;
|
||||||
|
mod objects;
|
||||||
|
pub mod path_counter;
|
||||||
|
mod polygons;
|
||||||
|
pub mod shared_row;
|
||||||
|
|
||||||
pub struct DebugMode {
|
pub struct DebugMode {
|
||||||
panel: Panel,
|
panel: Panel,
|
||||||
common: CommonState,
|
common: CommonState,
|
||||||
|
@ -1,10 +1,3 @@
|
|||||||
mod destinations;
|
|
||||||
mod kml;
|
|
||||||
pub mod mapping;
|
|
||||||
mod polygon;
|
|
||||||
mod scenario;
|
|
||||||
mod story;
|
|
||||||
|
|
||||||
use crate::app::App;
|
use crate::app::App;
|
||||||
use crate::common::CityPicker;
|
use crate::common::CityPicker;
|
||||||
use crate::game::{ChooseSomething, DrawBaselayer, State, Transition};
|
use crate::game::{ChooseSomething, DrawBaselayer, State, Transition};
|
||||||
@ -16,6 +9,13 @@ use widgetry::{
|
|||||||
VerticalAlignment, Widget,
|
VerticalAlignment, Widget,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
mod destinations;
|
||||||
|
mod kml;
|
||||||
|
pub mod mapping;
|
||||||
|
mod polygon;
|
||||||
|
mod scenario;
|
||||||
|
mod story;
|
||||||
|
|
||||||
pub struct DevToolsMode {
|
pub struct DevToolsMode {
|
||||||
panel: Panel,
|
panel: Panel,
|
||||||
}
|
}
|
||||||
|
@ -1,13 +1,3 @@
|
|||||||
mod bulk;
|
|
||||||
mod cluster_traffic_signals;
|
|
||||||
mod lanes;
|
|
||||||
mod routes;
|
|
||||||
mod select;
|
|
||||||
mod stop_signs;
|
|
||||||
mod traffic_signals;
|
|
||||||
mod validate;
|
|
||||||
mod zones;
|
|
||||||
|
|
||||||
pub use self::cluster_traffic_signals::ClusterTrafficSignalEditor;
|
pub use self::cluster_traffic_signals::ClusterTrafficSignalEditor;
|
||||||
pub use self::lanes::LaneEditor;
|
pub use self::lanes::LaneEditor;
|
||||||
pub use self::routes::RouteEditor;
|
pub use self::routes::RouteEditor;
|
||||||
@ -32,6 +22,16 @@ use widgetry::{
|
|||||||
Outcome, Panel, Text, TextExt, VerticalAlignment, Widget,
|
Outcome, Panel, Text, TextExt, VerticalAlignment, Widget,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
mod bulk;
|
||||||
|
mod cluster_traffic_signals;
|
||||||
|
mod lanes;
|
||||||
|
mod routes;
|
||||||
|
mod select;
|
||||||
|
mod stop_signs;
|
||||||
|
mod traffic_signals;
|
||||||
|
mod validate;
|
||||||
|
mod zones;
|
||||||
|
|
||||||
pub struct EditMode {
|
pub struct EditMode {
|
||||||
tool_panel: Panel,
|
tool_panel: Panel,
|
||||||
top_center: Panel,
|
top_center: Panel,
|
||||||
|
@ -1,8 +1,3 @@
|
|||||||
mod edits;
|
|
||||||
mod offsets;
|
|
||||||
mod picker;
|
|
||||||
mod preview;
|
|
||||||
|
|
||||||
use crate::app::{App, ShowEverything};
|
use crate::app::{App, ShowEverything};
|
||||||
use crate::common::{CommonState, Warping};
|
use crate::common::{CommonState, Warping};
|
||||||
use crate::edit::{apply_map_edits, ConfirmDiscard};
|
use crate::edit::{apply_map_edits, ConfirmDiscard};
|
||||||
@ -22,6 +17,11 @@ use widgetry::{
|
|||||||
MultiButton, Outcome, Panel, RewriteColor, Text, TextExt, VerticalAlignment, Widget,
|
MultiButton, Outcome, Panel, RewriteColor, Text, TextExt, VerticalAlignment, Widget,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
mod edits;
|
||||||
|
mod offsets;
|
||||||
|
mod picker;
|
||||||
|
mod preview;
|
||||||
|
|
||||||
// Welcome to one of the most overwhelmingly complicated parts of the UI...
|
// Welcome to one of the most overwhelmingly complicated parts of the UI...
|
||||||
|
|
||||||
pub struct TrafficSignalEditor {
|
pub struct TrafficSignalEditor {
|
||||||
|
@ -1,12 +1,3 @@
|
|||||||
mod building;
|
|
||||||
mod bus;
|
|
||||||
mod debug;
|
|
||||||
mod intersection;
|
|
||||||
mod lane;
|
|
||||||
mod parking_lot;
|
|
||||||
mod person;
|
|
||||||
mod trip;
|
|
||||||
|
|
||||||
use crate::app::App;
|
use crate::app::App;
|
||||||
use crate::common::Warping;
|
use crate::common::Warping;
|
||||||
use crate::debug::path_counter::PathCounter;
|
use crate::debug::path_counter::PathCounter;
|
||||||
@ -27,6 +18,15 @@ use widgetry::{
|
|||||||
LinePlot, Outcome, Panel, PlotOptions, Series, TextExt, VerticalAlignment, Widget,
|
LinePlot, Outcome, Panel, PlotOptions, Series, TextExt, VerticalAlignment, Widget,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
mod building;
|
||||||
|
mod bus;
|
||||||
|
mod debug;
|
||||||
|
mod intersection;
|
||||||
|
mod lane;
|
||||||
|
mod parking_lot;
|
||||||
|
mod person;
|
||||||
|
mod trip;
|
||||||
|
|
||||||
pub struct InfoPanel {
|
pub struct InfoPanel {
|
||||||
tab: Tab,
|
tab: Tab,
|
||||||
time: Time,
|
time: Time,
|
||||||
|
@ -1,3 +1,10 @@
|
|||||||
|
use crate::app::App;
|
||||||
|
use crate::common::HeatmapOptions;
|
||||||
|
use crate::game::{DrawBaselayer, State, Transition};
|
||||||
|
use crate::helpers::hotkey_btn;
|
||||||
|
use crate::sandbox::dashboards;
|
||||||
|
use widgetry::{Btn, EventCtx, GfxCtx, Key, Line, Outcome, Panel, TextExt, Widget};
|
||||||
|
|
||||||
mod elevation;
|
mod elevation;
|
||||||
pub mod map;
|
pub mod map;
|
||||||
mod pandemic;
|
mod pandemic;
|
||||||
@ -6,13 +13,6 @@ mod population;
|
|||||||
pub mod traffic;
|
pub mod traffic;
|
||||||
pub mod transit;
|
pub mod transit;
|
||||||
|
|
||||||
use crate::app::App;
|
|
||||||
use crate::common::HeatmapOptions;
|
|
||||||
use crate::game::{DrawBaselayer, State, Transition};
|
|
||||||
use crate::helpers::hotkey_btn;
|
|
||||||
use crate::sandbox::dashboards;
|
|
||||||
use widgetry::{Btn, EventCtx, GfxCtx, Key, Line, Outcome, Panel, TextExt, Widget};
|
|
||||||
|
|
||||||
// TODO Good ideas in
|
// TODO Good ideas in
|
||||||
// https://towardsdatascience.com/top-10-map-types-in-data-visualization-b3a80898ea70
|
// https://towardsdatascience.com/top-10-map-types-in-data-visualization-b3a80898ea70
|
||||||
|
|
||||||
|
@ -1,3 +1,12 @@
|
|||||||
|
#[macro_use]
|
||||||
|
extern crate log;
|
||||||
|
|
||||||
|
use abstutil::{CmdArgs, Timer};
|
||||||
|
use geom::Duration;
|
||||||
|
use sim::SimFlags;
|
||||||
|
|
||||||
|
use crate::app::Flags;
|
||||||
|
|
||||||
mod app;
|
mod app;
|
||||||
mod challenges;
|
mod challenges;
|
||||||
mod colors;
|
mod colors;
|
||||||
@ -15,14 +24,6 @@ mod pregame;
|
|||||||
mod render;
|
mod render;
|
||||||
mod sandbox;
|
mod sandbox;
|
||||||
|
|
||||||
#[macro_use]
|
|
||||||
extern crate log;
|
|
||||||
|
|
||||||
use crate::app::Flags;
|
|
||||||
use abstutil::{CmdArgs, Timer};
|
|
||||||
use geom::Duration;
|
|
||||||
use sim::SimFlags;
|
|
||||||
|
|
||||||
pub fn main() {
|
pub fn main() {
|
||||||
let mut args = CmdArgs::new();
|
let mut args = CmdArgs::new();
|
||||||
|
|
||||||
|
@ -1,17 +1,3 @@
|
|||||||
mod area;
|
|
||||||
mod bike;
|
|
||||||
mod building;
|
|
||||||
mod bus_stop;
|
|
||||||
mod car;
|
|
||||||
mod intersection;
|
|
||||||
mod lane;
|
|
||||||
mod map;
|
|
||||||
mod parking_lot;
|
|
||||||
mod pedestrian;
|
|
||||||
mod road;
|
|
||||||
pub mod traffic_signal;
|
|
||||||
mod turn;
|
|
||||||
|
|
||||||
use crate::app::App;
|
use crate::app::App;
|
||||||
use crate::colors::ColorScheme;
|
use crate::colors::ColorScheme;
|
||||||
use crate::helpers::ID;
|
use crate::helpers::ID;
|
||||||
@ -28,6 +14,20 @@ use map_model::{IntersectionID, Map};
|
|||||||
use sim::{DrawCarInput, VehicleType};
|
use sim::{DrawCarInput, VehicleType};
|
||||||
use widgetry::{GfxCtx, Prerender};
|
use widgetry::{GfxCtx, Prerender};
|
||||||
|
|
||||||
|
mod area;
|
||||||
|
mod bike;
|
||||||
|
mod building;
|
||||||
|
mod bus_stop;
|
||||||
|
mod car;
|
||||||
|
mod intersection;
|
||||||
|
mod lane;
|
||||||
|
mod map;
|
||||||
|
mod parking_lot;
|
||||||
|
mod pedestrian;
|
||||||
|
mod road;
|
||||||
|
pub mod traffic_signal;
|
||||||
|
mod turn;
|
||||||
|
|
||||||
pub const BIG_ARROW_THICKNESS: Distance = Distance::const_meters(0.5);
|
pub const BIG_ARROW_THICKNESS: Distance = Distance::const_meters(0.5);
|
||||||
|
|
||||||
pub const CROSSWALK_LINE_THICKNESS: Distance = Distance::const_meters(0.15);
|
pub const CROSSWALK_LINE_THICKNESS: Distance = Distance::const_meters(0.15);
|
||||||
|
@ -1,3 +1,10 @@
|
|||||||
|
use crate::app::App;
|
||||||
|
use crate::game::Transition;
|
||||||
|
pub use commuter::CommuterPatterns;
|
||||||
|
pub use traffic_signals::TrafficSignalDemand;
|
||||||
|
pub use trip_table::FinishedTripTable;
|
||||||
|
use widgetry::{Btn, Choice, EventCtx, Key, Line, Panel, TextExt, Widget};
|
||||||
|
|
||||||
mod commuter;
|
mod commuter;
|
||||||
mod generic_trip_table;
|
mod generic_trip_table;
|
||||||
mod misc;
|
mod misc;
|
||||||
@ -7,13 +14,6 @@ mod table;
|
|||||||
mod traffic_signals;
|
mod traffic_signals;
|
||||||
mod trip_table;
|
mod trip_table;
|
||||||
|
|
||||||
use crate::app::App;
|
|
||||||
use crate::game::Transition;
|
|
||||||
pub use commuter::CommuterPatterns;
|
|
||||||
pub use traffic_signals::TrafficSignalDemand;
|
|
||||||
pub use trip_table::FinishedTripTable;
|
|
||||||
use widgetry::{Btn, Choice, EventCtx, Key, Line, Panel, TextExt, Widget};
|
|
||||||
|
|
||||||
// Oh the dashboards melted, but we still had the radio
|
// Oh the dashboards melted, but we still had the radio
|
||||||
#[derive(Clone, Copy, PartialEq, Debug)]
|
#[derive(Clone, Copy, PartialEq, Debug)]
|
||||||
pub enum DashTab {
|
pub enum DashTab {
|
||||||
|
@ -1,10 +1,3 @@
|
|||||||
// TODO pub so challenges can grab cutscenes and SandboxMode can dispatch to actions. Weird?
|
|
||||||
pub mod commute;
|
|
||||||
pub mod fix_traffic_signals;
|
|
||||||
pub mod freeform;
|
|
||||||
pub mod play_scenario;
|
|
||||||
pub mod tutorial;
|
|
||||||
|
|
||||||
pub use self::freeform::spawn_agents_around;
|
pub use self::freeform::spawn_agents_around;
|
||||||
pub use self::tutorial::{Tutorial, TutorialPointer, TutorialState};
|
pub use self::tutorial::{Tutorial, TutorialPointer, TutorialState};
|
||||||
use crate::app::App;
|
use crate::app::App;
|
||||||
@ -22,6 +15,13 @@ use widgetry::{
|
|||||||
lctrl, Btn, Color, EventCtx, GeomBatch, GfxCtx, Key, Line, Outcome, Panel, TextExt, Widget,
|
lctrl, Btn, Color, EventCtx, GeomBatch, GfxCtx, Key, Line, Outcome, Panel, TextExt, Widget,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// TODO pub so challenges can grab cutscenes and SandboxMode can dispatch to actions. Weird?
|
||||||
|
pub mod commute;
|
||||||
|
pub mod fix_traffic_signals;
|
||||||
|
pub mod freeform;
|
||||||
|
pub mod play_scenario;
|
||||||
|
pub mod tutorial;
|
||||||
|
|
||||||
#[derive(PartialEq, Eq, PartialOrd, Ord, Clone)]
|
#[derive(PartialEq, Eq, PartialOrd, Ord, Clone)]
|
||||||
pub enum GameplayMode {
|
pub enum GameplayMode {
|
||||||
// TODO Maybe this should be "sandbox"
|
// TODO Maybe this should be "sandbox"
|
||||||
|
@ -1,10 +1,3 @@
|
|||||||
pub mod dashboards;
|
|
||||||
pub mod gameplay;
|
|
||||||
mod misc_tools;
|
|
||||||
mod speed;
|
|
||||||
mod time_warp;
|
|
||||||
mod uber_turns;
|
|
||||||
|
|
||||||
use self::misc_tools::{RoutePreview, TurnExplorer};
|
use self::misc_tools::{RoutePreview, TurnExplorer};
|
||||||
use crate::app::App;
|
use crate::app::App;
|
||||||
use crate::common::{tool_panel, CommonState, ContextualActions, IsochroneViewer, Minimap};
|
use crate::common::{tool_panel, CommonState, ContextualActions, IsochroneViewer, Minimap};
|
||||||
@ -30,6 +23,13 @@ use widgetry::{
|
|||||||
TextExt, UpdateType, VerticalAlignment, Widget,
|
TextExt, UpdateType, VerticalAlignment, Widget,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
pub mod dashboards;
|
||||||
|
pub mod gameplay;
|
||||||
|
mod misc_tools;
|
||||||
|
mod speed;
|
||||||
|
mod time_warp;
|
||||||
|
mod uber_turns;
|
||||||
|
|
||||||
pub struct SandboxMode {
|
pub struct SandboxMode {
|
||||||
gameplay: Box<dyn gameplay::GameplayState>,
|
gameplay: Box<dyn gameplay::GameplayState>,
|
||||||
pub gameplay_mode: GameplayMode,
|
pub gameplay_mode: GameplayMode,
|
||||||
|
@ -1,20 +1,3 @@
|
|||||||
mod angle;
|
|
||||||
mod bounds;
|
|
||||||
mod circle;
|
|
||||||
mod distance;
|
|
||||||
mod duration;
|
|
||||||
mod find_closest;
|
|
||||||
mod gps;
|
|
||||||
mod line;
|
|
||||||
mod percent;
|
|
||||||
mod polygon;
|
|
||||||
mod polyline;
|
|
||||||
mod pt;
|
|
||||||
mod ring;
|
|
||||||
mod speed;
|
|
||||||
mod stats;
|
|
||||||
mod time;
|
|
||||||
|
|
||||||
pub use crate::angle::Angle;
|
pub use crate::angle::Angle;
|
||||||
pub use crate::bounds::{Bounds, GPSBounds};
|
pub use crate::bounds::{Bounds, GPSBounds};
|
||||||
pub use crate::circle::Circle;
|
pub use crate::circle::Circle;
|
||||||
@ -32,6 +15,23 @@ pub use crate::speed::Speed;
|
|||||||
pub use crate::stats::{HgramValue, Histogram, Statistic};
|
pub use crate::stats::{HgramValue, Histogram, Statistic};
|
||||||
pub use crate::time::Time;
|
pub use crate::time::Time;
|
||||||
|
|
||||||
|
mod angle;
|
||||||
|
mod bounds;
|
||||||
|
mod circle;
|
||||||
|
mod distance;
|
||||||
|
mod duration;
|
||||||
|
mod find_closest;
|
||||||
|
mod gps;
|
||||||
|
mod line;
|
||||||
|
mod percent;
|
||||||
|
mod polygon;
|
||||||
|
mod polyline;
|
||||||
|
mod pt;
|
||||||
|
mod ring;
|
||||||
|
mod speed;
|
||||||
|
mod stats;
|
||||||
|
mod time;
|
||||||
|
|
||||||
// About 0.4 inches... which is quite tiny on the scale of things. :)
|
// About 0.4 inches... which is quite tiny on the scale of things. :)
|
||||||
pub const EPSILON_DIST: Distance = Distance::const_meters(0.01);
|
pub const EPSILON_DIST: Distance = Distance::const_meters(0.01);
|
||||||
|
|
||||||
|
@ -1,3 +1,6 @@
|
|||||||
|
use configuration::{load_configuration, ImporterConfiguration};
|
||||||
|
use dependencies::are_dependencies_callable;
|
||||||
|
|
||||||
mod berlin;
|
mod berlin;
|
||||||
mod configuration;
|
mod configuration;
|
||||||
mod dependencies;
|
mod dependencies;
|
||||||
@ -10,9 +13,6 @@ mod tel_aviv;
|
|||||||
mod utils;
|
mod utils;
|
||||||
mod xian;
|
mod xian;
|
||||||
|
|
||||||
use configuration::{load_configuration, ImporterConfiguration};
|
|
||||||
use dependencies::are_dependencies_callable;
|
|
||||||
|
|
||||||
// TODO Might be cleaner to express as a dependency graph?
|
// TODO Might be cleaner to express as a dependency graph?
|
||||||
|
|
||||||
struct Job {
|
struct Job {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
mod popdat;
|
|
||||||
mod trips;
|
|
||||||
|
|
||||||
pub use self::popdat::{import_data, PopDat};
|
pub use self::popdat::{import_data, PopDat};
|
||||||
pub use self::trips::{make_weekday_scenario, make_weekday_scenario_with_everyone};
|
pub use self::trips::{make_weekday_scenario, make_weekday_scenario_with_everyone};
|
||||||
|
|
||||||
|
mod popdat;
|
||||||
|
mod trips;
|
||||||
|
@ -1,6 +1,3 @@
|
|||||||
mod model;
|
|
||||||
mod world;
|
|
||||||
|
|
||||||
use abstutil::{CmdArgs, Timer};
|
use abstutil::{CmdArgs, Timer};
|
||||||
use geom::{Distance, Line, Polygon};
|
use geom::{Distance, Line, Polygon};
|
||||||
use map_model::osm;
|
use map_model::osm;
|
||||||
@ -11,6 +8,9 @@ use widgetry::{
|
|||||||
Outcome, Panel, ScreenPt, Text, VerticalAlignment, Widget, GUI,
|
Outcome, Panel, ScreenPt, Text, VerticalAlignment, Widget, GUI,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
mod model;
|
||||||
|
mod world;
|
||||||
|
|
||||||
struct UI {
|
struct UI {
|
||||||
model: Model,
|
model: Model,
|
||||||
state: State,
|
state: State,
|
||||||
|
@ -2,9 +2,6 @@
|
|||||||
// the changes to a file (as PermanentMapEdits). See
|
// the changes to a file (as PermanentMapEdits). See
|
||||||
// https://dabreegster.github.io/abstreet/map/edits.html.
|
// https://dabreegster.github.io/abstreet/map/edits.html.
|
||||||
|
|
||||||
mod compat;
|
|
||||||
mod perma;
|
|
||||||
|
|
||||||
use crate::make::initial::lane_specs::get_lane_specs_ltr;
|
use crate::make::initial::lane_specs::get_lane_specs_ltr;
|
||||||
use crate::{
|
use crate::{
|
||||||
connectivity, AccessRestrictions, BusRouteID, ControlStopSign, ControlTrafficSignal, Direction,
|
connectivity, AccessRestrictions, BusRouteID, ControlStopSign, ControlTrafficSignal, Direction,
|
||||||
@ -17,6 +14,9 @@ pub use perma::PermanentMapEdits;
|
|||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use std::collections::{BTreeMap, BTreeSet};
|
use std::collections::{BTreeMap, BTreeSet};
|
||||||
|
|
||||||
|
mod compat;
|
||||||
|
mod perma;
|
||||||
|
|
||||||
// Represents changes to a map. Note this isn't serializable -- that's what PermanentMapEdits does.
|
// Represents changes to a map. Note this isn't serializable -- that's what PermanentMapEdits does.
|
||||||
#[derive(Debug, Clone, PartialEq)]
|
#[derive(Debug, Clone, PartialEq)]
|
||||||
pub struct MapEdits {
|
pub struct MapEdits {
|
||||||
|
@ -21,17 +21,6 @@
|
|||||||
// - t = turn
|
// - t = turn
|
||||||
// - ts = traffic signal
|
// - ts = traffic signal
|
||||||
|
|
||||||
mod city;
|
|
||||||
pub mod connectivity;
|
|
||||||
mod edits;
|
|
||||||
mod make;
|
|
||||||
mod map;
|
|
||||||
mod objects;
|
|
||||||
pub mod osm;
|
|
||||||
mod pathfind;
|
|
||||||
pub mod raw;
|
|
||||||
mod traversable;
|
|
||||||
|
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate log;
|
extern crate log;
|
||||||
|
|
||||||
@ -66,6 +55,17 @@ use geom::{Bounds, Distance, GPSBounds, Polygon};
|
|||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use std::collections::BTreeMap;
|
use std::collections::BTreeMap;
|
||||||
|
|
||||||
|
mod city;
|
||||||
|
pub mod connectivity;
|
||||||
|
mod edits;
|
||||||
|
mod make;
|
||||||
|
mod map;
|
||||||
|
mod objects;
|
||||||
|
pub mod osm;
|
||||||
|
mod pathfind;
|
||||||
|
pub mod raw;
|
||||||
|
mod traversable;
|
||||||
|
|
||||||
// TODO Minimize uses of these!
|
// TODO Minimize uses of these!
|
||||||
pub const NORMAL_LANE_THICKNESS: Distance = Distance::const_meters(2.5);
|
pub const NORMAL_LANE_THICKNESS: Distance = Distance::const_meters(2.5);
|
||||||
pub(crate) const SERVICE_ROAD_LANE_THICKNESS: Distance = Distance::const_meters(1.5);
|
pub(crate) const SERVICE_ROAD_LANE_THICKNESS: Distance = Distance::const_meters(1.5);
|
||||||
|
@ -1,9 +1,6 @@
|
|||||||
// Naming is confusing, but RawMap -> InitialMap -> Map. InitialMap is separate pretty much just
|
// Naming is confusing, but RawMap -> InitialMap -> Map. InitialMap is separate pretty much just
|
||||||
// for the step of producing https://dabreegster.github.io/abstreet/map/importing/geometry.html.
|
// for the step of producing https://dabreegster.github.io/abstreet/map/importing/geometry.html.
|
||||||
|
|
||||||
mod geometry;
|
|
||||||
pub mod lane_specs;
|
|
||||||
|
|
||||||
pub use self::geometry::intersection_polygon;
|
pub use self::geometry::intersection_polygon;
|
||||||
use crate::raw::{OriginalRoad, RawMap, RawRoad};
|
use crate::raw::{OriginalRoad, RawMap, RawRoad};
|
||||||
use crate::{osm, DrivingSide, IntersectionType};
|
use crate::{osm, DrivingSide, IntersectionType};
|
||||||
@ -12,6 +9,9 @@ use geom::{Bounds, Circle, Distance, PolyLine, Polygon, Pt2D};
|
|||||||
use lane_specs::LaneSpec;
|
use lane_specs::LaneSpec;
|
||||||
use std::collections::{BTreeMap, BTreeSet};
|
use std::collections::{BTreeMap, BTreeSet};
|
||||||
|
|
||||||
|
mod geometry;
|
||||||
|
pub mod lane_specs;
|
||||||
|
|
||||||
pub struct InitialMap {
|
pub struct InitialMap {
|
||||||
pub roads: BTreeMap<OriginalRoad, Road>,
|
pub roads: BTreeMap<OriginalRoad, Road>,
|
||||||
pub intersections: BTreeMap<osm::NodeID, Intersection>,
|
pub intersections: BTreeMap<osm::NodeID, Intersection>,
|
||||||
|
@ -1,16 +1,6 @@
|
|||||||
// See https://dabreegster.github.io/abstreet/map/importing/index.html for an overview. This module
|
// See https://dabreegster.github.io/abstreet/map/importing/index.html for an overview. This module
|
||||||
// covers the RawMap->Map stage.
|
// covers the RawMap->Map stage.
|
||||||
|
|
||||||
mod bridges;
|
|
||||||
mod buildings;
|
|
||||||
pub mod initial;
|
|
||||||
mod parking_lots;
|
|
||||||
mod remove_disconnected;
|
|
||||||
pub mod traffic_signals;
|
|
||||||
mod transit;
|
|
||||||
pub mod turns;
|
|
||||||
mod walking_turns;
|
|
||||||
|
|
||||||
use crate::pathfind::Pathfinder;
|
use crate::pathfind::Pathfinder;
|
||||||
use crate::raw::{OriginalRoad, RawMap};
|
use crate::raw::{OriginalRoad, RawMap};
|
||||||
use crate::{
|
use crate::{
|
||||||
@ -22,6 +12,16 @@ use abstutil::{Parallelism, Timer};
|
|||||||
use geom::{Bounds, Distance, FindClosest, HashablePt2D, Speed, EPSILON_DIST};
|
use geom::{Bounds, Distance, FindClosest, HashablePt2D, Speed, EPSILON_DIST};
|
||||||
use std::collections::{BTreeMap, BTreeSet, HashMap, HashSet};
|
use std::collections::{BTreeMap, BTreeSet, HashMap, HashSet};
|
||||||
|
|
||||||
|
mod bridges;
|
||||||
|
mod buildings;
|
||||||
|
pub mod initial;
|
||||||
|
mod parking_lots;
|
||||||
|
mod remove_disconnected;
|
||||||
|
pub mod traffic_signals;
|
||||||
|
mod transit;
|
||||||
|
pub mod turns;
|
||||||
|
mod walking_turns;
|
||||||
|
|
||||||
impl Map {
|
impl Map {
|
||||||
pub fn create_from_raw(mut raw: RawMap, build_ch: bool, timer: &mut Timer) -> Map {
|
pub fn create_from_raw(mut raw: RawMap, build_ch: bool, timer: &mut Timer) -> Map {
|
||||||
// Better to defer this and see RawMaps with more debug info in map_editor
|
// Better to defer this and see RawMaps with more debug info in map_editor
|
||||||
|
@ -1,13 +1,5 @@
|
|||||||
// Everything related to pathfinding through a map for different types of agents.
|
// Everything related to pathfinding through a map for different types of agents.
|
||||||
|
|
||||||
mod ch;
|
|
||||||
mod dijkstra;
|
|
||||||
mod driving;
|
|
||||||
mod node_map;
|
|
||||||
// TODO tmp
|
|
||||||
pub mod uber_turns;
|
|
||||||
mod walking;
|
|
||||||
|
|
||||||
pub use self::ch::ContractionHierarchyPathfinder;
|
pub use self::ch::ContractionHierarchyPathfinder;
|
||||||
pub use self::driving::driving_cost;
|
pub use self::driving::driving_cost;
|
||||||
pub use self::walking::{walking_cost, WalkingNode};
|
pub use self::walking::{walking_cost, WalkingNode};
|
||||||
@ -22,6 +14,14 @@ use serde::{Deserialize, Serialize};
|
|||||||
use std::collections::{BTreeSet, VecDeque};
|
use std::collections::{BTreeSet, VecDeque};
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
|
|
||||||
|
mod ch;
|
||||||
|
mod dijkstra;
|
||||||
|
mod driving;
|
||||||
|
mod node_map;
|
||||||
|
// TODO tmp
|
||||||
|
pub mod uber_turns;
|
||||||
|
mod walking;
|
||||||
|
|
||||||
#[derive(Debug, Clone, Copy, Serialize, Deserialize, PartialEq, Eq, Hash, PartialOrd, Ord)]
|
#[derive(Debug, Clone, Copy, Serialize, Deserialize, PartialEq, Eq, Hash, PartialOrd, Ord)]
|
||||||
pub enum PathStep {
|
pub enum PathStep {
|
||||||
// Original direction
|
// Original direction
|
||||||
|
@ -1,16 +1,3 @@
|
|||||||
mod analytics;
|
|
||||||
mod cap;
|
|
||||||
mod events;
|
|
||||||
mod make;
|
|
||||||
mod mechanics;
|
|
||||||
mod pandemic;
|
|
||||||
mod render;
|
|
||||||
mod router;
|
|
||||||
mod scheduler;
|
|
||||||
mod sim;
|
|
||||||
mod transit;
|
|
||||||
mod trips;
|
|
||||||
|
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate log;
|
extern crate log;
|
||||||
|
|
||||||
@ -47,6 +34,19 @@ use map_model::{
|
|||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
|
|
||||||
|
mod analytics;
|
||||||
|
mod cap;
|
||||||
|
mod events;
|
||||||
|
mod make;
|
||||||
|
mod mechanics;
|
||||||
|
mod pandemic;
|
||||||
|
mod render;
|
||||||
|
mod router;
|
||||||
|
mod scheduler;
|
||||||
|
mod sim;
|
||||||
|
mod transit;
|
||||||
|
mod trips;
|
||||||
|
|
||||||
// http://pccsc.net/bicycle-parking-info/ says 68 inches, which is 1.73m
|
// http://pccsc.net/bicycle-parking-info/ says 68 inches, which is 1.73m
|
||||||
pub const BIKE_LENGTH: Distance = Distance::const_meters(1.8);
|
pub const BIKE_LENGTH: Distance = Distance::const_meters(1.8);
|
||||||
// These two must be < PARKING_SPOT_LENGTH
|
// These two must be < PARKING_SPOT_LENGTH
|
||||||
|
@ -1,10 +1,5 @@
|
|||||||
mod activity_model;
|
use rand::{RngCore, SeedableRng};
|
||||||
mod external;
|
use rand_xorshift::XorShiftRng;
|
||||||
mod generator;
|
|
||||||
mod load;
|
|
||||||
mod modifier;
|
|
||||||
mod scenario;
|
|
||||||
mod spawner;
|
|
||||||
|
|
||||||
pub use self::external::{ExternalPerson, ExternalTrip};
|
pub use self::external::{ExternalPerson, ExternalTrip};
|
||||||
pub use self::generator::{
|
pub use self::generator::{
|
||||||
@ -16,8 +11,14 @@ pub use self::scenario::{
|
|||||||
IndividTrip, OffMapLocation, PersonSpec, Scenario, SpawnTrip, TripPurpose,
|
IndividTrip, OffMapLocation, PersonSpec, Scenario, SpawnTrip, TripPurpose,
|
||||||
};
|
};
|
||||||
pub use self::spawner::{TripSpawner, TripSpec};
|
pub use self::spawner::{TripSpawner, TripSpec};
|
||||||
use rand::{RngCore, SeedableRng};
|
|
||||||
use rand_xorshift::XorShiftRng;
|
mod activity_model;
|
||||||
|
mod external;
|
||||||
|
mod generator;
|
||||||
|
mod load;
|
||||||
|
mod modifier;
|
||||||
|
mod scenario;
|
||||||
|
mod spawner;
|
||||||
|
|
||||||
// Need to explain this trick -- basically keeps consistency between two different simulations when
|
// Need to explain this trick -- basically keeps consistency between two different simulations when
|
||||||
// each one might make slightly different sequences of calls to the RNG.
|
// each one might make slightly different sequences of calls to the RNG.
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
|
pub use self::driving::DrivingSimState;
|
||||||
|
pub use self::intersection::IntersectionSimState;
|
||||||
|
pub use self::parking::{ParkingSim, ParkingSimState};
|
||||||
|
pub use self::queue::Queue;
|
||||||
|
pub use self::walking::WalkingSimState;
|
||||||
|
|
||||||
mod car;
|
mod car;
|
||||||
mod driving;
|
mod driving;
|
||||||
mod intersection;
|
mod intersection;
|
||||||
mod parking;
|
mod parking;
|
||||||
mod queue;
|
mod queue;
|
||||||
mod walking;
|
mod walking;
|
||||||
|
|
||||||
pub use self::driving::DrivingSimState;
|
|
||||||
pub use self::intersection::IntersectionSimState;
|
|
||||||
pub use self::parking::{ParkingSim, ParkingSimState};
|
|
||||||
pub use self::queue::Queue;
|
|
||||||
pub use self::walking::WalkingSimState;
|
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
mod pandemic;
|
|
||||||
|
|
||||||
use geom::{Duration, Time};
|
use geom::{Duration, Time};
|
||||||
pub use pandemic::{Cmd, PandemicModel};
|
pub use pandemic::{Cmd, PandemicModel};
|
||||||
use rand::Rng;
|
use rand::Rng;
|
||||||
@ -7,6 +5,8 @@ use rand_distr::{Distribution, Exp, Normal};
|
|||||||
use rand_xorshift::XorShiftRng;
|
use rand_xorshift::XorShiftRng;
|
||||||
use std::ops;
|
use std::ops;
|
||||||
|
|
||||||
|
mod pandemic;
|
||||||
|
|
||||||
#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
|
#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
|
||||||
pub struct AnyTime(f64);
|
pub struct AnyTime(f64);
|
||||||
|
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
mod queries;
|
|
||||||
|
|
||||||
pub use self::queries::AgentProperties;
|
pub use self::queries::AgentProperties;
|
||||||
use crate::{
|
use crate::{
|
||||||
AgentID, AlertLocation, Analytics, CapSimState, CarID, Command, CreateCar, DrawCarInput,
|
AgentID, AlertLocation, Analytics, CapSimState, CarID, Command, CreateCar, DrawCarInput,
|
||||||
@ -23,6 +21,8 @@ use serde::{Deserialize, Serialize};
|
|||||||
use std::collections::{BTreeSet, HashSet};
|
use std::collections::{BTreeSet, HashSet};
|
||||||
use std::panic;
|
use std::panic;
|
||||||
|
|
||||||
|
mod queries;
|
||||||
|
|
||||||
// TODO Do something else.
|
// TODO Do something else.
|
||||||
const BLIND_RETRY_TO_SPAWN: Duration = Duration::const_seconds(5.0);
|
const BLIND_RETRY_TO_SPAWN: Duration = Duration::const_seconds(5.0);
|
||||||
|
|
||||||
|
@ -28,33 +28,6 @@
|
|||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate log;
|
extern crate log;
|
||||||
|
|
||||||
mod assets;
|
|
||||||
#[cfg(any(feature = "glow-backend", feature = "wasm-backend"))]
|
|
||||||
mod backend_glow;
|
|
||||||
#[cfg(feature = "glow-backend")]
|
|
||||||
mod backend_glow_native;
|
|
||||||
#[cfg(feature = "wasm-backend")]
|
|
||||||
mod backend_glow_wasm;
|
|
||||||
mod canvas;
|
|
||||||
mod color;
|
|
||||||
mod drawing;
|
|
||||||
mod event;
|
|
||||||
mod event_ctx;
|
|
||||||
mod geom;
|
|
||||||
mod input;
|
|
||||||
mod runner;
|
|
||||||
mod screen_geom;
|
|
||||||
mod style;
|
|
||||||
mod svg;
|
|
||||||
mod text;
|
|
||||||
mod tools;
|
|
||||||
mod widgets;
|
|
||||||
|
|
||||||
mod backend {
|
|
||||||
#[cfg(any(feature = "glow-backend", feature = "wasm-backend"))]
|
|
||||||
pub use crate::backend_glow::*;
|
|
||||||
}
|
|
||||||
|
|
||||||
pub use crate::backend::Drawable;
|
pub use crate::backend::Drawable;
|
||||||
pub use crate::canvas::{Canvas, HorizontalAlignment, VerticalAlignment};
|
pub use crate::canvas::{Canvas, HorizontalAlignment, VerticalAlignment};
|
||||||
pub use crate::color::{Color, Fill, LinearGradient, Texture};
|
pub use crate::color::{Color, Fill, LinearGradient, Texture};
|
||||||
@ -87,6 +60,33 @@ pub use crate::widgets::spinner::Spinner;
|
|||||||
pub(crate) use crate::widgets::text_box::TextBox;
|
pub(crate) use crate::widgets::text_box::TextBox;
|
||||||
pub use crate::widgets::{EdgeInsets, Outcome, Panel, Widget, WidgetImpl, WidgetOutput};
|
pub use crate::widgets::{EdgeInsets, Outcome, Panel, Widget, WidgetImpl, WidgetOutput};
|
||||||
|
|
||||||
|
mod assets;
|
||||||
|
#[cfg(any(feature = "glow-backend", feature = "wasm-backend"))]
|
||||||
|
mod backend_glow;
|
||||||
|
#[cfg(feature = "glow-backend")]
|
||||||
|
mod backend_glow_native;
|
||||||
|
#[cfg(feature = "wasm-backend")]
|
||||||
|
mod backend_glow_wasm;
|
||||||
|
mod canvas;
|
||||||
|
mod color;
|
||||||
|
mod drawing;
|
||||||
|
mod event;
|
||||||
|
mod event_ctx;
|
||||||
|
mod geom;
|
||||||
|
mod input;
|
||||||
|
mod runner;
|
||||||
|
mod screen_geom;
|
||||||
|
mod style;
|
||||||
|
mod svg;
|
||||||
|
mod text;
|
||||||
|
mod tools;
|
||||||
|
mod widgets;
|
||||||
|
|
||||||
|
mod backend {
|
||||||
|
#[cfg(any(feature = "glow-backend", feature = "wasm-backend"))]
|
||||||
|
pub use crate::backend_glow::*;
|
||||||
|
}
|
||||||
|
|
||||||
pub struct Choice<T> {
|
pub struct Choice<T> {
|
||||||
pub label: String,
|
pub label: String,
|
||||||
pub data: T,
|
pub data: T,
|
||||||
|
@ -1,3 +1,18 @@
|
|||||||
|
use crate::widgets::containers::{Container, Nothing};
|
||||||
|
pub use crate::widgets::panel::Panel;
|
||||||
|
use crate::{
|
||||||
|
Button, Choice, Color, DeferDraw, DrawWithTooltips, Drawable, Dropdown, EventCtx, GeomBatch,
|
||||||
|
GfxCtx, JustDraw, Menu, RewriteColor, ScreenDims, ScreenPt, ScreenRectangle, Text, TextBox,
|
||||||
|
};
|
||||||
|
use geom::{Distance, Percent, Polygon};
|
||||||
|
use std::collections::HashSet;
|
||||||
|
use stretch::geometry::{Rect, Size};
|
||||||
|
use stretch::node::{Node, Stretch};
|
||||||
|
use stretch::number::Number;
|
||||||
|
use stretch::style::{
|
||||||
|
AlignItems, Dimension, FlexDirection, FlexWrap, JustifyContent, PositionType, Style,
|
||||||
|
};
|
||||||
|
|
||||||
pub mod autocomplete;
|
pub mod autocomplete;
|
||||||
pub mod button;
|
pub mod button;
|
||||||
pub mod checkbox;
|
pub mod checkbox;
|
||||||
@ -16,21 +31,6 @@ pub mod slider;
|
|||||||
pub mod spinner;
|
pub mod spinner;
|
||||||
pub mod text_box;
|
pub mod text_box;
|
||||||
|
|
||||||
use crate::widgets::containers::{Container, Nothing};
|
|
||||||
pub use crate::widgets::panel::Panel;
|
|
||||||
use crate::{
|
|
||||||
Button, Choice, Color, DeferDraw, DrawWithTooltips, Drawable, Dropdown, EventCtx, GeomBatch,
|
|
||||||
GfxCtx, JustDraw, Menu, RewriteColor, ScreenDims, ScreenPt, ScreenRectangle, Text, TextBox,
|
|
||||||
};
|
|
||||||
use geom::{Distance, Percent, Polygon};
|
|
||||||
use std::collections::HashSet;
|
|
||||||
use stretch::geometry::{Rect, Size};
|
|
||||||
use stretch::node::{Node, Stretch};
|
|
||||||
use stretch::number::Number;
|
|
||||||
use stretch::style::{
|
|
||||||
AlignItems, Dimension, FlexDirection, FlexWrap, JustifyContent, PositionType, Style,
|
|
||||||
};
|
|
||||||
|
|
||||||
/// Create a new widget by implementing this trait. You can instantiate your widget by calling
|
/// Create a new widget by implementing this trait. You can instantiate your widget by calling
|
||||||
/// `Widget::new(Box::new(instance of your new widget))`, which gives you the usual style options.
|
/// `Widget::new(Box::new(instance of your new widget))`, which gives you the usual style options.
|
||||||
pub trait WidgetImpl: downcast_rs::Downcast {
|
pub trait WidgetImpl: downcast_rs::Downcast {
|
||||||
|
Loading…
Reference in New Issue
Block a user