MCPcopy Create free account
hub / github.com/OpenDriveLab/TCP / __init__

Method __init__

scenario_runner/metrics_manager.py:37–58  ·  view source on GitHub ↗

Initialization of the metrics manager. This creates the client, needed to parse the information from the recorder, extract the metrics class, and runs it

(self, args)

Source from the content-addressed store, hash-verified

35 """
36
37 def __init__(self, args):
38 """
39 Initialization of the metrics manager. This creates the client, needed to parse
40 the information from the recorder, extract the metrics class, and runs it
41 """
42 self._args = args
43
44 # Parse the arguments
45 recorder_str = self._get_recorder(self._args.log)
46 criteria_dict = self._get_criteria(self._args.criteria)
47
48 # Get the correct world and load it
49 map_name = self._get_recorder_map(recorder_str)
50 world = self._client.load_world(map_name)
51 town_map = world.get_map()
52
53 # Instanciate the MetricsLog, used to querry the needed information
54 log = MetricsLog(recorder_str)
55
56 # Read and run the metric class
57 metric_class = self._get_metric_class(self._args.metric)
58 metric_class(town_map, log, criteria_dict)
59
60 def _get_recorder(self, log):
61 """

Callers

nothing calls this directly

Calls 6

_get_recorderMethod · 0.95
_get_criteriaMethod · 0.95
_get_recorder_mapMethod · 0.95
_get_metric_classMethod · 0.95
MetricsLogClass · 0.90
get_mapMethod · 0.80

Tested by

no test coverage detected