Skip to content

Commit

Permalink
Adding dataclasses for manual journey level configs
Browse files Browse the repository at this point in the history
  • Loading branch information
vivverma9 committed Jul 12, 2024
1 parent 47ee90d commit 2ccf92d
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion tm2py/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -1143,7 +1143,6 @@ class TransitVehicleConfig(ConfigItem):
@dataclass(frozen=True)
class TransitClassConfig(ConfigItem):
"""Transit demand class definition."""

skim_set_id: str
name: str
description: str
Expand All @@ -1152,6 +1151,21 @@ class TransitClassConfig(ConfigItem):
required_mode_combo: Optional[Tuple[str, ...]] = Field(default=None)


@dataclass(frozen=True)
class ManualJourneyLevelsConfig(ConfigItem):
"""Manual Journey Level Specification"""
level_id: int
group_fare_systems: Tuple[int, ...]


@dataclass(frozen=True)
class TransitJourneyLevelsConfig(ConfigItem):
"""Transit manual journey levels structure."""
use_algorithm: bool = Field(default = True)
specify_manually: bool = Field(default = False)
manual: Tuple[ManualJourneyLevelsConfig, ...] = Field(default = None)


@dataclass(frozen=True)
class AssignmentStoppingCriteriaConfig(ConfigItem):
"Assignment stop configuration parameters."
Expand Down Expand Up @@ -1204,12 +1218,14 @@ class CongestedAssnConfig(ConfigItem):
pm_peaking_factor: float = Field(default=1.262)



@dataclass(frozen=True)
class TransitConfig(ConfigItem):
"""Transit assignment parameters."""

modes: Tuple[TransitModeConfig, ...]
classes: Tuple[TransitClassConfig, ...]
journey_levels: TransitJourneyLevelsConfig
apply_msa_demand: bool
value_of_time: float
walk_speed: float
Expand Down

0 comments on commit 2ccf92d

Please sign in to comment.