Esempio n. 1
0
    def __init__(self, turnflowintervals):
        # print 'AddOdWizzard',odintervals#,odintervals.times_start
        # print ' ',dir(odintervals)
        edges = turnflowintervals.get_edges()
        self._init_objman('turnflowimporter', parent=turnflowintervals,
                          name='Turnflow Wizzard',
                          info='Wizzard to add origin zone to destination zone demand informations.',
                          )
        attrsman = self.set_attrsman(cm.Attrsman(self))

        attrsman.add(am.AttrConf('t_start', 0,
                                 groupnames=['state'],
                                 perm='rw',
                                 name='Start time',
                                 unit='s',
                                 info='Start time of interval',
                                 ))

        attrsman.add(am.AttrConf('t_end', 3600,
                                 groupnames=['state'],
                                 perm='rw',
                                 name='End time',
                                 unit='s',
                                 info='End time of interval',
                                 ))

        # here we ged classes not vehicle type
        # specific vehicle type within a class will be generated later
        attrsman.add(am.AttrConf('id_mode',   MODES['private'],
                                 groupnames=['state'],
                                 choices=MODES,
                                 name='ID mode',
                                 info='ID of transport mode.',
                                 ))
Esempio n. 2
0
    def add_odoptions_common(self, odintervals):
        self.add(am.AttrConf('t_start', 0,
                             groupnames=['options'],
                             perm='rw',
                             name='Start time',
                             unit='s',
                             info='Start time of interval',
                             ))

        self.add(am.AttrConf('t_end', 3600,
                             groupnames=['options'],
                             perm='rw',
                             name='End time',
                             unit='s',
                             info='End time of interval',
                             ))

        # here we ged classes not vehicle type
        # specific vehicle type within a class will be generated later
        self.add(am.AttrConf('id_mode',   MODES['passenger'],
                             groupnames=['options'],
                             choices=odintervals.parent.vtypes.get_modechoices(),
                             name='Mode',
                             info='Transport mode.',
                             ))

        self.add(cm.AttrConf('scale', 1.0,
                             groupnames=['options'],
                             perm='rw',
                             name='Scale',
                             info='Scale demand by this factor before adding. Value od 1.0 means no scaling.'
                             ))
Esempio n. 3
0
    def add_options_common(self, turnflows=None):
        self.add(am.AttrConf('t_start', 0,
                             groupnames=['options'],
                             perm='rw',
                             name='Start time',
                             unit='s',
                             info='Start time of interval',
                             ))

        self.add(am.AttrConf('t_end', 3600,
                             groupnames=['options'],
                             perm='rw',
                             name='End time',
                             unit='s',
                             info='End time of interval',
                             ))

        if turnflows is not None:
            modechoices = turnflows.parent.vtypes.get_modechoices()
            id_mode = modechoices.get('passenger', 0)
        else:
            modechoices = {'': -1}
            id_mode = -1

        # here we ged classes not vehicle type
        # specific vehicle type within a class will be generated later
        self.add(am.AttrConf('id_mode',  id_mode,
                             groupnames=['options'],
                             choices=modechoices,
                             name='Mode',
                             info='Transport mode.',
                             ))
Esempio n. 4
0
    def __init__(self, turnflows, rootname=None, rootdirpath=None, tffilepath=None,
                 logger=None, **kwargs):

        self._init_common('turnflowimporter', name='Turnflow Importer',
                          parent=turnflows,
                          logger=logger,
                          info='Reads and imports turnflow data from different file formates.',
                          )

        self._edges = turnflows.get_edges()
        self._net = self._edges.get_parent()

        if rootname is None:
            rootname = self._net.parent.get_rootfilename()

        if rootdirpath is None:
            if self._net.parent is not None:
                rootdirpath = self._net.parent.get_workdirpath()
            else:
                rootdirpath = os.getcwd()

        if tffilepath is None:
            tffilepath = os.path.join(rootdirpath, rootname+'.net.xml')

        attrsman = self.get_attrsman()

        self.t_start = attrsman.add(am.AttrConf('t_start', 0,
                                                groupnames=['options'],
                                                perm='rw',
                                                name='Start time',
                                                unit='s',
                                                info='Start time of interval',
                                                ))

        self.t_end = attrsman.add(am.AttrConf('t_end', 3600,
                                              groupnames=['options'],
                                              perm='rw',
                                              name='End time',
                                              unit='s',
                                              info='End time of interval',
                                              ))

        # here we get currently available vehicle classes not vehicle type
        # specific vehicle type within a class will be generated later
        self.id_mode = attrsman.add(am.AttrConf('id_mode', MODES['passenger'],
                                                groupnames=['options'],
                                                choices=turnflows.parent.vtypes.get_modechoices(),
                                                name='ID mode',
                                                info='ID of transport mode.',
                                                ))

        self.tffilepath = attrsman.add(am.AttrConf('tffilepath', tffilepath,
                                                   groupnames=['options'],  # this will make it show up in the dialog
                                                   perm='rw',
                                                   name='Turnflow file',
                                                   wildcards="Turnflows CSV files (*.csv)|*.csv|CSV files (*.txt)|*.txt|All files (*.*)|*.*",
                                                   metatype='filepath',
                                                   info='CSV file with turnflow information for the specific mode and time interval.',
                                                   ))
Esempio n. 5
0
    def __init__(self, ident='flowsimporter', flows=None,
                 name='Flows Importer',
                 info='Reads and imports flow measurements from detectors.',
                 filepath='', logger=None, **kwargs):
        demand = flows.parent.parent

        self._init_common(ident, name=name,
                          parent=flows,
                          logger=logger,
                          info=info,
                          )

        attrsman = self.get_attrsman()

        self.t_start = attrsman.add(am.AttrConf('t_start', 0,
                                                groupnames=['options'],
                                                perm='rw',
                                                name='Start time',
                                                unit='s',
                                                info='Start reading detector data at this time.',
                                                ))

        self.t_end = attrsman.add(am.AttrConf('t_end', 24*3600,
                                              groupnames=['options'],
                                              perm='rw',
                                              name='End time',
                                              unit='s',
                                              info='Stop reading detector data at this time.',
                                              ))

        self.t_offset = attrsman.add(am.AttrConf('t_offset', 0,
                                                 groupnames=['options'],
                                                 perm='rw',
                                                 name='Time offset',
                                                 unit='s',
                                                 info='Time offset added to the time of the measurement values prior to the verification of the time window.',
                                                 ))

        # here we get currently available vehicle classes not vehicle type
        # specific vehicle type within a class will be generated later
        self.id_mode = attrsman.add(am.AttrConf('id_mode', MODES['passenger'],
                                                groupnames=['options'],
                                                choices=demand.vtypes.get_modechoices(),
                                                name='ID mode',
                                                info='ID of transport mode.',
                                                ))

        self.filepath = attrsman.add(am.AttrConf('filepath', filepath,
                                                 groupnames=['options'],  # this will make it show up in the dialog
                                                 perm='rw',
                                                 name='Flow file',
                                                 wildcards="Flow CSV files (*.csv)|*.csv|CSV files (*.txt)|*.txt|All files (*.*)|*.*",
                                                 metatype='filepath',
                                                 info='CSV file with flow measurements from detectors for the specific mode and time interval.',
                                                 ))
Esempio n. 6
0
    def __init__(self, odintervals):
        # print 'AddOdWizzard',odintervals#,odintervals.times_start
        # print ' ',dir(odintervals)
        zones = odintervals.get_zones()

        self._init_objman('odm_adder', parent=odintervals,
                          name='ODM Wizzard',
                          info='Wizzard to add origin zone to destination zone demand informations.',
                          )

        self.add(am.AttrConf('t_start', 0,
                             groupnames=['state'],
                             perm='rw',
                             name='Start time',
                             unit='s',
                             info='Start time of interval',
                             ))

        self.add(am.AttrConf('t_end', 3600,
                             groupnames=['state'],
                             perm='rw',
                             name='End time',
                             unit='s',
                             info='End time of interval',
                             ))

        # here we ged classes not vehicle type
        # specific vehicle type within a class will be generated later
        self.add(am.AttrConf('id_mode',   MODES['passenger'],
                             groupnames=['state'],
                             choices=odintervals.parent.vtypes.get_modechoices(),
                             name='ID mode',
                             info='ID of transport mode.',
                             ))

        self.add(cm.AttrConf('scale', 1.0,
                             groupnames=['options'],
                             perm='rw',
                             name='Scale',
                             info='Scale demand by this factor before adding. Value od 1.0 means no scaling.'
                             ))

        self.add_col(am.ArrayConf('names_orig', '',
                                  dtype='object',
                                  groupnames=['state'],
                                  choices=list(zones.ids_sumo.get_value()),
                                  name='Orig zone',
                                  info='Name of traffic assignment zone of origin of trip.',
                                  ))

        self.add_col(am.ArrayConf('names_dest', '',
                                  dtype='object',
                                  groupnames=['state'],
                                  choices=list(zones.ids_sumo.get_value()),
                                  name='Dest zone',
                                  info='Name of traffic assignment zone of destination of trip.',
                                  ))

        self.add_col(am.ArrayConf('tripnumbers', 0,
                                  groupnames=['state'],
                                  perm='rw',
                                  name='Trips',
                                  info='Number of trips from zone with ID Orig to zone with ID Dest.',
                                  xmltag='tripnumber',
                                  ))

        self.add(cm.FuncConf('func_make_row', 'on_add_row', None,
                             groupnames=['rowfunctions', '_private'],
                             name='New row',
                             info='Add a new row.',
                             ))

        self.add(cm.FuncConf('func_delete_row', 'on_del_row', None,
                             groupnames=['rowfunctions', '_private'],
                             name='Del row',
                             info='Delete a row.',
                             ))
Esempio n. 7
0
    def __init__(self, odintervals, logger=None, **kwargs):

        self._init_common(
            'odtripgenerator',
            name='OD Trip generator',
            parent=odintervals,
            logger=logger,
            info='Generates trips from OD flows.',
        )

        self.init_cml(' ')  # pass  no commad to generate options only

        attrsman = self.get_attrsman()

        self.is_clear_trips = attrsman.add(
            am.AttrConf(
                'is_clear_trips',
                True,
                groupnames=['options'],
                perm='rw',
                name='Clear trips',
                info=
                'Clear all trips in current trips database before routing.',
            ))

        self.is_refresh_zoneedges = attrsman.add(
            am.AttrConf(
                'is_refresh_zoneedges',
                True,
                groupnames=['options'],
                perm='rw',
                name='Refresh zone edges',
                info=
                """Identify all edges in all zones before generating the trips. 
                                              Dependent on the  will take some time.""",
            ))

        self.is_make_route = attrsman.add(
            am.AttrConf(
                'is_make_route',
                True,
                groupnames=['options'],
                perm='rw',
                name='Make also routes',
                info=
                """Perform also a shortes distance routing between edge of origin and edge of destination.""",
            ))

        self.n_trials_connect = attrsman.add(
            am.AttrConf(
                'n_trials_connect',
                5,
                groupnames=['options'],
                perm='rw',
                name='Connect trials',
                info="""Number of triels to connect randomly chosen  
                                              origin- and destination edges with valid routes.""",
            ))

        modechoices = odintervals.parent.parent.net.modes.names.get_indexmap()
        modechoices['No fallback'] = -1
        # print '  modechoices',modechoices
        self.id_mode_fallback = attrsman.add(
            am.AttrConf(
                'id_mode_fallback',
                modechoices['No fallback'],
                groupnames=['options'],
                choices=modechoices,
                name='Fallback Mode',
                info="""Transport mode to be used instead of "passenger" mode
                                         in case the origin and destination cannot be connected by a route. 
                                         This is typically the case with origins or destinations 
                                         in traffic restricted zones. 
                                         Coose for example "taxi" to get access to traffic restricted Zones.
                                         """,
            ))

        # priority_max.get_value()) & (edges.speeds_max[ids_edge] < self.speed_max.get_value()))
        self.priority_max = attrsman.add(
            cm.AttrConf(
                'priority_max',
                8,
                groupnames=['options'],
                name='Max. edge priority',
                perm='rw',
                info=
                "Maximum edge priority for which edges in a zone are considered departure or arrival edges.",
            ))

        self.speed_max = attrsman.add(
            cm.AttrConf(
                'speed_max',
                14.0,
                groupnames=['options'],
                name='Max. edge speed',
                perm='rw',
                unit='m/s',
                info=
                "Maximum edge speed for which edges in a zone are considered departure or arrival edges.",
            ))

        self.n_edges_min_length = attrsman.add(
            cm.AttrConf(
                'n_edges_min_length',
                1,
                groupnames=['options'],
                name='Min. edge number length prob.',
                perm='rw',
                info=
                "Edge arrival/departure probability is proportional to the edge length if the number of zone edges is above this minimum number zone edges. Otherwise probability is proportional to the number of zone edges.",
            ))

        self.n_edges_max_length = attrsman.add(
            cm.AttrConf(
                'n_edges_max_length',
                500,
                groupnames=['options'],
                name='Max. edge number length prob.',
                perm='rw',
                info=
                "Edge arrival/departure probability is proportional to the edge length if the number of zone edges is below this maximum number zone edges. Otherwise probability is proportional to the number of zone edges.",
            ))

        self.add_posoptions()
        self.add_laneoptions()
        self.add_speedoptions()
Esempio n. 8
0
    def __init__(self, detectorflows, logger=None, **kwargs):

        self._init_common('detectorflowrouter', name='Detectorflow Router',
                          parent=detectorflows,
                          logger=logger,
                          info='Generates routes from measured flows at detectors using the DFrouter.',
                          )

        self.init_cml('dfrouter')  # pass  no commad to generate options only

        attrsman = self.get_attrsman()

        self.add_option('timestep', kwargs.get('timestep', 3600),
                        groupnames=['options', 'processing'],
                        cml='--time-step',
                        name='Time step',
                        info='Expected distance between two successive data sets.',
                        untit='s',
                        )

        self.add_option('is_respect_concurrent_inflows', kwargs.get('is_respect_concurrent_inflows', False),
                        groupnames=['options', 'processing'],
                        cml='--respect-concurrent-inflows',
                        name='Respect concurrent inflows',
                        info='Try to determine further inflows to an inbetween detector when computing split probabilities.',
                        #is_enabled = lambda self: self.width_sublanes > 0,
                        )

        self.add_option('is_routes_for_all', kwargs.get('is_routes_for_all', False),
                        groupnames=['options', 'processing'],
                        cml='--routes-for-all',
                        name='Routes for inbetween detectors',
                        info='Forces DFROUTER to compute routes for in-between detectors.',
                        #is_enabled = lambda self: self.width_sublanes > 0,
                        )

        # self.add_option('is_guess_empty_flows', kwargs.get('is_guess_empty_flows',False),
        #                groupnames = ['processing'],#
        #                cml = '--guess-empty-flows',
        #                name = 'Guess empty flows',
        #                info = 'Derive missing flow values from upstream or downstream (not working!)',
        #                #is_enabled = lambda self: self.width_sublanes > 0,
        #                )

        # self.add_option('is_ignore_invalid_detectors', kwargs.get('is_ignore_invalid_detectors',False),
        #                groupnames = ['processing',],#
        #                cml = '--ignore-invalid-detectors',
        #                name = 'Ignore invalid detectors',
        #                info = 'Only warn about unparseable detectors.',
        #                #is_enabled = lambda self: self.width_sublanes > 0,
        #                )

        self.add_option('is_keep_unfinished_routes', kwargs.get('is_keep_unfinished_routes', False),
                        groupnames=['options', 'processing'],
                        cml='--keep-unfinished-routes',
                        name='Keep unfinished routes',
                        info='Keeps routes even if they have exhausted max-search-depth.',
                        #is_enabled = lambda self: self.width_sublanes > 0,
                        )

        self.add_option('is_keep_longer_routes', kwargs.get('is_keep_longer_routes', False),
                        groupnames=['options', 'processing'],
                        cml='--keep-longer-routes',
                        name='Keep longer routes',
                        info='eeps routes even if a shorter one exists.',
                        #is_enabled = lambda self: self.width_sublanes > 0,
                        )

        self.add_option('n_max_search_depth', kwargs.get('n_max_search_depth', 30),
                        groupnames=['options', 'processing'],
                        cml='--max-search-depth',
                        name='Max. search depth',
                        info='Number of edges to follow a route without passing a detector.',
                        #is_enabled = lambda self: self.width_sublanes > 0,
                        )

        self.add_option('is_keep_turnarounds', kwargs.get('is_keep_turnarounds', False),
                        groupnames=['options', 'processing'],
                        cml='--keep-turnarounds',
                        name='keep turnarounds',
                        info='Allow turnarounds as route continuations.',
                        #is_enabled = lambda self: self.width_sublanes > 0,
                        )

        self.add_option('length_min_route', kwargs.get('length_min_route', 500.0),
                        groupnames=['options', 'processing'],
                        cml='--min-route-length',
                        name='Min route length',
                        info='Minimum distance in meters between start and end node of every route.',
                        unit='m',
                        #is_enabled = lambda self: self.width_sublanes > 0,
                        )

        self.add_option('is_randomize_flows', kwargs.get('is_randomize_flows', False),
                        groupnames=['options', 'processing'],
                        cml='--randomize-flows',
                        name='Randomize flows',
                        info='Generate random departure times for emitted vehicles.',
                        #is_enabled = lambda self: self.width_sublanes > 0,
                        )

        self.add_option('c_flows', kwargs.get('c_flows', 1.0),
                        groupnames=['options', 'processing'],
                        cml='--scale',
                        name='Flow scale factor',
                        info='Scale factor for flows.',
                        #is_enabled = lambda self: self.width_sublanes > 0,
                        )

        self.add_option('c_time', kwargs.get('c_time', 1.0),
                        groupnames=['options', 'processing'],
                        cml='--time-factor',
                        name='Time factor',
                        info='Multiply flow times with TIME to get seconds.',
                        #is_enabled = lambda self: self.width_sublanes > 0,
                        )

        self.add_option('time_offset', kwargs.get('time_offset', 0),
                        groupnames=['options', 'processing'],
                        cml='--time-offset',
                        name='Time offset',
                        info='Multiply flow times with TIME to get seconds.',
                        #is_enabled = lambda self: self.width_sublanes > 0,
                        )

        self.add_option('seed', 1234,
                        groupnames=['options', 'processing'],
                        cml='--seed',
                        name='Random seed',
                        info='Initialises the random number generator with the given value.',
                        )

        self.is_export_network = attrsman.add(am.AttrConf('is_export_network', True,
                                                          groupnames=['options', ],
                                                          perm='rw',
                                                          name='Export network',
                                                          info='Export network before routing.',
                                                          ))

        self.is_clear_trips = attrsman.add(am.AttrConf('is_clear_trips', True,
                                                       groupnames=['options'],
                                                       perm='rw',
                                                       name='Clear trips',
                                                       info='Clear all trips in current trips database before routing.',
                                                       ))
    def __init__(self,  mapmatching, logger=None, **kwargs):
        print 'EccTracesImporter.__init__', mapmatching.get_ident()
        self._init_common('traceimporter',
                          parent=mapmatching,
                          name='ECC Trace Importer',
                          logger=logger,
                          info='Import workouts and GPS points of a European cycling challange.',
                          )

        attrsman = self.set_attrsman(cm.Attrsman(self))

        scenario = mapmatching.get_scenario()
        rootfilepath = scenario.get_rootfilepath()

        # here we ged classes not vehicle type
        # specific vehicle type within a class will be generated later
        modechoices = scenario.net.modes.names.get_indexmap()

        # print '  modechoices',modechoices
        self.id_mode = attrsman.add(am.AttrConf('id_mode',  modechoices['bicycle'],
                                                groupnames=['options'],
                                                choices=modechoices,
                                                name='Mode',
                                                info='Transport mode to be matched.',
                                                ))

        self.workoutsfilepath = attrsman.add(
            cm.AttrConf('workoutsfilepath', kwargs.get('workoutsfilepath', rootfilepath+'.workouts.csv'),
                        groupnames=['options'],
                        perm='rw',
                        name='Workout file',
                        wildcards='CSV file (*.csv)|*.csv',
                        metatype='filepath',
                        info="""CSV text file with workout database.""",
                        ))

        self.pointsfilepath = attrsman.add(cm.AttrConf('pointsfilepath', kwargs.get('pointsfilepath', rootfilepath+'.points.csv'),
                                                       groupnames=['options'],
                                                       perm='rw',
                                                       name='Points file',
                                                       wildcards='CSV file (*.csv)|*.csv',
                                                       metatype='filepath',
                                                       info="CSV text file with GPS point database.",
                                                       ))

        self.year = attrsman.add(cm.AttrConf('year', kwargs.get('year', 2014),
                                             groupnames=['options'],
                                             choices={'2014': 2014, 'from 2015': 2015},
                                             perm='rw',
                                             name='Year of challange',
                                             info='Year of challange is used to identify the correct database format.',
                                             ))

        self.dist_trip_min = attrsman.add(cm.AttrConf('dist_trip_min', kwargs.get('dist_trip_min', 100.0),
                                                      groupnames=['options'],
                                                      perm='rw',
                                                      name='Min. trip distance',
                                                      unit='m',
                                                      info='Minimum distance of one trip. Shorter trips will not be imported.',
                                                      ))

        self.duration_trip_min = attrsman.add(cm.AttrConf('duration_trip_min', kwargs.get('duration_trip_min', 30.0),
                                                          groupnames=['options'],
                                                          perm='rw',
                                                          name='Min. trip duration',
                                                          unit='s',
                                                          info='Minimum duration of one trip. Trips with shorter duration will not be imported.',
                                                          ))

        self.speed_trip_min = attrsman.add(cm.AttrConf('speed_trip_min', kwargs.get('speed_trip_min', 3.0),
                                                       groupnames=['options'],
                                                       perm='rw',
                                                       name='Min. av. trip speed',
                                                       unit='m/s',
                                                       info='Minimum average trip speed. Trips with lower average speed will not be imported.',
                                                       ))

        self.speed_trip_max = attrsman.add(cm.AttrConf('speed_trip_max', kwargs.get('speed_trip_max', 50.0),
                                                       groupnames=['options'],
                                                       perm='rw',
                                                       name='Max. av. trip speed',
                                                       unit='m/s',
                                                       info='Maximum average trip speed. Trips with higher average speed will not be imported.',
                                                       ))

        self.sep_column_workout = attrsman.add(cm.AttrConf('sep_column_workout', kwargs.get('sep_column_workout', ','),
                                                           groupnames=['options'],
                                                           perm='rw',
                                                           name='Workoutdata seperator',
                                                           info='Workout column seperator of CSV file',
                                                           ))

        self.sep_column_points = attrsman.add(cm.AttrConf('sep_column_points', kwargs.get('sep_column_points', ','),
                                                          groupnames=['options'],
                                                          perm='rw',
                                                          name='Point data seperator',
                                                          info='Pointdata column seperator of CSV file',
                                                          ))
Esempio n. 10
0
    def __init__(self, turnflows, logger=None, **kwargs):

        self._init_common(
            'turnflowrouter',
            name='Turnflow Router',
            parent=turnflows,
            logger=logger,
            info=
            'Generates routes from turnflow database using the JTR router.',
        )

        self.init_cml(' ')  # pass  no commad to generate options only

        attrsman = self.get_attrsman()

        self.add_option(
            'turnratio_defaults',
            '30,50,20',
            groupnames=['options'],  # 
            cml='--turn-defaults',
            name='Default turn ratios',
            info=
            'Default turn definition. Comma separated string means: "percent right, percent straight, percent left".',
        )

        self.add_option(
            'max-edges-factor',
            2.0,
            groupnames=['options'],  # 
            cml='--max-edges-factor',
            name='Maximum edge factor',
            info=
            'Routes are cut off when the route edges to net edges ratio is larger than this factor.',
        )

        self.add_option(
            'is_internal_links',
            False,
            groupnames=['options'],  # 
            cml='--no-internal-links',
            name='Disable internal links',
            info='Disable (junction) internal links.',
        )

        self.add_option(
            'is_randomize_flows',
            True,
            groupnames=['options'],  # 
            cml='--randomize-flows',
            name='Randomize flows',
            info='generate random departure times for flow input.',
        )

        self.add_option(
            'is_ignore_vclasses',
            False,
            groupnames=['options'],  # 
            cml='--ignore-vclasses',
            name='Ignore mode restrictions',
            info='Ignore mode restrictions of network edges.',
        )

        self.add_option(
            'is_remove_loops',
            True,
            groupnames=['options'],  # 
            cml='--remove-loops',
            name='Remove loops',
            info=
            'emove loops within the route; Remove turnarounds at start and end of the route.',
        )

        self.add_option(
            'is_remove_loops',
            True,
            groupnames=['options'],  # 
            cml='--remove-loops',
            name='Remove loops',
            info=
            'Remove loops within the route; Remove turnarounds at start and end of the route.',
        )

        self.add_option(
            'is_weights_interpolate',
            True,
            groupnames=['options'],  # 
            cml='--weights.interpolate',
            name='Interpolate edge weights',
            info='Interpolate edge weights at interval boundaries.',
        )

        self.add_option(
            'weights_minor_penalty',
            1.5,
            groupnames=['options'],  # 
            cml='--weights.minor-penalty',
            name='Minor link panelty',
            info=
            'Apply the given time penalty when computing routing costs for minor-link internal lanes.',
        )

        self.add_option(
            'n_routing_threads',
            1,
            groupnames=['options'],  # 
            cml='--routing-threads',
            name='Number of parallel threads',
            info='The number of parallel execution threads used for routing.',
        )
        self.add_option(
            'seed',
            1,
            groupnames=['options'],  # 
            cml='--seed',
            name='Random seed',
            info=
            'Initialises the random number generator with the given value.',
        )

        self.add_option(
            'is_repair',
            True,
            groupnames=['options'],  # 
            cml='--repair',
            name='Repair routes',
            info='Tries to correct a false route.',
        )

        self.add_option(
            'is_ignore_errors',
            True,
            groupnames=['options'],  # 
            cml='--ignore-errors',
            name='Ignore errors',
            info="""Continue routing, even if errors occur. 
                        This option is recommended to avoid abortion if no sink zones are.""",
        )

        self.is_export_network = attrsman.add(
            am.AttrConf(
                'is_export_network',
                True,
                groupnames=['options'],
                perm='rw',
                name='Export network',
                info='Export network before routing.',
            ))

        self.is_clear_trips = attrsman.add(
            am.AttrConf(
                'is_clear_trips',
                True,
                groupnames=['options'],
                perm='rw',
                name='Clear trips',
                info=
                'Clear all trips in current trips database before routing.',
            ))

        self.add_posoptions()
        self.add_laneoptions()
        self.add_speedoptions()
    def add_odoptions_common(self, modes=None, activitytypes=None):
        # print 'add_odoptions_common',modes
        self.add(
            am.AttrConf(
                't_start',
                0,
                groupnames=['options'],
                perm='rw',
                name='Start time',
                unit='s',
                info='Start time of interval',
            ))

        self.add(
            am.AttrConf(
                't_end',
                3600,
                groupnames=['options'],
                perm='rw',
                name='End time',
                unit='s',
                info='End time of interval',
            ))

        # here we ged classes not vehicle type
        # specific vehicle type within a class will be generated later
        if modes is None:
            modechoices = {'': -1}
        else:
            modechoices = modes.names.get_indexmap()
        # print '  modechoices',modechoices
        self.add(
            am.AttrConf(
                'id_mode',
                -1,
                groupnames=['options'],
                choices=modechoices,
                name='Mode',
                info='Transport mode.',
            ))

        self.add(
            cm.AttrConf(
                'scale',
                1.0,
                groupnames=['options'],
                perm='rw',
                name='Scale',
                info=
                'Scale demand by this factor before adding. Value od 1.0 means no scaling.'
            ))

        if activitytypes is None:
            activitytypechoices = {'': -1}
            id_act_orig = -1
            id_act_dest = -1
        else:
            activitytypechoices = activitytypes.names.get_indexmap()
            id_act_orig = activitytypes.names.get_id_from_index('home')
            id_act_dest = activitytypes.names.get_id_from_index('work')

        self.add(
            cm.AttrConf(
                'id_activitytype_orig',
                id_act_orig,
                groupnames=['options'],
                choices=activitytypechoices,
                perm='rw',
                name='Activity at orig.',
                info='Activity type at origin.',
            ))

        self.add(
            cm.AttrConf(
                'id_activitytype_dest',
                id_act_dest,
                groupnames=['options'],
                choices=activitytypechoices,
                perm='rw',
                name='Activity at dest.',
                info='Activity type at destination.',
            ))