message: multiprocessing works
diff: @@ -20,12 +20,14 @@ from bark.world.evaluation import *
  from modules.runtime.commons.parameters import ParameterServer
  from bark.models.behavior import BehaviorIDMClassic, BehaviorConstantVelocity
  +# to find database files
  +os.chdir("../benchmark_database/")
  class DatabaseRunnerTests(unittest.TestCase):
  @unittest.skip
  def test_database_runner(self):
  dbs = DatabaseSerializer(test_scenarios=4, test_world_steps=5, num_serialize_scenarios=10)
  - os.chdir("../benchmark_database/")
  + cwd = os.getcwd()
  dbs.process("database")
  local_release_filename = dbs.release(version="test")
  @@ -46,33 +48,9 @@ class DatabaseRunnerTests(unittest.TestCase):
  df = result.get_data_frame()
  print(df)
  self.assertEqual(len(df.index), 20) # 2 Behaviors * 10 Serialize Scenarios
  - @unittest.skip
  - def test_serialization_benchmark_config(self):
  - params = ParameterServer()
  - scenario_generation = ConfigurableScenarioGeneration(num_scenarios=4,params=params)
  - bc = BenchmarkConfig(0, BehaviorConstantVelocity(params),
  - "const", scenario_generation.get_scenario(0), 0, "test1")
  - deserialized_bc = deserialize_benchmark_config(serialize_benchmark_config(bc))
  - self.assertEqual(deserialized_bc.behavior_name, "const")
  - self.assertTrue(isinstance(deserialized_bc.behavior, BehaviorConstantVelocity))
  - @unittest.skip
  - def test_ray_serialization_benchmark_config(self):
  - ray.init(ignore_reinit_error=True)
  - ray.register_custom_serializer(
  - BenchmarkConfig, serializer=serialize_benchmark_config,
  - deserializer=deserialize_benchmark_config)
  - params = ParameterServer()
  - scenario_generation = ConfigurableScenarioGeneration(num_scenarios=4,params=params)
  - bc = BenchmarkConfig(0, BehaviorConstantVelocity(params),
  - "const", scenario_generation.get_scenario(0), 0, "test1")
  - object_id = ray.put(bc)
  - self.assertEqual(ray.get(object_id).behavior_name, "const")
  - self.assertTrue(isinstance(ray.get(object_id).behavior, BehaviorConstantVelocity))
  - ray.shutdown()
  def test_database_multiprocessing_runner(self):
  - dbs = DatabaseSerializer(test_scenarios=4, test_world_steps=5, num_serialize_scenarios=10)
  - os.chdir("../benchmark_database/")
  + dbs = DatabaseSerializer(test_scenarios=4, test_world_steps=5, num_serialize_scenarios=100)
  dbs.process("database")
  local_release_filename = dbs.release(version="test")
  @@ -83,7 +61,6 @@ class DatabaseRunnerTests(unittest.TestCase):
  params = ParameterServer() # only for evaluated agents not passed to scenario!
  behaviors_tested = {"IDM": BehaviorIDMClassic(params), "Const" : BehaviorConstantVelocity(params)}
  -
  benchmark_runner = BenchmarkRunnerMP(benchmark_database=db,
  evaluators=evaluators,
  terminal_when=terminal_when,
  @@ -93,7 +70,7 @@ class DatabaseRunnerTests(unittest.TestCase):
  df = result.get_data_frame()
  print(df)
  - self.assertEqual(len(df.index), 20) # 2 Behaviors * 10 Serialize Scenarios
  + self.assertEqual(len(df.index), 200) # 2 Behaviors * 10 Serialize Scenarios
  if __name__ == '__main__':
  unittest.main()
  