11import os
2+
3+ import orca
24import pandas as pd
3- import urbansim . sim . simulation as sim
5+
46from activitysim import activitysim as asim
57from .util .mandatory_tour_frequency import process_mandatory_tours
68
1012"""
1113
1214
13- @sim .injectable ()
15+ @orca .injectable ()
1416def mandatory_tour_frequency_spec (configs_dir ):
1517 f = os .path .join (configs_dir , 'configs' , "mandatory_tour_frequency.csv" )
1618 return asim .read_model_spec (f ).fillna (0 )
1719
1820
19- @sim . model ()
21+ @orca . step ()
2022def mandatory_tour_frequency (set_random_seed ,
2123 persons_merged ,
2224 mandatory_tour_frequency_spec ):
@@ -36,7 +38,7 @@ def mandatory_tour_frequency(set_random_seed,
3638 index = choices .index ).reindex (persons_merged .local .index )
3739
3840 print "Choices:\n " , choices .value_counts ()
39- sim .add_column ("persons" , "mandatory_tour_frequency" , choices )
41+ orca .add_column ("persons" , "mandatory_tour_frequency" , choices )
4042
4143
4244"""
@@ -46,7 +48,7 @@ def mandatory_tour_frequency(set_random_seed,
4648"""
4749
4850
49- @sim .table ()
51+ @orca .table ()
5052def mandatory_tours (persons ):
5153 persons = persons .to_frame (columns = ["mandatory_tour_frequency" ,
5254 "is_worker" ])
@@ -55,7 +57,7 @@ def mandatory_tours(persons):
5557
5658
5759# broadcast mandatory_tours on to persons using the person_id foreign key
58- sim .broadcast ('persons' , 'mandatory_tours' ,
59- cast_index = True , onto_on = 'person_id' )
60- sim .broadcast ('persons_merged' , 'mandatory_tours' ,
61- cast_index = True , onto_on = 'person_id' )
60+ orca .broadcast ('persons' , 'mandatory_tours' ,
61+ cast_index = True , onto_on = 'person_id' )
62+ orca .broadcast ('persons_merged' , 'mandatory_tours' ,
63+ cast_index = True , onto_on = 'person_id' )
0 commit comments