Skip to content

Commit

Permalink
update cityproto to v2.0.0a5
Browse files Browse the repository at this point in the history
  • Loading branch information
chenchenplus committed Oct 23, 2024
1 parent e7161b6 commit 7fe8bfa
Show file tree
Hide file tree
Showing 4 changed files with 1,891 additions and 1,796 deletions.
3 changes: 2 additions & 1 deletion mosstool/trip/generator/_util/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
__all__ = [
"is_walking",
"gen_profiles",
"recalculate_trip_modes",
"recalculate_trip_mode_prob",
"gen_bus_drivers",
]
Expand Down Expand Up @@ -104,7 +105,7 @@ def gen_profiles(
)
return profiles

def recalculate_trip_modes(profile: dict,trip_modes:List[int])->List[int]:
def recalculate_trip_modes(profile: dict,trip_modes:List)->List:
res_modes = np.array([m for m in trip_modes], dtype=np.uint8)
if (
profile.get("consumption",-1)
Expand Down
2 changes: 1 addition & 1 deletion mosstool/trip/generator/generate_from_od.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def _get_mode_with_distribution(
V_bicycle = -0.1185 * bicycle_duration / 60
V = np.array([V_bus, V_subway, V_fuel, V_elec, V_bicycle])
V = np.exp(V)
_all_trip_modes = recalculate_trip_modes(profile,ALL_TRIP_MODES)
_all_trip_modes = recalculate_trip_modes(profile, ALL_TRIP_MODES)
V = recalculate_trip_mode_prob(profile, V)
V = V / sum(V)
rng = np.random.default_rng(seed)
Expand Down
Loading

0 comments on commit 7fe8bfa

Please sign in to comment.