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)
| 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 | """ |
nothing calls this directly
no test coverage detected