コード例 #1
0
    def __init__(self, ident, population, publictransport, name='Ride on PT', info='Ride on a single public transport line (no transfers).'):
        self.init_stagetype(ident, population, name=name, info=info)

        self.add_col(am.IdsArrayConf('ids_line', publictransport.ptlines,
                                     groupnames=['state'],
                                     name='ID line',
                                     info='ID of public transport line.',
                                     ))

        self.add_col(am.IdsArrayConf('ids_line', publictransport.stops,
                                     groupnames=['state'],
                                     name='ID line',
                                     info='ID of public transport line.',
                                     ))

        self.add_col(am.IdsArrayConf('ids_stop_from', publictransport.stops,
                                     groupnames=['state'],
                                     name='Dep. station',
                                     info='ID of departure station or bus stop.',
                                     ))

        self.add_col(am.IdsArrayConf('ids_stop_to', stops,
                                     groupnames=['state'],
                                     name='Arr. station',
                                     info='ID of arrival station or bus stop.',
                                     ))
コード例 #2
0
ファイル: turnflows.py プロジェクト: qichaow/sumo
    def _init_attributes(self, edges=None):
        if edges is None:
            # recover edges from already initialized
            edges = self.ids_fromedge.get_linktab()

        if self.get_version() < 0.1:
            # update attrs from previous
            # IdsArrayConf not yet modifiable interactively, despite perm = 'rw',!!!
            self.ids_fromedge.set_perm('rw')
            self.ids_toedge.set_perm('rw')
        if hasattr(self, 'func_delete_row'):
            self.func_make_row._is_returnval = False
            self.func_delete_row._is_returnval = False

        self.add_col(am.IdsArrayConf('ids_fromedge', edges,
                                     groupnames=['state'],
                                     name='Edge ID from',
                                     info='Edge ID where turn starts.',
                                     xmltag='fromEdge',
                                     ))

        self.add_col(am.IdsArrayConf('ids_toedge', edges,
                                     groupnames=['state'],
                                     name='Edge ID to',
                                     info='Edge ID where turn ends.',
                                     xmltag='toEdge',
                                     ))

        self.add_col(am.ArrayConf('flows', 0,
                                  dtype=np.int32,
                                  groupnames=['state'],
                                  perm='rw',
                                  name='Flow',
                                  info='Absolute number of vehicles which pass from "fromedge" to "toedge" during a certain time interval.',
                                  xmltag='number',
                                  ))

        self.add_col(am.ArrayConf('probabilities', 0.0,
                                  dtype=np.float32,
                                  groupnames=['state'],
                                  perm='rw',
                                  name='Probab.',
                                  info='Probability to make a turn between "Edge ID from" and "Edge ID to" and .',
                                  xmltag='probability',
                                  ))

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

        self.add(cm.FuncConf('func_delete_row', 'on_del_row', None,
                             groupnames=['rowfunctions', '_private'],
                             name='Del turns',
                             info='Delete turns.',
                             is_returnval=False,
                             ))
コード例 #3
0
    def __init__(self, ident, population, edges, name='Walks', info='walk from a position on a lane to another position of another lane.'):
        self.init_stagetype(ident, population, name=name, info=info)

        # TODO: this structure needs review: the private vehicle is part of a person, not a stage
        # street parking at home and work could be in stage. Private garage is
        # part of person...
        self.add_col(am.IdsArrayConf('ids_edge_from', edges,
                                     groupnames=['state'],
                                     name='ID Dep. edge',
                                     info='Edge ID at departure of walk.',
                                     ))

        self.add_col(am.IdsArrayConf('ids_edge_to', edges,
                                     groupnames=['state'],
                                     name='ID Arr. edge',
                                     info='Edge ID where walk finishes.',
                                     ))

        self.add_col(am.ArrayConf('positions_from', 0.0,
                                  dtype=np.float32,
                                  #choices = OPTIONMAP_POS_DEPARTURE,
                                  perm='r',
                                  name='Depart pos',
                                  unit='m',
                                  info="Position on edge at the moment of departure.",
                                  xmltag='departPos',
                                  #xmlmap = get_inversemap(OPTIONMAP_POS_ARRIVAL),
                                  ))

        self.add_col(am.ArrayConf('positions_to', 0.0,
                                  dtype=np.float32,
                                  #choices = OPTIONMAP_POS_ARRIVAL,
                                  perm='r',
                                  name='Arrival pos',
                                  unit='m',
                                  info="Position on edge at the moment of arrival.",
                                  xmltag='arrivalPos',
                                  #xmlmap = get_inversemap(OPTIONMAP_POS_ARRIVAL),
                                  ))

        self.add_col(am.ArrayConf('speeds', 0.8,
                                  dtype=np.float32,
                                  #choices = OPTIONMAP_SPEED_ARRIVAL,
                                  perm='r',
                                  name='Walk speed',
                                  unit='m/s',
                                  info='Average walking speed.',
                                  xmltag='speed',
                                  #xmlmap = get_inversemap(OPTIONMAP_SPEED_ARRIVAL),
                                  ))
コード例 #4
0
ファイル: prt-02-alloc.py プロジェクト: bstriner/sumo-1
    def _init_attributes(self):
        #vtypes = self.get_scenario().demand.vtypes
        net = self.get_scenario().net
        self.add(cm.AttrConf('length_default', 4.0,
                             groupnames=['parameters', 'options'],
                             name='Default length',
                             info='Default berth length.',
                             unit='m',
                             ))

        self.add_col(am.IdsArrayConf('ids_prtstop', self.parent,
                                     name='PRT stop ID',
                                     info='PRT stop ID',
                                     ))

        self.add_col(am.ArrayConf('states', default=BERTHSTATES['free'],
                                  dtype=np.int32,
                                  choices=BERTHSTATES,
                                  name='state',
                                  info='State of berth.',
                                  ))

        self.add_col(am.ArrayConf('stoppositions', default=0.0,
                                  dtype=np.float32,
                                  name='Stop position',
                                  info='Position on edge where vehicle stops',
                                  ))
コード例 #5
0
ファイル: prt-02-alloc.py プロジェクト: bstriner/sumo-1
    def _init_attributes(self):
        self.add(cm.ObjConf(PrtBerths('berths', self)))

        berths = self.get_berths()
        net = self.get_scenario().net

        self.add_col(am.IdsArrayConf('ids_ptstop', net.ptstops,
                                     name='ID PT stop',
                                     info='ID of public transport stop. ',
                                     ))

        self.add_col(am.ArrayConf('are_depot', default=False,
                                  dtype='bool',
                                  perm='rw',
                                  name='Is depot?',
                                  info='If true stop is a depot.',
                                  ))

        self.add_col(am.IdlistsArrayConf('ids_berth_alight', berths,
                                         #groupnames = ['_private'],
                                         name='Alight berth IDs',
                                         info="Alight berth IDs.",
                                         ))

        self.add_col(am.IdlistsArrayConf('ids_berth_board', berths,
                                         #groupnames = ['_private'],
                                         name='Board berth IDs',
                                         info="Board berth IDs.",
                                         ))
コード例 #6
0
ファイル: demandbase.py プロジェクト: bstriner/sumo-1
    def __init__(self, ident, parent, modes, **kwargs):

        self._init_objman(ident, parent=parent, name='Mode shares',
                          version=0.0,
                          **kwargs)

        self.add_col(am.IdsArrayConf('ids_mode', modes,
                                     groupnames=['parameters'],
                                     name='Mode ID',
                                     info='Transport Mode ID.',
                                     ))

        self.add_col(am.ArrayConf('shares', '',
                                  dtype=np.float32,
                                  is_index=True,
                                  groupnames=['parameters'],
                                  perm='rw',
                                  name='Share',
                                  info='Mode share.',
                                  ))

        # self.add_col(am.ArrayConf( 'speeds_max', 50.0/3.6,
        #                            dtype = np.float32,
        #                            groupnames = ['parameters'],
        #                            perm='rw',
        #                            name = 'Max. Speed',
        #                            unit = 'm/s',
        #                            info = 'Maximum possible speed for this mode. Speed is used to estimate free flow link travel times, mainly for routig purposes. Note that speeds are usully limited by the lane speed attribute',
        #                            ))
        self._init_attributes()
        self.add_default()
コード例 #7
0
ファイル: turnflows.py プロジェクト: kassenov/sumo
 def __init__(self,ident,parent, modes, edges, **kwargs):
         self._init_objman(  ident,parent=parent,
                             name = 'Mode OD tables',
                             info = 'Contains for each transport mode an OD trip table.',
                             xmltag = ('modesods','modeods','ids_mode'), **kwargs)
         
         print 'TurnflowModes.__init__',modes
         self.add_col(am.IdsArrayConf( 'ids_mode', modes, 
                                         groupnames = ['state'], 
                                         choices = MODES,
                                         name = 'ID mode', 
                                         is_index = True,
                                         #xmltag = 'vClass',
                                         info = 'ID of transport mode.',
                                         ))
         print '  self.ids_mode.is_index',self.ids_mode.is_index()
                                                                                       
         self.add_col(cm.ObjsConf( 'flowtables', 
                                         groupnames = ['state'], 
                                         name = 'Flows', 
                                         info = 'Flow generation per edge for a specific mode.',
                                         ))
         
         self.add_col(cm.ObjsConf( 'turntables', 
                                         groupnames = ['state'], 
                                         name = 'Turns', 
                                         info = 'Turn probabilities between edges for a specific mode.',
                                         ))
                                                                         
         self.add( cm.ObjConf( edges, is_child = False,groups = ['_private']))
コード例 #8
0
ファイル: virtualpop.py プロジェクト: wsgan001/plexe-sumo
    def __init__(self, ident, population, lanes, name='Activities'):
        self.init_stagetype(ident,
                            population,
                            name=name,
                            info='Do some activity  at a position of a lane.')

        # TODO: this structure needs review: the private vehicle is part of a person, not a stage
        # street parking at home and work could be in stage. Private garage is
        # part of person...
        self.add_col(
            am.IdsArrayConf(
                'id_lane',
                lanes,
                groupnames=['state'],
                name='ID lane',
                info='Lane ID at which activity takes place.',
            ))
        self.add_col(
            am.ArrayConf(
                'pos_lane',
                0.0,
                name='Lane pos.',
                unit='m',
                info='Position on Lane on where activity takes place.',
                xml='pos_start',
            ))

        self.add_col(
            am.ArrayConf(
                'activity',
                '',
                dtype=np.object,
                name='Activity',
                info='Type of activity performed during the stop.',
            ))
コード例 #9
0
    def __init__(self,
                 ident,
                 parent,
                 persons,
                 edges,
                 datapathkey='tripdatapath',
                 is_add_default=True,
                 name='Person results',
                 info='Table with simulation results for each person.',
                 **kwargs):

        self._init_objman(
            ident=ident,
            parent=parent,  # main results object
            info=info,
            name=name,
            **kwargs)

        self.add(
            cm.AttrConf(
                'datapathkey',
                datapathkey,
                groupnames=['_private'],
                name='data pathkey',
                info="key of data path",
            ))

        self.add_col(
            am.IdsArrayConf(
                'ids_person',
                persons,
                groupnames=['state'],
                is_index=True,
                name='person ID',
                info='ID of person.',
            ))
        attrinfos = OrderedDict([\
                ('times_travel_total', {'name':'Total travel time',     'unit':'s',     'default':0.0, 'info':'Total travel time, including all trips and waiting times, but excluding activities.','groupnames':['tripdata']}),
                ('times_walk', {'name':'Walking time',     'unit':'s',     'default':0.0, 'info':'Time walking, excluding waiting time.','groupnames':['tripdata']}),
                ('times_ride', {'name':'Riding time',     'unit':'s',     'default':0.0, 'info':'Time riding on a vehicle, excluding waiting time.','groupnames':['tripdata']}),
                ('times_wait', {'name':'Waiting time',     'unit':'s',     'default':0.0, 'info':'Time waiting for a vehicle.','groupnames':['tripdata']}),
                ('times_activity', {'name':'Activity time',     'unit':'s',     'default':0.0, 'info':'Time having some activities.','groupnames':['tripdata']}),
                ('times_depart',    {'name':'Dep. time', 'xmltag':'depart',   'unit':'s',     'default':0.0, 'info':'Time beginning firts trip or activity.','groupnames':['tripdata']}),
                ('times_arrival',   {'name':'Arr. time', 'xmltag':'arrival',   'unit':'s',    'default':0.0, 'info':'Time ending last trip or activity.','groupnames':['tripdata']}),
                ])

        for attrname, kwargs in attrinfos.iteritems():
            self.add_resultattr(attrname, **kwargs)

        # this is a special for route info
        self.add_col(
            am.IdlistsArrayConf(
                'ids_edges',
                edges,
                name='Edge IDs',
                groupnames=['routeinfo'],
                info='List of edge IDs constituting the actually taken route.',
                xmltag='edges',
            ))
コード例 #10
0
ファイル: prt-02-alloc.py プロジェクト: bstriner/sumo-1
 def set_prtvehicles(self, prtvehicles):
     """
     Defines attributes which are linked with prtvehicles
     """
     self.add_col(am.IdsArrayConf('ids_veh_allocated', prtvehicles,
                                  name='Alloc. veh ID',
                                  info='ID of  vehicle which have allocated this berth. -1 means no allocation.',
                                  ))
コード例 #11
0
    def _init_attributes(self, edges=None):
        if edges is None:
            # recover edges from already initialized
            edges = self.ids_edge.get_linktab()

        if self.get_version() < 0.1:
            # update attrs from previous
            # IdsArrayConf not yet modifiable interactively, despite perm = 'rw',!!!
            self.ids_edge.set_perm('rw')
        if hasattr(self, 'func_delete_row'):
            self.func_make_row._is_returnval = False
            self.func_delete_row._is_returnval = False

        self.add_col(
            am.IdsArrayConf(
                'ids_edge',
                edges,
                groupnames=['state'],
                name='Edge ID',
                perm='rw',
                info='Edge ID of flow.',
                xmltag='from',
            ))

        self.add_col(
            am.ArrayConf(
                'flows',
                0,
                dtype=np.int32,
                groupnames=['state'],
                perm='rw',
                name='Flow',
                info=
                'Absolute number of vehicles which start on the given edge during a certain time interval.',
                xmltag='number',
            ))

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

        self.add(
            cm.FuncConf(
                'func_delete_row',
                'on_del_row',
                None,
                groupnames=['rowfunctions', '_private'],
                name='Del flow',
                info='Delete flow.',
                is_returnval=False,
            ))
コード例 #12
0
    def _init_attributes(self):
        """
        Detector;Time;qPKW;qLKW;vPKW;vLKW
        myDet1;0;10;2;100;80
        ... further entries ...

        This means the first time has to name the entries (columns). Their order is not of importance, but at least the following columns must be included:

            Detector: A string holding the id of the detector this line describes; should be one of the ids used in <DETECTOR_FILE>
            Time: The time period begin that this entry describes (in minutes)
            qPKW: The number of passenger cars that drove over the detector within this time period
            vPKW: The average speed of passenger cars that drove over the detector within this time period in km/h

        The following columns may optionally be included:

            qLKW: The number of transport vehicles that drove over the detector within this time period
            vLKW: The average speed of transport vehicles that drove over the detector within this time period in km/h
        """

        self.add_col(am.IdsArrayConf('ids_detector', self.parent.detectors,
                                     name='ID Detector',
                                     info='Detector ID which measured this flow.',
                                     ))

        self.add_col(am.ArrayConf('timeperiods', 0.0,
                                  perm='rw',
                                  name='Time period',
                                  unit='s',
                                  info='Time period of flow measurement.',
                                  ))
        self.add_col(am.ArrayConf('flows_passenger', 0.0,
                                  perm='rw',
                                  name='Passenger car flow',
                                  info='Number of passenger cars detected during the corrisponding time period.',
                                  ))

        self.add_col(am.ArrayConf('flows_heavyduty', 0.0,
                                  perm='rw',
                                  name='Heavy duty vehicle flow',
                                  info='Number of heavy duty vehicles detected during the corrisponding time period.',
                                  ))

        self.add_col(am.ArrayConf('speeds_passenger', 0.0,
                                  perm='rw',
                                  name='Passenger car speed',
                                  unit='m/s',
                                  info='Average velocity of passenger cars, detected during the corrisponding time period.',
                                  ))

        self.add_col(am.ArrayConf('speeds_heavyduty', 0.0,
                                  perm='rw',
                                  name='Heavy duty vehicle speed',
                                  unit='m/s',
                                  info='Average velocity of heavy duty vehicles, detected during the corrisponding time period.',
                                  ))
コード例 #13
0
    def __init__(self, ident, polulation, vtypes, edges, parking, **kwargs):
        print 'IndividualVehicles vtype id_default', vtypes.ids_sumo.get_id_from_index('passenger1')
        self._init_objman(ident=ident,
                          parent=polulation,
                          name='Indiv. Veh.',
                          info='Individual vehicle database. These are privately owned vehicles.',
                          **kwargs)

        self.add_col(am.IdsArrayConf('ids_vtype', vtypes,
                                     id_default=vtypes.ids_sumo.get_id_from_index(
                                         'passenger1'),
                                     groupnames=['state'],
                                     name='Veh. type',
                                     info='Vehicle type.',
                                     #xmltag = 'type',
                                     ))

        self.add_col(am.IdsArrayConf('ids_person', polulation,
                                     groupnames=['state'],
                                     name='ID person',
                                     info='ID of person who ownes the vehicle.',
                                     ))

        self.add_col(am.IdlistsArrayConf('routes', edges,
                                         groupnames=['_private'],
                                         name='Route',
                                         info="The vehicle's route as a sequence of edge ids.",
                                         ))

        self.add_col(am.IdlistsArrayConf('ids_parkings', parking,
                                         groupnames=['state'],
                                         name='Parking',
                                         info='Sequence of parking IDs, this will cause the vehicle to stop successively at these parkings.',
                                         ))

        self.add_col(am.ArrayConf('times_exec', 0.0,
                                  name='Exec time',
                                  info='Total route execution time from simulation run of last plan.',
                                  unit='s',
                                  ))

        parking.link_vehiclefleet(self)
コード例 #14
0
ファイル: virtualpop.py プロジェクト: wsgan001/plexe-sumo
    def __init__(self, polulation, **kwargs):
        """Plans database."""
        self._init_objman(
            ident='plans',
            parent=polulation,
            name='Plans',
            info='Mobility plan for virtual polulation.',
            #xmltag = ('plans','plan',None),
            **kwargs)

        self.add_col(
            am.IdsArrayConf(
                'ids_person',
                polulation,
                groupnames=['state'],
                name='Person ID',
                info='Person ID to who this plan belongs to.',
            ))

        self.add_col(
            am.ArrayConf(
                'probabilities',
                1.0,
                name='Probability',
                info='Plan execution probability.',
            ))

        self.add_col(
            am.ArrayConf(
                'times_est',
                0.0,
                name='Estim. time',
                info='Estimated time to execute plan.',
                unit='s',
            ))

        self.add_col(
            am.ArrayConf(
                'times_exec',
                0.0,
                name='Exec time',
                info='Last plan execution time from simulation run.',
                unit='s',
            ))

        self.add_col(
            am.TabIdListArrayConf(
                'stagelists',
                name='Stages',
                info='Sequence of stages of this plan.',
            ))
コード例 #15
0
    def __init__(self, ident, population, parking, name='Auto rides', info='Rides with privately owned vehicle.'):
        self.init_stagetype(ident, population, name=name, info=info)

        # TODO: this structure needs review: the private vehicle is part of a person, not a stage
        # street parking at home and work could be in stage. Private garage is
        # part of person...
        self.add_col(am.IdsArrayConf('ids_veh', population.get_individualvehicles(),
                                     groupnames=['state'],
                                     name='ID vehicle',
                                     info='ID of private vehicle.',
                                     ))

        #self._vehicles_individual = vehicles_individual
        self.add_col(am.IdsArrayConf('ids_parking_from', parking,
                                     groupnames=['state'],
                                     name='ID dep. parking',
                                     info='Parking ID at the departure of the ride starts.',
                                     ))
        self.add_col(am.IdsArrayConf('ids_parking_to', parking,
                                     groupnames=['state'],
                                     name='ID arr. parking',
                                     info='Parking ID  at the arrival of the ride.',
                                     ))
コード例 #16
0
ファイル: results.py プロジェクト: kassenov/sumo
 def __init__(self, parent, edges, is_add_default=True, **kwargs):
     
     self._init_objman(  ident='edgeresults', 
                         parent = parent, # main results object
                         name = 'Edge results', 
                         info = 'Table with simulation results for each network edge.', 
                         #xmltag = ('vtypes','vtype','ids_sumo'),
                         **kwargs)
     
     self.add_col(am.IdsArrayConf( 'ids_edge', edges, 
                                         groupnames = ['state'], 
                                         is_index = True,
                                         name = 'ID edge', 
                                         info = 'ID of edge.',
                                         ))
     
     
     
     attrinfos = OrderedDict([\
             ('entered',  {'name':'Entered',      'unit':None,    'default':0, 'info':'Entered number of vehicles','xmltag':'entered','groupnames':['edgedata']}),
             ('left',     {'name':'Left',         'unit':None,    'default':0, 'info':'Left number of vehicles','xmltag':'left','groupnames':['edgedata']}),
             ('arrived',  {'name':'Arrived',      'unit':None,    'default':0, 'info':'Arrived number of vehicles','xmltag':'arrived','groupnames':['edgedata']}),
             ('departed', {'name':'Departed',     'unit':None,    'default':0, 'info':'Departed number of vehicles','xmltag':'departed','groupnames':['edgedata']}),
             ('traveltime',{'name':'Av. times',   'unit':'s',     'default':0.0, 'info':'Av. Travel times','xmltag':'traveltime','groupnames':['edgedata'], 'is_average' : True}),
             ('density',  {'name':'Av. Densities','unit':'veh/km','default':0.0, 'info':'Av. Density in vehicles of vehicles on this Edge/Lane','xmltag':'density','groupnames':['edgedata'], 'is_average' : True}),
             ('waitingTime',{'name':'Av. waits',  'unit':'s',     'default':0.0, 'info':'Av. Waiting times of vehicles on this Edge/Lane','xmltag':'waitingTime','groupnames':['edgedata'], 'is_average' : True}),
             ('speed',    {'name':'Av. speeds',   'unit':'m/s',   'default':0.0, 'info':'Av. velocity of vehicles on this Edge/Lane','xmltag':'speed','groupnames':['edgedata'], 'is_average' : True}),
             ('fuel_abs', {'name':'Abs. Fuel',    'unit':'ml',    'default':0.0, 'info':'Absolute fuel consumption of vehicles on this Edge/Lane','xmltag':'fuel_abs','groupnames':['edgeemissions']}),
             ('CO_abs',   {'name':'Abs. CO',      'unit':'mg',    'default':0.0, 'info':'Absolute CO emission of vehicles on this Edge/Lane','xmltag':'CO_abs','groupnames':['edgeemissions']}),
             ('CO2_abs',  {'name':'Abs. CO2',     'unit':'mg',    'default':0.0, 'info':'Absolute CO2 emission of vehicles on this Edge/Lane','xmltag':'CO2_abs','groupnames':['edgeemissions']}),
             ('NOx_abs',  {'name':'Abs. NOx',     'unit':'mg',    'default':0.0, 'info':'Absolute NOx emission of vehicles on this Edge/Lane','xmltag':'NOx_abs','groupnames':['edgeemissions']}),
             ('PMx_abs',  {'name':'Abs. PMx',     'unit':'mg',    'default':0.0, 'info':'Absolute PMx  emission (Particle matter, all sizes) of vehicles on this Edge/Lane','xmltag':'PMx_abs','groupnames':['edgeemissions']}),
             ('fuel_normed',{'name':'Specific fuel',       'unit':'l/km/h','default':0.0, 'info':'Absolute fuel consumption of vehicles on this Edge/Lane','xmltag':'fuel_normed','groupnames':['edgeemissions'], 'is_average' : True}),
             ('CO_normed',{'name':'Specific CO',           'unit':'g/km/h','default':0.0, 'info':'Normalized CO emission of vehicles on this Edge/Lane','xmltag':'CO_normed','groupnames':['edgeemissions'], 'is_average' : True}),
             ('CO2_normed',{'name':'Specific CO2',         'unit':'g/km/h','default':0.0, 'info':'Normalized CO2 emission of vehicles on this Edge/Lane','xmltag':'CO2_normed','groupnames':['edgeemissions'], 'is_average' : True}),
             ('NOx_normed',{'name':'Specific NOx',         'unit':'g/km/h','default':0.0, 'info':'Normalized NOx emission of vehicles on this Edge/Lane','xmltag':'NOx_normed','groupnames':['edgeemissions'], 'is_average' : True}),
             ('PMx_normed',{'name':'Specific PMx',         'unit':'g/km/h','default':0.0, 'info':'Normalized PMx emission of vehicles on this Edge/Lane','xmltag':'PMx_normed','groupnames':['edgeemissions'], 'is_average' : True}),
             ('fuel_perVeh',{'name':'Fuel per veh.',       'unit':'ml/veh','default':0.0, 'info':'Absolute fuel consumption of vehicles on this Edge/Lane','xmltag':'fuel_perVeh','groupnames':['edgeemissions'], 'is_average' : True}),
             ('CO_perVeh',{'name':'CO per veh.',           'unit':'mg/veh','default':0.0, 'info':'CO emission per vehicle on this Edge/Lane','xmltag':'CO_perVeh','groupnames':['edgeemissions'], 'is_average' : True}),
             ('CO2_perVeh',{'name':'CO2 per veh.',         'unit':'mg/veh','default':0.0, 'info':'CO2 emission per vehicle on this Edge/Lane','xmltag':'CO2_perVeh','groupnames':['edgeemissions'], 'is_average' : True}),
             ('NOx_perVeh',{'name':'NOx per veh.',         'unit':'mg/veh','default':0.0, 'info':'NOx emission per vehicle on this Edge/Lane','xmltag':'NOx_perVeh','groupnames':['edgeemissions'], 'is_average' : True}),
             ('PMx_perVeh',{'name':'PMx per veh.',         'unit':'mg/veh','default':0.0, 'info':'PMx emission per vehicle on this Edge/Lane','xmltag':'PMx_perVeh','groupnames':['edgeemissions'], 'is_average' : True}),
             ('noise',    {'name':'Noise',         'unit':'dB',   'default':0.0, 'info':'Noise of vehicles on this Edge/Lane','xmltag':'noise','groupnames':['edgenoise'], 'is_average' : True}),
             ])
             
     
     for attrname, kwargs in attrinfos.iteritems():
         self.add_resultattr(attrname, **kwargs)
コード例 #17
0
    def __init__(self, parent, edges, is_add_default=True, **kwargs):

        self._init_objman(ident='edgeresults',
                          parent=parent,  # main results object
                          name='Edge results',
                          info='Table with simulation results for each network edge.',
                          #xmltag = ('vtypes','vtype','ids_sumo'),
                          **kwargs)

        self.add_col(am.IdsArrayConf('ids_edge', edges,
                                     groupnames=['state'],
                                     is_index=True,
                                     name='ID edge',
                                     info='ID of edge.',
                                     ))
        self._init_attributes()
コード例 #18
0
    def __init__(self, ident, trips, net, **kwargs):

        self._init_objman(ident=ident,
                          parent=trips,
                          name='Routes',
                          info='Table with route info.',
                          xmltag=('routes', 'route', None),
                          **kwargs)

        #self.add_col(SumoIdsConf('Route', xmltag = 'id'))

        self.add_col(am.IdsArrayConf('ids_trip', trips,
                                     groupnames=['state'],
                                     name='Trip ID',
                                     info='Route for this trip ID.',
                                     ))

        self.add_col(am.IdlistsArrayConf('ids_edges', net.edges,
                                         name='Edge IDs',
                                         info='List of edge IDs constituting the route.',
                                         xmltag='edges',
                                         ))

        self.add_col(am.ArrayConf('costs', 0.0,
                                  dtype=np.float32,
                                  perm='r',
                                  name='Costs',
                                  info="Route costs.",
                                  xmltag='cost',
                                  ))

        self.add_col(am.ArrayConf('probabilities', 1.0,
                                  dtype=np.float32,
                                  perm='r',
                                  name='Probab.',
                                  info="Route route choice probability.",
                                  xmltag='probability',
                                  ))

        self.add_col(am.ArrayConf('colors', np.ones(4, np.float32),
                                  dtype=np.float32,
                                  metatype='color',
                                  perm='rw',
                                  name='Color',
                                  info="Route color. Color as RGBA tuple with values from 0.0 to 1.0",
                                  xmltag='color',
                                  ))
コード例 #19
0
    def __init__(self, parent, trips, edges, is_add_default=True, **kwargs):

        self._init_objman(ident='tripresults',
                          parent=parent,  # main results object
                          name='Trip results',
                          info='Table with simulation results for each trip made.',
                          **kwargs)

        self.add_col(am.IdsArrayConf('ids_trip', trips,
                                     groupnames=['state'],
                                     is_index=True,
                                     name='ID trip',
                                     info='ID of trip.',
                                     ))
        attrinfos = OrderedDict([
            ('duration', {'name': 'Duration', 'xmltag': 'duration',    'unit': 's',
                          'default': 0, 'info': 'Trip duration', 'groupnames': ['tripdata']}),
            ('depart',   {'name': 'Dep. time', 'xmltag': 'depart',   'unit': 's',
                          'default': 0, 'info': 'Departure time', 'groupnames': ['tripdata']}),
            ('arrival',   {'name': 'Arr. time', 'xmltag': 'arrival',   'unit': 's',
                           'default': 0, 'info': 'Departure time', 'groupnames': ['tripdata']}),
            ('departPos',   {'name': 'depart pos', 'xmltag': 'departPos',   'unit': 'm',
                             'default': 0.0, 'info': 'depart position', 'groupnames': ['tripdata']}),
            ('arrivalPos',   {'name': 'arrival pos', 'xmltag': 'arrivalPos',    'unit': 'm',
                              'default': 0.0, 'info': 'arrival position', 'groupnames': ['tripdata']}),
            ('routeLength',   {'name': 'Length', 'xmltag': 'routeLength',    'unit': 'm',
                               'default': 0.0, 'info': 'Route length', 'groupnames': ['tripdata']}),
            ('waitSteps',   {'name': 'wait steps', 'xmltag': 'waitSteps',   'unit': None,    'default': 0,
                             'info': 'Time steps, the vehicle has been waiting during its trip', 'groupnames': ['tripdata']}),
            ('rerouteNo',   {'name': 'reroute No', 'xmltag': 'rerouteNo',   'unit': None,
                             'default': 0, 'info': 'Number of re-routes', 'groupnames': ['tripdata']}),
        ])

        for attrname, kwargs in attrinfos.iteritems():
            self.add_resultattr(attrname, **kwargs)

        # this is special for route info
        self.add_col(am.IdlistsArrayConf('ids_edges', edges,
                                         name='Edge IDs',
                                         groupnames=['routeinfo'],
                                         info='List of edge IDs constituting the actually taken route.',
                                         xmltag='edges',
                                         ))
コード例 #20
0
ファイル: virtualpop.py プロジェクト: wsgan001/plexe-sumo
    def init_stagetype(self, ident, polulation, name='', info="Stage of Plan"):

        self._init_objman(
            ident=ident,
            parent=polulation,
            name=name,
            info=info,
        )

        self.add_col(
            am.IdsArrayConf(
                'ids_plan',
                polulation.get_plans(),
                groupnames=['state'],
                name='ID plan',
                info='ID of plan.',
                xmltag='type',
            ))

        self.add_col(
            am.ArrayConf(
                'times_start',
                -1.0,
                name='Start time',
                unit='s',
                info=
                'Planned or estimated time when this stage starts. Value -1 means unknown.',
            ))

        self.add_col(
            am.ArrayConf(
                'durations',
                -1.0,
                name='Duration',
                unit='s',
                info=
                'Planned or estimated Duration for this stage starts. Value -1 means unknown.',
            ))