Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Java is required in order to create bicycle logsums, run the taxi/TNC routing mo

As noted above, the user needs to install UV on the workstation they intend to install ABM3 on. UV is utilized to create a Python3-based environment required to run ActivitySim and other model components.

To install UV and create asim_140 environment using UV for all users on a server:
To install UV and create asim_151 environment using UV for all users on a server:

- Create the following directories

Expand Down Expand Up @@ -96,23 +96,23 @@ To install UV and create asim_140 environment using UV for all users on a server

- Run the following commands (one at a time):

`mkdir asim_140 `
`mkdir asim_151 `

`cd asim_140 `
`cd asim_151 `

`echo 3.10 > .python-version `

`uv init `

- Open asim_140/pyproject.toml and edit the requires-python setting to:
- Open asim_151/pyproject.toml and edit the requires-python setting to:

`requires-python = ">=3.10, <3.11"`

- Back in command prompt (at C:\uv_env\asim_140), run one final command
- Back in command prompt (at C:\uv_env\asim_151), run one final command

`uv add -r requirements.txt `

- The requirements.txt will have to be saved under asim_140 or you will have to point to wherever it is saved
- The requirements.txt will have to be saved under asim_151 or you will have to point to wherever it is saved

- The requirements.txt is on the GitHub repo at: [requirements.txt](https://github.com/SANDAG/ABM/blob/main/src/asim/scripts/requirements.txt)

Expand All @@ -128,9 +128,9 @@ To install UV and create asim_140 environment using UV for all users on a server

- Under Environment Variables > System variables (requires Admin)

- Create a new variable called ***activate_uv_asim*** and set to the path of asim_140’s activate file
- Create a new variable called ***activate_uv_asim_151*** and set to the path of asim_151’s activate file

- E.g., C:\uv_env\asim_140\\.venv\Scripts\activate
- E.g., C:\uv_env\asim_151\\.venv\Scripts\activate

#### Azure Environment Variables

Expand Down
2 changes: 1 addition & 1 deletion src/asim-cvm/extensions/cvm_route_stops.py
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ def _route_stop_location(
eligibility_term
]

maz_choices = choose_MAZ_for_TAZ(state, taz_sample, MAZ_size_terms, trace_label)
maz_choices = choose_MAZ_for_TAZ(state, taz_sample, MAZ_size_terms, model_settings, trace_label)

assert DEST_MAZ in maz_choices
maz_choices = maz_choices.rename(columns={DEST_MAZ: alt_dest_col_name})
Expand Down
11 changes: 8 additions & 3 deletions src/asim-cvm/extensions/cvm_terminal_choice.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import numpy as np
import pandas as pd

from activitysim.abm.models.util import annotate, tour_destination
from activitysim.abm.models.util import tour_destination
from activitysim.core import (
estimation,
expressions,
Expand Down Expand Up @@ -469,7 +469,7 @@ def route_endpoint(
eligibility_term
]

maz_choices = choose_MAZ_for_TAZ(state, taz_sample, MAZ_size_terms, trace_label)
maz_choices = choose_MAZ_for_TAZ(state, taz_sample, MAZ_size_terms, model_settings, trace_label)

assert DEST_MAZ in maz_choices
maz_choices = maz_choices.rename(columns={DEST_MAZ: alt_dest_col_name})
Expand Down Expand Up @@ -498,7 +498,12 @@ def route_endpoint(
state.add_table("routes", routes)

if model_settings.annotate_routes:
annotate.annotate_tours(state, model_settings, trace_label)
expressions.assign_columns(
state,
df=routes,
model_settings=model_settings.annotate_routes,
trace_label=tracing.extend_trace_label(trace_label, "annotate_routes"),
)


@workflow.step
Expand Down
9 changes: 7 additions & 2 deletions src/asim-cvm/extensions/cvm_terminal_choice_tnc.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import numpy as np
import pandas as pd

from activitysim.abm.models.util import annotate, tour_destination
from activitysim.abm.models.util import tour_destination
from activitysim.core.interaction_sample import interaction_sample
from activitysim.core import (
estimation,
Expand Down Expand Up @@ -306,7 +306,12 @@ def route_endpoint_tnc(
state.add_table("routes", routes)

if model_settings.annotate_routes:
annotate.annotate_tours(state, model_settings, trace_label)
expressions.assign_columns(
state,
df=routes,
model_settings=model_settings.annotate_routes,
trace_label=tracing.extend_trace_label(trace_label, "annotate_routes"),
)


@workflow.step
Expand Down
80 changes: 1 addition & 79 deletions src/asim/configs/crossborder/estimation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,82 +27,4 @@ survey_tables:
index_col: tour_id
trips:
file_name: trips_survey.csv
index_col: trip_id

estimation_table_recipes:

interaction_sample_simulate:
omnibus_tables:
choosers_combined:
- choices
- override_choices
- choosers
alternatives_combined:
- interaction_sample_alternatives
- interaction_expression_values
omnibus_tables_append_columns: [choosers_combined]

interaction_simulate:
omnibus_tables:
choosers_combined:
- choices
- override_choices
- choosers
omnibus_tables_append_columns: [choosers_combined]

simple_simulate:
omnibus_tables:
values_combined:
- choices
- override_choices
- expression_values
- choosers
omnibus_tables_append_columns: [values_combined]

cdap_simulate:
omnibus_tables:
values_combined:
- choices
- override_choices
- choosers
omnibus_tables_append_columns: [values_combined]

simple_probabilistic:
omnibus_tables:
values_combined:
- choices
- override_choices
- choosers
- probs
omnibus_tables_append_columns: [values_combined]


model_estimation_table_types:
tour_scheduling_probabilistic: simple_probabilistic
tour_od_choice: interaction_sample_simulate
school_location: interaction_sample_simulate
workplace_location: interaction_sample_simulate
auto_ownership: simple_simulate
free_parking: simple_simulate
cdap: cdap_simulate
mandatory_tour_frequency: simple_simulate
mandatory_tour_scheduling_work: interaction_sample_simulate
mandatory_tour_scheduling_school: interaction_sample_simulate
joint_tour_frequency: simple_simulate
joint_tour_composition: simple_simulate
joint_tour_participation: simple_simulate
joint_tour_destination: interaction_sample_simulate
joint_tour_scheduling: interaction_sample_simulate
non_mandatory_tour_frequency: interaction_simulate
non_mandatory_tour_destination: interaction_sample_simulate
non_mandatory_tour_scheduling: interaction_sample_simulate
tour_mode_choice: simple_simulate
atwork_subtour_frequency: simple_simulate
atwork_subtour_destination: interaction_sample_simulate
atwork_subtour_scheduling: interaction_sample_simulate
atwork_subtour_mode_choice: simple_simulate
stop_frequency: simple_simulate
trip_purpose: simple_probabilistic
trip_destination: interaction_sample_simulate
trip_scheduling: simple_probabilistic
trip_mode_choice: simple_simulate
index_col: trip_id
80 changes: 1 addition & 79 deletions src/asim/configs/visitor/estimation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,82 +27,4 @@ survey_tables:
index_col: tour_id
trips:
file_name: trips_survey.csv
index_col: trip_id

estimation_table_recipes:

interaction_sample_simulate:
omnibus_tables:
choosers_combined:
- choices
- override_choices
- choosers
alternatives_combined:
- interaction_sample_alternatives
- interaction_expression_values
omnibus_tables_append_columns: [choosers_combined]

interaction_simulate:
omnibus_tables:
choosers_combined:
- choices
- override_choices
- choosers
omnibus_tables_append_columns: [choosers_combined]

simple_simulate:
omnibus_tables:
values_combined:
- choices
- override_choices
- expression_values
- choosers
omnibus_tables_append_columns: [values_combined]

cdap_simulate:
omnibus_tables:
values_combined:
- choices
- override_choices
- choosers
omnibus_tables_append_columns: [values_combined]

simple_probabilistic:
omnibus_tables:
values_combined:
- choices
- override_choices
- choosers
- probs
omnibus_tables_append_columns: [values_combined]


model_estimation_table_types:
tour_scheduling_probabilistic: simple_probabilistic
tour_od_choice: interaction_sample_simulate
school_location: interaction_sample_simulate
workplace_location: interaction_sample_simulate
auto_ownership: simple_simulate
free_parking: simple_simulate
cdap: cdap_simulate
mandatory_tour_frequency: simple_simulate
mandatory_tour_scheduling_work: interaction_sample_simulate
mandatory_tour_scheduling_school: interaction_sample_simulate
joint_tour_frequency: simple_simulate
joint_tour_composition: simple_simulate
joint_tour_participation: simple_simulate
joint_tour_destination: interaction_sample_simulate
joint_tour_scheduling: interaction_sample_simulate
non_mandatory_tour_frequency: interaction_simulate
non_mandatory_tour_destination: interaction_sample_simulate
non_mandatory_tour_scheduling: interaction_sample_simulate
tour_mode_choice: simple_simulate
atwork_subtour_frequency: simple_simulate
atwork_subtour_destination: interaction_sample_simulate
atwork_subtour_scheduling: interaction_sample_simulate
atwork_subtour_mode_choice: simple_simulate
stop_frequency: simple_simulate
trip_purpose: simple_probabilistic
trip_destination: interaction_sample_simulate
trip_scheduling: simple_probabilistic
trip_mode_choice: simple_simulate
index_col: trip_id
2 changes: 1 addition & 1 deletion src/asim/scripts/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,4 @@ xmle
wring
zarr>=2,<3
zstandard
activitysim==1.4.0
activitysim==1.5.1
2 changes: 1 addition & 1 deletion src/main/resources/DataExporter.bat
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ call bin\CTRampEnv.bat
set JAR_LOCATION=%PROJECT_DIRECTORY%/application

rem ### Call environment
CALL %activate_uv_asim%
CALL %activate_uv_asim_151%

%PROJECT_DRIVE%
cd %PROJECT_DRIVE%%PROJECT_DIRECTORY%
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/RunViz.bat
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ set PROJECT_DRIVE=%1
set PROJECT_DIRECTORY=%2

ECHO Activate ActivitySim....
CALL %activate_uv_asim%
CALL %activate_uv_asim_151%

cd /d %PROJECT_DIRECTORY%

Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/convertSkimsToOMXZ.cmd
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
set PROJECT_DRIVE=%1
set PROJECT_DIRECTORY=%2

CALL %activate_uv_asim%
CALL %activate_uv_asim_151%

%PROJECT_DRIVE%
cd /d %PROJECT_DIRECTORY%
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/cvm.bat
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set PROJECT_DIRECTORY=%2
set SCENARIO_YEAR_WITH_SUFFIX=%3

ECHO Activate ActivitySim for CVM...
CALL %activate_uv_asim%
CALL %activate_uv_asim_151%

set MKL_NUM_THREADS=1
set MKL=1
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/cvmEst.bat
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set PROJECT_DIRECTORY=%2
set luz_data_file=%3

ECHO Activate ActivitySim for CVM...
CALL %activate_uv_asim%
CALL %activate_uv_asim_151%

set MKL_NUM_THREADS=1
set MKL=1
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/export_hwy_shape.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ set PROJECT_DIRECTORY=%2
%PROJECT_DRIVE%
cd /d %PROJECT_DIRECTORY%

ECHO Activate asim_140....
CALL %activate_uv_asim%
ECHO Activate asim_151....
CALL %activate_uv_asim_151%

set MKL_NUM_THREADS=1
set MKL=1
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/htm.bat
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ set scenario_year=%6
set scenario_year_with_suffix=%7

ECHO Activate ActivitySim for CVM...
CALL %activate_uv_asim%
CALL %activate_uv_asim_151%

set MKL_NUM_THREADS=1
set MKL=1
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/manage_skim_mem.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ set PROJECT_DIRECTORY=%2
%PROJECT_DRIVE%
cd /d %PROJECT_DIRECTORY%

ECHO Activate asim_140....
CALL %activate_uv_asim%
ECHO Activate asim_151....
CALL %activate_uv_asim_151%

set MKL_NUM_THREADS=1
set MKL=1
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/runSandagAbm_2zoneSkim.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ cd /d %PROJECT_DIRECTORY%

:: ---------------------------------------------------------------------
ECHO Activate ActivitySim Environment....
CALL %activate_uv_asim%
CALL %activate_uv_asim_151%

:: Run skimming
python src/main/python/2zoneSkim.py %PROJECT_DIRECTORY% || exit /b 2
Expand Down
Loading