diff --git a/bonsai/Bonsai.config b/bonsai/Bonsai.config
index 1f46300..44af239 100644
--- a/bonsai/Bonsai.config
+++ b/bonsai/Bonsai.config
@@ -34,6 +34,7 @@
+
@@ -107,6 +108,7 @@
+
@@ -149,6 +151,7 @@
+
diff --git a/examples/coupled_trial_generator.py b/examples/coupled_trial_generator.py
new file mode 100644
index 0000000..2cc96cf
--- /dev/null
+++ b/examples/coupled_trial_generator.py
@@ -0,0 +1,22 @@
+import logging
+import random
+
+from aind_behavior_dynamic_foraging.task_logic.trial_generators.coupled_trial_generator import CoupledTrialGeneratorSpec
+from aind_behavior_dynamic_foraging.task_logic.trial_models import Trial, TrialOutcome
+
+
+def main():
+ coupled_trial_generator = CoupledTrialGeneratorSpec().create_generator()
+ trial = Trial()
+ for i in range(100):
+ trial_outcome = TrialOutcome(
+ trial=trial, is_right_choice=random.choice([True, False, None]), is_rewarded=random.choice([True, False])
+ )
+ coupled_trial_generator.update(trial_outcome)
+ trial = coupled_trial_generator.next()
+ print(f"Next trial: {trial}")
+
+
+if __name__ == "__main__":
+ logging.basicConfig(level=logging.INFO)
+ main()
diff --git a/examples/task_logic.py b/examples/task_logic.py
index a7e13d1..dc16f9d 100644
--- a/examples/task_logic.py
+++ b/examples/task_logic.py
@@ -8,27 +8,12 @@
task_logic = AindDynamicForagingTaskLogic(
task_parameters=AindDynamicForagingTaskParameters(
rng_seed=42,
- warmup=df_task_logic.Warmup(min_trial=50, max_choice_ratio_bias=0.1, min_finish_ratio=0.8, windowsize=20),
- reward_probability=df_task_logic.RewardProbability(base_reward_sum=0.8, family=3, pairs_n=1),
- block_parameters=df_task_logic.BlockParameters(min=10, max=30, beta=10, min_reward=0),
- inter_trial_interval=df_task_logic.InterTrialInterval(min=1, max=7, beta=3),
- delay_period=df_task_logic.DelayPeriod(min=0, max=0, beta=0),
- reward_delay=0.1,
reward_size=df_task_logic.RewardSize(right_value_volume=4.0, left_value_volume=4.0),
- auto_water=df_task_logic.AutoWater(
- auto_water_type="Natural",
- multiplier=0.5,
- unrewarded=3,
- ignored=3,
- ),
- auto_block=df_task_logic.AutoBlock(advanced_block_auto="now", switch_thr=0.5, points_in_a_row=5),
- response_time=df_task_logic.Response(response_time=5, reward_consume_time=1),
- uncoupled_reward=[0.1, 0.3, 0.7],
)
)
-def main(path_seed: str = "./local/PatchForaging_{schema}.json"):
+def main(path_seed: str = "./local/DynamicForaging_{schema}.json"):
example_task_logic = task_logic
example_trainer_state = TrainerState(
stage=Stage(name="example_stage", task=example_task_logic), curriculum=None, is_on_curriculum=False
diff --git a/pyproject.toml b/pyproject.toml
index 10aef73..48eb413 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -19,7 +19,7 @@ version = "0.0.2rc13"
readme = {file = "README.md", content-type = "text/markdown"}
dependencies = [
- "aind_behavior_services<0.14",
+ "aind_behavior_services>=0.13.2",
"pydantic-settings",
]
diff --git a/schema/aind_behavior_dynamic_foraging.json b/schema/aind_behavior_dynamic_foraging.json
index fdcf1ad..ce6d683 100644
--- a/schema/aind_behavior_dynamic_foraging.json
+++ b/schema/aind_behavior_dynamic_foraging.json
@@ -3,7 +3,7 @@
"AindDynamicForagingRig": {
"properties": {
"aind_behavior_services_pkg_version": {
- "default": "0.13.0",
+ "default": "0.13.2",
"pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$",
"title": "aind_behavior_services package version",
"type": "string"
@@ -195,110 +195,11 @@
"title": "Rng Seed"
},
"aind_behavior_services_pkg_version": {
- "default": "0.13.0",
+ "default": "0.13.2",
"pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$",
"title": "aind_behavior_services package version",
"type": "string"
},
- "block_parameters": {
- "$ref": "#/$defs/BlockParameters",
- "default": {
- "min": 20,
- "max": 60,
- "beta": 20,
- "min_reward": 1
- },
- "description": "Parameters describing block conditions."
- },
- "reward_probability": {
- "$ref": "#/$defs/RewardProbability",
- "default": {
- "base_reward_sum": 0.8,
- "family": 1,
- "pairs_n": 1
- },
- "description": "Parameters describing reward_probability."
- },
- "uncoupled_reward": {
- "default": [
- 0.1,
- 0.3,
- 0.7
- ],
- "oneOf": [
- {
- "items": {
- "type": "number"
- },
- "maxItems": 3,
- "minItems": 3,
- "type": "array"
- },
- {
- "type": "null"
- }
- ],
- "title": "Uncoupled reward"
- },
- "randomness": {
- "default": "Exponential",
- "enum": [
- "Exponential",
- "Even"
- ],
- "title": "Randomness mode",
- "type": "string"
- },
- "delay_period": {
- "$ref": "#/$defs/DelayPeriod",
- "default": {
- "min": 0.0,
- "max": 1.0,
- "beta": 1.0
- },
- "description": "Parameters describing delay period."
- },
- "reward_delay": {
- "default": 0,
- "title": "Reward delay (sec)",
- "type": "number"
- },
- "auto_water": {
- "default": null,
- "description": "Parameters describing auto water.",
- "oneOf": [
- {
- "$ref": "#/$defs/aind_behavior_dynamic_foraging__task_logic__AutoWater"
- },
- {
- "type": "null"
- }
- ]
- },
- "inter_trial_interval": {
- "$ref": "#/$defs/InterTrialInterval",
- "description": "Parameters describing iti."
- },
- "response_time": {
- "$ref": "#/$defs/Response",
- "default": {
- "response_time": 1.0,
- "reward_consume_time": 3.0
- },
- "description": "Parameters describing response time."
- },
- "auto_block": {
- "default": null,
- "description": "Parameters describing auto advancement to next block.",
- "oneOf": [
- {
- "$ref": "#/$defs/AutoBlock"
- },
- {
- "type": "null"
- }
- ]
- },
"reward_size": {
"$ref": "#/$defs/RewardSize",
"default": {
@@ -307,48 +208,6 @@
},
"description": "Parameters describing reward size."
},
- "warmup": {
- "default": null,
- "description": "Parameters describing warmup.",
- "oneOf": [
- {
- "$ref": "#/$defs/Warmup"
- },
- {
- "type": "null"
- }
- ]
- },
- "no_response_trial_addition": {
- "default": true,
- "description": "Add one trial to the block length on both lickspouts.",
- "title": "No Response Trial Addition",
- "type": "boolean"
- },
- "reward_n": {
- "default": null,
- "oneOf": [
- {
- "$ref": "#/$defs/RewardN"
- },
- {
- "type": "null"
- }
- ]
- },
- "lick_spout_retraction": {
- "default": false,
- "description": "Lick spout retraction enabled.",
- "oneOf": [
- {
- "type": "boolean"
- },
- {
- "type": "null"
- }
- ],
- "title": "Lick Spout Retraction"
- },
"trial_generator": {
"$ref": "#/$defs/TrialGeneratorSpec",
"default": {
@@ -574,31 +433,6 @@
"title": "AuditorySecondaryReinforcer",
"type": "object"
},
- "AutoBlock": {
- "properties": {
- "advanced_block_auto": {
- "default": "now",
- "enum": [
- "now",
- "once"
- ],
- "title": "Auto block mode",
- "type": "string"
- },
- "switch_thr": {
- "default": 0.5,
- "title": "Switch threshold for auto block",
- "type": "number"
- },
- "points_in_a_row": {
- "default": 5,
- "title": "Points in a row for auto block",
- "type": "integer"
- }
- },
- "title": "AutoBlock",
- "type": "object"
- },
"Axis": {
"description": "Motor axis available",
"enum": [
@@ -680,30 +514,183 @@
"title": "BaseModel",
"type": "object"
},
- "BlockParameters": {
+ "BehaviorStabilityParameters": {
+ "description": "Parameters controlling when behavior is considered stable enough to switch blocks.",
"properties": {
- "min": {
- "default": 20,
- "title": "Block length (min)",
- "type": "integer"
+ "behavior_evaluation_mode": {
+ "default": "end",
+ "description": "When to evaluate stability \u2014 at the end of the block (end) or at any point during the block (anytime).",
+ "enum": [
+ "end",
+ "anytime"
+ ],
+ "title": "Behavior Evaluation Mode",
+ "type": "string"
},
- "max": {
- "default": 60,
- "title": "Block length (max)",
+ "behavior_stability_fraction": {
+ "default": 0.5,
+ "description": "Fraction scaling reward-probability difference for behavior.",
+ "maximum": 1,
+ "minimum": 0,
+ "title": "Behavior Stability Fraction",
+ "type": "number"
+ },
+ "min_consecutive_stable_trials": {
+ "default": 5,
+ "description": "Minimum number of consecutive trials satisfying the behavioral stability fraction.",
+ "minimum": 0,
+ "title": "Min Consecutive Stable Trials",
"type": "integer"
+ }
+ },
+ "title": "BehaviorStabilityParameters",
+ "type": "object"
+ },
+ "BetaDistribution": {
+ "description": "A beta probability distribution.\n\nContinuous distribution bounded between 0 and 1. Commonly used\nfor modeling probabilities and proportions.",
+ "properties": {
+ "family": {
+ "const": "Beta",
+ "default": "Beta",
+ "title": "Family",
+ "type": "string"
+ },
+ "distribution_parameters": {
+ "$ref": "#/$defs/BetaDistributionParameters",
+ "default": {
+ "family": "Beta",
+ "alpha": 5.0,
+ "beta": 5.0
+ },
+ "description": "Parameters of the distribution"
+ },
+ "truncation_parameters": {
+ "default": null,
+ "description": "Truncation parameters of the distribution",
+ "oneOf": [
+ {
+ "$ref": "#/$defs/TruncationParameters"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "scaling_parameters": {
+ "default": null,
+ "description": "Scaling parameters of the distribution",
+ "oneOf": [
+ {
+ "$ref": "#/$defs/ScalingParameters"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ },
+ "title": "BetaDistribution",
+ "type": "object"
+ },
+ "BetaDistributionParameters": {
+ "description": "Parameters for a beta distribution.\n\nDefined by alpha and beta shape parameters.",
+ "properties": {
+ "family": {
+ "const": "Beta",
+ "default": "Beta",
+ "title": "Family",
+ "type": "string"
+ },
+ "alpha": {
+ "default": 5,
+ "description": "Alpha parameter of the distribution",
+ "minimum": 0,
+ "title": "Alpha",
+ "type": "number"
},
"beta": {
- "default": 20,
- "title": "Block length (beta)",
- "type": "integer"
+ "default": 5,
+ "description": "Beta parameter of the distribution",
+ "minimum": 0,
+ "title": "Beta",
+ "type": "number"
+ }
+ },
+ "title": "BetaDistributionParameters",
+ "type": "object"
+ },
+ "BinomialDistribution": {
+ "description": "A binomial probability distribution.\n\nModels the number of successes in a fixed number of independent\nBernoulli trials with constant success probability.",
+ "properties": {
+ "family": {
+ "const": "Binomial",
+ "default": "Binomial",
+ "title": "Family",
+ "type": "string"
+ },
+ "distribution_parameters": {
+ "$ref": "#/$defs/BinomialDistributionParameters",
+ "default": {
+ "family": "Binomial",
+ "n": 1,
+ "p": 0.5
+ },
+ "description": "Parameters of the distribution"
+ },
+ "truncation_parameters": {
+ "default": null,
+ "description": "Truncation parameters of the distribution",
+ "oneOf": [
+ {
+ "$ref": "#/$defs/TruncationParameters"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "scaling_parameters": {
+ "default": null,
+ "description": "Scaling parameters of the distribution",
+ "oneOf": [
+ {
+ "$ref": "#/$defs/ScalingParameters"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ },
+ "title": "BinomialDistribution",
+ "type": "object"
+ },
+ "BinomialDistributionParameters": {
+ "description": "Parameters for a binomial distribution.\n\nDefined by number of trials (n) and success probability (p).",
+ "properties": {
+ "family": {
+ "const": "Binomial",
+ "default": "Binomial",
+ "title": "Family",
+ "type": "string"
},
- "min_reward": {
+ "n": {
"default": 1,
- "title": "Minimal rewards in a block to switch",
+ "description": "Number of trials",
+ "minimum": 0,
+ "title": "N",
"type": "integer"
+ },
+ "p": {
+ "default": 0.5,
+ "description": "Probability of success",
+ "maximum": 1,
+ "minimum": 0,
+ "title": "P",
+ "type": "number"
}
},
- "title": "BlockParameters",
+ "title": "BinomialDistributionParameters",
"type": "object"
},
"CameraController_SpinnakerCamera_": {
@@ -832,6 +819,47 @@
"title": "ConnectedClockOutput",
"type": "object"
},
+ "CoupledTrialGenerationEndConditions": {
+ "description": "Defines the conditions under which a foraging session should terminate.",
+ "properties": {
+ "ignore_win": {
+ "default": 30,
+ "description": "Number of recent trials to check for ignored responses.",
+ "minimum": 0,
+ "title": "Ignore Win",
+ "type": "integer"
+ },
+ "ignore_ratio_threshold": {
+ "default": 0.8,
+ "description": "Maximum fraction of ignored trials within the window before the session is ended.",
+ "maximum": 1,
+ "minimum": 0,
+ "title": "Ignore Ratio Threshold",
+ "type": "number"
+ },
+ "max_trial": {
+ "default": 1000,
+ "description": "Maximum number of trials allowed in a session.",
+ "minimum": 0,
+ "title": "Max Trial",
+ "type": "integer"
+ },
+ "max_time": {
+ "default": 4500,
+ "description": "Maximum session duration (sec).",
+ "title": "Max Time",
+ "type": "number"
+ },
+ "min_time": {
+ "default": 1800,
+ "description": "Minimum session duration (sec)",
+ "title": "Min Time",
+ "type": "number"
+ }
+ },
+ "title": "CoupledTrialGenerationEndConditions",
+ "type": "object"
+ },
"CoupledTrialGeneratorSpec": {
"properties": {
"type": {
@@ -840,66 +868,56 @@
"title": "Type",
"type": "string"
},
- "iti": {
+ "quiescent_duration": {
+ "$ref": "#/$defs/Distribution",
"default": {
"family": "Exponential",
"distribution_parameters": {
"family": "Exponential",
- "rate": 0.5
+ "rate": 1.0
},
"truncation_parameters": {
- "max": 8.0,
- "min": 1.0,
+ "max": 1.0,
+ "min": 0.0,
"truncation_mode": "exclude"
},
"scaling_parameters": null
},
- "oneOf": [
- {
- "$ref": "#/$defs/UniformDistribution"
- },
- {
- "$ref": "#/$defs/ExponentialDistribution"
- }
- ],
- "title": "Iti"
+ "description": "Distribution describing the quiescence period before trial starts (in seconds). Each lick resets the timer."
},
- "quiescent_period": {
- "default": {
- "family": "Exponential",
+ "response_duration": {
+ "default": 1.0,
+ "description": "Duration after go cue for animal response.",
+ "minimum": 0,
+ "title": "Response Duration",
+ "type": "number"
+ },
+ "reward_consumption_duration": {
+ "default": 3.0,
+ "description": "Duration of reward consumption before transition to ITI (in seconds).",
+ "minimum": 0,
+ "title": "Reward Consumption Duration",
+ "type": "number"
+ },
+ "inter_trial_interval_duration": {
+ "$ref": "#/$defs/Distribution",
+ "default": {
+ "family": "Exponential",
"distribution_parameters": {
"family": "Exponential",
- "rate": 1.0
+ "rate": 0.5
},
"truncation_parameters": {
- "max": 1.0,
- "min": 0.0,
+ "max": 8.0,
+ "min": 1.0,
"truncation_mode": "exclude"
},
"scaling_parameters": null
},
- "oneOf": [
- {
- "$ref": "#/$defs/UniformDistribution"
- },
- {
- "$ref": "#/$defs/ExponentialDistribution"
- }
- ],
- "title": "Quiescent Period"
- },
- "response_time": {
- "default": 1.0,
- "title": "Response time",
- "type": "number"
+ "description": "Distribution describing the inter-trial interval (in seconds)."
},
- "reward_consume_time": {
- "default": 3.0,
- "description": "Time of the no-lick period before trial end",
- "title": "Reward consume time",
- "type": "number"
- },
- "block_parameters": {
+ "block_len": {
+ "$ref": "#/$defs/Distribution",
"default": {
"family": "Exponential",
"distribution_parameters": {
@@ -913,185 +931,126 @@
},
"scaling_parameters": null
},
- "oneOf": [
- {
- "$ref": "#/$defs/UniformDistribution"
- },
- {
- "$ref": "#/$defs/ExponentialDistribution"
- }
- ],
- "title": "Block Parameters"
+ "description": "Distribution describing block length."
},
- "min_reward": {
+ "min_block_reward": {
"default": 1,
+ "minimum": 0,
"title": "Minimal rewards in a block to switch",
"type": "integer"
},
- "auto_water": {
- "default": null,
- "description": "Parameters describing auto water.",
- "oneOf": [
- {
- "$ref": "#/$defs/aind_behavior_dynamic_foraging__task_logic__trial_generators__coupled_trial_generator__AutoWater"
- },
- {
- "type": "null"
- }
- ]
+ "kernel_size": {
+ "default": 2,
+ "description": "Kernel to evaluate choice fraction.",
+ "title": "Kernel Size",
+ "type": "integer"
},
- "behavior_evaluation_mode": {
- "default": "ignore",
- "enum": [
- "ignore",
- "end",
- "anytime"
- ],
- "title": "Auto block mode",
- "type": "string"
+ "reward_probability_parameters": {
+ "$ref": "#/$defs/RewardProbabilityParameters",
+ "default": {
+ "base_reward_sum": 0.8,
+ "reward_pairs": [
+ [
+ 8.0,
+ 1.0
+ ]
+ ]
+ },
+ "description": "Parameters defining the reward probability structure."
},
- "switch_thr": {
- "default": 0.5,
- "title": "Switch threshold for auto block",
- "type": "number"
+ "is_baiting": {
+ "default": false,
+ "description": "Whether uncollected rewards carry over to the next trial.",
+ "title": "Is Baiting",
+ "type": "boolean"
},
- "points_in_a_row": {
- "default": 5,
- "title": "Points in a row for auto block",
- "type": "integer"
+ "trial_generation_end_parameters": {
+ "$ref": "#/$defs/CoupledTrialGenerationEndConditions",
+ "default": {
+ "ignore_win": 30,
+ "ignore_ratio_threshold": 0.8,
+ "max_trial": 1000,
+ "max_time": 4500.0,
+ "min_time": 1800.0
+ },
+ "description": "Conditions to end trial generation."
},
- "warmup": {
- "default": null,
- "description": "Parameters describing warmup.",
+ "behavior_stability_parameters": {
+ "default": {
+ "behavior_evaluation_mode": "end",
+ "behavior_stability_fraction": 0.5,
+ "min_consecutive_stable_trials": 5
+ },
+ "description": "Parameters controlling behavior-dependent block switching. If None, block switches rely only on length and reward criteria.",
"oneOf": [
{
- "$ref": "#/$defs/Warmup"
+ "$ref": "#/$defs/BehaviorStabilityParameters"
},
{
"type": "null"
}
]
},
- "no_response_trial_addition": {
+ "extend_block_on_no_response": {
"default": true,
- "description": "Add one trial to the block length on both lickspouts.",
- "title": "No Response Trial Addition",
+ "description": "Whether to extend the minimum block length by one trial when the animal does not respond.",
+ "title": "Extend Block On No Response",
"type": "boolean"
- },
- "kernel_size": {
- "title": "Kernel Size",
- "type": "integer"
- },
- "reward_probability_specs": {
- "$ref": "#/$defs/RewardProbability",
- "default": {
- "base_reward_sum": 0.8,
- "family": 1,
- "pairs_n": 1
- }
- },
- "reward_family": {
- "default": [
- [
- [
- 8,
- 1
- ],
- [
- 6,
- 1
- ],
- [
- 3,
- 1
- ],
- [
- 1,
- 1
- ]
- ],
- [
- [
- 8,
- 1
- ],
- [
- 1,
- 1
- ]
- ],
- [
- [
- 1,
- 0
- ],
- [
- 0.9,
- 0.1
- ],
- [
- 0.8,
- 0.2
- ],
- [
- 0.7,
- 0.3
- ],
- [
- 0.6,
- 0.4
- ],
- [
- 0.5,
- 0.5
- ]
- ],
- [
- [
- 6,
- 1
- ],
- [
- 3,
- 1
- ],
- [
- 1,
- 1
- ]
- ]
- ],
- "items": {},
- "title": "Reward Family",
- "type": "array"
}
},
- "required": [
- "kernel_size"
- ],
"title": "CoupledTrialGeneratorSpec",
"type": "object"
},
- "DelayPeriod": {
- "properties": {
- "min": {
- "default": 0.0,
- "title": "Delay period (min) ",
- "type": "number"
+ "Distribution": {
+ "description": "Available distributions",
+ "discriminator": {
+ "mapping": {
+ "Beta": "#/$defs/BetaDistribution",
+ "Binomial": "#/$defs/BinomialDistribution",
+ "Exponential": "#/$defs/ExponentialDistribution",
+ "Gamma": "#/$defs/GammaDistribution",
+ "LogNormal": "#/$defs/LogNormalDistribution",
+ "Normal": "#/$defs/NormalDistribution",
+ "Pdf": "#/$defs/PdfDistribution",
+ "Poisson": "#/$defs/PoissonDistribution",
+ "Scalar": "#/$defs/Scalar",
+ "Uniform": "#/$defs/UniformDistribution"
+ },
+ "propertyName": "family"
+ },
+ "oneOf": [
+ {
+ "$ref": "#/$defs/Scalar"
},
- "max": {
- "default": 1.0,
- "title": "Delay period (max) ",
- "type": "number"
+ {
+ "$ref": "#/$defs/NormalDistribution"
},
- "beta": {
- "default": 1.0,
- "title": "Delay period (beta)",
- "type": "number"
+ {
+ "$ref": "#/$defs/LogNormalDistribution"
+ },
+ {
+ "$ref": "#/$defs/ExponentialDistribution"
+ },
+ {
+ "$ref": "#/$defs/UniformDistribution"
+ },
+ {
+ "$ref": "#/$defs/PoissonDistribution"
+ },
+ {
+ "$ref": "#/$defs/BinomialDistribution"
+ },
+ {
+ "$ref": "#/$defs/BetaDistribution"
+ },
+ {
+ "$ref": "#/$defs/GammaDistribution"
+ },
+ {
+ "$ref": "#/$defs/PdfDistribution"
}
- },
- "title": "DelayPeriod",
- "type": "object"
+ ],
+ "title": "Distribution"
},
"DynamicForagingSoundCard": {
"description": "A calibrated sound card for the dynamic foraging rig. This is a subclass of the HarpSoundCard that includes the sound card calibration.",
@@ -1222,6 +1181,79 @@
"title": "ExponentialDistributionParameters",
"type": "object"
},
+ "GammaDistribution": {
+ "description": "A gamma probability distribution.\n\nGeneralizes the exponential distribution. Used for modeling\npositive continuous variables with right-skewed distributions.",
+ "properties": {
+ "family": {
+ "const": "Gamma",
+ "default": "Gamma",
+ "title": "Family",
+ "type": "string"
+ },
+ "distribution_parameters": {
+ "$ref": "#/$defs/GammaDistributionParameters",
+ "default": {
+ "family": "Gamma",
+ "shape": 1.0,
+ "rate": 1.0
+ },
+ "description": "Parameters of the distribution"
+ },
+ "truncation_parameters": {
+ "default": null,
+ "description": "Truncation parameters of the distribution",
+ "oneOf": [
+ {
+ "$ref": "#/$defs/TruncationParameters"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "scaling_parameters": {
+ "default": null,
+ "description": "Scaling parameters of the distribution",
+ "oneOf": [
+ {
+ "$ref": "#/$defs/ScalingParameters"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ },
+ "title": "GammaDistribution",
+ "type": "object"
+ },
+ "GammaDistributionParameters": {
+ "description": "Parameters for a gamma distribution.\n\nDefined by shape (k) and rate (\u03b8\u207b\u00b9) parameters.",
+ "properties": {
+ "family": {
+ "const": "Gamma",
+ "default": "Gamma",
+ "title": "Family",
+ "type": "string"
+ },
+ "shape": {
+ "default": 1,
+ "description": "Shape parameter of the distribution",
+ "minimum": 0,
+ "title": "Shape",
+ "type": "number"
+ },
+ "rate": {
+ "default": 1,
+ "description": "Rate parameter of the distribution",
+ "minimum": 0,
+ "title": "Rate",
+ "type": "number"
+ }
+ },
+ "title": "GammaDistributionParameters",
+ "type": "object"
+ },
"HarpBehavior": {
"properties": {
"device_type": {
@@ -1498,132 +1530,399 @@
"title": "IntegrationTestTrialGeneratorSpec",
"type": "object"
},
- "InterTrialInterval": {
+ "LogNormalDistribution": {
+ "description": "A log-normal probability distribution.\n\nDistribution where the logarithm of the variable is normally distributed.\nAlways produces positive values and is right-skewed.",
"properties": {
- "min": {
- "default": 1.0,
- "title": "ITI (min)",
+ "family": {
+ "const": "LogNormal",
+ "default": "LogNormal",
+ "title": "Family",
+ "type": "string"
+ },
+ "distribution_parameters": {
+ "$ref": "#/$defs/LogNormalDistributionParameters",
+ "default": {
+ "family": "LogNormal",
+ "mean": 0.0,
+ "std": 0.0
+ },
+ "description": "Parameters of the distribution"
+ },
+ "truncation_parameters": {
+ "default": null,
+ "description": "Truncation parameters of the distribution",
+ "oneOf": [
+ {
+ "$ref": "#/$defs/TruncationParameters"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "scaling_parameters": {
+ "default": null,
+ "description": "Scaling parameters of the distribution",
+ "oneOf": [
+ {
+ "$ref": "#/$defs/ScalingParameters"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ },
+ "title": "LogNormalDistribution",
+ "type": "object"
+ },
+ "LogNormalDistributionParameters": {
+ "description": "Parameters for a log-normal distribution.\n\nDefined by the mean and standard deviation of the underlying normal distribution.",
+ "properties": {
+ "family": {
+ "const": "LogNormal",
+ "default": "LogNormal",
+ "title": "Family",
+ "type": "string"
+ },
+ "mean": {
+ "default": 0,
+ "description": "Mean of the distribution",
+ "title": "Mean",
"type": "number"
},
- "max": {
- "default": 8.0,
- "title": "ITI (max)",
+ "std": {
+ "default": 0,
+ "description": "Standard deviation of the distribution",
+ "title": "Std",
+ "type": "number"
+ }
+ },
+ "title": "LogNormalDistributionParameters",
+ "type": "object"
+ },
+ "ManipulatorPosition": {
+ "description": "Represents a position in the manipulator coordinate system",
+ "properties": {
+ "x": {
+ "title": "X coordinate",
"type": "number"
},
- "beta": {
- "default": 2.0,
- "title": "ITI (beta)",
+ "y1": {
+ "title": "Y1 coordinate",
"type": "number"
},
- "increase": {
- "default": 0.0,
- "title": "ITI increase",
+ "y2": {
+ "title": "Y2 coordinate",
+ "type": "number"
+ },
+ "z": {
+ "title": "Z coordinate",
+ "type": "number"
+ }
+ },
+ "required": [
+ "x",
+ "y1",
+ "y2",
+ "z"
+ ],
+ "title": "ManipulatorPosition",
+ "type": "object"
+ },
+ "Measurement": {
+ "description": "Input for water valve calibration class",
+ "properties": {
+ "valve_open_interval": {
+ "description": "Time between two consecutive valve openings (s)",
+ "exclusiveMinimum": 0,
+ "title": "Valve open interval",
"type": "number"
+ },
+ "valve_open_time": {
+ "description": "Valve open interval (s)",
+ "exclusiveMinimum": 0,
+ "title": "Valve open time",
+ "type": "number"
+ },
+ "water_weight": {
+ "description": "Weight of water delivered (g)",
+ "items": {
+ "exclusiveMinimum": 0,
+ "type": "number"
+ },
+ "minItems": 1,
+ "title": "Water weight",
+ "type": "array"
+ },
+ "repeat_count": {
+ "description": "Number of times the valve opened.",
+ "minimum": 0,
+ "title": "Repeat count",
+ "type": "integer"
+ }
+ },
+ "required": [
+ "valve_open_interval",
+ "valve_open_time",
+ "water_weight",
+ "repeat_count"
+ ],
+ "title": "Measurement",
+ "type": "object"
+ },
+ "MicrostepResolution": {
+ "description": "Microstep resolution available",
+ "enum": [
+ 0,
+ 1,
+ 2,
+ 3
+ ],
+ "title": "MicrostepResolution",
+ "type": "integer",
+ "x-enumNames": [
+ "Microstep8",
+ "Microstep16",
+ "Microstep32",
+ "Microstep64"
+ ]
+ },
+ "MotorOperationMode": {
+ "description": "Motor operation mode",
+ "enum": [
+ 0,
+ 1
+ ],
+ "title": "MotorOperationMode",
+ "type": "integer",
+ "x-enumNames": [
+ "Quiet",
+ "Dynamic"
+ ]
+ },
+ "NormalDistribution": {
+ "description": "A normal (Gaussian) probability distribution.\n\nBell-shaped distribution symmetric around the mean, commonly used\nfor modeling naturally occurring random variables.",
+ "properties": {
+ "family": {
+ "const": "Normal",
+ "default": "Normal",
+ "title": "Family",
+ "type": "string"
+ },
+ "distribution_parameters": {
+ "$ref": "#/$defs/NormalDistributionParameters",
+ "default": {
+ "family": "Normal",
+ "mean": 0.0,
+ "std": 0.0
+ },
+ "description": "Parameters of the distribution"
+ },
+ "truncation_parameters": {
+ "default": null,
+ "description": "Truncation parameters of the distribution",
+ "oneOf": [
+ {
+ "$ref": "#/$defs/TruncationParameters"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "scaling_parameters": {
+ "default": null,
+ "description": "Scaling parameters of the distribution",
+ "oneOf": [
+ {
+ "$ref": "#/$defs/ScalingParameters"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ },
+ "title": "NormalDistribution",
+ "type": "object"
+ },
+ "NormalDistributionParameters": {
+ "description": "Parameters for a normal (Gaussian) distribution.\n\nDefined by mean (center) and standard deviation (spread).",
+ "properties": {
+ "family": {
+ "const": "Normal",
+ "default": "Normal",
+ "title": "Family",
+ "type": "string"
+ },
+ "mean": {
+ "default": 0,
+ "description": "Mean of the distribution",
+ "title": "Mean",
+ "type": "number"
+ },
+ "std": {
+ "default": 0,
+ "description": "Standard deviation of the distribution",
+ "title": "Std",
+ "type": "number"
+ }
+ },
+ "title": "NormalDistributionParameters",
+ "type": "object"
+ },
+ "PdfDistribution": {
+ "description": "A custom probability density function distribution.\n\nAllows defining arbitrary discrete distributions by specifying\nprobability values and their corresponding indices.",
+ "properties": {
+ "family": {
+ "const": "Pdf",
+ "default": "Pdf",
+ "title": "Family",
+ "type": "string"
+ },
+ "distribution_parameters": {
+ "$ref": "#/$defs/PdfDistributionParameters",
+ "default": {
+ "family": "Pdf",
+ "pdf": [
+ 1.0
+ ],
+ "index": [
+ 0.0
+ ]
+ },
+ "description": "Parameters of the distribution"
+ },
+ "truncation_parameters": {
+ "default": null,
+ "description": "Truncation parameters of the distribution",
+ "oneOf": [
+ {
+ "$ref": "#/$defs/TruncationParameters"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "scaling_parameters": {
+ "default": null,
+ "description": "Scaling parameters of the distribution",
+ "oneOf": [
+ {
+ "$ref": "#/$defs/ScalingParameters"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ },
+ "title": "PdfDistribution",
+ "type": "object"
+ },
+ "PdfDistributionParameters": {
+ "description": "Parameters for a custom probability density function distribution.\n\nDefined by explicit probability values and their corresponding indices.\nProbabilities are automatically normalized to sum to 1.",
+ "properties": {
+ "family": {
+ "const": "Pdf",
+ "default": "Pdf",
+ "title": "Family",
+ "type": "string"
+ },
+ "pdf": {
+ "default": [
+ 1
+ ],
+ "description": "The probability density function",
+ "items": {
+ "minimum": 0,
+ "type": "number"
+ },
+ "title": "Pdf",
+ "type": "array"
+ },
+ "index": {
+ "default": [
+ 0
+ ],
+ "description": "The index of the probability density function",
+ "items": {
+ "type": "number"
+ },
+ "title": "Index",
+ "type": "array"
}
},
- "title": "InterTrialInterval",
+ "title": "PdfDistributionParameters",
"type": "object"
},
- "ManipulatorPosition": {
- "description": "Represents a position in the manipulator coordinate system",
+ "PoissonDistribution": {
+ "description": "A Poisson probability distribution.\n\nModels the number of events occurring in a fixed interval of time or space\nwhen events occur independently at a constant rate.",
"properties": {
- "x": {
- "title": "X coordinate",
- "type": "number"
+ "family": {
+ "const": "Poisson",
+ "default": "Poisson",
+ "title": "Family",
+ "type": "string"
},
- "y1": {
- "title": "Y1 coordinate",
- "type": "number"
+ "distribution_parameters": {
+ "$ref": "#/$defs/PoissonDistributionParameters",
+ "default": {
+ "family": "Poisson",
+ "rate": 1.0
+ },
+ "description": "Parameters of the distribution"
},
- "y2": {
- "title": "Y2 coordinate",
- "type": "number"
+ "truncation_parameters": {
+ "default": null,
+ "description": "Truncation parameters of the distribution",
+ "oneOf": [
+ {
+ "$ref": "#/$defs/TruncationParameters"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "z": {
- "title": "Z coordinate",
- "type": "number"
+ "scaling_parameters": {
+ "default": null,
+ "description": "Scaling parameters of the distribution",
+ "oneOf": [
+ {
+ "$ref": "#/$defs/ScalingParameters"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
- "required": [
- "x",
- "y1",
- "y2",
- "z"
- ],
- "title": "ManipulatorPosition",
+ "title": "PoissonDistribution",
"type": "object"
},
- "Measurement": {
- "description": "Input for water valve calibration class",
+ "PoissonDistributionParameters": {
+ "description": "Parameters for a Poisson distribution.\n\nDefined by the rate parameter (average number of events).",
"properties": {
- "valve_open_interval": {
- "description": "Time between two consecutive valve openings (s)",
- "exclusiveMinimum": 0,
- "title": "Valve open interval",
- "type": "number"
- },
- "valve_open_time": {
- "description": "Valve open interval (s)",
- "exclusiveMinimum": 0,
- "title": "Valve open time",
- "type": "number"
- },
- "water_weight": {
- "description": "Weight of water delivered (g)",
- "items": {
- "exclusiveMinimum": 0,
- "type": "number"
- },
- "minItems": 1,
- "title": "Water weight",
- "type": "array"
+ "family": {
+ "const": "Poisson",
+ "default": "Poisson",
+ "title": "Family",
+ "type": "string"
},
- "repeat_count": {
- "description": "Number of times the valve opened.",
+ "rate": {
+ "default": 1,
+ "description": "Rate parameter of the Poisson process that generates the distribution",
"minimum": 0,
- "title": "Repeat count",
- "type": "integer"
+ "title": "Rate",
+ "type": "number"
}
},
- "required": [
- "valve_open_interval",
- "valve_open_time",
- "water_weight",
- "repeat_count"
- ],
- "title": "Measurement",
+ "title": "PoissonDistributionParameters",
"type": "object"
},
- "MicrostepResolution": {
- "description": "Microstep resolution available",
- "enum": [
- 0,
- 1,
- 2,
- 3
- ],
- "title": "MicrostepResolution",
- "type": "integer",
- "x-enumNames": [
- "Microstep8",
- "Microstep16",
- "Microstep32",
- "Microstep64"
- ]
- },
- "MotorOperationMode": {
- "description": "Motor operation mode",
- "enum": [
- 0,
- 1
- ],
- "title": "MotorOperationMode",
- "type": "integer",
- "x-enumNames": [
- "Quiet",
- "Dynamic"
- ]
- },
"Rect": {
"description": "Represents a rectangle defined by its top-left corner, width, and height.",
"properties": {
@@ -1659,69 +1958,51 @@
"title": "Rect",
"type": "object"
},
- "Response": {
- "properties": {
- "response_time": {
- "default": 1.0,
- "title": "Response time",
- "type": "number"
- },
- "reward_consume_time": {
- "default": 3.0,
- "description": "Time of the no-lick period before trial end",
- "title": "Reward consume time",
- "type": "number"
- }
- },
- "title": "Response",
- "type": "object"
- },
- "RewardN": {
- "properties": {
- "initial_inactive_trials": {
- "default": 2,
- "description": "Initial N trials of the active side where no bait will be be given.",
- "title": "Initial Inactive Trials",
- "type": "integer"
- }
- },
- "title": "RewardN",
- "type": "object"
- },
- "RewardProbability": {
+ "RewardProbabilityParameters": {
+ "description": "Defines the reward probability structure for a dynamic foraging task.\n\nReward probabilities are defined as pairs (p_left, p_right) normalized by\nbase_reward_sum. Pairs are drawn from a family representing a difficulty level:\n\n Family 0: [[8, 1], [6, 1], [3, 1], [1, 1]]\n Family 1: [[8, 1], [1, 1]]\n Family 2: [[1.0, 0.0], [0.9, 0.1], [0.8, 0.2], [0.7, 0.3], [0.6, 0.4], [0.5, 0.5]]\n Family 3: [[6, 1], [3, 1], [1, 1]]",
"properties": {
"base_reward_sum": {
"default": 0.8,
- "title": "Sum of p_reward",
+ "description": "Total reward probability shared between the two sides. Each reward pair is normalized to sum to this value.",
+ "title": "Base Reward Sum",
"type": "number"
},
- "family": {
- "default": 1,
- "title": "Reward family",
- "type": "integer"
- },
- "pairs_n": {
- "default": 1,
- "title": "Number of pairs",
- "type": "integer"
+ "reward_pairs": {
+ "default": [
+ [
+ 8,
+ 1
+ ]
+ ],
+ "description": "List of (left, right) reward ratio pairs to sample from during block transitions. ",
+ "items": {
+ "items": {
+ "type": "number"
+ },
+ "type": "array"
+ },
+ "title": "Reward Pairs",
+ "type": "array"
}
},
- "title": "RewardProbability",
+ "title": "RewardProbabilityParameters",
"type": "object"
},
"RewardSize": {
"properties": {
"right_value_volume": {
- "default": 3.0,
"title": "Right reward size (uL)",
"type": "number"
},
"left_value_volume": {
- "default": 3.0,
"title": "Left reward size (uL)",
"type": "number"
}
},
+ "required": [
+ "right_value_volume",
+ "left_value_volume"
+ ],
"title": "RewardSize",
"type": "object"
},
@@ -1744,6 +2025,58 @@
"title": "RigCalibration",
"type": "object"
},
+ "Scalar": {
+ "description": "A scalar distribution that returns a constant value.\n\nUseful for fixed parameters that don't vary across trials or samples.",
+ "properties": {
+ "family": {
+ "const": "Scalar",
+ "default": "Scalar",
+ "title": "Family",
+ "type": "string"
+ },
+ "distribution_parameters": {
+ "$ref": "#/$defs/ScalarDistributionParameter",
+ "default": {
+ "family": "Scalar",
+ "value": 0.0
+ },
+ "description": "Parameters of the distribution"
+ },
+ "truncation_parameters": {
+ "const": null,
+ "default": null,
+ "title": "Truncation Parameters",
+ "type": "null"
+ },
+ "scaling_parameters": {
+ "const": null,
+ "default": null,
+ "title": "Scaling Parameters",
+ "type": "null"
+ }
+ },
+ "title": "Scalar",
+ "type": "object"
+ },
+ "ScalarDistributionParameter": {
+ "description": "Parameters for a scalar (constant) distribution.\n\nRepresents a deterministic value that always returns the same number.",
+ "properties": {
+ "family": {
+ "const": "Scalar",
+ "default": "Scalar",
+ "title": "Family",
+ "type": "string"
+ },
+ "value": {
+ "default": 0,
+ "description": "The static value of the distribution",
+ "title": "Value",
+ "type": "number"
+ }
+ },
+ "title": "ScalarDistributionParameter",
+ "type": "object"
+ },
"ScalingParameters": {
"description": "Parameters for scaling and offsetting sampled distribution values.\nScaling is applied as (value * scale + offset).\n\nApplies linear transformation: result = (value * scale) + offset.",
"properties": {
@@ -1780,14 +2113,14 @@
"Session": {
"properties": {
"aind_behavior_services_pkg_version": {
- "default": "0.13.0",
+ "default": "0.13.2",
"pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$",
"title": "aind_behavior_services package version",
"type": "string"
},
"version": {
- "const": "0.13.0",
- "default": "0.13.0",
+ "const": "0.13.2",
+ "default": "0.13.2",
"title": "Version",
"type": "string"
},
@@ -2674,13 +3007,13 @@
"type": "integer"
},
"container_extension": {
- "default": "mp4",
+ "default": "mkv",
"description": "Container extension",
"title": "Container Extension",
"type": "string"
},
"output_arguments": {
- "default": "-vf \"scale=out_color_matrix=bt709:out_range=full,format=bgr24,scale=out_range=full\" -c:v h264_nvenc -pix_fmt yuv420p -color_range full -colorspace bt709 -color_trc linear -tune hq -preset p4 -rc vbr -cq 12 -b:v 0M -metadata author=\"Allen Institute for Neural Dynamics\" -maxrate 700M -bufsize 350M",
+ "default": "-vf \"scale=out_range=full,setparams=range=full:colorspace=bt709:color_primaries=bt709:color_trc=linear\" -c:v h264_nvenc -pix_fmt yuv420p -color_range full -colorspace bt709 -color_trc linear -tune hq -preset p3 -rc vbr -cq 18 -b:v 0M -metadata author=\"Allen Institute for Neural Dynamics\" -maxrate 700M -bufsize 350M -f matroska -write_crc32 0",
"description": "Output arguments",
"title": "Output Arguments",
"type": "string"
@@ -2727,40 +3060,22 @@
"title": "VideoWriterOpenCv",
"type": "object"
},
- "Warmup": {
- "properties": {
- "min_trial": {
- "default": 50,
- "title": "Warmup finish criteria: minimal trials",
- "type": "integer"
- },
- "max_choice_ratio_bias": {
- "default": 0.1,
- "title": "Warmup finish criteria: maximal choice ratio bias from 0.5",
- "type": "number"
- },
- "min_finish_ratio": {
- "default": 0.8,
- "title": "Warmup finish criteria: minimal finish ratio",
- "type": "number"
- },
- "windowsize": {
- "default": 20,
- "title": "Warmup finish criteria: window size to compute the bias and ratio",
- "type": "integer"
- }
- },
- "title": "Warmup",
- "type": "object"
- },
"WaterValveCalibration": {
"description": "Represents a water valve calibration.",
"properties": {
"date": {
+ "default": null,
"description": "Date of the calibration",
- "format": "date-time",
- "title": "Date",
- "type": "string"
+ "oneOf": [
+ {
+ "format": "date-time",
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Date"
},
"measurements": {
"default": [],
@@ -2929,74 +3244,6 @@
},
"title": "WebCamera",
"type": "object"
- },
- "aind_behavior_dynamic_foraging__task_logic__AutoWater": {
- "properties": {
- "auto_water_type": {
- "default": "Natural",
- "enum": [
- "Natural",
- "Both",
- "High pro"
- ],
- "title": "Auto water mode",
- "type": "string"
- },
- "multiplier": {
- "default": 0.8,
- "title": "Multiplier for auto reward",
- "type": "number"
- },
- "unrewarded": {
- "default": 200,
- "title": "Number of unrewarded trials before auto water",
- "type": "integer"
- },
- "ignored": {
- "default": 100,
- "title": "Number of ignored trials before auto water",
- "type": "integer"
- },
- "include_reward": {
- "default": false,
- "description": "Include auto water in total rewards.",
- "title": "Include Reward",
- "type": "boolean"
- }
- },
- "title": "AutoWater",
- "type": "object"
- },
- "aind_behavior_dynamic_foraging__task_logic__trial_generators__coupled_trial_generator__AutoWater": {
- "properties": {
- "auto_water_type": {
- "default": "Natural",
- "enum": [
- "Natural",
- "Both",
- "High pro"
- ],
- "title": "Auto water mode",
- "type": "string"
- },
- "multiplier": {
- "default": 0.8,
- "title": "Multiplier for auto reward",
- "type": "number"
- },
- "unrewarded": {
- "default": 200,
- "title": "Number of unrewarded trials before auto water",
- "type": "integer"
- },
- "ignored": {
- "default": 100,
- "title": "Number of ignored trials before auto water",
- "type": "integer"
- }
- },
- "title": "AutoWater",
- "type": "object"
}
}
}
\ No newline at end of file
diff --git a/src/Extensions/AindBehaviorDynamicForaging.Generated.cs b/src/Extensions/AindBehaviorDynamicForaging.Generated.cs
index 7618944..b27a6dd 100644
--- a/src/Extensions/AindBehaviorDynamicForaging.Generated.cs
+++ b/src/Extensions/AindBehaviorDynamicForaging.Generated.cs
@@ -49,7 +49,7 @@ public partial class AindDynamicForagingRig
public AindDynamicForagingRig()
{
- _aindBehaviorServicesPkgVersion = "0.13.0";
+ _aindBehaviorServicesPkgVersion = "0.13.2";
_version = "0.0.2-rc13";
_triggeredCameraController = new CameraControllerSpinnakerCamera();
_harpBehavior = new HarpBehavior();
@@ -584,50 +584,14 @@ public partial class AindDynamicForagingTaskParameters
private string _aindBehaviorServicesPkgVersion;
- private BlockParameters _blockParameters;
-
- private RewardProbability _rewardProbability;
-
- private System.Collections.Generic.List _uncoupledReward;
-
- private AindDynamicForagingTaskParametersRandomness _randomness;
-
- private DelayPeriod _delayPeriod;
-
- private double _rewardDelay;
-
- private AindBehaviorDynamicForagingTaskLogicAutoWater _autoWater;
-
- private InterTrialInterval _interTrialInterval;
-
- private Response _responseTime;
-
- private AutoBlock _autoBlock;
-
private RewardSize _rewardSize;
- private Warmup _warmup;
-
- private bool _noResponseTrialAddition;
-
- private RewardN _rewardN;
-
- private bool? _lickSpoutRetraction;
-
private TrialGeneratorSpec _trialGenerator;
public AindDynamicForagingTaskParameters()
{
- _aindBehaviorServicesPkgVersion = "0.13.0";
- _blockParameters = new BlockParameters();
- _rewardProbability = new RewardProbability();
- _randomness = AindDynamicForagingTaskParametersRandomness.Exponential;
- _delayPeriod = new DelayPeriod();
- _rewardDelay = 0D;
- _responseTime = new Response();
+ _aindBehaviorServicesPkgVersion = "0.13.2";
_rewardSize = new RewardSize();
- _noResponseTrialAddition = true;
- _lickSpoutRetraction = false;
_trialGenerator = new TrialGeneratorSpec();
}
@@ -635,21 +599,7 @@ protected AindDynamicForagingTaskParameters(AindDynamicForagingTaskParameters ot
{
_rngSeed = other._rngSeed;
_aindBehaviorServicesPkgVersion = other._aindBehaviorServicesPkgVersion;
- _blockParameters = other._blockParameters;
- _rewardProbability = other._rewardProbability;
- _uncoupledReward = other._uncoupledReward;
- _randomness = other._randomness;
- _delayPeriod = other._delayPeriod;
- _rewardDelay = other._rewardDelay;
- _autoWater = other._autoWater;
- _interTrialInterval = other._interTrialInterval;
- _responseTime = other._responseTime;
- _autoBlock = other._autoBlock;
_rewardSize = other._rewardSize;
- _warmup = other._warmup;
- _noResponseTrialAddition = other._noResponseTrialAddition;
- _rewardN = other._rewardN;
- _lickSpoutRetraction = other._lickSpoutRetraction;
_trialGenerator = other._trialGenerator;
}
@@ -683,172 +633,6 @@ public string AindBehaviorServicesPkgVersion
}
}
- ///
- /// Parameters describing block conditions.
- ///
- [System.Xml.Serialization.XmlIgnoreAttribute()]
- [Newtonsoft.Json.JsonPropertyAttribute("block_parameters")]
- [System.ComponentModel.DescriptionAttribute("Parameters describing block conditions.")]
- public BlockParameters BlockParameters
- {
- get
- {
- return _blockParameters;
- }
- set
- {
- _blockParameters = value;
- }
- }
-
- ///
- /// Parameters describing reward_probability.
- ///
- [System.Xml.Serialization.XmlIgnoreAttribute()]
- [Newtonsoft.Json.JsonPropertyAttribute("reward_probability")]
- [System.ComponentModel.DescriptionAttribute("Parameters describing reward_probability.")]
- public RewardProbability RewardProbability
- {
- get
- {
- return _rewardProbability;
- }
- set
- {
- _rewardProbability = value;
- }
- }
-
- [System.Xml.Serialization.XmlIgnoreAttribute()]
- [Newtonsoft.Json.JsonPropertyAttribute("uncoupled_reward")]
- public System.Collections.Generic.List UncoupledReward
- {
- get
- {
- return _uncoupledReward;
- }
- set
- {
- _uncoupledReward = value;
- }
- }
-
- [Newtonsoft.Json.JsonPropertyAttribute("randomness")]
- public AindDynamicForagingTaskParametersRandomness Randomness
- {
- get
- {
- return _randomness;
- }
- set
- {
- _randomness = value;
- }
- }
-
- ///
- /// Parameters describing delay period.
- ///
- [System.Xml.Serialization.XmlIgnoreAttribute()]
- [Newtonsoft.Json.JsonPropertyAttribute("delay_period")]
- [System.ComponentModel.DescriptionAttribute("Parameters describing delay period.")]
- public DelayPeriod DelayPeriod
- {
- get
- {
- return _delayPeriod;
- }
- set
- {
- _delayPeriod = value;
- }
- }
-
- [Newtonsoft.Json.JsonPropertyAttribute("reward_delay")]
- public double RewardDelay
- {
- get
- {
- return _rewardDelay;
- }
- set
- {
- _rewardDelay = value;
- }
- }
-
- ///
- /// Parameters describing auto water.
- ///
- [System.Xml.Serialization.XmlIgnoreAttribute()]
- [Newtonsoft.Json.JsonPropertyAttribute("auto_water")]
- [System.ComponentModel.DescriptionAttribute("Parameters describing auto water.")]
- public AindBehaviorDynamicForagingTaskLogicAutoWater AutoWater
- {
- get
- {
- return _autoWater;
- }
- set
- {
- _autoWater = value;
- }
- }
-
- ///
- /// Parameters describing iti.
- ///
- [System.Xml.Serialization.XmlIgnoreAttribute()]
- [Newtonsoft.Json.JsonPropertyAttribute("inter_trial_interval")]
- [System.ComponentModel.DescriptionAttribute("Parameters describing iti.")]
- public InterTrialInterval InterTrialInterval
- {
- get
- {
- return _interTrialInterval;
- }
- set
- {
- _interTrialInterval = value;
- }
- }
-
- ///
- /// Parameters describing response time.
- ///
- [System.Xml.Serialization.XmlIgnoreAttribute()]
- [Newtonsoft.Json.JsonPropertyAttribute("response_time")]
- [System.ComponentModel.DescriptionAttribute("Parameters describing response time.")]
- public Response ResponseTime
- {
- get
- {
- return _responseTime;
- }
- set
- {
- _responseTime = value;
- }
- }
-
- ///
- /// Parameters describing auto advancement to next block.
- ///
- [System.Xml.Serialization.XmlIgnoreAttribute()]
- [Newtonsoft.Json.JsonPropertyAttribute("auto_block")]
- [System.ComponentModel.DescriptionAttribute("Parameters describing auto advancement to next block.")]
- public AutoBlock AutoBlock
- {
- get
- {
- return _autoBlock;
- }
- set
- {
- _autoBlock = value;
- }
- }
-
///
/// Parameters describing reward size.
///
@@ -867,72 +651,6 @@ public RewardSize RewardSize
}
}
- ///
- /// Parameters describing warmup.
- ///
- [System.Xml.Serialization.XmlIgnoreAttribute()]
- [Newtonsoft.Json.JsonPropertyAttribute("warmup")]
- [System.ComponentModel.DescriptionAttribute("Parameters describing warmup.")]
- public Warmup Warmup
- {
- get
- {
- return _warmup;
- }
- set
- {
- _warmup = value;
- }
- }
-
- ///
- /// Add one trial to the block length on both lickspouts.
- ///
- [Newtonsoft.Json.JsonPropertyAttribute("no_response_trial_addition")]
- [System.ComponentModel.DescriptionAttribute("Add one trial to the block length on both lickspouts.")]
- public bool NoResponseTrialAddition
- {
- get
- {
- return _noResponseTrialAddition;
- }
- set
- {
- _noResponseTrialAddition = value;
- }
- }
-
- [System.Xml.Serialization.XmlIgnoreAttribute()]
- [Newtonsoft.Json.JsonPropertyAttribute("reward_n")]
- public RewardN RewardN
- {
- get
- {
- return _rewardN;
- }
- set
- {
- _rewardN = value;
- }
- }
-
- ///
- /// Lick spout retraction enabled.
- ///
- [Newtonsoft.Json.JsonPropertyAttribute("lick_spout_retraction")]
- [System.ComponentModel.DescriptionAttribute("Lick spout retraction enabled.")]
- public bool? LickSpoutRetraction
- {
- get
- {
- return _lickSpoutRetraction;
- }
- set
- {
- _lickSpoutRetraction = value;
- }
- }
-
///
/// Trial generator model for generating trials in the task.
///
@@ -965,21 +683,7 @@ protected virtual bool PrintMembers(System.Text.StringBuilder stringBuilder)
{
stringBuilder.Append("RngSeed = " + _rngSeed + ", ");
stringBuilder.Append("AindBehaviorServicesPkgVersion = " + _aindBehaviorServicesPkgVersion + ", ");
- stringBuilder.Append("BlockParameters = " + _blockParameters + ", ");
- stringBuilder.Append("RewardProbability = " + _rewardProbability + ", ");
- stringBuilder.Append("UncoupledReward = " + _uncoupledReward + ", ");
- stringBuilder.Append("Randomness = " + _randomness + ", ");
- stringBuilder.Append("DelayPeriod = " + _delayPeriod + ", ");
- stringBuilder.Append("RewardDelay = " + _rewardDelay + ", ");
- stringBuilder.Append("AutoWater = " + _autoWater + ", ");
- stringBuilder.Append("InterTrialInterval = " + _interTrialInterval + ", ");
- stringBuilder.Append("ResponseTime = " + _responseTime + ", ");
- stringBuilder.Append("AutoBlock = " + _autoBlock + ", ");
stringBuilder.Append("RewardSize = " + _rewardSize + ", ");
- stringBuilder.Append("Warmup = " + _warmup + ", ");
- stringBuilder.Append("NoResponseTrialAddition = " + _noResponseTrialAddition + ", ");
- stringBuilder.Append("RewardN = " + _rewardN + ", ");
- stringBuilder.Append("LickSpoutRetraction = " + _lickSpoutRetraction + ", ");
stringBuilder.Append("TrialGenerator = " + _trialGenerator);
return true;
}
@@ -1356,104 +1060,6 @@ public override string ToString()
}
- [System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.7.2.0 (Newtonsoft.Json v13.0.0.0)")]
- [Bonsai.WorkflowElementCategoryAttribute(Bonsai.ElementCategory.Source)]
- [Bonsai.CombinatorAttribute(MethodName="Generate")]
- public partial class AutoBlock
- {
-
- private AutoBlockAdvancedBlockAuto _advancedBlockAuto;
-
- private double _switchThr;
-
- private int _pointsInARow;
-
- public AutoBlock()
- {
- _advancedBlockAuto = AutoBlockAdvancedBlockAuto.Now;
- _switchThr = 0.5D;
- _pointsInARow = 5;
- }
-
- protected AutoBlock(AutoBlock other)
- {
- _advancedBlockAuto = other._advancedBlockAuto;
- _switchThr = other._switchThr;
- _pointsInARow = other._pointsInARow;
- }
-
- [Newtonsoft.Json.JsonPropertyAttribute("advanced_block_auto")]
- public AutoBlockAdvancedBlockAuto AdvancedBlockAuto
- {
- get
- {
- return _advancedBlockAuto;
- }
- set
- {
- _advancedBlockAuto = value;
- }
- }
-
- [Newtonsoft.Json.JsonPropertyAttribute("switch_thr")]
- public double SwitchThr
- {
- get
- {
- return _switchThr;
- }
- set
- {
- _switchThr = value;
- }
- }
-
- [Newtonsoft.Json.JsonPropertyAttribute("points_in_a_row")]
- public int PointsInARow
- {
- get
- {
- return _pointsInARow;
- }
- set
- {
- _pointsInARow = value;
- }
- }
-
- public System.IObservable Generate()
- {
- return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new AutoBlock(this)));
- }
-
- public System.IObservable Generate(System.IObservable source)
- {
- return System.Reactive.Linq.Observable.Select(source, _ => new AutoBlock(this));
- }
-
- protected virtual bool PrintMembers(System.Text.StringBuilder stringBuilder)
- {
- stringBuilder.Append("AdvancedBlockAuto = " + _advancedBlockAuto + ", ");
- stringBuilder.Append("SwitchThr = " + _switchThr + ", ");
- stringBuilder.Append("PointsInARow = " + _pointsInARow);
- return true;
- }
-
- public override string ToString()
- {
- System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder();
- stringBuilder.Append(GetType().Name);
- stringBuilder.Append(" { ");
- if (PrintMembers(stringBuilder))
- {
- stringBuilder.Append(" ");
- }
- stringBuilder.Append("}");
- return stringBuilder.ToString();
- }
- }
-
-
///
/// Motor axis available
///
@@ -1721,104 +1327,105 @@ public override string ToString()
}
+ ///
+ /// Parameters controlling when behavior is considered stable enough to switch blocks.
+ ///
[System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.7.2.0 (Newtonsoft.Json v13.0.0.0)")]
+ [System.ComponentModel.DescriptionAttribute("Parameters controlling when behavior is considered stable enough to switch blocks" +
+ ".")]
[Bonsai.WorkflowElementCategoryAttribute(Bonsai.ElementCategory.Source)]
[Bonsai.CombinatorAttribute(MethodName="Generate")]
- public partial class BlockParameters
+ public partial class BehaviorStabilityParameters
{
- private int _min;
+ private BehaviorStabilityParametersBehaviorEvaluationMode _behaviorEvaluationMode;
- private int _max;
+ private double _behaviorStabilityFraction;
- private int _beta;
+ private int _minConsecutiveStableTrials;
- private int _minReward;
-
- public BlockParameters()
+ public BehaviorStabilityParameters()
{
- _min = 20;
- _max = 60;
- _beta = 20;
- _minReward = 1;
+ _behaviorEvaluationMode = BehaviorStabilityParametersBehaviorEvaluationMode.End;
+ _behaviorStabilityFraction = 0.5D;
+ _minConsecutiveStableTrials = 5;
}
- protected BlockParameters(BlockParameters other)
+ protected BehaviorStabilityParameters(BehaviorStabilityParameters other)
{
- _min = other._min;
- _max = other._max;
- _beta = other._beta;
- _minReward = other._minReward;
+ _behaviorEvaluationMode = other._behaviorEvaluationMode;
+ _behaviorStabilityFraction = other._behaviorStabilityFraction;
+ _minConsecutiveStableTrials = other._minConsecutiveStableTrials;
}
- [Newtonsoft.Json.JsonPropertyAttribute("min")]
- public int Min
+ ///
+ /// When to evaluate stability — at the end of the block (end) or at any point during the block (anytime).
+ ///
+ [Newtonsoft.Json.JsonPropertyAttribute("behavior_evaluation_mode")]
+ [System.ComponentModel.DescriptionAttribute("When to evaluate stability — at the end of the block (end) or at any point during" +
+ " the block (anytime).")]
+ public BehaviorStabilityParametersBehaviorEvaluationMode BehaviorEvaluationMode
{
get
{
- return _min;
+ return _behaviorEvaluationMode;
}
set
{
- _min = value;
+ _behaviorEvaluationMode = value;
}
}
- [Newtonsoft.Json.JsonPropertyAttribute("max")]
- public int Max
+ ///
+ /// Fraction scaling reward-probability difference for behavior.
+ ///
+ [Newtonsoft.Json.JsonPropertyAttribute("behavior_stability_fraction")]
+ [System.ComponentModel.DescriptionAttribute("Fraction scaling reward-probability difference for behavior.")]
+ public double BehaviorStabilityFraction
{
get
{
- return _max;
- }
- set
- {
- _max = value;
- }
- }
-
- [Newtonsoft.Json.JsonPropertyAttribute("beta")]
- public int Beta
- {
- get
- {
- return _beta;
+ return _behaviorStabilityFraction;
}
set
{
- _beta = value;
+ _behaviorStabilityFraction = value;
}
}
- [Newtonsoft.Json.JsonPropertyAttribute("min_reward")]
- public int MinReward
+ ///
+ /// Minimum number of consecutive trials satisfying the behavioral stability fraction.
+ ///
+ [Newtonsoft.Json.JsonPropertyAttribute("min_consecutive_stable_trials")]
+ [System.ComponentModel.DescriptionAttribute("Minimum number of consecutive trials satisfying the behavioral stability fraction" +
+ ".")]
+ public int MinConsecutiveStableTrials
{
get
{
- return _minReward;
+ return _minConsecutiveStableTrials;
}
set
{
- _minReward = value;
+ _minConsecutiveStableTrials = value;
}
}
- public System.IObservable Generate()
+ public System.IObservable Generate()
{
- return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new BlockParameters(this)));
+ return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new BehaviorStabilityParameters(this)));
}
- public System.IObservable Generate(System.IObservable source)
+ public System.IObservable Generate(System.IObservable source)
{
- return System.Reactive.Linq.Observable.Select(source, _ => new BlockParameters(this));
+ return System.Reactive.Linq.Observable.Select(source, _ => new BehaviorStabilityParameters(this));
}
protected virtual bool PrintMembers(System.Text.StringBuilder stringBuilder)
{
- stringBuilder.Append("Min = " + _min + ", ");
- stringBuilder.Append("Max = " + _max + ", ");
- stringBuilder.Append("Beta = " + _beta + ", ");
- stringBuilder.Append("MinReward = " + _minReward);
+ stringBuilder.Append("BehaviorEvaluationMode = " + _behaviorEvaluationMode + ", ");
+ stringBuilder.Append("BehaviorStabilityFraction = " + _behaviorStabilityFraction + ", ");
+ stringBuilder.Append("MinConsecutiveStableTrials = " + _minConsecutiveStableTrials);
return true;
}
@@ -1837,246 +1444,211 @@ public override string ToString()
}
+ ///
+ /// A beta probability distribution.
+ ///
+ ///Continuous distribution bounded between 0 and 1. Commonly used
+ ///for modeling probabilities and proportions.
+ ///
[System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.7.2.0 (Newtonsoft.Json v13.0.0.0)")]
+ [System.ComponentModel.DescriptionAttribute("A beta probability distribution.\n\nContinuous distribution bounded between 0 and 1" +
+ ". Commonly used\nfor modeling probabilities and proportions.")]
[Bonsai.WorkflowElementCategoryAttribute(Bonsai.ElementCategory.Source)]
[Bonsai.CombinatorAttribute(MethodName="Generate")]
- public partial class CameraControllerSpinnakerCamera
+ public partial class BetaDistribution : Distribution
{
- private string _deviceType;
-
- private BaseModel _calibration;
-
- private System.Collections.Generic.Dictionary _cameras;
+ private BetaDistributionParameters _distributionParameters;
- private int? _frameRate;
+ private TruncationParameters _truncationParameters;
- public CameraControllerSpinnakerCamera()
- {
- _deviceType = "CameraController";
- _cameras = new System.Collections.Generic.Dictionary();
- _frameRate = 30;
- }
+ private ScalingParameters _scalingParameters;
- protected CameraControllerSpinnakerCamera(CameraControllerSpinnakerCamera other)
+ public BetaDistribution()
{
- _deviceType = other._deviceType;
- _calibration = other._calibration;
- _cameras = other._cameras;
- _frameRate = other._frameRate;
+ _distributionParameters = new BetaDistributionParameters();
}
- [Newtonsoft.Json.JsonPropertyAttribute("device_type")]
- public string DeviceType
+ protected BetaDistribution(BetaDistribution other) :
+ base(other)
{
- get
- {
- return _deviceType;
- }
- set
- {
- _deviceType = value;
- }
+ _distributionParameters = other._distributionParameters;
+ _truncationParameters = other._truncationParameters;
+ _scalingParameters = other._scalingParameters;
}
///
- /// Calibration for the device.
+ /// Parameters of the distribution
///
[System.Xml.Serialization.XmlIgnoreAttribute()]
- [Newtonsoft.Json.JsonPropertyAttribute("calibration")]
- [System.ComponentModel.DescriptionAttribute("Calibration for the device.")]
- public BaseModel Calibration
+ [Newtonsoft.Json.JsonPropertyAttribute("distribution_parameters")]
+ [System.ComponentModel.DescriptionAttribute("Parameters of the distribution")]
+ public BetaDistributionParameters DistributionParameters
{
get
{
- return _calibration;
+ return _distributionParameters;
}
set
{
- _calibration = value;
+ _distributionParameters = value;
}
}
///
- /// Cameras to be instantiated
+ /// Truncation parameters of the distribution
///
[System.Xml.Serialization.XmlIgnoreAttribute()]
- [Newtonsoft.Json.JsonPropertyAttribute("cameras", Required=Newtonsoft.Json.Required.Always)]
- [System.ComponentModel.DescriptionAttribute("Cameras to be instantiated")]
- public System.Collections.Generic.Dictionary Cameras
+ [Newtonsoft.Json.JsonPropertyAttribute("truncation_parameters")]
+ [System.ComponentModel.DescriptionAttribute("Truncation parameters of the distribution")]
+ public TruncationParameters TruncationParameters
{
get
{
- return _cameras;
+ return _truncationParameters;
}
set
{
- _cameras = value;
+ _truncationParameters = value;
}
}
///
- /// Frame rate of the trigger to all cameras
+ /// Scaling parameters of the distribution
///
- [Newtonsoft.Json.JsonPropertyAttribute("frame_rate")]
- [System.ComponentModel.DescriptionAttribute("Frame rate of the trigger to all cameras")]
- public int? FrameRate
+ [System.Xml.Serialization.XmlIgnoreAttribute()]
+ [Newtonsoft.Json.JsonPropertyAttribute("scaling_parameters")]
+ [System.ComponentModel.DescriptionAttribute("Scaling parameters of the distribution")]
+ public ScalingParameters ScalingParameters
{
get
{
- return _frameRate;
+ return _scalingParameters;
}
set
{
- _frameRate = value;
+ _scalingParameters = value;
}
}
- public System.IObservable Generate()
- {
- return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new CameraControllerSpinnakerCamera(this)));
- }
-
- public System.IObservable Generate(System.IObservable source)
+ public System.IObservable Generate()
{
- return System.Reactive.Linq.Observable.Select(source, _ => new CameraControllerSpinnakerCamera(this));
+ return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new BetaDistribution(this)));
}
- protected virtual bool PrintMembers(System.Text.StringBuilder stringBuilder)
+ public System.IObservable Generate(System.IObservable source)
{
- stringBuilder.Append("DeviceType = " + _deviceType + ", ");
- stringBuilder.Append("Calibration = " + _calibration + ", ");
- stringBuilder.Append("Cameras = " + _cameras + ", ");
- stringBuilder.Append("FrameRate = " + _frameRate);
- return true;
+ return System.Reactive.Linq.Observable.Select(source, _ => new BetaDistribution(this));
}
- public override string ToString()
+ protected override bool PrintMembers(System.Text.StringBuilder stringBuilder)
{
- System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder();
- stringBuilder.Append(GetType().Name);
- stringBuilder.Append(" { ");
- if (PrintMembers(stringBuilder))
+ if (base.PrintMembers(stringBuilder))
{
- stringBuilder.Append(" ");
+ stringBuilder.Append(", ");
}
- stringBuilder.Append("}");
- return stringBuilder.ToString();
+ stringBuilder.Append("DistributionParameters = " + _distributionParameters + ", ");
+ stringBuilder.Append("TruncationParameters = " + _truncationParameters + ", ");
+ stringBuilder.Append("ScalingParameters = " + _scalingParameters);
+ return true;
}
}
+ ///
+ /// Parameters for a beta distribution.
+ ///
+ ///Defined by alpha and beta shape parameters.
+ ///
[System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.7.2.0 (Newtonsoft.Json v13.0.0.0)")]
+ [System.ComponentModel.DescriptionAttribute("Parameters for a beta distribution.\n\nDefined by alpha and beta shape parameters.")]
[Bonsai.WorkflowElementCategoryAttribute(Bonsai.ElementCategory.Source)]
[Bonsai.CombinatorAttribute(MethodName="Generate")]
- public partial class CameraControllerWebCamera
+ public partial class BetaDistributionParameters
{
- private string _deviceType;
-
- private BaseModel _calibration;
-
- private System.Collections.Generic.Dictionary _cameras;
+ private string _family;
- private int? _frameRate;
+ private double _alpha;
- public CameraControllerWebCamera()
- {
- _deviceType = "CameraController";
- _cameras = new System.Collections.Generic.Dictionary();
- _frameRate = 30;
- }
+ private double _beta;
- protected CameraControllerWebCamera(CameraControllerWebCamera other)
+ public BetaDistributionParameters()
{
- _deviceType = other._deviceType;
- _calibration = other._calibration;
- _cameras = other._cameras;
- _frameRate = other._frameRate;
+ _family = "Beta";
+ _alpha = 5D;
+ _beta = 5D;
}
- [Newtonsoft.Json.JsonPropertyAttribute("device_type")]
- public string DeviceType
+ protected BetaDistributionParameters(BetaDistributionParameters other)
{
- get
- {
- return _deviceType;
- }
- set
- {
- _deviceType = value;
- }
+ _family = other._family;
+ _alpha = other._alpha;
+ _beta = other._beta;
}
- ///
- /// Calibration for the device.
- ///
- [System.Xml.Serialization.XmlIgnoreAttribute()]
- [Newtonsoft.Json.JsonPropertyAttribute("calibration")]
- [System.ComponentModel.DescriptionAttribute("Calibration for the device.")]
- public BaseModel Calibration
+ [Newtonsoft.Json.JsonPropertyAttribute("family")]
+ public string Family
{
get
{
- return _calibration;
+ return _family;
}
set
{
- _calibration = value;
+ _family = value;
}
}
///
- /// Cameras to be instantiated
+ /// Alpha parameter of the distribution
///
- [System.Xml.Serialization.XmlIgnoreAttribute()]
- [Newtonsoft.Json.JsonPropertyAttribute("cameras", Required=Newtonsoft.Json.Required.Always)]
- [System.ComponentModel.DescriptionAttribute("Cameras to be instantiated")]
- public System.Collections.Generic.Dictionary Cameras
+ [Newtonsoft.Json.JsonPropertyAttribute("alpha")]
+ [System.ComponentModel.DescriptionAttribute("Alpha parameter of the distribution")]
+ public double Alpha
{
get
{
- return _cameras;
+ return _alpha;
}
set
{
- _cameras = value;
+ _alpha = value;
}
}
///
- /// Frame rate of the trigger to all cameras
+ /// Beta parameter of the distribution
///
- [Newtonsoft.Json.JsonPropertyAttribute("frame_rate")]
- [System.ComponentModel.DescriptionAttribute("Frame rate of the trigger to all cameras")]
- public int? FrameRate
+ [Newtonsoft.Json.JsonPropertyAttribute("beta")]
+ [System.ComponentModel.DescriptionAttribute("Beta parameter of the distribution")]
+ public double Beta
{
get
{
- return _frameRate;
+ return _beta;
}
set
{
- _frameRate = value;
+ _beta = value;
}
}
- public System.IObservable Generate()
+ public System.IObservable Generate()
{
- return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new CameraControllerWebCamera(this)));
+ return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new BetaDistributionParameters(this)));
}
- public System.IObservable Generate(System.IObservable source)
+ public System.IObservable Generate(System.IObservable source)
{
- return System.Reactive.Linq.Observable.Select(source, _ => new CameraControllerWebCamera(this));
+ return System.Reactive.Linq.Observable.Select(source, _ => new BetaDistributionParameters(this));
}
protected virtual bool PrintMembers(System.Text.StringBuilder stringBuilder)
{
- stringBuilder.Append("DeviceType = " + _deviceType + ", ");
- stringBuilder.Append("Calibration = " + _calibration + ", ");
- stringBuilder.Append("Cameras = " + _cameras + ", ");
- stringBuilder.Append("FrameRate = " + _frameRate);
+ stringBuilder.Append("Family = " + _family + ", ");
+ stringBuilder.Append("Alpha = " + _alpha + ", ");
+ stringBuilder.Append("Beta = " + _beta);
return true;
}
@@ -2095,414 +1667,355 @@ public override string ToString()
}
+ ///
+ /// A binomial probability distribution.
+ ///
+ ///Models the number of successes in a fixed number of independent
+ ///Bernoulli trials with constant success probability.
+ ///
[System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.7.2.0 (Newtonsoft.Json v13.0.0.0)")]
+ [System.ComponentModel.DescriptionAttribute("A binomial probability distribution.\n\nModels the number of successes in a fixed n" +
+ "umber of independent\nBernoulli trials with constant success probability.")]
[Bonsai.WorkflowElementCategoryAttribute(Bonsai.ElementCategory.Source)]
[Bonsai.CombinatorAttribute(MethodName="Generate")]
- public partial class ConnectedClockOutput
+ public partial class BinomialDistribution : Distribution
{
- private string _targetDevice;
+ private BinomialDistributionParameters _distributionParameters;
- private int _outputChannel;
+ private TruncationParameters _truncationParameters;
- public ConnectedClockOutput()
+ private ScalingParameters _scalingParameters;
+
+ public BinomialDistribution()
{
+ _distributionParameters = new BinomialDistributionParameters();
}
- protected ConnectedClockOutput(ConnectedClockOutput other)
+ protected BinomialDistribution(BinomialDistribution other) :
+ base(other)
{
- _targetDevice = other._targetDevice;
- _outputChannel = other._outputChannel;
+ _distributionParameters = other._distributionParameters;
+ _truncationParameters = other._truncationParameters;
+ _scalingParameters = other._scalingParameters;
}
///
- /// Optional device name to provide user additional information
+ /// Parameters of the distribution
///
- [Newtonsoft.Json.JsonPropertyAttribute("target_device")]
- [System.ComponentModel.DescriptionAttribute("Optional device name to provide user additional information")]
- public string TargetDevice
+ [System.Xml.Serialization.XmlIgnoreAttribute()]
+ [Newtonsoft.Json.JsonPropertyAttribute("distribution_parameters")]
+ [System.ComponentModel.DescriptionAttribute("Parameters of the distribution")]
+ public BinomialDistributionParameters DistributionParameters
{
get
{
- return _targetDevice;
+ return _distributionParameters;
}
set
{
- _targetDevice = value;
+ _distributionParameters = value;
}
}
///
- /// Output channel
+ /// Truncation parameters of the distribution
///
- [Newtonsoft.Json.JsonPropertyAttribute("output_channel", Required=Newtonsoft.Json.Required.Always)]
- [System.ComponentModel.DescriptionAttribute("Output channel")]
- public int OutputChannel
+ [System.Xml.Serialization.XmlIgnoreAttribute()]
+ [Newtonsoft.Json.JsonPropertyAttribute("truncation_parameters")]
+ [System.ComponentModel.DescriptionAttribute("Truncation parameters of the distribution")]
+ public TruncationParameters TruncationParameters
{
get
{
- return _outputChannel;
+ return _truncationParameters;
}
set
{
- _outputChannel = value;
+ _truncationParameters = value;
}
}
- public System.IObservable Generate()
+ ///
+ /// Scaling parameters of the distribution
+ ///
+ [System.Xml.Serialization.XmlIgnoreAttribute()]
+ [Newtonsoft.Json.JsonPropertyAttribute("scaling_parameters")]
+ [System.ComponentModel.DescriptionAttribute("Scaling parameters of the distribution")]
+ public ScalingParameters ScalingParameters
{
- return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new ConnectedClockOutput(this)));
+ get
+ {
+ return _scalingParameters;
+ }
+ set
+ {
+ _scalingParameters = value;
+ }
}
- public System.IObservable Generate(System.IObservable source)
+ public System.IObservable Generate()
{
- return System.Reactive.Linq.Observable.Select(source, _ => new ConnectedClockOutput(this));
+ return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new BinomialDistribution(this)));
}
- protected virtual bool PrintMembers(System.Text.StringBuilder stringBuilder)
+ public System.IObservable Generate(System.IObservable source)
{
- stringBuilder.Append("TargetDevice = " + _targetDevice + ", ");
- stringBuilder.Append("OutputChannel = " + _outputChannel);
- return true;
+ return System.Reactive.Linq.Observable.Select(source, _ => new BinomialDistribution(this));
}
- public override string ToString()
+ protected override bool PrintMembers(System.Text.StringBuilder stringBuilder)
{
- System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder();
- stringBuilder.Append(GetType().Name);
- stringBuilder.Append(" { ");
- if (PrintMembers(stringBuilder))
+ if (base.PrintMembers(stringBuilder))
{
- stringBuilder.Append(" ");
+ stringBuilder.Append(", ");
}
- stringBuilder.Append("}");
- return stringBuilder.ToString();
+ stringBuilder.Append("DistributionParameters = " + _distributionParameters + ", ");
+ stringBuilder.Append("TruncationParameters = " + _truncationParameters + ", ");
+ stringBuilder.Append("ScalingParameters = " + _scalingParameters);
+ return true;
}
}
+ ///
+ /// Parameters for a binomial distribution.
+ ///
+ ///Defined by number of trials (n) and success probability (p).
+ ///
[System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.7.2.0 (Newtonsoft.Json v13.0.0.0)")]
+ [System.ComponentModel.DescriptionAttribute("Parameters for a binomial distribution.\n\nDefined by number of trials (n) and succ" +
+ "ess probability (p).")]
[Bonsai.WorkflowElementCategoryAttribute(Bonsai.ElementCategory.Source)]
[Bonsai.CombinatorAttribute(MethodName="Generate")]
- public partial class CoupledTrialGeneratorSpec : TrialGeneratorSpec
+ public partial class BinomialDistributionParameters
{
- private object _iti;
-
- private object _quiescentPeriod;
-
- private double _responseTime;
-
- private double _rewardConsumeTime;
-
- private object _blockParameters;
-
- private int _minReward;
-
- private AindBehaviorDynamicForagingTaskLogicTrialGeneratorsCoupledTrialGeneratorAutoWater _autoWater;
-
- private CoupledTrialGeneratorSpecBehaviorEvaluationMode _behaviorEvaluationMode;
-
- private double _switchThr;
-
- private int _pointsInARow;
-
- private Warmup _warmup;
-
- private bool _noResponseTrialAddition;
-
- private int _kernelSize;
+ private string _family;
- private RewardProbability _rewardProbabilitySpecs;
+ private int _n;
- private System.Collections.Generic.List