message: Fix find_benchmark_config
diff: @@ -30,6 +30,12 @@ class BenchmarkConfig:
  self.scenario_idx = scenario_idx
  self.scenario_set_name = scenario_set_name
  + def __eq__(self, other):
  + return self.config_idx == other.config_idx
  +
  + def __hash__(self):
  + return self.config_idx
  +
  def get_info_string_list(self):
  info_strings = ["ConfigIdx: {}".format(self.config_idx),
  "Behavior: {}".format(self.behavior_name),
  @@ -69,8 +75,13 @@ class BenchmarkResult:
  @staticmethod
  def find_benchmark_config(benchmark_configs, config_idx):
  - BenchmarkResult._sort_bench_confs(benchmark_configs)
  - bench_conf = benchmark_configs[config_idx]
  + # BenchmarkResult._sort_bench_confs(benchmark_configs)
  + b_conf_list = list(filter(lambda x: x.config_idx == config_idx, benchmark_configs))
  + bench_conf = None
  + if len(b_conf_list) == 0:
  + logging.error("Benchmark config {} not found!".format(config_idx))
  + else:
  + bench_conf = list(b_conf_list)[0]
  assert (bench_conf.config_idx == config_idx)
  return bench_conf
  @@ -118,7 +129,7 @@ class BenchmarkRunner:
  self.exceptions_caught = []
  self.log_eval_avg_every = log_eval_avg_every
  self.logger = logging.getLogger(logger_name or "BenchmarkRunner")
  - self.logger.setLevel(logging.DEBUG)
  + self.logger.setLevel(logging.INFO)
  def _create_configurations(self, num_scenarios=None):
  benchmark_configs = []
  @@ -158,6 +169,9 @@ class BenchmarkRunner:
  def run_benchmark_config(self, config_idx, **kwargs):
  for idx, bmark_conf in enumerate(self.benchmark_configs):
  if bmark_conf.config_idx == config_idx:
  + self.logger.info("Running config idx {}/{}: Scenario {} of set \"{}\" for behavior \"{}\"".format(
  + idx, len(self.benchmark_configs) - 1, bmark_conf.scenario_idx,
  + bmark_conf.scenario_set_name, bmark_conf.behavior_name))
  return self._run_benchmark_config(copy.deepcopy(bmark_conf), **kwargs)
  self.logger.error("Config idx {} not found in benchmark configs. Skipping...".format(config_idx))
  return
  