api.task_logic¶
- pydantic model aind_behavior_force_foraging.task_logic.ActionUpdater[source]¶
Bases:
BaseModel
- Fields:
- field target_parameter: UpdateTargetParameter = UpdateTargetParameter.PROBABILITY[source]¶
Target parameter
- field updated_by: UpdateTargetParameterBy = UpdateTargetParameterBy.TIME[source]¶
Independent variable
- field updater: NumericalUpdater [Required][source]¶
Updater
- pydantic model aind_behavior_force_foraging.task_logic.AindForceForagingTaskLogic[source]¶
Bases:
AindBehaviorTaskLogicModel
- Config:
extra: str = forbid
validate_assignment: bool = True
validate_defaults: bool = True
strict: bool = True
str_strip_whitespace: bool = True
- Fields:
- Validators:
coerce_version
»version
- field task_parameters: AindForceForagingTaskParameters [Required][source]¶
Parameters of the task logic
- pydantic model aind_behavior_force_foraging.task_logic.AindForceForagingTaskParameters[source]¶
Bases:
TaskParameters
- Config:
extra: str = allow
validate_assignment: bool = True
validate_defaults: bool = True
strict: bool = True
str_strip_whitespace: bool = True
- Fields:
- field environment: Environment [Required][source]¶
Environment settings
- field operation_control: OperationControl = OperationControl(force=ForceOperationControl(press_mode=<PressMode.DOUBLE: 'Double'>, left_index=0, right_index=1, force_lookup_table=None), spout=SpoutOperationControl(default_retracted_position=0, default_extended_position=0, enabled=True))[source]¶
Operation control
- field updaters: Dict[str, NumericalUpdater] [Optional][source]¶
List of numerical updaters
- pydantic model aind_behavior_force_foraging.task_logic.AudioFeedback[source]¶
Bases:
_ContinuousFeedbackBase
- Fields:
- Validators:
- pydantic model aind_behavior_force_foraging.task_logic.Block[source]¶
Bases:
BaseModel
- Fields:
- pydantic model aind_behavior_force_foraging.task_logic.BlockGenerator[source]¶
Bases:
BaseModel
- Fields:
- field block_size: distributions.Distribution = UniformDistribution(family=<DistributionFamily.UNIFORM: 'Uniform'>, distribution_parameters=UniformDistributionParameters(family=<DistributionFamily.UNIFORM: 'Uniform'>, min=50.0, max=60.0), truncation_parameters=None, scaling_parameters=None)[source]¶
Size of the block
- class aind_behavior_force_foraging.task_logic.BlockStatisticsMode(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]¶
Bases:
str
,Enum
Defines the mode of the environment
- pydantic model aind_behavior_force_foraging.task_logic.BrownianRandomWalk[source]¶
Bases:
BaseModel
- Fields:
- field block_size: distributions.Distribution = UniformDistribution(family=<DistributionFamily.UNIFORM: 'Uniform'>, distribution_parameters=UniformDistributionParameters(family=<DistributionFamily.UNIFORM: 'Uniform'>, min=50.0, max=60.0), truncation_parameters=None, scaling_parameters=None)[source]¶
Size of the block
- class aind_behavior_force_foraging.task_logic.ContinuousFeedbackMode(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]¶
Bases:
str
,Enum
Defines the feedback mode
- pydantic model aind_behavior_force_foraging.task_logic.Environment[source]¶
Bases:
BaseModel
- Fields:
- field block_statistics: List[BlockStatistics] [Required][source]¶
Statistics of the environment
- pydantic model aind_behavior_force_foraging.task_logic.ForceLookUpTable[source]¶
Bases:
BaseModel
- Fields:
- Validators:
_validate_bounds
»all fields
- field left_max: float [Required][source]¶
The upper value of Left force used to linearly scale the input coordinate to.
- Validated by:
_validate_bounds
- field left_min: float [Required][source]¶
The lower value of Left force used to linearly scale the input coordinate to.
- Validated by:
_validate_bounds
- field offset: float = 0[source]¶
Offset to add to the look up table value
- Validated by:
_validate_bounds
- field path: str [Required][source]¶
Reference to the look up table image. Should be a 1 channel image. Value = LUT[Left, Right]
- Validated by:
_validate_bounds
- field right_max: float [Required][source]¶
The upper value of Right force used to linearly scale the input coordinate to.
- Validated by:
_validate_bounds
- pydantic model aind_behavior_force_foraging.task_logic.ForceOperationControl[source]¶
Bases:
BaseModel
- Fields:
- Validators:
_validate_press_mode_versus_lut
»all fields
- field force_lookup_table: ForceLookUpTable | None = None[source]¶
Look up table for force projection
- Validated by:
_validate_press_mode_versus_lut
- field left_index: int = 0[source]¶
Index of the left sensor
- Validated by:
_validate_press_mode_versus_lut
- pydantic model aind_behavior_force_foraging.task_logic.HarvestAction[source]¶
Bases:
BaseModel
Defines an abstract class for an harvest action
- Fields:
- Validators:
_validate_thresholds
»all fields
_validate_trial_type
»all fields
- field action: HarvestActionLabel = HarvestActionLabel.NONE[source]¶
Label of the action
- Validated by:
_validate_thresholds
_validate_trial_type
- field action_updaters: List[ActionUpdater] = [][source]¶
List of action updaters. All updaters are called at the start of a new trial.
- Validated by:
_validate_thresholds
_validate_trial_type
- field amount: float = 1[source]¶
Amount of reward to be delivered
- Validated by:
_validate_thresholds
_validate_trial_type
- field continuous_feedback: ContinuousFeedback | None = None[source]¶
Continuous feedback settings
- Validated by:
_validate_thresholds
_validate_trial_type
- field delay: float = 0[source]¶
Delay between successful harvest and reward delivery
- Validated by:
_validate_thresholds
_validate_trial_type
- field force_duration: float = 0.5[source]¶
Duration that the force much stay above threshold
- Validated by:
_validate_thresholds
_validate_trial_type
- field is_operant: bool = True[source]¶
Whether the reward delivery is contingent on licking.
- Validated by:
_validate_thresholds
_validate_trial_type
- field lower_force_threshold: float = 5000[source]¶
Lower bound of the force target region.
- Constraints:
ge = -32768
le = 32768
- Validated by:
_validate_thresholds
_validate_trial_type
- field probability: float = 1[source]¶
Probability of reward
- Validated by:
_validate_thresholds
_validate_trial_type
- field time_to_collect: float | None = None[source]¶
Time to collect the reward after it is available. If null, the reward will be available indefinitely.
- Constraints:
ge = 0
- Validated by:
_validate_thresholds
_validate_trial_type
- class aind_behavior_force_foraging.task_logic.HarvestActionLabel(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]¶
Bases:
str
,Enum
Defines the harvest actions
- pydantic model aind_behavior_force_foraging.task_logic.InitiationPeriod[source]¶
Bases:
BaseModel
Defines an initiation period
- field abort_on_force: bool = False[source]¶
Whether to abort the trial if a choice is made during the initiation period.
- pydantic model aind_behavior_force_foraging.task_logic.ManipulatorFeedback[source]¶
Bases:
_ContinuousFeedbackBase
- Fields:
- Validators:
- pydantic model aind_behavior_force_foraging.task_logic.NumericalUpdater[source]¶
Bases:
BaseModel
- Fields:
- field operation: NumericalUpdaterOperation = NumericalUpdaterOperation.NONE[source]¶
Operation to perform on the parameter
- field parameters: NumericalUpdaterParameters = NumericalUpdaterParameters(value=Distribution(root=Scalar(family=<DistributionFamily.SCALAR: 'Scalar'>, distribution_parameters=ScalarDistributionParameter(family=<DistributionFamily.SCALAR: 'Scalar'>, value=0.0), truncation_parameters=None, scaling_parameters=None)), minimum=0, maximum=0)[source]¶
Parameters of the updater
- class aind_behavior_force_foraging.task_logic.NumericalUpdaterOperation(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]¶
Bases:
str
,Enum
- pydantic model aind_behavior_force_foraging.task_logic.NumericalUpdaterParameters[source]¶
Bases:
BaseModel
- Fields:
- field value: distributions.Distribution = Scalar(family=<DistributionFamily.SCALAR: 'Scalar'>, distribution_parameters=ScalarDistributionParameter(family=<DistributionFamily.SCALAR: 'Scalar'>, value=0.0), truncation_parameters=None, scaling_parameters=None)[source]¶
The value of the update. This value will be multiplied by the optional input event value.
- pydantic model aind_behavior_force_foraging.task_logic.OperationControl[source]¶
Bases:
BaseModel
- Fields:
- field force: ForceOperationControl = ForceOperationControl(press_mode=<PressMode.DOUBLE: 'Double'>, left_index=0, right_index=1, force_lookup_table=None)[source]¶
Operation control for force sensor
- field spout: SpoutOperationControl = SpoutOperationControl(default_retracted_position=0, default_extended_position=0, enabled=True)[source]¶
Operation control for spout
- class aind_behavior_force_foraging.task_logic.PressMode(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]¶
Bases:
str
,Enum
Defines the press mode
- pydantic model aind_behavior_force_foraging.task_logic.QuiescencePeriod[source]¶
Bases:
BaseModel
Defines a quiescence settings
- pydantic model aind_behavior_force_foraging.task_logic.ResponsePeriod[source]¶
Bases:
BaseModel
Defines a response period
- pydantic model aind_behavior_force_foraging.task_logic.SpoutOperationControl[source]¶
Bases:
BaseModel
- pydantic model aind_behavior_force_foraging.task_logic.Trial[source]¶
Bases:
BaseModel
Defines a trial
- Fields:
initiation_period (aind_behavior_force_foraging.task_logic.InitiationPeriod)
left_harvest (aind_behavior_force_foraging.task_logic.HarvestAction | None)
quiescence_period (aind_behavior_force_foraging.task_logic.QuiescencePeriod | None)
response_period (aind_behavior_force_foraging.task_logic.ResponsePeriod)
right_harvest (aind_behavior_force_foraging.task_logic.HarvestAction | None)
- Validators:
_validate_left_harvest
»left_harvest
_validate_right_harvest
»right_harvest
- field initiation_period: InitiationPeriod = InitiationPeriod(duration=0, has_cue=True, abort_on_force=False, abort_on_force_threshold=0)[source]¶
Initiation settings
- field left_harvest: HarvestAction | None = HarvestAction(action=<HarvestActionLabel.LEFT: 'Left'>, trial_type=<TrialType.NONE: 'None'>, probability=1, amount=1, delay=0, force_duration=0.5, upper_force_threshold=32768, lower_force_threshold=5000, is_operant=True, time_to_collect=None, action_updaters=[], continuous_feedback=None)[source]¶
Specification of the left action
- Validated by:
_validate_left_harvest
- field quiescence_period: QuiescencePeriod | None = None[source]¶
Quiescence settings
- field response_period: ResponsePeriod = ResponsePeriod(duration=0, has_cue=True, has_feedback=False)[source]¶
Response settings
- field right_harvest: HarvestAction | None = HarvestAction(action=<HarvestActionLabel.RIGHT: 'Right'>, trial_type=<TrialType.NONE: 'None'>, probability=1, amount=1, delay=0, force_duration=0.5, upper_force_threshold=32768, lower_force_threshold=5000, is_operant=True, time_to_collect=None, action_updaters=[], continuous_feedback=None)[source]¶
Specification of the right action
- Validated by:
_validate_right_harvest
- class aind_behavior_force_foraging.task_logic.TrialType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]¶
Bases:
str
,Enum
Defines the trial types
- class aind_behavior_force_foraging.task_logic.UpdateTargetParameter(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]¶
Bases:
str
,Enum
Defines the target parameters
- class aind_behavior_force_foraging.task_logic.UpdateTargetParameterBy(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]¶
Bases:
str
,Enum
Defines the independent variable used for the update
- aind_behavior_force_foraging.task_logic.normal_distribution_value(mean: float, std: float) distributions.Normal [source]¶
Helper function to create a normal distribution for a given range.
- Parameters:
mean (float) – The mean value of the normal distribution.
std (float) – The standard deviation of the normal distribution.
- Returns:
The normal distribution type.
- Return type:
distributions.Normal
- aind_behavior_force_foraging.task_logic.scalar_value(value: float) Scalar [source]¶
Helper function to create a scalar value distribution for a given value.
- Parameters:
value (float) – The value of the scalar distribution.
- Returns:
The scalar distribution type.
- Return type:
distributions.Scalar
- aind_behavior_force_foraging.task_logic.uniform_distribution_value(min: float, max: float) distributions.Uniform [source]¶
Helper function to create a uniform distribution for a given range.
- Parameters:
min (float) – The minimum value of the uniform distribution.
max (float) – The maximum value of the uniform distribution.
- Returns:
The uniform distribution type.
- Return type:
distributions.Uniform