Пример #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)
Пример #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]])
Пример #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)
Пример #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)
Пример #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)
Пример #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)
Пример #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)
Пример #9
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)
Пример #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)
Пример #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)
Пример #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)
Пример #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)
Пример #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)
Пример #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)
Пример #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)
Пример #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)
Пример #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)
Пример #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)
Пример #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)
Пример #22
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)
Пример #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)
Пример #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)
Пример #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)
Пример #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)
Пример #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)
Пример #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)
Пример #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)