From c2266a7a4b2cb4240b23c921e623e61f3f585fa1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Moulin-Frier?= Date: Thu, 21 Mar 2024 16:46:40 +0100 Subject: [PATCH] This parameter set seems OK --- scripts/run_server.py | 4 ++-- vivarium/controllers/config.py | 6 ++--- vivarium/simulator/grpc_server/converters.py | 24 ++++++++++---------- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/scripts/run_server.py b/scripts/run_server.py index f09b1dc..b340b97 100644 --- a/scripts/run_server.py +++ b/scripts/run_server.py @@ -26,8 +26,8 @@ def parse_args(): parser.add_argument('--to_jit', action='store_false', help='Whether to use JIT compilation') parser.add_argument('--use_fori_loop', action='store_true', help='Whether to use fori loop') parser.add_argument('--log_level', type=str, default='INFO', help='Logging level') - parser.add_argument('--collision_eps', type=float, required=False, default=0.3) - parser.add_argument('--collision_alpha', type=float, required=False, default=0.4) + parser.add_argument('--collision_eps', type=float, required=False, default=0.1) + parser.add_argument('--collision_alpha', type=float, required=False, default=0.5) return parser.parse_args() diff --git a/vivarium/controllers/config.py b/vivarium/controllers/config.py index 3a558bb..5943517 100644 --- a/vivarium/controllers/config.py +++ b/vivarium/controllers/config.py @@ -65,7 +65,7 @@ class ObjectConfig(Config): mass_orientation = param.Number(mass_orientation) diameter = param.Number(5.) color = param.Color('red') - friction = param.Number(10.) + friction = param.Number(0.1) exists = param.Boolean(True) def __init__(self, **params): @@ -83,8 +83,8 @@ class SimulatorConfig(Config): neighbor_radius = param.Number(100., bounds=(0, None)) to_jit = param.Boolean(True) use_fori_loop = param.Boolean(False) - collision_eps = param.Number(0.003) - collision_alpha = param.Number(0.7) + collision_eps = param.Number(0.1) + collision_alpha = param.Number(0.5) def __init__(self, **params): super().__init__(**params) diff --git a/vivarium/simulator/grpc_server/converters.py b/vivarium/simulator/grpc_server/converters.py index 10801fc..11c2683 100644 --- a/vivarium/simulator/grpc_server/converters.py +++ b/vivarium/simulator/grpc_server/converters.py @@ -13,18 +13,18 @@ def proto_to_state(state): def proto_to_simulator_state(simulator_state): - return SimulatorState(idx=proto_to_ndarray(simulator_state.idx), - box_size=proto_to_ndarray(simulator_state.box_size), - n_agents=proto_to_ndarray(simulator_state.n_agents), - n_objects=proto_to_ndarray(simulator_state.n_objects), - num_steps_lax=proto_to_ndarray(simulator_state.num_steps_lax), - dt=proto_to_ndarray(simulator_state.dt), - freq=proto_to_ndarray(simulator_state.freq), - neighbor_radius=proto_to_ndarray(simulator_state.neighbor_radius), - to_jit=proto_to_ndarray(simulator_state.to_jit), - use_fori_loop=proto_to_ndarray(simulator_state.use_fori_loop), - collision_eps=proto_to_ndarray(simulator_state.collision_eps), - collision_alpha=proto_to_ndarray(simulator_state.collision_alpha) + return SimulatorState(idx=proto_to_ndarray(simulator_state.idx).astype(int), + box_size=proto_to_ndarray(simulator_state.box_size).astype(float), + n_agents=proto_to_ndarray(simulator_state.n_agents).astype(int), + n_objects=proto_to_ndarray(simulator_state.n_objects).astype(int), + num_steps_lax=proto_to_ndarray(simulator_state.num_steps_lax).astype(int), + dt=proto_to_ndarray(simulator_state.dt).astype(float), + freq=proto_to_ndarray(simulator_state.freq).astype(float), + neighbor_radius=proto_to_ndarray(simulator_state.neighbor_radius).astype(float), + to_jit=proto_to_ndarray(simulator_state.to_jit).astype(int), + use_fori_loop=proto_to_ndarray(simulator_state.use_fori_loop).astype(int), + collision_eps=proto_to_ndarray(simulator_state.collision_eps).astype(float), + collision_alpha=proto_to_ndarray(simulator_state.collision_alpha).astype(float) )