Example #1
0
def cdap_indiv_spec(configs_dir):
    """
    spec to compute the activity utilities for each individual hh member
    with no interactions with other household members taken into account
    """

    f = os.path.join(configs_dir, 'cdap_indiv_and_hhsize1.csv')
    return asim.read_model_spec(f).fillna(0)
Example #2
0
def test_read_model_spec(spec_name, desc_name, expr_name):
    spec = asim.read_model_spec(
        spec_name, description_name=desc_name, expression_name=expr_name)

    assert len(spec) == 4
    assert spec.index.name == 'expression'
    assert list(spec.columns) == ['alt0', 'alt1']
    npt.assert_array_equal(
        spec.as_matrix(),
        [[1.1, 11], [2.2, 22], [3.3, 33], [4.4, 44]])
Example #3
0
def cdap_fixed_relative_proportions(configs_dir):
    """
    spec to compute/specify the relative proportions of each activity (M, N, H)
    that should be used to choose activities for additional household members
    not handled by CDAP

    This spec is handled much like an activitysim logit utility spec,
    EXCEPT that the values computed are relative proportions, not utilities
    (i.e. values are not exponentiated before being normalized to probabilities summing to 1.0)
    """
    f = os.path.join(configs_dir, 'cdap_fixed_relative_proportions.csv')
    return asim.read_model_spec(f).fillna(0)
Example #4
0
def cdap_3_person_spec(configs_dir):
    f = os.path.join(configs_dir, 'configs', "cdap_3_person.csv")
    return asim.read_model_spec(f).fillna(0)
def mandatory_tour_frequency_spec(configs_dir):
    f = os.path.join(configs_dir, 'configs', "mandatory_tour_frequency.csv")
    return asim.read_model_spec(f).fillna(0)
Example #6
0
def mode_choice_spec_df(configs_dir):
    with open(os.path.join(configs_dir, "configs",
                           "tour_mode_choice.csv")) as f:
        return asim.read_model_spec(f)
Example #7
0
def trip_mode_choice_spec_df(configs_dir):
    with open(os.path.join(configs_dir,
                           "configs",
                           "trip_mode_choice.csv")) as f:
        return asim.read_model_spec(f)
Example #8
0
def school_location_spec(configs_dir):
    f = os.path.join(configs_dir, 'configs', "school_location.csv")
    return asim.read_model_spec(f).fillna(0)
def tdd_non_mandatory_spec(configs_dir):
    f = os.path.join(configs_dir, 'configs',
                     'tour_departure_and_duration_nonmandatory.csv')
    return asim.read_model_spec(f).fillna(0)
def non_mandatory_tour_frequency_spec(configs_dir):
    f = os.path.join(configs_dir, 'configs', "non_mandatory_tour_frequency.csv")
    return asim.read_model_spec(f).fillna(0)
Example #11
0
def mode_choice_spec(configs_dir, mode_choice_coefficients):
    f = os.path.join(configs_dir, 'configs', "mode_choice_work.csv")
    df = asim.read_model_spec(f)
    df['work'] = evaluate_expression_list(df['work'],
                                          mode_choice_coefficients.to_dict())
    return df.set_index('Alternative', append=True)
Example #12
0
def auto_ownership_spec(configs_dir):
    f = os.path.join(configs_dir, 'configs', "auto_ownership.csv")
    return asim.read_model_spec(f).fillna(0)
Example #13
0
def pet_spec(configs_dir):
    f = os.path.join(configs_dir, 'configs', "pet_activity.csv")
    return asim.read_model_spec(f).fillna(0)
Example #14
0
def cdap_final_rules(configs_dir):
    f = os.path.join(configs_dir, 'configs', "cdap_final_rules.csv")
    return asim.read_model_spec(f).fillna(0)
Example #15
0
def trip_mode_choice_spec_df(configs_dir):
    with open(os.path.join(configs_dir, 'trip_mode_choice.csv')) as f:
        return asim.read_model_spec(f)
Example #16
0
def auto_ownership_spec(configs_dir):
    f = os.path.join(configs_dir, 'configs', "auto_ownership.csv")
    return asim.read_model_spec(f).fillna(0)
Example #17
0
def tdd_school_spec(configs_dir):
    f = os.path.join(configs_dir, 'configs',
                     'tour_departure_and_duration_school.csv')
    return asim.read_model_spec(f).fillna(0)
Example #18
0
def tdd_school_spec(configs_dir):
    f = os.path.join(configs_dir, 'configs',
                     'tour_departure_and_duration_school.csv')
    return asim.read_model_spec(f).fillna(0)
Example #19
0
def school_location_spec(configs_dir):
    f = os.path.join(configs_dir, 'configs', "school_location.csv")
    return asim.read_model_spec(f).fillna(0)
Example #20
0
def cdap_all_people(configs_dir):
    f = os.path.join(configs_dir, 'configs', "cdap_all_people.csv")
    return asim.read_model_spec(f).fillna(0)
Example #21
0
def destination_choice_spec(configs_dir):
    f = os.path.join(configs_dir, 'configs', 'destination_choice.csv')
    return asim.read_model_spec(f).fillna(0)
def workplace_location_spec(configs_dir):
    f = os.path.join(configs_dir, 'configs', "workplace_location.csv")
    return asim.read_model_spec(f).fillna(0)
Example #23
0
def cdap_3_person_spec(configs_dir):
    f = os.path.join(configs_dir, "configs", "cdap_3_person.csv")
    return asim.read_model_spec(f).fillna(0)
Example #24
0
def workplace_location_spec(configs_dir):
    f = os.path.join(configs_dir, 'configs', "workplace_location.csv")
    return asim.read_model_spec(f).fillna(0)
Example #25
0
def cdap_final_rules(configs_dir):
    f = os.path.join(configs_dir, "configs", "cdap_final_rules.csv")
    return asim.read_model_spec(f).fillna(0)
Example #26
0
def tdd_non_mandatory_spec(configs_dir):
    f = os.path.join(configs_dir, 'configs',
                     'tour_departure_and_duration_nonmandatory.csv')
    return asim.read_model_spec(f).fillna(0)
Example #27
0
def cdap_all_people(configs_dir):
    f = os.path.join(configs_dir, "configs", "cdap_all_people.csv")
    return asim.read_model_spec(f).fillna(0)
Example #28
0
def destination_choice_spec(configs_dir):
    f = os.path.join(configs_dir, 'destination_choice.csv')
    return asim.read_model_spec(f).fillna(0)
Example #29
0
def spec(spec_name, desc_name, expr_name):
    return asim.read_model_spec(
        spec_name, description_name=desc_name, expression_name=expr_name)