larvaworld.lib.sim.conditions

Functions

get_exp_condition(→ type[ExpCondition] | None)

Get experiment condition class for given experiment type.

Module Contents

larvaworld.lib.sim.conditions.get_exp_condition(exp: str) type[ExpCondition] | None

Get experiment condition class for given experiment type.

Maps experiment type strings to their corresponding condition checker classes for experiment termination logic.

Args:
exp: Experiment type identifier string. Supported values:
  • ‘PItrain_mini’: Preference training (mini version)

  • ‘PItrain’: Full preference training

  • ‘catch_me’: Chase/tag game

  • ‘keep_the_flag’: Flag possession game

  • ‘capture_the_flag’: Flag capture game

Returns:

ExpCondition subclass for the experiment, or None if experiment type is not recognized.

Example:
>>> CondClass = get_exp_condition('PItrain')
>>> if CondClass:
>>>     condition = CondClass(env=exp_env)
>>>     if condition.check():
>>>         print("Experiment complete!")