diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json
index 44b1c27d..134d7ab4 100644
--- a/.config/dotnet-tools.json
+++ b/.config/dotnet-tools.json
@@ -3,7 +3,7 @@
"isRoot": true,
"tools": {
"bonsai.sgen": {
- "version": "0.6.1",
+ "version": "0.9.0",
"commands": [
"bonsai.sgen"
]
diff --git a/bonsai/Bonsai.config b/bonsai/Bonsai.config
index ca095052..a220b5a6 100644
--- a/bonsai/Bonsai.config
+++ b/bonsai/Bonsai.config
@@ -4,10 +4,11 @@
-
-
-
-
+
+
+
+
+
@@ -30,8 +31,8 @@
-
-
+
+
@@ -50,7 +51,7 @@
-
+
@@ -74,7 +75,7 @@
-
+
@@ -84,6 +85,7 @@
+
@@ -132,10 +134,11 @@
-
-
-
-
+
+
+
+
+
@@ -157,8 +160,8 @@
-
-
+
+
@@ -175,7 +178,7 @@
-
+
@@ -197,7 +200,7 @@
-
+
diff --git a/docs/conf.py b/docs/conf.py
index 323ce512..1071ef14 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -3,6 +3,8 @@
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
+from typing import Type
+
import erdantic as erd
from pydantic import BaseModel
@@ -81,7 +83,7 @@ def linkcode_resolve(domain, info):
_static_path = "_static"
-def export_model_diagram(model: BaseModel, root: str = _static_path) -> None:
+def export_model_diagram(model: Type[BaseModel], root: str = _static_path) -> None:
diagram = erd.create(model)
diagram.draw(f"{root}/{model.__name__}.svg")
diff --git a/examples/rig.py b/examples/rig.py
index b55ccf99..33ab84d1 100644
--- a/examples/rig.py
+++ b/examples/rig.py
@@ -1,41 +1,31 @@
import datetime
import os
-import aind_behavior_services.rig as rig
-from aind_behavior_services.calibration.aind_manipulator import (
+from aind_behavior_services.rig import cameras, visual_stimulation
+from aind_behavior_services.rig.aind_manipulator import (
AindManipulatorCalibration,
- AindManipulatorCalibrationInput,
- AindManipulatorCalibrationOutput,
Axis,
AxisConfiguration,
ManipulatorPosition,
)
-from aind_behavior_services.calibration.olfactometer import (
+from aind_behavior_services.rig.harp import (
+ HarpBehavior,
+ HarpLicketySplit,
+ HarpSniffDetector,
+ HarpWhiteRabbit,
+)
+from aind_behavior_services.rig.olfactometer import (
Olfactometer,
OlfactometerCalibration,
- OlfactometerCalibrationInput,
- OlfactometerCalibrationOutput,
OlfactometerChannel,
OlfactometerChannelConfig,
OlfactometerChannelType,
)
-from aind_behavior_services.calibration.treadmill import (
+from aind_behavior_services.rig.treadmill import (
Treadmill,
TreadmillCalibration,
- TreadmillCalibrationInput,
- TreadmillCalibrationOutput,
-)
-from aind_behavior_services.calibration.water_valve import (
- Measurement,
- WaterValveCalibration,
- WaterValveCalibrationInput,
-)
-from aind_behavior_services.rig.harp import (
- HarpBehavior,
- HarpLicketySplit,
- HarpSniffDetector,
- HarpWhiteRabbit,
)
+from aind_behavior_services.rig.water_valve import Measurement, calibrate_water_valves
from aind_behavior_vr_foraging.rig import (
AindManipulatorDevice,
@@ -44,85 +34,78 @@
)
manipulator_calibration = AindManipulatorCalibration(
- output=AindManipulatorCalibrationOutput(),
- input=AindManipulatorCalibrationInput(
- full_step_to_mm=(ManipulatorPosition(x=0.010, y1=0.010, y2=0.010, z=0.010)),
- axis_configuration=[
- AxisConfiguration(axis=Axis.Y1, min_limit=-0.01, max_limit=25),
- AxisConfiguration(axis=Axis.Y2, min_limit=-0.01, max_limit=25),
- AxisConfiguration(axis=Axis.X, min_limit=-0.01, max_limit=25),
- AxisConfiguration(axis=Axis.Z, min_limit=-0.01, max_limit=25),
- ],
- homing_order=[Axis.Y1, Axis.Y2, Axis.X, Axis.Z],
- initial_position=ManipulatorPosition(y1=0, y2=0, x=0, z=0),
- ),
+ full_step_to_mm=(ManipulatorPosition(x=0.010, y1=0.010, y2=0.010, z=0.010)),
+ axis_configuration=[
+ AxisConfiguration(axis=Axis.Y1, min_limit=-0.01, max_limit=25),
+ AxisConfiguration(axis=Axis.Y2, min_limit=-0.01, max_limit=25),
+ AxisConfiguration(axis=Axis.X, min_limit=-0.01, max_limit=25),
+ AxisConfiguration(axis=Axis.Z, min_limit=-0.01, max_limit=25),
+ ],
+ homing_order=[Axis.Y1, Axis.Y2, Axis.X, Axis.Z],
+ initial_position=ManipulatorPosition(y1=0, y2=0, x=0, z=0),
)
olfactometer_calibration = OlfactometerCalibration(
- output=OlfactometerCalibrationOutput(),
date=datetime.datetime.now(),
- input=OlfactometerCalibrationInput(
- channel_config={
- OlfactometerChannel.Channel0: OlfactometerChannelConfig(
- channel_index=OlfactometerChannel.Channel0,
- channel_type=OlfactometerChannelType.ODOR,
- flow_rate_capacity=100,
- flow_rate=100,
- odorant="Amyl Acetate",
- odorant_dilution=1.5,
- ),
- OlfactometerChannel.Channel1: OlfactometerChannelConfig(
- channel_index=OlfactometerChannel.Channel1,
- channel_type=OlfactometerChannelType.ODOR,
- flow_rate_capacity=100,
- flow_rate=100,
- odorant="Banana",
- odorant_dilution=1.5,
- ),
- OlfactometerChannel.Channel2: OlfactometerChannelConfig(
- channel_index=OlfactometerChannel.Channel2,
- channel_type=OlfactometerChannelType.ODOR,
- flow_rate_capacity=100,
- flow_rate=100,
- odorant="Apple",
- odorant_dilution=1.5,
- ),
- OlfactometerChannel.Channel3: OlfactometerChannelConfig(
- channel_index=OlfactometerChannel.Channel3,
- channel_type=OlfactometerChannelType.CARRIER,
- flow_rate_capacity=1000,
- ),
- }
- ),
+ channel_config={
+ OlfactometerChannel.Channel0: OlfactometerChannelConfig(
+ channel_index=OlfactometerChannel.Channel0,
+ channel_type=OlfactometerChannelType.ODOR,
+ flow_rate_capacity=100,
+ flow_rate=100,
+ odorant="Amyl Acetate",
+ odorant_dilution=1.5,
+ ),
+ OlfactometerChannel.Channel1: OlfactometerChannelConfig(
+ channel_index=OlfactometerChannel.Channel1,
+ channel_type=OlfactometerChannelType.ODOR,
+ flow_rate_capacity=100,
+ flow_rate=100,
+ odorant="Banana",
+ odorant_dilution=1.5,
+ ),
+ OlfactometerChannel.Channel2: OlfactometerChannelConfig(
+ channel_index=OlfactometerChannel.Channel2,
+ channel_type=OlfactometerChannelType.ODOR,
+ flow_rate_capacity=100,
+ flow_rate=100,
+ odorant="Apple",
+ odorant_dilution=1.5,
+ ),
+ OlfactometerChannel.Channel3: OlfactometerChannelConfig(
+ channel_index=OlfactometerChannel.Channel3,
+ channel_type=OlfactometerChannelType.CARRIER,
+ flow_rate_capacity=1000,
+ ),
+ },
)
-water_valve_input = WaterValveCalibrationInput(
+water_valve_calibration = calibrate_water_valves(
measurements=[
Measurement(valve_open_interval=0.2, valve_open_time=0.01, water_weight=[0.6, 0.6], repeat_count=200),
Measurement(valve_open_interval=0.2, valve_open_time=0.02, water_weight=[1.2, 1.2], repeat_count=200),
]
)
-water_valve_calibration = WaterValveCalibration(
- input=water_valve_input, output=water_valve_input.calibrate_output(), date=datetime.datetime.now()
-)
-video_writer = rig.cameras.VideoWriterFfmpeg(frame_rate=120, container_extension="mp4")
+video_writer = cameras.VideoWriterFfmpeg(frame_rate=120, container_extension="mp4")
rig = AindVrForagingRig(
+ data_directory=r"C:/data",
+ computer_name="TestRigComputer",
rig_name="test_rig",
- triggered_camera_controller=rig.cameras.CameraController[rig.cameras.SpinnakerCamera](
+ triggered_camera_controller=cameras.CameraController[cameras.SpinnakerCamera](
frame_rate=120,
cameras={
- "FaceCamera": rig.cameras.SpinnakerCamera(
+ "FaceCamera": cameras.SpinnakerCamera(
serial_number="SerialNumber", binning=1, exposure=5000, gain=0, video_writer=video_writer
),
- "SideCamera": rig.cameras.SpinnakerCamera(
+ "SideCamera": cameras.SpinnakerCamera(
serial_number="SerialNumber", binning=1, exposure=5000, gain=0, video_writer=video_writer
),
},
),
- monitoring_camera_controller=rig.cameras.CameraController[rig.cameras.WebCamera](
- cameras={"WebCam0": rig.cameras.WebCamera(index=0)}
+ monitoring_camera_controller=cameras.CameraController[cameras.WebCamera](
+ cameras={"WebCam0": cameras.WebCamera(index=0)}
),
harp_behavior=HarpBehavior(port_name="COM3"),
harp_olfactometer=Olfactometer(port_name="COM4", calibration=olfactometer_calibration),
@@ -133,14 +116,11 @@
harp_treadmill=Treadmill(
port_name="COM8",
calibration=TreadmillCalibration(
- input=TreadmillCalibrationInput(),
- output=TreadmillCalibrationOutput(
- wheel_diameter=15, pulses_per_revolution=28800, brake_lookup_calibration=[[0, 0], [1, 65535]]
- ),
+ wheel_diameter=15, pulses_per_revolution=28800, brake_lookup_calibration=[[0, 0], [1, 65535]]
),
),
manipulator=AindManipulatorDevice(port_name="COM9", calibration=manipulator_calibration),
- screen=rig.visual_stimulation.Screen(display_index=1),
+ screen=visual_stimulation.ScreenAssembly(display_index=1),
calibration=RigCalibration(water_valve=water_valve_calibration),
)
diff --git a/examples/session.py b/examples/session.py
index 3fed0bf1..d8e9c512 100644
--- a/examples/session.py
+++ b/examples/session.py
@@ -1,15 +1,13 @@
import datetime
import os
-from aind_behavior_services.session import AindBehaviorSessionModel
+from aind_behavior_services.session import Session
-session = AindBehaviorSessionModel(
+session = Session(
date=datetime.datetime.now(tz=datetime.timezone.utc),
experiment="AindVrForaging",
- root_path="c://",
subject="test",
notes="test session",
- experiment_version="0.1.0",
allow_dirty_repo=True,
skip_hardware_validation=False,
experimenter=["Foo", "Bar"],
diff --git a/examples/task_mcm.py b/examples/task_mcm.py
index 9de7adb5..90e0593f 100644
--- a/examples/task_mcm.py
+++ b/examples/task_mcm.py
@@ -1,7 +1,7 @@
import os
from typing import cast
-import aind_behavior_services.task_logic.distributions as distributions
+import aind_behavior_services.task.distributions as distributions
import numpy as np
from aind_behavior_curriculum import Stage, TrainerState
from scipy.linalg import expm
@@ -85,6 +85,10 @@ def compute_cmc_transition_probability(n_states, rep_rate, T=3.5, dt=0.1) -> np.
rhos = [0.9, 0.9, 0.9]
+def odor_concentration_from_index(odor_index: int) -> list[float]:
+ return [1.0 if i == odor_index else 0.0 for i in range(3)]
+
+
def make_patch(
label: str,
state_index: int,
@@ -118,7 +122,7 @@ def make_patch(
return vr_task_logic.Patch(
label=label,
state_index=state_index,
- odor_specification=vr_task_logic.OdorSpecification(index=odor_index, concentration=1),
+ odor_specification=odor_concentration_from_index(odor_index),
reward_specification=vr_task_logic.RewardSpecification(
amount=vr_task_logic.scalar_value(reward_amount),
probability=vr_task_logic.scalar_value(p_max),
diff --git a/examples/task_patch_foraging.py b/examples/task_patch_foraging.py
index 70582382..3117810c 100644
--- a/examples/task_patch_foraging.py
+++ b/examples/task_patch_foraging.py
@@ -1,13 +1,9 @@
import os
-import aind_behavior_services.task_logic.distributions as distributions
+import aind_behavior_services.task.distributions as distributions
from aind_behavior_curriculum import Stage, TrainerState
import aind_behavior_vr_foraging.task_logic as vr_task_logic
-from aind_behavior_vr_foraging.task_logic import (
- AindVrForagingTaskLogic,
- AindVrForagingTaskParameters,
-)
def NumericalUpdaterParametersHelper(initial_value, increment, decrement, minimum, maximum):
@@ -38,9 +34,7 @@ def NumericalUpdaterParametersHelper(initial_value, increment, decrement, minimu
retracting_distance=2000,
),
audio_control=vr_task_logic.AudioControl(frequency=1000, duration=0.2),
- odor_control=vr_task_logic.OdorControl(
- valve_max_open_time=100000, target_odor_flow=100, target_total_flow=1000, use_channel_3_as_carrier=True
- ),
+ odor_control=vr_task_logic.OdorControl(target_odor_flow=100, target_total_flow=1000, use_channel_3_as_carrier=True),
position_control=vr_task_logic.PositionControl(
gain=vr_task_logic.Vector3(x=1, y=1, z=1),
initial_position=vr_task_logic.Vector3(x=0, y=2.56, z=0),
@@ -120,7 +114,7 @@ def PostPatchVirtualSiteGeneratorHelper(contrast: float = 1, friction: float = 0
patch1 = vr_task_logic.Patch(
label="reset",
state_index=0,
- odor_specification=vr_task_logic.OdorSpecification(index=1, concentration=1),
+ odor_specification=[0.0, 1.0, 0.0],
reward_specification=vr_task_logic.RewardSpecification(
amount=vr_task_logic.scalar_value(1),
probability=vr_task_logic.scalar_value(1),
@@ -140,7 +134,7 @@ def PostPatchVirtualSiteGeneratorHelper(contrast: float = 1, friction: float = 0
patch2 = vr_task_logic.Patch(
label="slow-replenish",
state_index=1,
- odor_specification=vr_task_logic.OdorSpecification(index=0, concentration=1),
+ odor_specification=[0.1, 0.0, 0.0],
reward_specification=vr_task_logic.RewardSpecification(
reward_function=[reward_function, replenish_function],
operant_logic=OperantLogicHelper(),
@@ -157,8 +151,8 @@ def PostPatchVirtualSiteGeneratorHelper(contrast: float = 1, friction: float = 0
first_state_occupancy=[1, 0], transition_matrix=[[1, 0], [0, 1]], patches=[patch1, patch2]
)
-task_logic = AindVrForagingTaskLogic(
- task_parameters=AindVrForagingTaskParameters(
+task_logic = vr_task_logic.AindVrForagingTaskLogic(
+ task_parameters=vr_task_logic.AindVrForagingTaskParameters(
rng_seed=42,
updaters=updaters,
environment=vr_task_logic.BlockStructure(
diff --git a/examples/test_single_site_patch.py b/examples/test_single_site_patch.py
index 032d9751..36f438b9 100644
--- a/examples/test_single_site_patch.py
+++ b/examples/test_single_site_patch.py
@@ -1,7 +1,7 @@
import os
from typing import Optional
-import aind_behavior_services.task_logic.distributions as distributions
+import aind_behavior_services.task.distributions as distributions
from aind_behavior_curriculum import Stage, TrainerState
import aind_behavior_vr_foraging.task_logic as vr_task_logic
@@ -31,6 +31,10 @@
]
+def odor_concentration_from_index(odor_index: int) -> list[float]:
+ return [1.0 if i == odor_index else 0.0 for i in range(3)]
+
+
def make_patch(
label: str,
state_index: int,
@@ -59,7 +63,7 @@ def make_patch(
return vr_task_logic.Patch(
label=label,
state_index=state_index,
- odor_specification=vr_task_logic.OdorSpecification(index=odor_index, concentration=1),
+ odor_specification=odor_concentration_from_index(odor_index),
patch_terminators=[
vr_task_logic.PatchTerminatorOnChoice(count=vr_task_logic.scalar_value(1)),
vr_task_logic.PatchTerminatorOnRejection(count=vr_task_logic.scalar_value(1)),
diff --git a/pyproject.toml b/pyproject.toml
index 98b45eb4..1402caa8 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -12,11 +12,11 @@ classifiers = [
"Programming Language :: Python :: 3.11",
"Operating System :: Microsoft :: Windows",
]
-version = "0.6.5"
+version = "0.7.0rc0"
readme = {file = "README.md", content-type = "text/markdown"}
dependencies = [
- "aind_behavior_services>=0.12, <0.13",
+ "aind_behavior_services>=0.13.6",
"pydantic-settings"
]
@@ -31,10 +31,9 @@ Changelog = "https://github.com/AllenNeuralDynamics/Aind.Behavior.VrForaging/rel
data = ["contraqctor>=0.5.3, <0.6.0"]
launcher = [
- "aind-clabe[aind-services]>=0.9.1",
- "aind-data-schema>=2.2",
+ "aind-clabe[aind-services]>=0.10",
+ "aind-data-schema>=2.6",
"aind_behavior_vr_foraging[data]",
- "aind-watchdog-service==0.1.6.dev8"
]
[dependency-groups]
@@ -42,6 +41,8 @@ launcher = [
dev = [
"aind_behavior_vr_foraging[launcher]",
"aind_behavior_vr_foraging[data]",
+ "aind-data-schema",
+ "aind-data-schema-models",
"ruff",
"codespell",
]
diff --git a/scripts/aind.py b/scripts/aind.py
new file mode 100644
index 00000000..1500755d
--- /dev/null
+++ b/scripts/aind.py
@@ -0,0 +1,335 @@
+import logging
+import os
+from pathlib import Path
+from typing import Any, cast
+
+from aind_behavior_services.rig.aind_manipulator import ManipulatorPosition
+from aind_behavior_services.session import Session
+from aind_behavior_services.utils import utcnow
+from clabe import resource_monitor
+from clabe.apps import (
+ AindBehaviorServicesBonsaiApp,
+ CurriculumApp,
+ CurriculumSettings,
+ CurriculumSuggestion,
+)
+from clabe.data_transfer.aind_watchdog import WatchdogDataTransferService, WatchdogSettings
+from clabe.launcher import Launcher, LauncherCliArgs, experiment
+from clabe.pickers import ByAnimalModifier, DefaultBehaviorPickerSettings
+from clabe.pickers.dataverse import DataversePicker
+from contraqctor.contract.json import SoftwareEvents
+from pydantic_settings import CliApp
+
+from aind_behavior_vr_foraging import data_contract
+from aind_behavior_vr_foraging.data_mappers import DataMapperCli
+from aind_behavior_vr_foraging.rig import AindVrForagingRig
+from aind_behavior_vr_foraging.task_logic import AindVrForagingTaskLogic
+
+logger = logging.getLogger(__name__)
+
+
+@experiment()
+async def aind_experiment_protocol(launcher: Launcher) -> None:
+ # Start experiment setup
+ picker = DataversePicker(launcher=launcher, settings=DefaultBehaviorPickerSettings())
+
+ # Pick and register session
+ session = picker.pick_session(Session)
+
+ # Fetch the task settings
+ trainer_state, task_logic = picker.pick_trainer_state(AindVrForagingTaskLogic)
+
+ # Fetch rig settings
+ rig = picker.pick_rig(AindVrForagingRig)
+ ensure_rig_and_computer_name(rig)
+
+ launcher.register_session(session, rig.data_directory)
+
+ resource_monitor.ResourceMonitor(
+ constrains=[
+ resource_monitor.available_storage_constraint_factory(rig.data_directory, 2e11),
+ ]
+ ).run()
+
+ input_trainer_state_path = launcher.session_directory / "behavior" / "trainer_state.json"
+ input_trainer_state_path.write_text(trainer_state.model_dump_json(indent=2), encoding="utf-8")
+
+ # Post-fetching modifications
+ manipulator_modifier = ByAnimalManipulatorModifier(
+ subject_db_path=picker.subject_dir / session.subject,
+ model_path="manipulator.calibration.initial_position",
+ model_name="manipulator_init.json",
+ launcher=launcher,
+ )
+ manipulator_modifier.inject(rig)
+
+ # Run the task via Bonsai
+ bonsai_app = AindBehaviorServicesBonsaiApp(
+ workflow=Path(r"./src/main.bonsai"),
+ temp_directory=launcher.temp_dir,
+ rig=rig,
+ session=session,
+ task_logic=task_logic,
+ )
+ await bonsai_app.run_async()
+
+ # Update manipulator initial position for next session
+ try:
+ manipulator_modifier.dump()
+ except Exception as e:
+ logger.error(f"Failed to update manipulator initial position: {e}")
+
+ # Curriculum
+ suggestion: CurriculumSuggestion | None = None
+ suggestion_path: Path | None = None
+ if not (
+ (picker.trainer_state is None)
+ or (picker.trainer_state.is_on_curriculum is False)
+ or (picker.trainer_state.stage is None)
+ ):
+ trainer = CurriculumApp(
+ settings=CurriculumSettings(
+ input_trainer_state=input_trainer_state_path.resolve(), data_directory=launcher.session_directory
+ )
+ )
+ # Run the curriculum
+ await trainer.run_async()
+ suggestion = trainer.process_suggestion()
+ # Dump suggestion for debugging (for now, but we will prob remove this later)
+ suggestion_path = _dump_suggestion(suggestion, launcher.session_directory)
+ # Push updated trainer state back to the database
+ picker.push_new_suggestion(suggestion.trainer_state)
+
+ # Mappers
+ assert launcher.repository.working_tree_dir is not None
+
+ DataMapperCli(
+ data_path=launcher.session_directory,
+ repo_path=launcher.repository.working_tree_dir, # type: ignore[arg-type]
+ curriculum_suggestion=suggestion_path,
+ session_end_time=utcnow(),
+ ).cli_cmd()
+
+ # Run data qc
+ if picker.ui_helper.prompt_yes_no_question("Would you like to generate a qc report?"):
+ try:
+ import webbrowser
+
+ from contraqctor.qc.reporters import HtmlReporter
+
+ from ..src.aind_behavior_vr_foraging.data_qc.data_qc import make_qc_runner
+
+ vr_dataset = data_contract.dataset(launcher.session_directory)
+ runner = make_qc_runner(vr_dataset)
+ qc_path = launcher.session_directory / "Behavior" / "Logs" / "qc_report.html"
+ reporter = HtmlReporter(output_path=qc_path)
+ runner.run_all_with_progress(reporter=reporter)
+ webbrowser.open(qc_path.as_uri(), new=2)
+ except Exception as e:
+ logger.error(f"Failed to run data QC: {e}")
+
+ # Watchdog
+ is_transfer = picker.ui_helper.prompt_yes_no_question("Would you like to transfer data?")
+ if not is_transfer:
+ logger.info("Data transfer skipped by user.")
+ return
+
+ launcher.copy_logs()
+ watchdog_settings = WatchdogSettings()
+ watchdog_settings.destination = Path(watchdog_settings.destination) / launcher.session.subject
+ WatchdogDataTransferService(
+ source=launcher.session_directory,
+ settings=watchdog_settings,
+ session=session,
+ ).transfer()
+
+ return
+
+
+@experiment()
+async def calibration_protocol(launcher: Launcher) -> None:
+ # Start experiment setup
+ picker = DataversePicker(launcher=launcher, settings=DefaultBehaviorPickerSettings())
+
+ # Pick and register session
+ session = Session(subject="CALIBRATION", experiment="CALIBRATION", date=utcnow())
+
+ # Fetch rig settings
+ rig = picker.pick_rig(AindVrForagingRig)
+
+ launcher.register_session(session, rig.data_directory)
+
+ resource_monitor.ResourceMonitor(
+ constrains=[
+ resource_monitor.available_storage_constraint_factory(rig.data_directory, 2e11),
+ ]
+ ).run()
+
+ # Run the task via Bonsai
+ bonsai_app = AindBehaviorServicesBonsaiApp(
+ workflow=Path(r"./src/main.bonsai"),
+ temp_directory=launcher.temp_dir,
+ rig=rig,
+ )
+ await bonsai_app.run_async()
+ logger.info("Calibration protocol completed successfully.")
+
+
+def _dump_suggestion(suggestion: CurriculumSuggestion, session_directory: Path) -> Path:
+ path = session_directory / "Behavior" / "Logs" / "suggestion.json"
+ logger.info("Dumping curriculum suggestion to: %s", path)
+ with open(path, "w", encoding="utf-8") as f:
+ f.write(suggestion.model_dump_json(indent=2))
+ return path
+
+
+class ByAnimalManipulatorModifier(ByAnimalModifier[AindVrForagingRig]):
+ """Modifier to set and update manipulator initial position based on animal-specific data."""
+
+ def __init__(
+ self, subject_db_path: Path, model_path: str, model_name: str, *, launcher: Launcher, **kwargs
+ ) -> None:
+ super().__init__(subject_db_path, model_path, model_name, **kwargs)
+ self._launcher = launcher
+
+ def _process_before_dump(self) -> ManipulatorPosition:
+ _dataset = data_contract.dataset(self._launcher.session_directory)
+ manipulator_parking_position: SoftwareEvents = cast(
+ SoftwareEvents, _dataset["Behavior"]["SoftwareEvents"]["SpoutParkingPositions"].load()
+ )
+ data: dict[str, Any] = manipulator_parking_position.data.iloc[0]["data"]["ResetPosition"]
+ position = ManipulatorPosition.model_validate(data)
+ return position
+
+
+def ensure_rig_and_computer_name(rig: AindVrForagingRig) -> None:
+ """Ensures rig and computer name are set from environment variables if available, otherwise defaults to rig configuration values."""
+ rig_name = os.environ.get("aibs_comp_id", None)
+ computer_name = os.environ.get("hostname", None)
+
+ if rig_name is None:
+ logger.warning(
+ "'aibs_comp_id' environment variable not set. Defaulting to rig name from configuration. %s", rig.rig_name
+ )
+ rig_name = rig.rig_name
+ if computer_name is None:
+ computer_name = rig.computer_name
+ logger.warning(
+ "'hostname' environment variable not set. Defaulting to computer name from configuration. %s",
+ rig.computer_name,
+ )
+
+ if rig_name != rig.rig_name or computer_name != rig.computer_name:
+ logger.warning(
+ "Rig name or computer name from environment variables do not match the rig configuration. "
+ "Forcing rig name: %s and computer name: %s from environment variables.",
+ rig_name,
+ computer_name,
+ )
+ rig.rig_name = rig_name
+ rig.computer_name = computer_name
+
+
+@experiment()
+async def recover_session(launcher: Launcher) -> None:
+ # Start experiment setup
+ picker = DataversePicker(launcher=launcher, settings=DefaultBehaviorPickerSettings())
+ session_path = Path(picker.ui_helper.input("Enter the path to the session you want to recover:"))
+ if not session_path.exists():
+ logger.error("Session path does not exist: %s", session_path)
+ return
+ session_model = Session.model_validate_json(
+ (session_path / "behavior/Logs/session_input.json").read_text(encoding="utf-8")
+ )
+ rig_model = AindVrForagingRig.model_validate_json(
+ (session_path / "behavior/Logs/rig_input.json").read_text(encoding="utf-8")
+ )
+ trainer_state_files = list((session_path / "behavior").glob("trainer_state*.json"))
+ if trainer_state_files:
+ input_trainer_state_path = trainer_state_files[0]
+ else:
+ raise FileNotFoundError("Trainer state file not found.")
+
+ ensure_rig_and_computer_name(rig_model)
+
+ launcher.register_session(session_model, rig_model.data_directory)
+
+ # Curriculum
+ suggestion: CurriculumSuggestion | None = None
+ suggestion_path: Path | None = None
+ if not (
+ (picker.trainer_state is None)
+ or (picker.trainer_state.is_on_curriculum is False)
+ or (picker.trainer_state.stage is None)
+ ):
+ trainer = CurriculumApp(
+ settings=CurriculumSettings(
+ input_trainer_state=input_trainer_state_path.resolve(), data_directory=launcher.session_directory
+ )
+ )
+ # Run the curriculum
+ await trainer.run_async()
+ suggestion = trainer.process_suggestion()
+ # Dump suggestion for debugging (for now, but we will prob remove this later)
+ suggestion_path = _dump_suggestion(suggestion, launcher.session_directory)
+ # Push updated trainer state back to the database
+ picker.push_new_suggestion(suggestion.trainer_state)
+
+ # Mappers
+ assert launcher.repository.working_tree_dir is not None
+
+ DataMapperCli(
+ data_path=launcher.session_directory,
+ repo_path=launcher.repository.working_tree_dir, # type: ignore[arg-type]
+ curriculum_suggestion=suggestion_path,
+ session_end_time=utcnow(),
+ ).cli_cmd()
+
+ # Run data qc
+ if picker.ui_helper.prompt_yes_no_question("Would you like to generate a qc report?"):
+ try:
+ import webbrowser
+
+ from contraqctor.qc.reporters import HtmlReporter
+
+ from ..src.aind_behavior_vr_foraging.data_qc.data_qc import make_qc_runner
+
+ vr_dataset = data_contract.dataset(launcher.session_directory)
+ runner = make_qc_runner(vr_dataset)
+ qc_path = launcher.session_directory / "Behavior" / "Logs" / "qc_report.html"
+ reporter = HtmlReporter(output_path=qc_path)
+ runner.run_all_with_progress(reporter=reporter)
+ webbrowser.open(qc_path.as_uri(), new=2)
+ except Exception as e:
+ logger.error(f"Failed to run data QC: {e}")
+
+ # Watchdog
+ is_transfer = picker.ui_helper.prompt_yes_no_question("Would you like to transfer data?")
+ if not is_transfer:
+ logger.info("Data transfer skipped by user.")
+ return
+
+ watchdog_settings = WatchdogSettings()
+ watchdog_settings.destination = Path(watchdog_settings.destination) / launcher.session.subject
+ WatchdogDataTransferService(
+ source=launcher.session_directory,
+ settings=watchdog_settings,
+ session=session_model,
+ ).transfer()
+
+ return
+
+
+class ClabeCli(LauncherCliArgs):
+ def cli_cmd(self):
+ launcher = Launcher(settings=self)
+ launcher.run_experiment(aind_experiment_protocol)
+ return None
+
+
+def main() -> None:
+ CliApp().run(ClabeCli)
+
+
+if __name__ == "__main__":
+ main()
diff --git a/scripts/launcher.ps1 b/scripts/launcher.ps1
index ce04aba0..a36181aa 100644
--- a/scripts/launcher.ps1
+++ b/scripts/launcher.ps1
@@ -1,3 +1,3 @@
$scriptPath = Split-Path -Parent $MyInvocation.MyCommand.Path
Set-Location -Path (Split-Path -Parent $scriptPath)
-&uv run vr-foraging clabe
+&uv run clabe run ./scripts/aind.py @args
diff --git a/src/DataSchemas/aind_behavior_vr_foraging.json b/src/DataSchemas/aind_behavior_vr_foraging.json
index 6c214c71..a358dba4 100644
--- a/src/DataSchemas/aind_behavior_vr_foraging.json
+++ b/src/DataSchemas/aind_behavior_vr_foraging.json
@@ -1,193 +1,14 @@
{
"$defs": {
- "AindBehaviorSessionModel": {
- "properties": {
- "aind_behavior_services_pkg_version": {
- "default": "0.12.5",
- "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.12.5",
- "default": "0.12.5",
- "title": "Version",
- "type": "string"
- },
- "experiment": {
- "default": null,
- "description": "Name of the experiment",
- "oneOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ],
- "title": "Experiment"
- },
- "experimenter": {
- "default": [],
- "description": "Name of the experimenter",
- "items": {
- "type": "string"
- },
- "title": "Experimenter",
- "type": "array"
- },
- "date": {
- "description": "Date of the experiment",
- "format": "date-time",
- "title": "Date",
- "type": "string"
- },
- "root_path": {
- "description": "Root path where data will be logged",
- "title": "Root Path",
- "type": "string"
- },
- "session_name": {
- "default": null,
- "description": "Name of the session. This will be used to create a folder in the root path. If not provided, it will be generated using subject and date.",
- "oneOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ],
- "title": "Session Name"
- },
- "subject": {
- "description": "Name of the subject",
- "title": "Subject",
- "type": "string"
- },
- "experiment_version": {
- "default": "",
- "deprecated": true,
- "description": "Version of the experiment",
- "title": "Experiment Version",
- "type": "string"
- },
- "notes": {
- "default": null,
- "description": "Notes about the experiment",
- "oneOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ],
- "title": "Notes"
- },
- "commit_hash": {
- "default": null,
- "description": "Commit hash of the repository",
- "oneOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ],
- "title": "Commit Hash"
- },
- "allow_dirty_repo": {
- "default": false,
- "description": "Allow running from a dirty repository",
- "title": "Allow Dirty Repo",
- "type": "boolean"
- },
- "skip_hardware_validation": {
- "default": false,
- "description": "Skip hardware validation",
- "title": "Skip Hardware Validation",
- "type": "boolean"
- }
- },
- "required": [
- "root_path",
- "subject"
- ],
- "title": "AindBehaviorSessionModel",
- "type": "object"
- },
- "AindManipulatorAdditionalSettings": {
- "description": "Additional settings for the manipulator device",
- "properties": {
- "spout_axis": {
- "$ref": "#/$defs/Axis",
- "default": 2,
- "description": "Spout axis"
- }
- },
- "title": "AindManipulatorAdditionalSettings",
- "type": "object"
- },
"AindManipulatorCalibration": {
- "description": "Aind manipulator calibration class",
+ "description": "AindManipulator calibration class",
"properties": {
- "device_name": {
- "default": "AindManipulator",
- "description": "Must match a device name in rig/instrument",
- "title": "Device name",
- "type": "string"
- },
- "input": {
- "$ref": "#/$defs/AindManipulatorCalibrationInput",
- "title": "Input of the calibration"
- },
- "output": {
- "$ref": "#/$defs/AindManipulatorCalibrationOutput",
- "title": "Output of the calibration."
- },
- "date": {
- "default": null,
- "oneOf": [
- {
- "format": "date-time",
- "type": "string"
- },
- {
- "type": "null"
- }
- ],
- "title": "Date"
- },
"description": {
- "const": "Calibration of the load cells system",
- "default": "Calibration of the load cells system",
+ "const": "AindManipulator calibration and settings",
+ "default": "AindManipulator calibration and settings",
"title": "Description",
"type": "string"
},
- "notes": {
- "default": null,
- "oneOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ],
- "title": "Notes"
- }
- },
- "required": [
- "input",
- "output"
- ],
- "title": "AindManipulatorCalibration",
- "type": "object"
- },
- "AindManipulatorCalibrationInput": {
- "properties": {
"full_step_to_mm": {
"$ref": "#/$defs/ManipulatorPosition",
"default": {
@@ -270,16 +91,12 @@
}
}
},
- "title": "AindManipulatorCalibrationInput",
- "type": "object"
- },
- "AindManipulatorCalibrationOutput": {
- "properties": {},
- "title": "AindManipulatorCalibrationOutput",
- "type": "object"
+ "title": "AindManipulatorCalibration",
+ "type": "object",
+ "x-sgen-typename": "AllenNeuralDynamics.AindManipulator.AindManipulatorCalibration"
},
"AindManipulatorDevice": {
- "description": "Overrides the default settings for the manipulator device by spec'ing additional_settings field",
+ "description": "Appends a task specific configuration to the base manipulator model.",
"properties": {
"device_type": {
"const": "StepperDriver",
@@ -287,37 +104,72 @@
"title": "Device Type",
"type": "string"
},
- "device_name": {
- "default": null,
- "description": "Device name",
- "oneOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ],
- "title": "Device Name"
- },
- "additional_settings": {
- "$ref": "#/$defs/AindManipulatorAdditionalSettings",
- "default": {
- "spout_axis": 2
- },
- "description": "Additional settings"
- },
"calibration": {
- "default": null,
- "oneOf": [
- {
- "$ref": "#/$defs/AindManipulatorCalibration"
- },
- {
- "type": "null"
+ "$ref": "#/$defs/AindManipulatorCalibration",
+ "default": {
+ "description": "AindManipulator calibration and settings",
+ "full_step_to_mm": {
+ "x": 0.01,
+ "y1": 0.01,
+ "y2": 0.01,
+ "z": 0.01
+ },
+ "axis_configuration": [
+ {
+ "axis": 2,
+ "max_limit": 25.0,
+ "maximum_step_interval": 2000,
+ "microstep_resolution": 0,
+ "min_limit": -0.01,
+ "motor_operation_mode": 0,
+ "step_acceleration_interval": 100,
+ "step_interval": 100
+ },
+ {
+ "axis": 3,
+ "max_limit": 25.0,
+ "maximum_step_interval": 2000,
+ "microstep_resolution": 0,
+ "min_limit": -0.01,
+ "motor_operation_mode": 0,
+ "step_acceleration_interval": 100,
+ "step_interval": 100
+ },
+ {
+ "axis": 1,
+ "max_limit": 25.0,
+ "maximum_step_interval": 2000,
+ "microstep_resolution": 0,
+ "min_limit": -0.01,
+ "motor_operation_mode": 0,
+ "step_acceleration_interval": 100,
+ "step_interval": 100
+ },
+ {
+ "axis": 4,
+ "max_limit": 25.0,
+ "maximum_step_interval": 2000,
+ "microstep_resolution": 0,
+ "min_limit": -0.01,
+ "motor_operation_mode": 0,
+ "step_acceleration_interval": 100,
+ "step_interval": 100
+ }
+ ],
+ "homing_order": [
+ 2,
+ 3,
+ 1,
+ 4
+ ],
+ "initial_position": {
+ "x": 0.0,
+ "y1": 0.0,
+ "y2": 0.0,
+ "z": 0.0
}
- ],
- "title": "Calibration of the manipulator"
+ },
+ "description": "Calibration for the device."
},
"who_am_i": {
"const": 1130,
@@ -342,6 +194,11 @@
"description": "Device port name",
"title": "Port Name",
"type": "string"
+ },
+ "spout_axis": {
+ "$ref": "#/$defs/Axis",
+ "default": 2,
+ "description": "Spout axis"
}
},
"required": [
@@ -351,16 +208,17 @@
"type": "object"
},
"AindVrForagingRig": {
+ "description": "Represents the schema, and concrete instantiation, of a rig configuration to run the VrForaging behavior task.",
"properties": {
"aind_behavior_services_pkg_version": {
- "default": "0.12.5",
+ "default": "0.13.6",
"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.6.5",
- "default": "0.6.5",
+ "const": "0.7.0-rc0",
+ "default": "0.7.0-rc0",
"title": "Version",
"type": "string"
},
@@ -374,6 +232,12 @@
"title": "Rig Name",
"type": "string"
},
+ "data_directory": {
+ "description": "Directory where data will be saved to",
+ "format": "path",
+ "title": "Data Directory",
+ "type": "string"
+ },
"triggered_camera_controller": {
"$ref": "#/$defs/CameraController_SpinnakerCamera_",
"description": "Required camera controller to triggered cameras."
@@ -398,6 +262,14 @@
"$ref": "#/$defs/Olfactometer",
"description": "Harp olfactometer"
},
+ "harp_olfactometer_extension": {
+ "description": "A collection of subordinate olfactometers that can be added to increase the number of independently delivered odors. The order of the list determines the order by which odors are numbered",
+ "items": {
+ "$ref": "#/$defs/Olfactometer"
+ },
+ "title": "Harp Olfactometer Extension",
+ "type": "array"
+ },
"harp_lickometer": {
"$ref": "#/$defs/HarpLicketySplit",
"description": "Harp lickometer"
@@ -451,11 +323,9 @@
"description": "Manipulator"
},
"screen": {
- "$ref": "#/$defs/Screen",
+ "$ref": "#/$defs/ScreenAssembly",
"default": {
- "device_type": "Screen",
- "device_name": "Screen",
- "additional_settings": null,
+ "device_type": "ScreenAssembly",
"calibration": {
"center": {
"extrinsics": {
@@ -533,7 +403,9 @@
}
},
"required": [
+ "computer_name",
"rig_name",
+ "data_directory",
"triggered_camera_controller",
"harp_behavior",
"harp_olfactometer",
@@ -568,8 +440,8 @@
"description": "Parameters of the task logic"
},
"version": {
- "const": "0.6.5",
- "default": "0.6.5",
+ "const": "0.7.0-rc0",
+ "default": "0.7.0-rc0",
"title": "Version",
"type": "string"
},
@@ -611,7 +483,7 @@
"title": "Rng Seed"
},
"aind_behavior_services_pkg_version": {
- "default": "0.12.5",
+ "default": "0.13.6",
"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"
@@ -682,7 +554,8 @@
"Y1",
"Y2",
"Z"
- ]
+ ],
+ "x-sgen-typename": "AllenNeuralDynamics.AindManipulator.Axis"
},
"AxisConfiguration": {
"description": "Axis configuration",
@@ -739,7 +612,8 @@
"axis"
],
"title": "AxisConfiguration",
- "type": "object"
+ "type": "object",
+ "x-sgen-typename": "AllenNeuralDynamics.AindManipulator.AxisConfiguration"
},
"BaseModel": {
"properties": {},
@@ -790,7 +664,8 @@
}
},
"title": "BetaDistribution",
- "type": "object"
+ "type": "object",
+ "x-sgen-typename": "AllenNeuralDynamics.AindBehaviorServices.Distributions.BetaDistribution"
},
"BetaDistributionParameters": {
"description": "Parameters for a beta distribution.\n\nDefined by alpha and beta shape parameters.",
@@ -817,7 +692,8 @@
}
},
"title": "BetaDistributionParameters",
- "type": "object"
+ "type": "object",
+ "x-sgen-typename": "AllenNeuralDynamics.AindBehaviorServices.Distributions.BetaDistributionParameters"
},
"BinomialDistribution": {
"description": "A binomial probability distribution.\n\nModels the number of successes in a fixed number of independent\nBernoulli trials with constant success probability.",
@@ -863,7 +739,8 @@
}
},
"title": "BinomialDistribution",
- "type": "object"
+ "type": "object",
+ "x-sgen-typename": "AllenNeuralDynamics.AindBehaviorServices.Distributions.BinomialDistribution"
},
"BinomialDistributionParameters": {
"description": "Parameters for a binomial distribution.\n\nDefined by number of trials (n) and success probability (p).",
@@ -891,7 +768,8 @@
}
},
"title": "BinomialDistributionParameters",
- "type": "object"
+ "type": "object",
+ "x-sgen-typename": "AllenNeuralDynamics.AindBehaviorServices.Distributions.BinomialDistributionParameters"
},
"Block": {
"description": "Configuration for a single experimental block.\n\nA block represents a period of the experiment with specific environment\nstatistics and ending conditions. Each block defines the environmental\nparameters and termination criteria for that experimental phase.",
@@ -1082,34 +960,9 @@
"title": "Device Type",
"type": "string"
},
- "device_name": {
- "default": null,
- "description": "Device name",
- "oneOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ],
- "title": "Device Name"
- },
- "additional_settings": {
- "default": null,
- "description": "Additional settings",
- "oneOf": [
- {
- "$ref": "#/$defs/BaseModel"
- },
- {
- "type": "null"
- }
- ]
- },
"calibration": {
"default": null,
- "description": "Calibration",
+ "description": "Calibration for the device.",
"oneOf": [
{
"$ref": "#/$defs/BaseModel"
@@ -1156,34 +1009,9 @@
"title": "Device Type",
"type": "string"
},
- "device_name": {
- "default": null,
- "description": "Device name",
- "oneOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ],
- "title": "Device Name"
- },
- "additional_settings": {
- "default": null,
- "description": "Additional settings",
- "oneOf": [
- {
- "$ref": "#/$defs/BaseModel"
- },
- {
- "type": "null"
- }
- ]
- },
"calibration": {
"default": null,
- "description": "Calibration",
+ "description": "Calibration for the device.",
"oneOf": [
{
"$ref": "#/$defs/BaseModel"
@@ -1364,23 +1192,43 @@
"type": "array"
},
"rho": {
- "description": "The underlying value goverining the stochastic process",
+ "description": "The underlying value governing the stochastic process",
"title": "Rho",
"type": "number"
},
- "minimum": {
- "default": 1,
- "description": "Maximum value after update",
- "title": "Minimum",
+ "dt": {
+ "const": 0.1,
+ "default": 0.1,
+ "description": "Sampling time step (s)",
+ "title": "Dt",
"type": "number"
},
- "maximum": {
- "default": 0,
- "description": "Minimum value after update",
- "title": "Maximum",
- "type": "number"
- }
- },
+ "rate": {
+ "default": null,
+ "description": "Rate of the replenishment used to generate the matrix. This value is used for metadata keep sake only",
+ "oneOf": [
+ {
+ "type": "number"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Rate"
+ },
+ "minimum": {
+ "default": 1,
+ "description": "Maximum value after update",
+ "title": "Minimum",
+ "type": "number"
+ },
+ "maximum": {
+ "default": 0,
+ "description": "Minimum value after update",
+ "title": "Maximum",
+ "type": "number"
+ }
+ },
"required": [
"transition_matrix",
"rho"
@@ -1389,6 +1237,7 @@
"type": "object"
},
"DisplayCalibration": {
+ "description": "Represents the calibration parameters of a display.",
"properties": {
"intrinsics": {
"$ref": "#/$defs/DisplayIntrinsics",
@@ -1421,9 +1270,10 @@
"type": "object"
},
"DisplayExtrinsics": {
+ "description": "Represents the extrinsic parameters of a display.",
"properties": {
"rotation": {
- "$ref": "#/$defs/aind_behavior_services__rig__visual_stimulation__Vector3",
+ "$ref": "#/$defs/Vector3",
"default": {
"x": 0.0,
"y": 0.0,
@@ -1432,7 +1282,7 @@
"description": "Rotation vector (radians)"
},
"translation": {
- "$ref": "#/$defs/aind_behavior_services__rig__visual_stimulation__Vector3",
+ "$ref": "#/$defs/Vector3",
"default": {
"x": 0.0,
"y": 1.309016,
@@ -1445,6 +1295,7 @@
"type": "object"
},
"DisplayIntrinsics": {
+ "description": "Represents the intrinsic parameters of a display.",
"properties": {
"frame_width": {
"default": 1920,
@@ -1478,84 +1329,6 @@
"title": "DisplayIntrinsics",
"type": "object"
},
- "DisplaysCalibration": {
- "properties": {
- "left": {
- "$ref": "#/$defs/DisplayCalibration",
- "default": {
- "intrinsics": {
- "display_height": 15.0,
- "display_width": 20.0,
- "frame_height": 1080,
- "frame_width": 1920
- },
- "extrinsics": {
- "rotation": {
- "x": 0.0,
- "y": 1.0472,
- "z": 0.0
- },
- "translation": {
- "x": -16.6917756,
- "y": 1.309016,
- "z": -3.575264
- }
- }
- },
- "description": "Left display calibration"
- },
- "center": {
- "$ref": "#/$defs/DisplayCalibration",
- "default": {
- "intrinsics": {
- "display_height": 15.0,
- "display_width": 20.0,
- "frame_height": 1080,
- "frame_width": 1920
- },
- "extrinsics": {
- "rotation": {
- "x": 0.0,
- "y": 0.0,
- "z": 0.0
- },
- "translation": {
- "x": 0.0,
- "y": 1.309016,
- "z": -13.27
- }
- }
- },
- "description": "Center display calibration"
- },
- "right": {
- "$ref": "#/$defs/DisplayCalibration",
- "default": {
- "intrinsics": {
- "display_height": 15.0,
- "display_width": 20.0,
- "frame_height": 1080,
- "frame_width": 1920
- },
- "extrinsics": {
- "rotation": {
- "x": 0.0,
- "y": -1.0472,
- "z": 0.0
- },
- "translation": {
- "x": 16.6917756,
- "y": 1.309016,
- "z": -3.575264
- }
- }
- },
- "description": "Right display calibration"
- }
- },
- "title": "DisplaysCalibration",
- "type": "object"
- },
"Distribution": {
"description": "Available distributions",
"discriminator": {
@@ -1605,7 +1378,8 @@
"$ref": "#/$defs/PdfDistribution"
}
],
- "title": "Distribution"
+ "title": "Distribution",
+ "x-sgen-typename": "AllenNeuralDynamics.AindBehaviorServices.Distributions.Distribution"
},
"EnvironmentStatistics": {
"description": "Defines the statistical properties of the foraging environment.\n\nThis class specifies the patches available in the environment, their transition\nprobabilities, and initial state occupancy. It forms the core specification\nfor the foraging environment structure.",
@@ -1700,7 +1474,8 @@
}
},
"title": "ExponentialDistribution",
- "type": "object"
+ "type": "object",
+ "x-sgen-typename": "AllenNeuralDynamics.AindBehaviorServices.Distributions.ExponentialDistribution"
},
"ExponentialDistributionParameters": {
"description": "Parameters for an exponential distribution.\n\nDefined by the rate parameter (inverse of mean).",
@@ -1720,7 +1495,8 @@
}
},
"title": "ExponentialDistributionParameters",
- "type": "object"
+ "type": "object",
+ "x-sgen-typename": "AllenNeuralDynamics.AindBehaviorServices.Distributions.ExponentialDistributionParameters"
},
"GammaDistribution": {
"description": "A gamma probability distribution.\n\nGeneralizes the exponential distribution. Used for modeling\npositive continuous variables with right-skewed distributions.",
@@ -1766,7 +1542,8 @@
}
},
"title": "GammaDistribution",
- "type": "object"
+ "type": "object",
+ "x-sgen-typename": "AllenNeuralDynamics.AindBehaviorServices.Distributions.GammaDistribution"
},
"GammaDistributionParameters": {
"description": "Parameters for a gamma distribution.\n\nDefined by shape (k) and rate (\u03b8\u207b\u00b9) parameters.",
@@ -1793,7 +1570,8 @@
}
},
"title": "GammaDistributionParameters",
- "type": "object"
+ "type": "object",
+ "x-sgen-typename": "AllenNeuralDynamics.AindBehaviorServices.Distributions.GammaDistributionParameters"
},
"HarpAnalogInput": {
"properties": {
@@ -1803,34 +1581,9 @@
"title": "Device Type",
"type": "string"
},
- "device_name": {
- "default": null,
- "description": "Device name",
- "oneOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ],
- "title": "Device Name"
- },
- "additional_settings": {
- "default": null,
- "description": "Additional settings",
- "oneOf": [
- {
- "$ref": "#/$defs/BaseModel"
- },
- {
- "type": "null"
- }
- ]
- },
"calibration": {
"default": null,
- "description": "Calibration",
+ "description": "Calibration for the device.",
"oneOf": [
{
"$ref": "#/$defs/BaseModel"
@@ -1879,34 +1632,9 @@
"title": "Device Type",
"type": "string"
},
- "device_name": {
- "default": null,
- "description": "Device name",
- "oneOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ],
- "title": "Device Name"
- },
- "additional_settings": {
- "default": null,
- "description": "Additional settings",
- "oneOf": [
- {
- "$ref": "#/$defs/BaseModel"
- },
- {
- "type": "null"
- }
- ]
- },
"calibration": {
"default": null,
- "description": "Calibration",
+ "description": "Calibration for the device.",
"oneOf": [
{
"$ref": "#/$defs/BaseModel"
@@ -1955,34 +1683,9 @@
"title": "Device Type",
"type": "string"
},
- "device_name": {
- "default": null,
- "description": "Device name",
- "oneOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ],
- "title": "Device Name"
- },
- "additional_settings": {
- "default": null,
- "description": "Additional settings",
- "oneOf": [
- {
- "$ref": "#/$defs/BaseModel"
- },
- {
- "type": "null"
- }
- ]
- },
"calibration": {
"default": null,
- "description": "Calibration",
+ "description": "Calibration for the device.",
"oneOf": [
{
"$ref": "#/$defs/BaseModel"
@@ -2031,34 +1734,9 @@
"title": "Device Type",
"type": "string"
},
- "device_name": {
- "default": null,
- "description": "Device name",
- "oneOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ],
- "title": "Device Name"
- },
- "additional_settings": {
- "default": null,
- "description": "Additional settings",
- "oneOf": [
- {
- "$ref": "#/$defs/BaseModel"
- },
- {
- "type": "null"
- }
- ]
- },
"calibration": {
"default": null,
- "description": "Calibration",
+ "description": "Calibration for the device.",
"oneOf": [
{
"$ref": "#/$defs/BaseModel"
@@ -2107,34 +1785,9 @@
"title": "Device Type",
"type": "string"
},
- "device_name": {
- "default": null,
- "description": "Device name",
- "oneOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ],
- "title": "Device Name"
- },
- "additional_settings": {
- "default": null,
- "description": "Additional settings",
- "oneOf": [
- {
- "$ref": "#/$defs/BaseModel"
- },
- {
- "type": "null"
- }
- ]
- },
"calibration": {
"default": null,
- "description": "Calibration",
+ "description": "Calibration for the device.",
"oneOf": [
{
"$ref": "#/$defs/BaseModel"
@@ -2183,34 +1836,9 @@
"title": "Device Type",
"type": "string"
},
- "device_name": {
- "default": null,
- "description": "Device name",
- "oneOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ],
- "title": "Device Name"
- },
- "additional_settings": {
- "default": null,
- "description": "Additional settings",
- "oneOf": [
- {
- "$ref": "#/$defs/BaseModel"
- },
- {
- "type": "null"
- }
- ]
- },
"calibration": {
"default": null,
- "description": "Calibration",
+ "description": "Calibration for the device.",
"oneOf": [
{
"$ref": "#/$defs/BaseModel"
@@ -2304,7 +1932,8 @@
}
},
"title": "LogNormalDistribution",
- "type": "object"
+ "type": "object",
+ "x-sgen-typename": "AllenNeuralDynamics.AindBehaviorServices.Distributions.LogNormalDistribution"
},
"LogNormalDistributionParameters": {
"description": "Parameters for a log-normal distribution.\n\nDefined by the mean and standard deviation of the underlying normal distribution.",
@@ -2329,7 +1958,8 @@
}
},
"title": "LogNormalDistributionParameters",
- "type": "object"
+ "type": "object",
+ "x-sgen-typename": "AllenNeuralDynamics.AindBehaviorServices.Distributions.LogNormalDistributionParameters"
},
"LookupTableFunction": {
"description": "A patch update function that uses lookup table interpolation.\n\nUpdate in the form of x = lut_values[lerp(lut_keys, lut_values, tick_value)].\nThis function maps input values to output values using a lookup table with\nlinear interpolation between defined points. Useful for complex, non-linear\nreward schedules or parameter updates.",
@@ -2367,6 +1997,7 @@
"type": "object"
},
"ManipulatorPosition": {
+ "description": "Represents a position in the manipulator coordinate system",
"properties": {
"x": {
"title": "X coordinate",
@@ -2392,7 +2023,8 @@
"z"
],
"title": "ManipulatorPosition",
- "type": "object"
+ "type": "object",
+ "x-sgen-typename": "AllenNeuralDynamics.AindManipulator.ManipulatorPosition"
},
"Measurement": {
"description": "Input for water valve calibration class",
@@ -2436,6 +2068,7 @@
"type": "object"
},
"MicrostepResolution": {
+ "description": "Microstep resolution available",
"enum": [
0,
1,
@@ -2449,9 +2082,11 @@
"Microstep16",
"Microstep32",
"Microstep64"
- ]
+ ],
+ "x-sgen-typename": "AllenNeuralDynamics.AindManipulator.MicrostepResolution"
},
"MotorOperationMode": {
+ "description": "Motor operation mode",
"enum": [
0,
1
@@ -2461,7 +2096,8 @@
"x-enumNames": [
"Quiet",
"Dynamic"
- ]
+ ],
+ "x-sgen-typename": "AllenNeuralDynamics.AindManipulator.MotorOperationMode"
},
"MovableSpoutControl": {
"description": "Controls the movable water spout behavior for reward delivery.\n\nThis class configures how the movable spout operates, including when it's\nenabled, timing for reward collection, and retraction distance for operant\nconditioning protocols.",
@@ -2534,7 +2170,8 @@
}
},
"title": "NormalDistribution",
- "type": "object"
+ "type": "object",
+ "x-sgen-typename": "AllenNeuralDynamics.AindBehaviorServices.Distributions.NormalDistribution"
},
"NormalDistributionParameters": {
"description": "Parameters for a normal (Gaussian) distribution.\n\nDefined by mean (center) and standard deviation (spread).",
@@ -2559,7 +2196,8 @@
}
},
"title": "NormalDistributionParameters",
- "type": "object"
+ "type": "object",
+ "x-sgen-typename": "AllenNeuralDynamics.AindBehaviorServices.Distributions.NormalDistributionParameters"
},
"NumericalUpdater": {
"description": "A numerical updater that modifies task parameters during execution.\n\nThis class combines an operation type with parameters to define how values\nshould be updated dynamically during the task, enabling adaptive behavior\nbased on animal performance or other criteria.",
@@ -2651,65 +2289,30 @@
"OdorControl": {
"description": "Controls the odor delivery system parameters.\n\nThis class manages the olfactory stimulus delivery system, including flow rates,\nvalve timing, and carrier gas configuration. It ensures proper odor concentration\nand delivery timing for the behavioral task.",
"properties": {
- "valve_max_open_time": {
- "default": 10,
- "description": "Maximum time (s) the valve can be open continuously",
- "minimum": 0,
- "title": "Valve Max Open Time",
- "type": "number"
- },
"target_total_flow": {
+ "const": 1000,
"default": 1000,
"description": "Target total flow (ml/s) of the odor mixture",
- "maximum": 1000,
- "minimum": 100,
+ "ge": 100,
+ "le": 1000,
"title": "Target Total Flow",
- "type": "number"
- },
- "use_channel_3_as_carrier": {
- "default": true,
- "description": "Whether to use channel 3 as carrier",
- "title": "Use Channel 3 As Carrier",
- "type": "boolean"
+ "type": "integer"
},
"target_odor_flow": {
+ "const": 100,
"default": 100,
"description": "Target odor flow (ml/s) in the odor mixture",
- "maximum": 100,
- "minimum": 0,
+ "ge": 0,
+ "le": 100,
"title": "Target Odor Flow",
- "type": "number"
- }
- },
- "title": "OdorControl",
- "type": "object"
- },
- "OdorSpecification": {
- "description": "Specifies odor delivery parameters for olfactory cues in the VR environment.\n\nOdors can be delivered at specific locations to provide additional sensory\ninformation for navigation and foraging decisions.",
- "properties": {
- "index": {
- "description": "Index of the odor to be used",
- "maximum": 3,
- "minimum": 0,
- "title": "Index",
"type": "integer"
- },
- "concentration": {
- "default": 1,
- "description": "Concentration of the odor",
- "maximum": 1,
- "minimum": 0,
- "title": "Concentration",
- "type": "number"
}
},
- "required": [
- "index"
- ],
- "title": "OdorSpecification",
+ "title": "OdorControl",
"type": "object"
},
"Olfactometer": {
+ "description": "A calibrated olfactometer device",
"properties": {
"device_type": {
"const": "Olfactometer",
@@ -2717,41 +2320,12 @@
"title": "Device Type",
"type": "string"
},
- "device_name": {
- "default": null,
- "description": "Device name",
- "oneOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ],
- "title": "Device Name"
- },
- "additional_settings": {
- "default": null,
- "description": "Additional settings",
- "oneOf": [
- {
- "$ref": "#/$defs/BaseModel"
- },
- {
- "type": "null"
- }
- ]
- },
"calibration": {
- "default": null,
- "oneOf": [
- {
- "$ref": "#/$defs/OlfactometerCalibration"
- },
- {
- "type": "null"
- }
- ],
+ "$ref": "#/$defs/OlfactometerCalibration",
+ "default": {
+ "date": null,
+ "channel_config": {}
+ },
"title": "Calibration of the olfactometer"
},
"who_am_i": {
@@ -2786,24 +2360,11 @@
"type": "object"
},
"OlfactometerCalibration": {
- "description": "Olfactometer calibration class",
+ "description": "Olfactometer device configuration model",
"properties": {
- "device_name": {
- "default": "Olfactometer",
- "description": "Name of the device being calibrated",
- "title": "Device name",
- "type": "string"
- },
- "input": {
- "$ref": "#/$defs/OlfactometerCalibrationInput",
- "title": "Input of the calibration"
- },
- "output": {
- "$ref": "#/$defs/OlfactometerCalibrationOutput",
- "title": "Output of the calibration"
- },
"date": {
"default": null,
+ "description": "Date of the calibration",
"oneOf": [
{
"format": "date-time",
@@ -2815,34 +2376,6 @@
],
"title": "Date"
},
- "description": {
- "const": "Calibration of the harp olfactometer device",
- "default": "Calibration of the harp olfactometer device",
- "title": "Description",
- "type": "string"
- },
- "notes": {
- "default": null,
- "oneOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ],
- "title": "Notes"
- }
- },
- "required": [
- "input",
- "output"
- ],
- "title": "OlfactometerCalibration",
- "type": "object"
- },
- "OlfactometerCalibrationInput": {
- "properties": {
"channel_config": {
"additionalProperties": {
"$ref": "#/$defs/OlfactometerChannelConfig"
@@ -2856,12 +2389,7 @@
"type": "object"
}
},
- "title": "OlfactometerCalibrationInput",
- "type": "object"
- },
- "OlfactometerCalibrationOutput": {
- "properties": {},
- "title": "OlfactometerCalibrationOutput",
+ "title": "OlfactometerCalibration",
"type": "object"
},
"OlfactometerChannel": {
@@ -2882,15 +2410,16 @@
]
},
"OlfactometerChannelConfig": {
+ "description": "Configuration for a single olfactometer channel",
"properties": {
"channel_index": {
- "title": "Channel index",
+ "title": "Odor channel index",
"type": "integer"
},
"channel_type": {
"$ref": "#/$defs/OlfactometerChannelType",
"default": "Odor",
- "title": "Channel type"
+ "title": "Olfactometer channel type"
},
"flow_rate_capacity": {
"default": 100,
@@ -2939,7 +2468,7 @@
"type": "object"
},
"OlfactometerChannelType": {
- "description": "Channel type",
+ "description": "Olfactometer channel type",
"enum": [
"Odor",
"Carrier"
@@ -3058,10 +2587,8 @@
"odor_control": {
"$ref": "#/$defs/OdorControl",
"default": {
- "valve_max_open_time": 10.0,
- "target_total_flow": 1000.0,
- "use_channel_3_as_carrier": true,
- "target_odor_flow": 100.0
+ "target_total_flow": 1000,
+ "target_odor_flow": 100
},
"description": "Control of the odor"
},
@@ -3180,16 +2707,13 @@
"type": "integer"
},
"odor_specification": {
- "default": null,
- "description": "The optional odor specification of the patch",
- "oneOf": [
- {
- "$ref": "#/$defs/OdorSpecification"
- },
- {
- "type": "null"
- }
- ]
+ "description": "A list of odor concentrations for the patch, where the index of the list corresponds to the odor channel",
+ "items": {
+ "minimum": 0,
+ "type": "number"
+ },
+ "title": "Odor Specification",
+ "type": "array"
},
"reward_specification": {
"$ref": "#/$defs/RewardSpecification",
@@ -3313,6 +2837,9 @@
"type": "array"
}
},
+ "required": [
+ "odor_specification"
+ ],
"title": "Patch",
"type": "object"
},
@@ -3684,7 +3211,8 @@
}
},
"title": "PdfDistribution",
- "type": "object"
+ "type": "object",
+ "x-sgen-typename": "AllenNeuralDynamics.AindBehaviorServices.Distributions.PdfDistribution"
},
"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.",
@@ -3720,7 +3248,8 @@
}
},
"title": "PdfDistributionParameters",
- "type": "object"
+ "type": "object",
+ "x-sgen-typename": "AllenNeuralDynamics.AindBehaviorServices.Distributions.PdfDistributionParameters"
},
"PersistentRewardFunction": {
"description": "A RewardFunction that is always active.",
@@ -3832,7 +3361,8 @@
}
},
"title": "PoissonDistribution",
- "type": "object"
+ "type": "object",
+ "x-sgen-typename": "AllenNeuralDynamics.AindBehaviorServices.Distributions.PoissonDistribution"
},
"PoissonDistributionParameters": {
"description": "Parameters for a Poisson distribution.\n\nDefined by the rate parameter (average number of events).",
@@ -3852,13 +3382,14 @@
}
},
"title": "PoissonDistributionParameters",
- "type": "object"
+ "type": "object",
+ "x-sgen-typename": "AllenNeuralDynamics.AindBehaviorServices.Distributions.PoissonDistributionParameters"
},
"PositionControl": {
"description": "Controls the position tracking and movement detection parameters.\n\nThis class manages the position control system including coordinate transformations,\ninitial positioning, signal filtering, and movement detection thresholds for the\nvirtual reality foraging task.",
"properties": {
"gain": {
- "$ref": "#/$defs/aind_behavior_vr_foraging__task_logic__Vector3",
+ "$ref": "#/$defs/Vector3",
"default": {
"x": 1.0,
"y": 1.0,
@@ -3867,13 +3398,13 @@
"description": "Gain of the position control."
},
"initial_position": {
- "$ref": "#/$defs/aind_behavior_vr_foraging__task_logic__Vector3",
+ "$ref": "#/$defs/Vector3",
"default": {
"x": 0.0,
"y": 2.56,
"z": 0.0
},
- "description": "Gain of the position control."
+ "description": "Initial position of the subject in the VR world."
},
"frequency_filter_cutoff": {
"default": 0.5,
@@ -3895,6 +3426,7 @@
"type": "object"
},
"Rect": {
+ "description": "Represents a rectangle defined by its top-left corner, width, and height.",
"properties": {
"x": {
"default": 0,
@@ -4056,7 +3588,7 @@
"type": "object"
},
"RigCalibration": {
- "description": "Container class for calibration models. In a future release these will be moved to the respective devices",
+ "description": "Container class for calibration models.",
"properties": {
"water_valve": {
"$ref": "#/$defs/WaterValveCalibration",
@@ -4087,20 +3619,33 @@
"description": "Parameters of the distribution"
},
"truncation_parameters": {
- "const": null,
"default": null,
- "title": "Truncation Parameters",
- "type": "null"
+ "description": "Truncation parameters of the distribution",
+ "oneOf": [
+ {
+ "$ref": "#/$defs/TruncationParameters"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"scaling_parameters": {
- "const": null,
"default": null,
- "title": "Scaling Parameters",
- "type": "null"
+ "description": "Scaling parameters of the distribution",
+ "oneOf": [
+ {
+ "$ref": "#/$defs/ScalingParameters"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
"title": "Scalar",
- "type": "object"
+ "type": "object",
+ "x-sgen-typename": "AllenNeuralDynamics.AindBehaviorServices.Distributions.Scalar"
},
"ScalarDistributionParameter": {
"description": "Parameters for a scalar (constant) distribution.\n\nRepresents a deterministic value that always returns the same number.",
@@ -4119,7 +3664,8 @@
}
},
"title": "ScalarDistributionParameter",
- "type": "object"
+ "type": "object",
+ "x-sgen-typename": "AllenNeuralDynamics.AindBehaviorServices.Distributions.ScalarDistributionParameter"
},
"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.",
@@ -4138,44 +3684,20 @@
}
},
"title": "ScalingParameters",
- "type": "object"
+ "type": "object",
+ "x-sgen-typename": "AllenNeuralDynamics.AindBehaviorServices.Distributions.ScalingParameters"
},
- "Screen": {
+ "ScreenAssembly": {
+ "description": "Represents a screen assembly (left, center and right screens) and respective configuration.",
"properties": {
"device_type": {
- "const": "Screen",
- "default": "Screen",
- "description": "Device type",
+ "const": "ScreenAssembly",
+ "default": "ScreenAssembly",
"title": "Device Type",
"type": "string"
},
- "device_name": {
- "default": null,
- "description": "Device name",
- "oneOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ],
- "title": "Device Name"
- },
- "additional_settings": {
- "default": null,
- "description": "Additional settings",
- "oneOf": [
- {
- "$ref": "#/$defs/BaseModel"
- },
- {
- "type": "null"
- }
- ]
- },
"calibration": {
- "$ref": "#/$defs/DisplaysCalibration",
+ "$ref": "#/$defs/ScreenAssemblyCalibration",
"default": {
"left": {
"extrinsics": {
@@ -4238,7 +3760,7 @@
}
}
},
- "description": "Screen calibration"
+ "description": "Screen assembly calibration"
},
"display_index": {
"default": 1,
@@ -4264,24 +3786,208 @@
"title": "Texture Assets Directory",
"type": "string"
},
- "brightness": {
- "default": 0,
- "description": "Brightness",
- "maximum": 1,
- "minimum": -1,
- "title": "Brightness",
- "type": "number"
+ "brightness": {
+ "default": 0,
+ "description": "Brightness",
+ "maximum": 1,
+ "minimum": -1,
+ "title": "Brightness",
+ "type": "number"
+ },
+ "contrast": {
+ "default": 1,
+ "description": "Contrast",
+ "maximum": 1,
+ "minimum": -1,
+ "title": "Contrast",
+ "type": "number"
+ }
+ },
+ "title": "ScreenAssembly",
+ "type": "object"
+ },
+ "ScreenAssemblyCalibration": {
+ "description": "Represents the calibration parameters for a screen assembly with three displays.",
+ "properties": {
+ "left": {
+ "$ref": "#/$defs/DisplayCalibration",
+ "default": {
+ "intrinsics": {
+ "display_height": 15.0,
+ "display_width": 20.0,
+ "frame_height": 1080,
+ "frame_width": 1920
+ },
+ "extrinsics": {
+ "rotation": {
+ "x": 0.0,
+ "y": 1.0472,
+ "z": 0.0
+ },
+ "translation": {
+ "x": -16.6917756,
+ "y": 1.309016,
+ "z": -3.575264
+ }
+ }
+ },
+ "description": "Left display calibration"
+ },
+ "center": {
+ "$ref": "#/$defs/DisplayCalibration",
+ "default": {
+ "intrinsics": {
+ "display_height": 15.0,
+ "display_width": 20.0,
+ "frame_height": 1080,
+ "frame_width": 1920
+ },
+ "extrinsics": {
+ "rotation": {
+ "x": 0.0,
+ "y": 0.0,
+ "z": 0.0
+ },
+ "translation": {
+ "x": 0.0,
+ "y": 1.309016,
+ "z": -13.27
+ }
+ }
+ },
+ "description": "Center display calibration"
+ },
+ "right": {
+ "$ref": "#/$defs/DisplayCalibration",
+ "default": {
+ "intrinsics": {
+ "display_height": 15.0,
+ "display_width": 20.0,
+ "frame_height": 1080,
+ "frame_width": 1920
+ },
+ "extrinsics": {
+ "rotation": {
+ "x": 0.0,
+ "y": -1.0472,
+ "z": 0.0
+ },
+ "translation": {
+ "x": 16.6917756,
+ "y": 1.309016,
+ "z": -3.575264
+ }
+ }
+ },
+ "description": "Right display calibration"
+ }
+ },
+ "title": "ScreenAssemblyCalibration",
+ "type": "object"
+ },
+ "Session": {
+ "properties": {
+ "aind_behavior_services_pkg_version": {
+ "default": "0.13.6",
+ "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.6",
+ "default": "0.13.6",
+ "title": "Version",
+ "type": "string"
+ },
+ "experiment": {
+ "default": null,
+ "description": "Name of the experiment",
+ "oneOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Experiment"
+ },
+ "experimenter": {
+ "default": [],
+ "description": "Name of the experimenter",
+ "items": {
+ "type": "string"
+ },
+ "title": "Experimenter",
+ "type": "array"
+ },
+ "date": {
+ "description": "Date of the experiment",
+ "format": "date-time",
+ "title": "Date",
+ "type": "string"
+ },
+ "session_name": {
+ "default": null,
+ "description": "Name of the session. This will be used to create a folder in the root path. If not provided, it will be generated using subject and date.",
+ "oneOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Session Name"
+ },
+ "subject": {
+ "description": "Name of the subject",
+ "title": "Subject",
+ "type": "string"
+ },
+ "notes": {
+ "default": null,
+ "description": "Notes about the experiment",
+ "oneOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Notes"
+ },
+ "commit_hash": {
+ "default": null,
+ "description": "Commit hash of the repository",
+ "oneOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Commit Hash"
},
- "contrast": {
- "default": 1,
- "description": "Contrast",
- "maximum": 1,
- "minimum": -1,
- "title": "Contrast",
- "type": "number"
+ "allow_dirty_repo": {
+ "default": false,
+ "description": "Allow running from a dirty repository",
+ "title": "Allow Dirty Repo",
+ "type": "boolean"
+ },
+ "skip_hardware_validation": {
+ "default": false,
+ "description": "Skip hardware validation",
+ "title": "Skip Hardware Validation",
+ "type": "boolean"
}
},
- "title": "Screen",
+ "required": [
+ "subject"
+ ],
+ "title": "Session",
"type": "object"
},
"SetValueFunction": {
@@ -4305,7 +4011,7 @@
"type": "object"
},
"Size": {
- "description": "Represents 2D dimensions with width and height.\n\nUsed for defining texture sizes, corridor dimensions, and other 2D measurements\nin the VR foraging environment.",
+ "description": "Represents 2D dimensions with width and height.",
"properties": {
"width": {
"default": 0,
@@ -4324,42 +4030,17 @@
"type": "object"
},
"SpinnakerCamera": {
+ "description": "Spinnaker camera device configuration.",
"properties": {
"device_type": {
"const": "SpinnakerCamera",
"default": "SpinnakerCamera",
- "description": "Device type",
"title": "Device Type",
"type": "string"
},
- "device_name": {
- "default": null,
- "description": "Device name",
- "oneOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ],
- "title": "Device Name"
- },
- "additional_settings": {
- "default": null,
- "description": "Additional settings",
- "oneOf": [
- {
- "$ref": "#/$defs/BaseModel"
- },
- {
- "type": "null"
- }
- ]
- },
"calibration": {
"default": null,
- "description": "Calibration",
+ "description": "Calibration for the device.",
"oneOf": [
{
"$ref": "#/$defs/BaseModel"
@@ -4473,6 +4154,7 @@
"type": "object"
},
"SpinnakerCameraAdcBitDepth": {
+ "description": "ADC bit depth options for Spinnaker cameras.",
"enum": [
0,
1,
@@ -4487,6 +4169,7 @@
]
},
"SpinnakerCameraPixelFormat": {
+ "description": "Pixel format options for Spinnaker cameras.",
"enum": [
0,
1,
@@ -4804,6 +4487,7 @@
"type": "object"
},
"Treadmill": {
+ "description": "A calibrated treadmill device",
"properties": {
"device_type": {
"const": "Treadmill",
@@ -4811,41 +4495,24 @@
"title": "Device Type",
"type": "string"
},
- "device_name": {
- "default": null,
- "description": "Device name",
- "oneOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ],
- "title": "Device Name"
- },
- "additional_settings": {
- "default": null,
- "description": "Additional settings",
- "oneOf": [
- {
- "$ref": "#/$defs/BaseModel"
- },
- {
- "type": "null"
- }
- ]
- },
"calibration": {
- "default": null,
- "oneOf": [
- {
- "$ref": "#/$defs/TreadmillCalibration"
- },
- {
- "type": "null"
- }
- ],
+ "$ref": "#/$defs/TreadmillCalibration",
+ "default": {
+ "date": null,
+ "wheel_diameter": 15.0,
+ "pulses_per_revolution": 28800,
+ "invert_direction": false,
+ "brake_lookup_calibration": [
+ [
+ 0.0,
+ 0.0
+ ],
+ [
+ 1.0,
+ 65535.0
+ ]
+ ]
+ },
"title": "Calibration of the treadmill"
},
"who_am_i": {
@@ -4882,22 +4549,9 @@
"TreadmillCalibration": {
"description": "Treadmill calibration class",
"properties": {
- "device_name": {
- "default": "Treadmill",
- "description": "Must match a device name in rig/instrument",
- "title": "Device name",
- "type": "string"
- },
- "input": {
- "$ref": "#/$defs/TreadmillCalibrationInput",
- "title": "Input of the calibration"
- },
- "output": {
- "$ref": "#/$defs/TreadmillCalibrationOutput",
- "title": "Output of the calibration."
- },
"date": {
"default": null,
+ "description": "Date of the calibration",
"oneOf": [
{
"format": "date-time",
@@ -4909,39 +4563,6 @@
],
"title": "Date"
},
- "description": {
- "const": "Calibration of the treadmill system",
- "default": "Calibration of the treadmill system",
- "title": "Description",
- "type": "string"
- },
- "notes": {
- "default": null,
- "oneOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ],
- "title": "Notes"
- }
- },
- "required": [
- "input",
- "output"
- ],
- "title": "TreadmillCalibration",
- "type": "object"
- },
- "TreadmillCalibrationInput": {
- "properties": {},
- "title": "TreadmillCalibrationInput",
- "type": "object"
- },
- "TreadmillCalibrationOutput": {
- "properties": {
"wheel_diameter": {
"default": 15,
"description": "Wheel diameter",
@@ -4963,6 +4584,16 @@
"type": "boolean"
},
"brake_lookup_calibration": {
+ "default": [
+ [
+ 0,
+ 0
+ ],
+ [
+ 1,
+ 65535
+ ]
+ ],
"description": "Brake lookup calibration. Each pair of values define (input [torque], output [brake set-point U16])",
"items": {
"items": {
@@ -4977,10 +4608,7 @@
"type": "array"
}
},
- "required": [
- "brake_lookup_calibration"
- ],
- "title": "TreadmillCalibrationOutput",
+ "title": "TreadmillCalibration",
"type": "object"
},
"TreadmillSpecification": {
@@ -5029,7 +4657,8 @@
}
},
"title": "TruncationParameters",
- "type": "object"
+ "type": "object",
+ "x-sgen-typename": "AllenNeuralDynamics.AindBehaviorServices.Distributions.TruncationParameters"
},
"UniformDistribution": {
"description": "A uniform probability distribution.\n\nAll values between min and max have equal probability of being sampled.",
@@ -5075,7 +4704,8 @@
}
},
"title": "UniformDistribution",
- "type": "object"
+ "type": "object",
+ "x-sgen-typename": "AllenNeuralDynamics.AindBehaviorServices.Distributions.UniformDistribution"
},
"UniformDistributionParameters": {
"description": "Parameters for a uniform distribution.\n\nDefined by minimum and maximum bounds of the distribution.",
@@ -5100,7 +4730,8 @@
}
},
"title": "UniformDistributionParameters",
- "type": "object"
+ "type": "object",
+ "x-sgen-typename": "AllenNeuralDynamics.AindBehaviorServices.Distributions.UniformDistributionParameters"
},
"UpdaterTarget": {
"description": "Enumeration of parameters that can be targeted by numerical updaters.\n\nThese targets define which task parameters can be dynamically modified\nduring task execution to adapt to animal performance or experimental needs.",
@@ -5112,6 +4743,31 @@
"title": "UpdaterTarget",
"type": "string"
},
+ "Vector3": {
+ "description": "Represents a 3D vector with float coordinates.",
+ "properties": {
+ "x": {
+ "default": 0,
+ "description": "X coordinate of the vector",
+ "title": "X",
+ "type": "number"
+ },
+ "y": {
+ "default": 0,
+ "description": "Y coordinate of the vector",
+ "title": "Y",
+ "type": "number"
+ },
+ "z": {
+ "default": 0,
+ "description": "Z coordinate of the vector",
+ "title": "Z",
+ "type": "number"
+ }
+ },
+ "title": "Vector3",
+ "type": "object"
+ },
"VideoWriter": {
"discriminator": {
"mapping": {
@@ -5130,6 +4786,7 @@
]
},
"VideoWriterFfmpeg": {
+ "description": "FFMPEG video writer configuration.",
"properties": {
"video_writer_type": {
"const": "FFMPEG",
@@ -5145,13 +4802,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"
@@ -5167,6 +4824,7 @@
"type": "object"
},
"VideoWriterOpenCv": {
+ "description": "OpenCV video writer configuration.",
"properties": {
"video_writer_type": {
"const": "OPENCV",
@@ -5230,12 +4888,18 @@
"description": "The optional odor specification of the virtual site",
"oneOf": [
{
- "$ref": "#/$defs/OdorSpecification"
+ "description": "The optional odor specification of the virtual site",
+ "items": {
+ "minimum": 0,
+ "type": "number"
+ },
+ "type": "array"
},
{
"type": "null"
}
- ]
+ ],
+ "title": "Odor Specification"
},
"reward_specification": {
"default": null,
@@ -5428,24 +5092,11 @@
"type": "object"
},
"WaterValveCalibration": {
- "description": "Water valve calibration class",
+ "description": "Represents a water valve calibration.",
"properties": {
- "device_name": {
- "default": "WaterValve",
- "description": "Name of the device being calibrated",
- "title": "Device name",
- "type": "string"
- },
- "input": {
- "$ref": "#/$defs/WaterValveCalibrationInput",
- "title": "Input of the calibration"
- },
- "output": {
- "$ref": "#/$defs/WaterValveCalibrationOutput",
- "title": "Output of the calibration."
- },
"date": {
"default": null,
+ "description": "Date of the calibration",
"oneOf": [
{
"format": "date-time",
@@ -5457,34 +5108,6 @@
],
"title": "Date"
},
- "description": {
- "const": "Calibration of the water valve delivery system",
- "default": "Calibration of the water valve delivery system",
- "title": "Description",
- "type": "string"
- },
- "notes": {
- "default": null,
- "oneOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ],
- "title": "Notes"
- }
- },
- "required": [
- "input",
- "output"
- ],
- "title": "WaterValveCalibration",
- "type": "object"
- },
- "WaterValveCalibrationInput": {
- "properties": {
"measurements": {
"default": [],
"description": "List of measurements",
@@ -5493,14 +5116,7 @@
},
"title": "Measurements",
"type": "array"
- }
- },
- "title": "WaterValveCalibrationInput",
- "type": "object"
- },
- "WaterValveCalibrationOutput": {
- "description": "Output for water valve calibration class",
- "properties": {
+ },
"interval_average": {
"default": null,
"description": "Dictionary keyed by measured valve interval and corresponding average single event volume.",
@@ -5566,46 +5182,21 @@
"slope",
"offset"
],
- "title": "WaterValveCalibrationOutput",
+ "title": "WaterValveCalibration",
"type": "object"
},
"WebCamera": {
+ "description": "Web camera device configuration.",
"properties": {
"device_type": {
"const": "WebCamera",
"default": "WebCamera",
- "description": "Device type",
"title": "Device Type",
"type": "string"
},
- "device_name": {
- "default": null,
- "description": "Device name",
- "oneOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ],
- "title": "Device Name"
- },
- "additional_settings": {
- "default": null,
- "description": "Additional settings",
- "oneOf": [
- {
- "$ref": "#/$defs/BaseModel"
- },
- {
- "type": "null"
- }
- ]
- },
"calibration": {
"default": null,
- "description": "Calibration",
+ "description": "Calibration for the device.",
"oneOf": [
{
"$ref": "#/$defs/BaseModel"
@@ -5637,55 +5228,6 @@
},
"title": "WebCamera",
"type": "object"
- },
- "aind_behavior_services__rig__visual_stimulation__Vector3": {
- "properties": {
- "x": {
- "default": 0,
- "description": "X coordinate of the point",
- "title": "X",
- "type": "number"
- },
- "y": {
- "default": 0,
- "description": "Y coordinate of the point",
- "title": "Y",
- "type": "number"
- },
- "z": {
- "default": 0,
- "description": "Z coordinate of the point",
- "title": "Z",
- "type": "number"
- }
- },
- "title": "Vector3",
- "type": "object"
- },
- "aind_behavior_vr_foraging__task_logic__Vector3": {
- "description": "Represents a 3D point or vector with x, y, and z coordinates.\n\nUsed for 3D positioning and movement in the virtual reality environment,\nincluding camera positions, object locations, and 3D transformations.",
- "properties": {
- "x": {
- "default": 0,
- "description": "X coordinate of the point",
- "title": "X",
- "type": "number"
- },
- "y": {
- "default": 0,
- "description": "Y coordinate of the point",
- "title": "Y",
- "type": "number"
- },
- "z": {
- "default": 0,
- "description": "Z coordinate of the point",
- "title": "Z",
- "type": "number"
- }
- },
- "title": "Vector3",
- "type": "object"
}
}
}
\ No newline at end of file
diff --git a/src/Extensions.csproj b/src/Extensions.csproj
index fb3b6fb9..19ff4931 100644
--- a/src/Extensions.csproj
+++ b/src/Extensions.csproj
@@ -13,13 +13,15 @@
-
+
-
+
+
+
\ No newline at end of file
diff --git a/src/Extensions/AddGapSite.bonsai b/src/Extensions/AddGapSite.bonsai
index 0d1b6ef9..7afa4531 100644
--- a/src/Extensions/AddGapSite.bonsai
+++ b/src/Extensions/AddGapSite.bonsai
@@ -1,8 +1,9 @@
-
@@ -57,8 +58,9 @@
-
+
LengthDistribution
+
RngSeed
@@ -69,7 +71,7 @@
-
+
@@ -97,7 +99,9 @@
-
+
+
+
@@ -112,6 +116,7 @@
388
+
20.7234077
0
diff --git a/src/Extensions/AddInterPatchSite.bonsai b/src/Extensions/AddInterPatchSite.bonsai
index d2267349..23bd868e 100644
--- a/src/Extensions/AddInterPatchSite.bonsai
+++ b/src/Extensions/AddInterPatchSite.bonsai
@@ -1,8 +1,9 @@
-
@@ -46,7 +47,7 @@
-
+
LengthDistribution
@@ -58,7 +59,7 @@
-
+
@@ -84,7 +85,9 @@
-
+
+
+
@@ -97,6 +100,7 @@
0
+
120
0
diff --git a/src/Extensions/AddPostPatchSite.bonsai b/src/Extensions/AddPostPatchSite.bonsai
index 1fb98db8..5ef5e83a 100644
--- a/src/Extensions/AddPostPatchSite.bonsai
+++ b/src/Extensions/AddPostPatchSite.bonsai
@@ -1,8 +1,9 @@
-
@@ -55,8 +56,9 @@
-
+
LengthDistribution
+
RngSeed
@@ -67,7 +69,7 @@
-
+
@@ -93,7 +95,9 @@
-
+
+
+
@@ -106,6 +110,7 @@
0
+
120
0
diff --git a/src/Extensions/AddRewardSite.bonsai b/src/Extensions/AddRewardSite.bonsai
index b9e9687d..ac50c6eb 100644
--- a/src/Extensions/AddRewardSite.bonsai
+++ b/src/Extensions/AddRewardSite.bonsai
@@ -3,6 +3,7 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:rx="clr-namespace:Bonsai.Reactive;assembly=Bonsai.Core"
xmlns:p1="clr-namespace:AindVrForagingDataSchema;assembly=Extensions"
+ xmlns:p2="clr-namespace:AllenNeuralDynamics.AindBehaviorServices.Distributions;assembly=AllenNeuralDynamics.AindBehaviorServices.Distributions"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
xmlns:num="clr-namespace:Bonsai.Numerics;assembly=Bonsai.Numerics"
xmlns="https://bonsai-rx.org/2018/workflow">
@@ -55,8 +56,9 @@
-
+
LengthDistribution
+
RngSeed
@@ -67,7 +69,7 @@
-
+
@@ -106,7 +108,9 @@
-
+
+
+
@@ -136,6 +140,7 @@
353
+
35.1602135
0
diff --git a/src/Extensions/AindBehaviorVrForaging.Generated.cs b/src/Extensions/AindBehaviorVrForaging.Generated.cs
index 924972de..26b2ace6 100644
--- a/src/Extensions/AindBehaviorVrForaging.Generated.cs
+++ b/src/Extensions/AindBehaviorVrForaging.Generated.cs
@@ -9,306 +9,159 @@ namespace AindVrForagingDataSchema
{
#pragma warning disable // Disable all warnings
- [System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.6.1.0 (Newtonsoft.Json v13.0.0.0)")]
+ ///
+ /// Appends a task specific configuration to the base manipulator model.
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.9.0.0 (Newtonsoft.Json v13.0.0.0)")]
+ [System.ComponentModel.DescriptionAttribute("Appends a task specific configuration to the base manipulator model.")]
[Bonsai.WorkflowElementCategoryAttribute(Bonsai.ElementCategory.Source)]
[Bonsai.CombinatorAttribute(MethodName="Generate")]
- public partial class AindBehaviorSessionModel
+ public partial class AindManipulatorDevice
{
- private string _aindBehaviorServicesPkgVersion;
-
- private string _version;
-
- private string _experiment;
-
- private System.Collections.Generic.List _experimenter;
-
- private System.DateTimeOffset _date;
-
- private string _rootPath;
-
- private string _sessionName;
-
- private string _subject;
-
- private string _experimentVersion;
-
- private string _notes;
-
- private string _commitHash;
+ private string _deviceType;
- private bool _allowDirtyRepo;
+ private AllenNeuralDynamics.AindManipulator.AindManipulatorCalibration _calibration;
- private bool _skipHardwareValidation;
+ private int _whoAmI;
- public AindBehaviorSessionModel()
- {
- _aindBehaviorServicesPkgVersion = "0.12.5";
- _version = "0.12.5";
- _experimenter = new System.Collections.Generic.List();
- _experimentVersion = "";
- _allowDirtyRepo = false;
- _skipHardwareValidation = false;
- }
+ private string _serialNumber;
- protected AindBehaviorSessionModel(AindBehaviorSessionModel other)
- {
- _aindBehaviorServicesPkgVersion = other._aindBehaviorServicesPkgVersion;
- _version = other._version;
- _experiment = other._experiment;
- _experimenter = other._experimenter;
- _date = other._date;
- _rootPath = other._rootPath;
- _sessionName = other._sessionName;
- _subject = other._subject;
- _experimentVersion = other._experimentVersion;
- _notes = other._notes;
- _commitHash = other._commitHash;
- _allowDirtyRepo = other._allowDirtyRepo;
- _skipHardwareValidation = other._skipHardwareValidation;
- }
+ private string _portName;
- [Newtonsoft.Json.JsonPropertyAttribute("aind_behavior_services_pkg_version")]
- public string AindBehaviorServicesPkgVersion
- {
- get
- {
- return _aindBehaviorServicesPkgVersion;
- }
- set
- {
- _aindBehaviorServicesPkgVersion = value;
- }
- }
+ private AllenNeuralDynamics.AindManipulator.Axis _spoutAxis;
- [Newtonsoft.Json.JsonPropertyAttribute("version")]
- public string Version
+ public AindManipulatorDevice()
{
- get
- {
- return _version;
- }
- set
- {
- _version = value;
- }
+ _deviceType = "StepperDriver";
+ _calibration = new AllenNeuralDynamics.AindManipulator.AindManipulatorCalibration();
+ _whoAmI = 1130;
+ _spoutAxis = AllenNeuralDynamics.AindManipulator.Axis.Y1;
}
- ///
- /// Name of the experiment
- ///
- [Newtonsoft.Json.JsonPropertyAttribute("experiment")]
- [System.ComponentModel.DescriptionAttribute("Name of the experiment")]
- public string Experiment
+ protected AindManipulatorDevice(AindManipulatorDevice other)
{
- get
- {
- return _experiment;
- }
- set
- {
- _experiment = value;
- }
+ _deviceType = other._deviceType;
+ _calibration = other._calibration;
+ _whoAmI = other._whoAmI;
+ _serialNumber = other._serialNumber;
+ _portName = other._portName;
+ _spoutAxis = other._spoutAxis;
}
- ///
- /// Name of the experimenter
- ///
- [System.Xml.Serialization.XmlIgnoreAttribute()]
- [Newtonsoft.Json.JsonPropertyAttribute("experimenter")]
- [System.ComponentModel.DescriptionAttribute("Name of the experimenter")]
- public System.Collections.Generic.List Experimenter
+ [Newtonsoft.Json.JsonPropertyAttribute("device_type")]
+ public string DeviceType
{
get
{
- return _experimenter;
+ return _deviceType;
}
set
{
- _experimenter = value;
+ _deviceType = value;
}
}
///
- /// Date of the experiment
+ /// Calibration for the device.
///
[System.Xml.Serialization.XmlIgnoreAttribute()]
- [Newtonsoft.Json.JsonPropertyAttribute("date")]
- [System.ComponentModel.DescriptionAttribute("Date of the experiment")]
- public System.DateTimeOffset Date
- {
- get
- {
- return _date;
- }
- set
- {
- _date = value;
- }
- }
-
- ///
- /// Root path where data will be logged
- ///
- [Newtonsoft.Json.JsonPropertyAttribute("root_path", Required=Newtonsoft.Json.Required.Always)]
- [System.ComponentModel.DescriptionAttribute("Root path where data will be logged")]
- public string RootPath
- {
- get
- {
- return _rootPath;
- }
- set
- {
- _rootPath = value;
- }
- }
-
- ///
- /// Name of the session. This will be used to create a folder in the root path. If not provided, it will be generated using subject and date.
- ///
- [Newtonsoft.Json.JsonPropertyAttribute("session_name")]
- [System.ComponentModel.DescriptionAttribute("Name of the session. This will be used to create a folder in the root path. If no" +
- "t provided, it will be generated using subject and date.")]
- public string SessionName
- {
- get
- {
- return _sessionName;
- }
- set
- {
- _sessionName = value;
- }
- }
-
- ///
- /// Name of the subject
- ///
- [Newtonsoft.Json.JsonPropertyAttribute("subject", Required=Newtonsoft.Json.Required.Always)]
- [System.ComponentModel.DescriptionAttribute("Name of the subject")]
- public string Subject
- {
- get
- {
- return _subject;
- }
- set
- {
- _subject = value;
- }
- }
-
- ///
- /// Version of the experiment
- ///
- [Newtonsoft.Json.JsonPropertyAttribute("experiment_version")]
- [System.ComponentModel.DescriptionAttribute("Version of the experiment")]
- public string ExperimentVersion
+ [Newtonsoft.Json.JsonPropertyAttribute("calibration")]
+ [System.ComponentModel.DescriptionAttribute("Calibration for the device.")]
+ public AllenNeuralDynamics.AindManipulator.AindManipulatorCalibration Calibration
{
get
{
- return _experimentVersion;
+ return _calibration;
}
set
{
- _experimentVersion = value;
+ _calibration = value;
}
}
- ///
- /// Notes about the experiment
- ///
- [Newtonsoft.Json.JsonPropertyAttribute("notes")]
- [System.ComponentModel.DescriptionAttribute("Notes about the experiment")]
- public string Notes
+ [Newtonsoft.Json.JsonPropertyAttribute("who_am_i")]
+ public int WhoAmI
{
get
{
- return _notes;
+ return _whoAmI;
}
set
{
- _notes = value;
+ _whoAmI = value;
}
}
///
- /// Commit hash of the repository
+ /// Device serial number
///
- [Newtonsoft.Json.JsonPropertyAttribute("commit_hash")]
- [System.ComponentModel.DescriptionAttribute("Commit hash of the repository")]
- public string CommitHash
+ [Newtonsoft.Json.JsonPropertyAttribute("serial_number")]
+ [System.ComponentModel.DescriptionAttribute("Device serial number")]
+ public string SerialNumber
{
get
{
- return _commitHash;
+ return _serialNumber;
}
set
{
- _commitHash = value;
+ _serialNumber = value;
}
}
///
- /// Allow running from a dirty repository
+ /// Device port name
///
- [Newtonsoft.Json.JsonPropertyAttribute("allow_dirty_repo")]
- [System.ComponentModel.DescriptionAttribute("Allow running from a dirty repository")]
- public bool AllowDirtyRepo
+ [Newtonsoft.Json.JsonPropertyAttribute("port_name", Required=Newtonsoft.Json.Required.Always)]
+ [System.ComponentModel.DescriptionAttribute("Device port name")]
+ public string PortName
{
get
{
- return _allowDirtyRepo;
+ return _portName;
}
set
{
- _allowDirtyRepo = value;
+ _portName = value;
}
}
///
- /// Skip hardware validation
+ /// Spout axis
///
- [Newtonsoft.Json.JsonPropertyAttribute("skip_hardware_validation")]
- [System.ComponentModel.DescriptionAttribute("Skip hardware validation")]
- public bool SkipHardwareValidation
+ [Newtonsoft.Json.JsonPropertyAttribute("spout_axis")]
+ [System.ComponentModel.DescriptionAttribute("Spout axis")]
+ public AllenNeuralDynamics.AindManipulator.Axis SpoutAxis
{
get
{
- return _skipHardwareValidation;
+ return _spoutAxis;
}
set
{
- _skipHardwareValidation = value;
+ _spoutAxis = value;
}
}
- public System.IObservable Generate()
+ public System.IObservable Generate()
{
- return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new AindBehaviorSessionModel(this)));
+ return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new AindManipulatorDevice(this)));
}
- public System.IObservable Generate(System.IObservable source)
+ public System.IObservable Generate(System.IObservable source)
{
- return System.Reactive.Linq.Observable.Select(source, _ => new AindBehaviorSessionModel(this));
+ return System.Reactive.Linq.Observable.Select(source, _ => new AindManipulatorDevice(this));
}
protected virtual bool PrintMembers(System.Text.StringBuilder stringBuilder)
{
- stringBuilder.Append("AindBehaviorServicesPkgVersion = " + _aindBehaviorServicesPkgVersion + ", ");
- stringBuilder.Append("Version = " + _version + ", ");
- stringBuilder.Append("Experiment = " + _experiment + ", ");
- stringBuilder.Append("Experimenter = " + _experimenter + ", ");
- stringBuilder.Append("Date = " + _date + ", ");
- stringBuilder.Append("RootPath = " + _rootPath + ", ");
- stringBuilder.Append("SessionName = " + _sessionName + ", ");
- stringBuilder.Append("Subject = " + _subject + ", ");
- stringBuilder.Append("ExperimentVersion = " + _experimentVersion + ", ");
- stringBuilder.Append("Notes = " + _notes + ", ");
- stringBuilder.Append("CommitHash = " + _commitHash + ", ");
- stringBuilder.Append("AllowDirtyRepo = " + _allowDirtyRepo + ", ");
- stringBuilder.Append("SkipHardwareValidation = " + _skipHardwareValidation);
+ stringBuilder.Append("DeviceType = " + _deviceType + ", ");
+ stringBuilder.Append("Calibration = " + _calibration + ", ");
+ stringBuilder.Append("WhoAmI = " + _whoAmI + ", ");
+ stringBuilder.Append("SerialNumber = " + _serialNumber + ", ");
+ stringBuilder.Append("PortName = " + _portName + ", ");
+ stringBuilder.Append("SpoutAxis = " + _spoutAxis);
return true;
}
@@ -328,384 +181,456 @@ public override string ToString()
///
- /// Additional settings for the manipulator device
+ /// Represents the schema, and concrete instantiation, of a rig configuration to run the VrForaging behavior task.
///
- [System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.6.1.0 (Newtonsoft.Json v13.0.0.0)")]
- [System.ComponentModel.DescriptionAttribute("Additional settings for the manipulator device")]
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.9.0.0 (Newtonsoft.Json v13.0.0.0)")]
+ [System.ComponentModel.DescriptionAttribute("Represents the schema, and concrete instantiation, of a rig configuration to run " +
+ "the VrForaging behavior task.")]
[Bonsai.WorkflowElementCategoryAttribute(Bonsai.ElementCategory.Source)]
[Bonsai.CombinatorAttribute(MethodName="Generate")]
- public partial class AindManipulatorAdditionalSettings
+ public partial class AindVrForagingRig
{
- private Axis _spoutAxis;
+ private string _aindBehaviorServicesPkgVersion;
- public AindManipulatorAdditionalSettings()
- {
- _spoutAxis = AindVrForagingDataSchema.Axis.Y1;
- }
+ private string _version;
- protected AindManipulatorAdditionalSettings(AindManipulatorAdditionalSettings other)
- {
- _spoutAxis = other._spoutAxis;
- }
+ private string _computerName;
- ///
- /// Spout axis
- ///
- [System.Xml.Serialization.XmlIgnoreAttribute()]
- [Newtonsoft.Json.JsonPropertyAttribute("spout_axis")]
- [System.ComponentModel.DescriptionAttribute("Spout axis")]
- public Axis SpoutAxis
- {
- get
- {
- return _spoutAxis;
- }
- set
- {
- _spoutAxis = value;
- }
- }
+ private string _rigName;
- public System.IObservable Generate()
- {
- return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new AindManipulatorAdditionalSettings(this)));
- }
+ private string _dataDirectory;
- public System.IObservable Generate(System.IObservable source)
- {
- return System.Reactive.Linq.Observable.Select(source, _ => new AindManipulatorAdditionalSettings(this));
- }
+ private CameraControllerSpinnakerCamera _triggeredCameraController;
- protected virtual bool PrintMembers(System.Text.StringBuilder stringBuilder)
- {
- stringBuilder.Append("SpoutAxis = " + _spoutAxis);
- return true;
- }
+ private CameraControllerWebCamera _monitoringCameraController;
- 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();
- }
- }
-
-
- ///
- /// Aind manipulator calibration class
- ///
- [System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.6.1.0 (Newtonsoft.Json v13.0.0.0)")]
- [System.ComponentModel.DescriptionAttribute("Aind manipulator calibration class")]
- [Bonsai.WorkflowElementCategoryAttribute(Bonsai.ElementCategory.Source)]
- [Bonsai.CombinatorAttribute(MethodName="Generate")]
- public partial class AindManipulatorCalibration
- {
+ private HarpBehavior _harpBehavior;
- private string _deviceName;
+ private Olfactometer _harpOlfactometer;
- private AindManipulatorCalibrationInput _input;
+ private System.Collections.Generic.List _harpOlfactometerExtension;
- private AindManipulatorCalibrationOutput _output;
+ private HarpLicketySplit _harpLickometer;
- private System.DateTimeOffset? _date;
+ private HarpWhiteRabbit _harpClockGenerator;
- private string _description;
+ private HarpAnalogInput _harpAnalogInput;
- private string _notes;
+ private Treadmill _harpTreadmill;
+
+ private HarpSniffDetector _harpSniffDetector;
+
+ private HarpEnvironmentSensor _harpEnvironmentSensor;
+
+ private AindManipulatorDevice _manipulator;
+
+ private ScreenAssembly _screen;
- public AindManipulatorCalibration()
+ private RigCalibration _calibration;
+
+ public AindVrForagingRig()
{
- _deviceName = "AindManipulator";
- _input = new AindManipulatorCalibrationInput();
- _output = new AindManipulatorCalibrationOutput();
- _description = "Calibration of the load cells system";
+ _aindBehaviorServicesPkgVersion = "0.13.6";
+ _version = "0.7.0-rc0";
+ _triggeredCameraController = new CameraControllerSpinnakerCamera();
+ _harpBehavior = new HarpBehavior();
+ _harpOlfactometer = new Olfactometer();
+ _harpOlfactometerExtension = new System.Collections.Generic.List();
+ _harpLickometer = new HarpLicketySplit();
+ _harpClockGenerator = new HarpWhiteRabbit();
+ _harpTreadmill = new Treadmill();
+ _manipulator = new AindManipulatorDevice();
+ _screen = new ScreenAssembly();
+ _calibration = new RigCalibration();
}
- protected AindManipulatorCalibration(AindManipulatorCalibration other)
+ protected AindVrForagingRig(AindVrForagingRig other)
{
- _deviceName = other._deviceName;
- _input = other._input;
- _output = other._output;
- _date = other._date;
- _description = other._description;
- _notes = other._notes;
+ _aindBehaviorServicesPkgVersion = other._aindBehaviorServicesPkgVersion;
+ _version = other._version;
+ _computerName = other._computerName;
+ _rigName = other._rigName;
+ _dataDirectory = other._dataDirectory;
+ _triggeredCameraController = other._triggeredCameraController;
+ _monitoringCameraController = other._monitoringCameraController;
+ _harpBehavior = other._harpBehavior;
+ _harpOlfactometer = other._harpOlfactometer;
+ _harpOlfactometerExtension = other._harpOlfactometerExtension;
+ _harpLickometer = other._harpLickometer;
+ _harpClockGenerator = other._harpClockGenerator;
+ _harpAnalogInput = other._harpAnalogInput;
+ _harpTreadmill = other._harpTreadmill;
+ _harpSniffDetector = other._harpSniffDetector;
+ _harpEnvironmentSensor = other._harpEnvironmentSensor;
+ _manipulator = other._manipulator;
+ _screen = other._screen;
+ _calibration = other._calibration;
}
- ///
- /// Must match a device name in rig/instrument
- ///
- [Newtonsoft.Json.JsonPropertyAttribute("device_name")]
- [System.ComponentModel.DescriptionAttribute("Must match a device name in rig/instrument")]
- public string DeviceName
+ [Newtonsoft.Json.JsonPropertyAttribute("aind_behavior_services_pkg_version")]
+ public string AindBehaviorServicesPkgVersion
{
get
{
- return _deviceName;
+ return _aindBehaviorServicesPkgVersion;
}
set
{
- _deviceName = value;
+ _aindBehaviorServicesPkgVersion = value;
}
}
- [System.Xml.Serialization.XmlIgnoreAttribute()]
- [Newtonsoft.Json.JsonPropertyAttribute("input", Required=Newtonsoft.Json.Required.Always)]
- public AindManipulatorCalibrationInput Input
+ [Newtonsoft.Json.JsonPropertyAttribute("version")]
+ public string Version
{
get
{
- return _input;
+ return _version;
}
set
{
- _input = value;
+ _version = value;
}
}
- [System.Xml.Serialization.XmlIgnoreAttribute()]
- [Newtonsoft.Json.JsonPropertyAttribute("output", Required=Newtonsoft.Json.Required.Always)]
- public AindManipulatorCalibrationOutput Output
+ ///
+ /// Computer name
+ ///
+ [Newtonsoft.Json.JsonPropertyAttribute("computer_name", Required=Newtonsoft.Json.Required.Always)]
+ [System.ComponentModel.DescriptionAttribute("Computer name")]
+ public string ComputerName
{
get
{
- return _output;
+ return _computerName;
}
set
{
- _output = value;
+ _computerName = value;
}
}
- [System.Xml.Serialization.XmlIgnoreAttribute()]
- [Newtonsoft.Json.JsonPropertyAttribute("date")]
- public System.DateTimeOffset? Date
+ ///
+ /// Rig name
+ ///
+ [Newtonsoft.Json.JsonPropertyAttribute("rig_name", Required=Newtonsoft.Json.Required.Always)]
+ [System.ComponentModel.DescriptionAttribute("Rig name")]
+ public string RigName
{
get
{
- return _date;
+ return _rigName;
}
set
{
- _date = value;
+ _rigName = value;
}
}
- [Newtonsoft.Json.JsonPropertyAttribute("description")]
- public string Description
+ ///
+ /// Directory where data will be saved to
+ ///
+ [Newtonsoft.Json.JsonPropertyAttribute("data_directory", Required=Newtonsoft.Json.Required.Always)]
+ [System.ComponentModel.DescriptionAttribute("Directory where data will be saved to")]
+ public string DataDirectory
{
get
{
- return _description;
+ return _dataDirectory;
}
set
{
- _description = value;
+ _dataDirectory = value;
}
}
- [Newtonsoft.Json.JsonPropertyAttribute("notes")]
- public string Notes
+ ///
+ /// Required camera controller to triggered cameras.
+ ///
+ [System.Xml.Serialization.XmlIgnoreAttribute()]
+ [Newtonsoft.Json.JsonPropertyAttribute("triggered_camera_controller", Required=Newtonsoft.Json.Required.Always)]
+ [System.ComponentModel.DescriptionAttribute("Required camera controller to triggered cameras.")]
+ public CameraControllerSpinnakerCamera TriggeredCameraController
{
get
{
- return _notes;
+ return _triggeredCameraController;
}
set
{
- _notes = value;
+ _triggeredCameraController = value;
}
}
- public System.IObservable Generate()
- {
- return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new AindManipulatorCalibration(this)));
- }
-
- public System.IObservable Generate(System.IObservable source)
- {
- return System.Reactive.Linq.Observable.Select(source, _ => new AindManipulatorCalibration(this));
- }
-
- protected virtual bool PrintMembers(System.Text.StringBuilder stringBuilder)
+ ///
+ /// Optional camera controller for monitoring cameras.
+ ///
+ [System.Xml.Serialization.XmlIgnoreAttribute()]
+ [Newtonsoft.Json.JsonPropertyAttribute("monitoring_camera_controller")]
+ [System.ComponentModel.DescriptionAttribute("Optional camera controller for monitoring cameras.")]
+ public CameraControllerWebCamera MonitoringCameraController
{
- stringBuilder.Append("DeviceName = " + _deviceName + ", ");
- stringBuilder.Append("Input = " + _input + ", ");
- stringBuilder.Append("Output = " + _output + ", ");
- stringBuilder.Append("Date = " + _date + ", ");
- stringBuilder.Append("Description = " + _description + ", ");
- stringBuilder.Append("Notes = " + _notes);
- return true;
+ get
+ {
+ return _monitoringCameraController;
+ }
+ set
+ {
+ _monitoringCameraController = value;
+ }
}
- public override string ToString()
+ ///
+ /// Harp behavior
+ ///
+ [System.Xml.Serialization.XmlIgnoreAttribute()]
+ [Newtonsoft.Json.JsonPropertyAttribute("harp_behavior", Required=Newtonsoft.Json.Required.Always)]
+ [System.ComponentModel.DescriptionAttribute("Harp behavior")]
+ public HarpBehavior HarpBehavior
{
- System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder();
- stringBuilder.Append(GetType().Name);
- stringBuilder.Append(" { ");
- if (PrintMembers(stringBuilder))
+ get
{
- stringBuilder.Append(" ");
+ return _harpBehavior;
+ }
+ set
+ {
+ _harpBehavior = value;
}
- stringBuilder.Append("}");
- return stringBuilder.ToString();
}
- }
-
-
- [System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.6.1.0 (Newtonsoft.Json v13.0.0.0)")]
- [Bonsai.WorkflowElementCategoryAttribute(Bonsai.ElementCategory.Source)]
- [Bonsai.CombinatorAttribute(MethodName="Generate")]
- public partial class AindManipulatorCalibrationInput
- {
-
- private ManipulatorPosition _fullStepToMm;
- private System.Collections.Generic.List _axisConfiguration;
-
- private System.Collections.Generic.List _homingOrder;
-
- private ManipulatorPosition _initialPosition;
-
- public AindManipulatorCalibrationInput()
+ ///
+ /// Harp olfactometer
+ ///
+ [System.Xml.Serialization.XmlIgnoreAttribute()]
+ [Newtonsoft.Json.JsonPropertyAttribute("harp_olfactometer", Required=Newtonsoft.Json.Required.Always)]
+ [System.ComponentModel.DescriptionAttribute("Harp olfactometer")]
+ public Olfactometer HarpOlfactometer
{
- _fullStepToMm = new ManipulatorPosition();
- _axisConfiguration = new System.Collections.Generic.List();
- _homingOrder = new System.Collections.Generic.List();
- _initialPosition = new ManipulatorPosition();
+ get
+ {
+ return _harpOlfactometer;
+ }
+ set
+ {
+ _harpOlfactometer = value;
+ }
}
- protected AindManipulatorCalibrationInput(AindManipulatorCalibrationInput other)
+ ///
+ /// A collection of subordinate olfactometers that can be added to increase the number of independently delivered odors. The order of the list determines the order by which odors are numbered
+ ///
+ [System.Xml.Serialization.XmlIgnoreAttribute()]
+ [Newtonsoft.Json.JsonPropertyAttribute("harp_olfactometer_extension")]
+ [System.ComponentModel.DescriptionAttribute("A collection of subordinate olfactometers that can be added to increase the numbe" +
+ "r of independently delivered odors. The order of the list determines the order b" +
+ "y which odors are numbered")]
+ public System.Collections.Generic.List HarpOlfactometerExtension
{
- _fullStepToMm = other._fullStepToMm;
- _axisConfiguration = other._axisConfiguration;
- _homingOrder = other._homingOrder;
- _initialPosition = other._initialPosition;
+ get
+ {
+ return _harpOlfactometerExtension;
+ }
+ set
+ {
+ _harpOlfactometerExtension = value;
+ }
}
+ ///
+ /// Harp lickometer
+ ///
[System.Xml.Serialization.XmlIgnoreAttribute()]
- [Newtonsoft.Json.JsonPropertyAttribute("full_step_to_mm")]
- public ManipulatorPosition FullStepToMm
+ [Newtonsoft.Json.JsonPropertyAttribute("harp_lickometer", Required=Newtonsoft.Json.Required.Always)]
+ [System.ComponentModel.DescriptionAttribute("Harp lickometer")]
+ public HarpLicketySplit HarpLickometer
{
get
{
- return _fullStepToMm;
+ return _harpLickometer;
}
set
{
- _fullStepToMm = value;
+ _harpLickometer = value;
}
}
+ ///
+ /// Harp clock generator
+ ///
[System.Xml.Serialization.XmlIgnoreAttribute()]
- [Newtonsoft.Json.JsonPropertyAttribute("axis_configuration")]
- public System.Collections.Generic.List AxisConfiguration
+ [Newtonsoft.Json.JsonPropertyAttribute("harp_clock_generator", Required=Newtonsoft.Json.Required.Always)]
+ [System.ComponentModel.DescriptionAttribute("Harp clock generator")]
+ public HarpWhiteRabbit HarpClockGenerator
{
get
{
- return _axisConfiguration;
+ return _harpClockGenerator;
}
set
{
- _axisConfiguration = value;
+ _harpClockGenerator = value;
}
}
+ ///
+ /// Harp analog input
+ ///
[System.Xml.Serialization.XmlIgnoreAttribute()]
- [Newtonsoft.Json.JsonPropertyAttribute("homing_order")]
- public System.Collections.Generic.List HomingOrder
+ [Newtonsoft.Json.JsonPropertyAttribute("harp_analog_input")]
+ [System.ComponentModel.DescriptionAttribute("Harp analog input")]
+ public HarpAnalogInput HarpAnalogInput
{
get
{
- return _homingOrder;
+ return _harpAnalogInput;
}
set
{
- _homingOrder = value;
+ _harpAnalogInput = value;
}
}
+ ///
+ /// Harp treadmill
+ ///
[System.Xml.Serialization.XmlIgnoreAttribute()]
- [Newtonsoft.Json.JsonPropertyAttribute("initial_position")]
- public ManipulatorPosition InitialPosition
+ [Newtonsoft.Json.JsonPropertyAttribute("harp_treadmill", Required=Newtonsoft.Json.Required.Always)]
+ [System.ComponentModel.DescriptionAttribute("Harp treadmill")]
+ public Treadmill HarpTreadmill
{
get
{
- return _initialPosition;
+ return _harpTreadmill;
}
set
{
- _initialPosition = value;
+ _harpTreadmill = value;
}
}
- public System.IObservable Generate()
- {
- return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new AindManipulatorCalibrationInput(this)));
- }
-
- public System.IObservable Generate(System.IObservable source)
+ ///
+ /// Sniff detector settings
+ ///
+ [System.Xml.Serialization.XmlIgnoreAttribute()]
+ [Newtonsoft.Json.JsonPropertyAttribute("harp_sniff_detector")]
+ [System.ComponentModel.DescriptionAttribute("Sniff detector settings")]
+ public HarpSniffDetector HarpSniffDetector
{
- return System.Reactive.Linq.Observable.Select(source, _ => new AindManipulatorCalibrationInput(this));
+ get
+ {
+ return _harpSniffDetector;
+ }
+ set
+ {
+ _harpSniffDetector = value;
+ }
}
- protected virtual bool PrintMembers(System.Text.StringBuilder stringBuilder)
+ ///
+ /// Environment sensor
+ ///
+ [System.Xml.Serialization.XmlIgnoreAttribute()]
+ [Newtonsoft.Json.JsonPropertyAttribute("harp_environment_sensor")]
+ [System.ComponentModel.DescriptionAttribute("Environment sensor")]
+ public HarpEnvironmentSensor HarpEnvironmentSensor
{
- stringBuilder.Append("FullStepToMm = " + _fullStepToMm + ", ");
- stringBuilder.Append("AxisConfiguration = " + _axisConfiguration + ", ");
- stringBuilder.Append("HomingOrder = " + _homingOrder + ", ");
- stringBuilder.Append("InitialPosition = " + _initialPosition);
- return true;
+ get
+ {
+ return _harpEnvironmentSensor;
+ }
+ set
+ {
+ _harpEnvironmentSensor = value;
+ }
}
- public override string ToString()
+ ///
+ /// Manipulator
+ ///
+ [System.Xml.Serialization.XmlIgnoreAttribute()]
+ [Newtonsoft.Json.JsonPropertyAttribute("manipulator", Required=Newtonsoft.Json.Required.Always)]
+ [System.ComponentModel.DescriptionAttribute("Manipulator")]
+ public AindManipulatorDevice Manipulator
{
- System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder();
- stringBuilder.Append(GetType().Name);
- stringBuilder.Append(" { ");
- if (PrintMembers(stringBuilder))
+ get
{
- stringBuilder.Append(" ");
+ return _manipulator;
+ }
+ set
+ {
+ _manipulator = value;
}
- stringBuilder.Append("}");
- return stringBuilder.ToString();
}
- }
-
-
- [System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.6.1.0 (Newtonsoft.Json v13.0.0.0)")]
- [Bonsai.WorkflowElementCategoryAttribute(Bonsai.ElementCategory.Source)]
- [Bonsai.CombinatorAttribute(MethodName="Generate")]
- public partial class AindManipulatorCalibrationOutput
- {
- public AindManipulatorCalibrationOutput()
+ ///
+ /// Screen settings
+ ///
+ [System.Xml.Serialization.XmlIgnoreAttribute()]
+ [Newtonsoft.Json.JsonPropertyAttribute("screen")]
+ [System.ComponentModel.DescriptionAttribute("Screen settings")]
+ public ScreenAssembly Screen
{
+ get
+ {
+ return _screen;
+ }
+ set
+ {
+ _screen = value;
+ }
}
- protected AindManipulatorCalibrationOutput(AindManipulatorCalibrationOutput other)
+ ///
+ /// Calibration models
+ ///
+ [System.Xml.Serialization.XmlIgnoreAttribute()]
+ [Newtonsoft.Json.JsonPropertyAttribute("calibration", Required=Newtonsoft.Json.Required.Always)]
+ [System.ComponentModel.DescriptionAttribute("Calibration models")]
+ public RigCalibration Calibration
{
+ get
+ {
+ return _calibration;
+ }
+ set
+ {
+ _calibration = value;
+ }
}
- public System.IObservable Generate()
+ public System.IObservable Generate()
{
- return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new AindManipulatorCalibrationOutput(this)));
+ return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new AindVrForagingRig(this)));
}
- public System.IObservable Generate(System.IObservable source)
+ public System.IObservable Generate(System.IObservable source)
{
- return System.Reactive.Linq.Observable.Select(source, _ => new AindManipulatorCalibrationOutput(this));
+ return System.Reactive.Linq.Observable.Select(source, _ => new AindVrForagingRig(this));
}
protected virtual bool PrintMembers(System.Text.StringBuilder stringBuilder)
{
- return false;
+ stringBuilder.Append("AindBehaviorServicesPkgVersion = " + _aindBehaviorServicesPkgVersion + ", ");
+ stringBuilder.Append("Version = " + _version + ", ");
+ stringBuilder.Append("ComputerName = " + _computerName + ", ");
+ stringBuilder.Append("RigName = " + _rigName + ", ");
+ stringBuilder.Append("DataDirectory = " + _dataDirectory + ", ");
+ stringBuilder.Append("TriggeredCameraController = " + _triggeredCameraController + ", ");
+ stringBuilder.Append("MonitoringCameraController = " + _monitoringCameraController + ", ");
+ stringBuilder.Append("HarpBehavior = " + _harpBehavior + ", ");
+ stringBuilder.Append("HarpOlfactometer = " + _harpOlfactometer + ", ");
+ stringBuilder.Append("HarpOlfactometerExtension = " + _harpOlfactometerExtension + ", ");
+ stringBuilder.Append("HarpLickometer = " + _harpLickometer + ", ");
+ stringBuilder.Append("HarpClockGenerator = " + _harpClockGenerator + ", ");
+ stringBuilder.Append("HarpAnalogInput = " + _harpAnalogInput + ", ");
+ stringBuilder.Append("HarpTreadmill = " + _harpTreadmill + ", ");
+ stringBuilder.Append("HarpSniffDetector = " + _harpSniffDetector + ", ");
+ stringBuilder.Append("HarpEnvironmentSensor = " + _harpEnvironmentSensor + ", ");
+ stringBuilder.Append("Manipulator = " + _manipulator + ", ");
+ stringBuilder.Append("Screen = " + _screen + ", ");
+ stringBuilder.Append("Calibration = " + _calibration);
+ return true;
}
public override string ToString()
@@ -724,176 +649,149 @@ public override string ToString()
///
- /// Overrides the default settings for the manipulator device by spec'ing additional_settings field
+ /// Main task logic model for the AIND VR Foraging task.
+ ///
+ ///This is the top-level class that encapsulates the complete task logic
+ ///specification for the virtual reality foraging behavioral experiment.
+ ///It includes all task parameters, environment specifications, and control settings.
///
- [System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.6.1.0 (Newtonsoft.Json v13.0.0.0)")]
- [System.ComponentModel.DescriptionAttribute("Overrides the default settings for the manipulator device by spec\'ing additional_" +
- "settings field")]
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.9.0.0 (Newtonsoft.Json v13.0.0.0)")]
+ [System.ComponentModel.DescriptionAttribute(@"Main task logic model for the AIND VR Foraging task.
+
+ This is the top-level class that encapsulates the complete task logic
+ specification for the virtual reality foraging behavioral experiment.
+ It includes all task parameters, environment specifications, and control settings.")]
[Bonsai.WorkflowElementCategoryAttribute(Bonsai.ElementCategory.Source)]
[Bonsai.CombinatorAttribute(MethodName="Generate")]
- public partial class AindManipulatorDevice
+ public partial class AindVrForagingTaskLogic
{
- private string _deviceType;
-
- private string _deviceName;
-
- private AindManipulatorAdditionalSettings _additionalSettings;
-
- private AindManipulatorCalibration _calibration;
+ private string _name;
- private int _whoAmI;
+ private string _description;
- private string _serialNumber;
+ private AindVrForagingTaskParameters _taskParameters;
- private string _portName;
+ private string _version;
- public AindManipulatorDevice()
- {
- _deviceType = "StepperDriver";
- _additionalSettings = new AindManipulatorAdditionalSettings();
- _whoAmI = 1130;
- }
+ private string _stageName;
- protected AindManipulatorDevice(AindManipulatorDevice other)
+ public AindVrForagingTaskLogic()
{
- _deviceType = other._deviceType;
- _deviceName = other._deviceName;
- _additionalSettings = other._additionalSettings;
- _calibration = other._calibration;
- _whoAmI = other._whoAmI;
- _serialNumber = other._serialNumber;
- _portName = other._portName;
+ _name = "AindVrForaging";
+ _description = "";
+ _taskParameters = new AindVrForagingTaskParameters();
+ _version = "0.7.0-rc0";
}
- [Newtonsoft.Json.JsonPropertyAttribute("device_type")]
- public string DeviceType
+ protected AindVrForagingTaskLogic(AindVrForagingTaskLogic other)
{
- get
- {
- return _deviceType;
- }
- set
- {
- _deviceType = value;
- }
+ _name = other._name;
+ _description = other._description;
+ _taskParameters = other._taskParameters;
+ _version = other._version;
+ _stageName = other._stageName;
}
///
- /// Device name
+ /// Name of the task logic
///
- [Newtonsoft.Json.JsonPropertyAttribute("device_name")]
- [System.ComponentModel.DescriptionAttribute("Device name")]
- public string DeviceName
+ [Newtonsoft.Json.JsonPropertyAttribute("name")]
+ [System.ComponentModel.DescriptionAttribute("Name of the task logic")]
+ public string Name
{
get
{
- return _deviceName;
+ return _name;
}
set
{
- _deviceName = value;
+ _name = value;
}
}
///
- /// Additional settings
+ /// Description of the task.
///
- [System.Xml.Serialization.XmlIgnoreAttribute()]
- [Newtonsoft.Json.JsonPropertyAttribute("additional_settings")]
- [System.ComponentModel.DescriptionAttribute("Additional settings")]
- public AindManipulatorAdditionalSettings AdditionalSettings
+ [Newtonsoft.Json.JsonPropertyAttribute("description")]
+ [System.ComponentModel.DescriptionAttribute("Description of the task.")]
+ public string Description
{
get
{
- return _additionalSettings;
+ return _description;
}
set
{
- _additionalSettings = value;
+ _description = value;
}
}
+ ///
+ /// Parameters of the task logic
+ ///
[System.Xml.Serialization.XmlIgnoreAttribute()]
- [Newtonsoft.Json.JsonPropertyAttribute("calibration")]
- public AindManipulatorCalibration Calibration
- {
- get
- {
- return _calibration;
- }
- set
- {
- _calibration = value;
- }
- }
-
- [Newtonsoft.Json.JsonPropertyAttribute("who_am_i")]
- public int WhoAmI
+ [Newtonsoft.Json.JsonPropertyAttribute("task_parameters", Required=Newtonsoft.Json.Required.Always)]
+ [System.ComponentModel.DescriptionAttribute("Parameters of the task logic")]
+ public AindVrForagingTaskParameters TaskParameters
{
get
{
- return _whoAmI;
+ return _taskParameters;
}
set
{
- _whoAmI = value;
+ _taskParameters = value;
}
}
- ///
- /// Device serial number
- ///
- [Newtonsoft.Json.JsonPropertyAttribute("serial_number")]
- [System.ComponentModel.DescriptionAttribute("Device serial number")]
- public string SerialNumber
+ [Newtonsoft.Json.JsonPropertyAttribute("version")]
+ public string Version
{
get
{
- return _serialNumber;
+ return _version;
}
set
{
- _serialNumber = value;
+ _version = value;
}
}
///
- /// Device port name
+ /// Optional stage name the `Task` object instance represents.
///
- [Newtonsoft.Json.JsonPropertyAttribute("port_name", Required=Newtonsoft.Json.Required.Always)]
- [System.ComponentModel.DescriptionAttribute("Device port name")]
- public string PortName
+ [Newtonsoft.Json.JsonPropertyAttribute("stage_name")]
+ [System.ComponentModel.DescriptionAttribute("Optional stage name the `Task` object instance represents.")]
+ public string StageName
{
get
{
- return _portName;
+ return _stageName;
}
set
{
- _portName = value;
+ _stageName = value;
}
}
- public System.IObservable Generate()
+ public System.IObservable Generate()
{
- return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new AindManipulatorDevice(this)));
+ return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new AindVrForagingTaskLogic(this)));
}
- public System.IObservable Generate(System.IObservable source)
+ public System.IObservable Generate(System.IObservable source)
{
- return System.Reactive.Linq.Observable.Select(source, _ => new AindManipulatorDevice(this));
+ return System.Reactive.Linq.Observable.Select(source, _ => new AindVrForagingTaskLogic(this));
}
protected virtual bool PrintMembers(System.Text.StringBuilder stringBuilder)
{
- stringBuilder.Append("DeviceType = " + _deviceType + ", ");
- stringBuilder.Append("DeviceName = " + _deviceName + ", ");
- stringBuilder.Append("AdditionalSettings = " + _additionalSettings + ", ");
- stringBuilder.Append("Calibration = " + _calibration + ", ");
- stringBuilder.Append("WhoAmI = " + _whoAmI + ", ");
- stringBuilder.Append("SerialNumber = " + _serialNumber + ", ");
- stringBuilder.Append("PortName = " + _portName);
+ stringBuilder.Append("Name = " + _name + ", ");
+ stringBuilder.Append("Description = " + _description + ", ");
+ stringBuilder.Append("TaskParameters = " + _taskParameters + ", ");
+ stringBuilder.Append("Version = " + _version + ", ");
+ stringBuilder.Append("StageName = " + _stageName);
return true;
}
@@ -912,406 +810,293 @@ public override string ToString()
}
- [System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.6.1.0 (Newtonsoft.Json v13.0.0.0)")]
- [Bonsai.WorkflowElementCategoryAttribute(Bonsai.ElementCategory.Source)]
- [Bonsai.CombinatorAttribute(MethodName="Generate")]
- public partial class AindVrForagingRig
- {
-
- private string _aindBehaviorServicesPkgVersion;
-
- private string _version;
-
- private string _computerName;
-
- private string _rigName;
-
- private CameraControllerSpinnakerCamera _triggeredCameraController;
-
- private CameraControllerWebCamera _monitoringCameraController;
-
- private HarpBehavior _harpBehavior;
-
- private Olfactometer _harpOlfactometer;
-
- private HarpLicketySplit _harpLickometer;
-
- private HarpWhiteRabbit _harpClockGenerator;
-
- private HarpAnalogInput _harpAnalogInput;
-
- private Treadmill _harpTreadmill;
+ ///
+ /// Complete parameter specification for the AIND VR Foraging task.
+ ///
+ ///This class contains all configurable parameters for the VR foraging task,
+ ///including environment structure, task mode settings, operation control,
+ ///and numerical updaters for dynamic parameter modification.
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.9.0.0 (Newtonsoft.Json v13.0.0.0)")]
+ [System.ComponentModel.DescriptionAttribute(@"Complete parameter specification for the AIND VR Foraging task.
+
+ This class contains all configurable parameters for the VR foraging task,
+ including environment structure, task mode settings, operation control,
+ and numerical updaters for dynamic parameter modification.")]
+ [Bonsai.WorkflowElementCategoryAttribute(Bonsai.ElementCategory.Source)]
+ [Bonsai.CombinatorAttribute(MethodName="Generate")]
+ public partial class AindVrForagingTaskParameters
+ {
- private HarpSniffDetector _harpSniffDetector;
+ private double? _rngSeed;
- private HarpEnvironmentSensor _harpEnvironmentSensor;
+ private string _aindBehaviorServicesPkgVersion;
- private AindManipulatorDevice _manipulator;
+ private System.Collections.Generic.Dictionary _updaters;
- private Screen _screen;
+ private BlockStructure _environment;
- private RigCalibration _calibration;
+ private OperationControl _operationControl;
- public AindVrForagingRig()
+ public AindVrForagingTaskParameters()
{
- _aindBehaviorServicesPkgVersion = "0.12.5";
- _version = "0.6.5";
- _triggeredCameraController = new CameraControllerSpinnakerCamera();
- _harpBehavior = new HarpBehavior();
- _harpOlfactometer = new Olfactometer();
- _harpLickometer = new HarpLicketySplit();
- _harpClockGenerator = new HarpWhiteRabbit();
- _harpTreadmill = new Treadmill();
- _manipulator = new AindManipulatorDevice();
- _screen = new Screen();
- _calibration = new RigCalibration();
+ _aindBehaviorServicesPkgVersion = "0.13.6";
+ _environment = new BlockStructure();
+ _operationControl = new OperationControl();
}
- protected AindVrForagingRig(AindVrForagingRig other)
+ protected AindVrForagingTaskParameters(AindVrForagingTaskParameters other)
{
+ _rngSeed = other._rngSeed;
_aindBehaviorServicesPkgVersion = other._aindBehaviorServicesPkgVersion;
- _version = other._version;
- _computerName = other._computerName;
- _rigName = other._rigName;
- _triggeredCameraController = other._triggeredCameraController;
- _monitoringCameraController = other._monitoringCameraController;
- _harpBehavior = other._harpBehavior;
- _harpOlfactometer = other._harpOlfactometer;
- _harpLickometer = other._harpLickometer;
- _harpClockGenerator = other._harpClockGenerator;
- _harpAnalogInput = other._harpAnalogInput;
- _harpTreadmill = other._harpTreadmill;
- _harpSniffDetector = other._harpSniffDetector;
- _harpEnvironmentSensor = other._harpEnvironmentSensor;
- _manipulator = other._manipulator;
- _screen = other._screen;
- _calibration = other._calibration;
+ _updaters = other._updaters;
+ _environment = other._environment;
+ _operationControl = other._operationControl;
}
- [Newtonsoft.Json.JsonPropertyAttribute("aind_behavior_services_pkg_version")]
- public string AindBehaviorServicesPkgVersion
+ ///
+ /// Seed of the random number generator
+ ///
+ [Newtonsoft.Json.JsonPropertyAttribute("rng_seed")]
+ [System.ComponentModel.DescriptionAttribute("Seed of the random number generator")]
+ public double? RngSeed
{
get
{
- return _aindBehaviorServicesPkgVersion;
+ return _rngSeed;
}
set
{
- _aindBehaviorServicesPkgVersion = value;
+ _rngSeed = value;
}
}
- [Newtonsoft.Json.JsonPropertyAttribute("version")]
- public string Version
+ [Newtonsoft.Json.JsonPropertyAttribute("aind_behavior_services_pkg_version")]
+ public string AindBehaviorServicesPkgVersion
{
get
{
- return _version;
+ return _aindBehaviorServicesPkgVersion;
}
set
{
- _version = value;
+ _aindBehaviorServicesPkgVersion = value;
}
}
///
- /// Computer name
+ /// Look-up table for numeric updaters
///
- [Newtonsoft.Json.JsonPropertyAttribute("computer_name")]
- [System.ComponentModel.DescriptionAttribute("Computer name")]
- public string ComputerName
+ [System.Xml.Serialization.XmlIgnoreAttribute()]
+ [Newtonsoft.Json.JsonPropertyAttribute("updaters")]
+ [System.ComponentModel.DescriptionAttribute("Look-up table for numeric updaters")]
+ public System.Collections.Generic.Dictionary Updaters
{
get
{
- return _computerName;
+ return _updaters;
}
set
{
- _computerName = value;
+ _updaters = value;
}
}
///
- /// Rig name
+ /// Statistics of the environment
///
- [Newtonsoft.Json.JsonPropertyAttribute("rig_name", Required=Newtonsoft.Json.Required.Always)]
- [System.ComponentModel.DescriptionAttribute("Rig name")]
- public string RigName
+ [System.Xml.Serialization.XmlIgnoreAttribute()]
+ [Newtonsoft.Json.JsonPropertyAttribute("environment", Required=Newtonsoft.Json.Required.Always)]
+ [System.ComponentModel.DescriptionAttribute("Statistics of the environment")]
+ public BlockStructure Environment
{
get
{
- return _rigName;
+ return _environment;
}
set
{
- _rigName = value;
+ _environment = value;
}
}
///
- /// Required camera controller to triggered cameras.
+ /// Control of the operation
///
[System.Xml.Serialization.XmlIgnoreAttribute()]
- [Newtonsoft.Json.JsonPropertyAttribute("triggered_camera_controller", Required=Newtonsoft.Json.Required.Always)]
- [System.ComponentModel.DescriptionAttribute("Required camera controller to triggered cameras.")]
- public CameraControllerSpinnakerCamera TriggeredCameraController
+ [Newtonsoft.Json.JsonPropertyAttribute("operation_control", Required=Newtonsoft.Json.Required.Always)]
+ [System.ComponentModel.DescriptionAttribute("Control of the operation")]
+ public OperationControl OperationControl
{
get
{
- return _triggeredCameraController;
+ return _operationControl;
}
set
{
- _triggeredCameraController = value;
+ _operationControl = value;
}
}
- ///
- /// Optional camera controller for monitoring cameras.
- ///
- [System.Xml.Serialization.XmlIgnoreAttribute()]
- [Newtonsoft.Json.JsonPropertyAttribute("monitoring_camera_controller")]
- [System.ComponentModel.DescriptionAttribute("Optional camera controller for monitoring cameras.")]
- public CameraControllerWebCamera MonitoringCameraController
+ public System.IObservable Generate()
{
- get
- {
- return _monitoringCameraController;
- }
- set
- {
- _monitoringCameraController = value;
- }
+ return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new AindVrForagingTaskParameters(this)));
}
- ///
- /// Harp behavior
- ///
- [System.Xml.Serialization.XmlIgnoreAttribute()]
- [Newtonsoft.Json.JsonPropertyAttribute("harp_behavior", Required=Newtonsoft.Json.Required.Always)]
- [System.ComponentModel.DescriptionAttribute("Harp behavior")]
- public HarpBehavior HarpBehavior
+ public System.IObservable Generate(System.IObservable source)
{
- get
- {
- return _harpBehavior;
- }
- set
- {
- _harpBehavior = value;
- }
+ return System.Reactive.Linq.Observable.Select(source, _ => new AindVrForagingTaskParameters(this));
}
- ///
- /// Harp olfactometer
- ///
- [System.Xml.Serialization.XmlIgnoreAttribute()]
- [Newtonsoft.Json.JsonPropertyAttribute("harp_olfactometer", Required=Newtonsoft.Json.Required.Always)]
- [System.ComponentModel.DescriptionAttribute("Harp olfactometer")]
- public Olfactometer HarpOlfactometer
+ protected virtual bool PrintMembers(System.Text.StringBuilder stringBuilder)
{
- get
- {
- return _harpOlfactometer;
- }
- set
+ stringBuilder.Append("RngSeed = " + _rngSeed + ", ");
+ stringBuilder.Append("AindBehaviorServicesPkgVersion = " + _aindBehaviorServicesPkgVersion + ", ");
+ stringBuilder.Append("Updaters = " + _updaters + ", ");
+ stringBuilder.Append("Environment = " + _environment + ", ");
+ stringBuilder.Append("OperationControl = " + _operationControl);
+ return true;
+ }
+
+ public override string ToString()
+ {
+ System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder();
+ stringBuilder.Append(GetType().Name);
+ stringBuilder.Append(" { ");
+ if (PrintMembers(stringBuilder))
{
- _harpOlfactometer = value;
+ stringBuilder.Append(" ");
}
+ stringBuilder.Append("}");
+ return stringBuilder.ToString();
+ }
+ }
+
+
+ ///
+ /// Controls audio feedback parameters for the task.
+ ///
+ ///This class manages audio cue generation including tone duration and frequency
+ ///for auditory feedback during the behavioral task.
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.9.0.0 (Newtonsoft.Json v13.0.0.0)")]
+ [System.ComponentModel.DescriptionAttribute("Controls audio feedback parameters for the task.\n\nThis class manages audio cue ge" +
+ "neration including tone duration and frequency\nfor auditory feedback during the " +
+ "behavioral task.")]
+ [Bonsai.WorkflowElementCategoryAttribute(Bonsai.ElementCategory.Source)]
+ [Bonsai.CombinatorAttribute(MethodName="Generate")]
+ public partial class AudioControl
+ {
+
+ private double _duration;
+
+ private double _frequency;
+
+ public AudioControl()
+ {
+ _duration = 0.2D;
+ _frequency = 1000D;
+ }
+
+ protected AudioControl(AudioControl other)
+ {
+ _duration = other._duration;
+ _frequency = other._frequency;
}
///
- /// Harp lickometer
+ /// Duration
///
- [System.Xml.Serialization.XmlIgnoreAttribute()]
- [Newtonsoft.Json.JsonPropertyAttribute("harp_lickometer", Required=Newtonsoft.Json.Required.Always)]
- [System.ComponentModel.DescriptionAttribute("Harp lickometer")]
- public HarpLicketySplit HarpLickometer
+ [Newtonsoft.Json.JsonPropertyAttribute("duration")]
+ [System.ComponentModel.DescriptionAttribute("Duration")]
+ public double Duration
{
get
{
- return _harpLickometer;
+ return _duration;
}
set
{
- _harpLickometer = value;
+ _duration = value;
}
}
///
- /// Harp clock generator
+ /// Frequency (Hz) of the audio cue
///
- [System.Xml.Serialization.XmlIgnoreAttribute()]
- [Newtonsoft.Json.JsonPropertyAttribute("harp_clock_generator", Required=Newtonsoft.Json.Required.Always)]
- [System.ComponentModel.DescriptionAttribute("Harp clock generator")]
- public HarpWhiteRabbit HarpClockGenerator
+ [Newtonsoft.Json.JsonPropertyAttribute("frequency")]
+ [System.ComponentModel.DescriptionAttribute("Frequency (Hz) of the audio cue")]
+ public double Frequency
{
get
{
- return _harpClockGenerator;
+ return _frequency;
}
set
{
- _harpClockGenerator = value;
+ _frequency = value;
}
}
- ///
- /// Harp analog input
- ///
- [System.Xml.Serialization.XmlIgnoreAttribute()]
- [Newtonsoft.Json.JsonPropertyAttribute("harp_analog_input")]
- [System.ComponentModel.DescriptionAttribute("Harp analog input")]
- public HarpAnalogInput HarpAnalogInput
- {
- get
- {
- return _harpAnalogInput;
- }
- set
- {
- _harpAnalogInput = value;
- }
- }
-
- ///
- /// Harp treadmill
- ///
- [System.Xml.Serialization.XmlIgnoreAttribute()]
- [Newtonsoft.Json.JsonPropertyAttribute("harp_treadmill", Required=Newtonsoft.Json.Required.Always)]
- [System.ComponentModel.DescriptionAttribute("Harp treadmill")]
- public Treadmill HarpTreadmill
+ public System.IObservable Generate()
{
- get
- {
- return _harpTreadmill;
- }
- set
- {
- _harpTreadmill = value;
- }
+ return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new AudioControl(this)));
}
- ///
- /// Sniff detector settings
- ///
- [System.Xml.Serialization.XmlIgnoreAttribute()]
- [Newtonsoft.Json.JsonPropertyAttribute("harp_sniff_detector")]
- [System.ComponentModel.DescriptionAttribute("Sniff detector settings")]
- public HarpSniffDetector HarpSniffDetector
+ public System.IObservable Generate(System.IObservable source)
{
- get
- {
- return _harpSniffDetector;
- }
- set
- {
- _harpSniffDetector = value;
- }
+ return System.Reactive.Linq.Observable.Select(source, _ => new AudioControl(this));
}
- ///
- /// Environment sensor
- ///
- [System.Xml.Serialization.XmlIgnoreAttribute()]
- [Newtonsoft.Json.JsonPropertyAttribute("harp_environment_sensor")]
- [System.ComponentModel.DescriptionAttribute("Environment sensor")]
- public HarpEnvironmentSensor HarpEnvironmentSensor
+ protected virtual bool PrintMembers(System.Text.StringBuilder stringBuilder)
{
- get
- {
- return _harpEnvironmentSensor;
- }
- set
- {
- _harpEnvironmentSensor = value;
- }
+ stringBuilder.Append("Duration = " + _duration + ", ");
+ stringBuilder.Append("Frequency = " + _frequency);
+ return true;
}
- ///
- /// Manipulator
- ///
- [System.Xml.Serialization.XmlIgnoreAttribute()]
- [Newtonsoft.Json.JsonPropertyAttribute("manipulator", Required=Newtonsoft.Json.Required.Always)]
- [System.ComponentModel.DescriptionAttribute("Manipulator")]
- public AindManipulatorDevice Manipulator
+ public override string ToString()
{
- get
- {
- return _manipulator;
- }
- set
+ System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder();
+ stringBuilder.Append(GetType().Name);
+ stringBuilder.Append(" { ");
+ if (PrintMembers(stringBuilder))
{
- _manipulator = value;
+ stringBuilder.Append(" ");
}
+ stringBuilder.Append("}");
+ return stringBuilder.ToString();
}
+ }
+
+
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.9.0.0 (Newtonsoft.Json v13.0.0.0)")]
+ [Bonsai.WorkflowElementCategoryAttribute(Bonsai.ElementCategory.Source)]
+ [Bonsai.CombinatorAttribute(MethodName="Generate")]
+ public partial class BaseModel
+ {
- ///
- /// Screen settings
- ///
- [System.Xml.Serialization.XmlIgnoreAttribute()]
- [Newtonsoft.Json.JsonPropertyAttribute("screen")]
- [System.ComponentModel.DescriptionAttribute("Screen settings")]
- public Screen Screen
+ public BaseModel()
{
- get
- {
- return _screen;
- }
- set
- {
- _screen = value;
- }
}
- ///
- /// Calibration models
- ///
- [System.Xml.Serialization.XmlIgnoreAttribute()]
- [Newtonsoft.Json.JsonPropertyAttribute("calibration", Required=Newtonsoft.Json.Required.Always)]
- [System.ComponentModel.DescriptionAttribute("Calibration models")]
- public RigCalibration Calibration
+ protected BaseModel(BaseModel other)
{
- get
- {
- return _calibration;
- }
- set
- {
- _calibration = value;
- }
}
- public System.IObservable Generate()
+ public System.IObservable Generate()
{
- return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new AindVrForagingRig(this)));
+ return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new BaseModel(this)));
}
- public System.IObservable Generate(System.IObservable source)
+ public System.IObservable Generate(System.IObservable source)
{
- return System.Reactive.Linq.Observable.Select(source, _ => new AindVrForagingRig(this));
+ return System.Reactive.Linq.Observable.Select(source, _ => new BaseModel(this));
}
protected virtual bool PrintMembers(System.Text.StringBuilder stringBuilder)
{
- stringBuilder.Append("AindBehaviorServicesPkgVersion = " + _aindBehaviorServicesPkgVersion + ", ");
- stringBuilder.Append("Version = " + _version + ", ");
- stringBuilder.Append("ComputerName = " + _computerName + ", ");
- stringBuilder.Append("RigName = " + _rigName + ", ");
- stringBuilder.Append("TriggeredCameraController = " + _triggeredCameraController + ", ");
- stringBuilder.Append("MonitoringCameraController = " + _monitoringCameraController + ", ");
- stringBuilder.Append("HarpBehavior = " + _harpBehavior + ", ");
- stringBuilder.Append("HarpOlfactometer = " + _harpOlfactometer + ", ");
- stringBuilder.Append("HarpLickometer = " + _harpLickometer + ", ");
- stringBuilder.Append("HarpClockGenerator = " + _harpClockGenerator + ", ");
- stringBuilder.Append("HarpAnalogInput = " + _harpAnalogInput + ", ");
- stringBuilder.Append("HarpTreadmill = " + _harpTreadmill + ", ");
- stringBuilder.Append("HarpSniffDetector = " + _harpSniffDetector + ", ");
- stringBuilder.Append("HarpEnvironmentSensor = " + _harpEnvironmentSensor + ", ");
- stringBuilder.Append("Manipulator = " + _manipulator + ", ");
- stringBuilder.Append("Screen = " + _screen + ", ");
- stringBuilder.Append("Calibration = " + _calibration);
- return true;
+ return false;
}
public override string ToString()
@@ -1330,149 +1115,88 @@ public override string ToString()
///
- /// Main task logic model for the AIND VR Foraging task.
+ /// Configuration for a single experimental block.
///
- ///This is the top-level class that encapsulates the complete task logic
- ///specification for the virtual reality foraging behavioral experiment.
- ///It includes all task parameters, environment specifications, and control settings.
+ ///A block represents a period of the experiment with specific environment
+ ///statistics and ending conditions. Each block defines the environmental
+ ///parameters and termination criteria for that experimental phase.
///
- [System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.6.1.0 (Newtonsoft.Json v13.0.0.0)")]
- [System.ComponentModel.DescriptionAttribute(@"Main task logic model for the AIND VR Foraging task.
-
- This is the top-level class that encapsulates the complete task logic
- specification for the virtual reality foraging behavioral experiment.
- It includes all task parameters, environment specifications, and control settings.")]
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.9.0.0 (Newtonsoft.Json v13.0.0.0)")]
+ [System.ComponentModel.DescriptionAttribute("Configuration for a single experimental block.\n\nA block represents a period of th" +
+ "e experiment with specific environment\nstatistics and ending conditions. Each bl" +
+ "ock defines the environmental\nparameters and termination criteria for that exper" +
+ "imental phase.")]
[Bonsai.WorkflowElementCategoryAttribute(Bonsai.ElementCategory.Source)]
[Bonsai.CombinatorAttribute(MethodName="Generate")]
- public partial class AindVrForagingTaskLogic
+ public partial class Block
{
- private string _name;
-
- private string _description;
-
- private AindVrForagingTaskParameters _taskParameters;
-
- private string _version;
-
- private string _stageName;
+ private EnvironmentStatistics _environmentStatistics;
- public AindVrForagingTaskLogic()
- {
- _name = "AindVrForaging";
- _description = "";
- _taskParameters = new AindVrForagingTaskParameters();
- _version = "0.6.5";
- }
+ private System.Collections.Generic.List _endConditions;
- protected AindVrForagingTaskLogic(AindVrForagingTaskLogic other)
+ public Block()
{
- _name = other._name;
- _description = other._description;
- _taskParameters = other._taskParameters;
- _version = other._version;
- _stageName = other._stageName;
+ _environmentStatistics = new EnvironmentStatistics();
+ _endConditions = new System.Collections.Generic.List();
}
- ///
- /// Name of the task logic
- ///
- [Newtonsoft.Json.JsonPropertyAttribute("name")]
- [System.ComponentModel.DescriptionAttribute("Name of the task logic")]
- public string Name
+ protected Block(Block other)
{
- get
- {
- return _name;
- }
- set
- {
- _name = value;
- }
+ _environmentStatistics = other._environmentStatistics;
+ _endConditions = other._endConditions;
}
///
- /// Description of the task.
+ /// Statistics of the environment
///
- [Newtonsoft.Json.JsonPropertyAttribute("description")]
- [System.ComponentModel.DescriptionAttribute("Description of the task.")]
- public string Description
+ [System.Xml.Serialization.XmlIgnoreAttribute()]
+ [Newtonsoft.Json.JsonPropertyAttribute("environment_statistics", Required=Newtonsoft.Json.Required.Always)]
+ [System.ComponentModel.DescriptionAttribute("Statistics of the environment")]
+ public EnvironmentStatistics EnvironmentStatistics
{
get
{
- return _description;
+ return _environmentStatistics;
}
set
{
- _description = value;
+ _environmentStatistics = value;
}
}
///
- /// Parameters of the task logic
+ /// List of end conditions that must be true for the block to end.
///
[System.Xml.Serialization.XmlIgnoreAttribute()]
- [Newtonsoft.Json.JsonPropertyAttribute("task_parameters", Required=Newtonsoft.Json.Required.Always)]
- [System.ComponentModel.DescriptionAttribute("Parameters of the task logic")]
- public AindVrForagingTaskParameters TaskParameters
+ [Newtonsoft.Json.JsonPropertyAttribute("end_conditions")]
+ [System.ComponentModel.DescriptionAttribute("List of end conditions that must be true for the block to end.")]
+ public System.Collections.Generic.List EndConditions
{
get
{
- return _taskParameters;
+ return _endConditions;
}
set
{
- _taskParameters = value;
+ _endConditions = value;
}
}
- [Newtonsoft.Json.JsonPropertyAttribute("version")]
- public string Version
+ public System.IObservable Generate()
{
- get
- {
- return _version;
- }
- set
- {
- _version = value;
- }
+ return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new Block(this)));
}
- ///
- /// Optional stage name the `Task` object instance represents.
- ///
- [Newtonsoft.Json.JsonPropertyAttribute("stage_name")]
- [System.ComponentModel.DescriptionAttribute("Optional stage name the `Task` object instance represents.")]
- public string StageName
- {
- get
- {
- return _stageName;
- }
- set
- {
- _stageName = value;
- }
- }
-
- public System.IObservable Generate()
- {
- return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new AindVrForagingTaskLogic(this)));
- }
-
- public System.IObservable Generate(System.IObservable source)
+ public System.IObservable Generate(System.IObservable source)
{
- return System.Reactive.Linq.Observable.Select(source, _ => new AindVrForagingTaskLogic(this));
+ return System.Reactive.Linq.Observable.Select(source, _ => new Block(this));
}
protected virtual bool PrintMembers(System.Text.StringBuilder stringBuilder)
{
- stringBuilder.Append("Name = " + _name + ", ");
- stringBuilder.Append("Description = " + _description + ", ");
- stringBuilder.Append("TaskParameters = " + _taskParameters + ", ");
- stringBuilder.Append("Version = " + _version + ", ");
- stringBuilder.Append("StageName = " + _stageName);
+ stringBuilder.Append("EnvironmentStatistics = " + _environmentStatistics + ", ");
+ stringBuilder.Append("EndConditions = " + _endConditions);
return true;
}
@@ -1492,741 +1216,600 @@ public override string ToString()
///
- /// Complete parameter specification for the AIND VR Foraging task.
+ /// Block end condition based on time duration.
///
- ///This class contains all configurable parameters for the VR foraging task,
- ///including environment structure, task mode settings, operation control,
- ///and numerical updaters for dynamic parameter modification.
+ ///This condition ends a block after a specified amount of time has elapsed.
///
- [System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.6.1.0 (Newtonsoft.Json v13.0.0.0)")]
- [System.ComponentModel.DescriptionAttribute(@"Complete parameter specification for the AIND VR Foraging task.
-
- This class contains all configurable parameters for the VR foraging task,
- including environment structure, task mode settings, operation control,
- and numerical updaters for dynamic parameter modification.")]
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.9.0.0 (Newtonsoft.Json v13.0.0.0)")]
+ [Newtonsoft.Json.JsonConverter(typeof(JsonInheritanceConverter), "condition_type")]
+ [JsonInheritanceAttribute("Duration", typeof(BlockEndConditionDuration))]
+ [JsonInheritanceAttribute("Distance", typeof(BlockEndConditionDistance))]
+ [JsonInheritanceAttribute("Choice", typeof(BlockEndConditionChoice))]
+ [JsonInheritanceAttribute("Reward", typeof(BlockEndConditionReward))]
+ [JsonInheritanceAttribute("PatchCount", typeof(BlockEndConditionPatchCount))]
+ [System.ComponentModel.DescriptionAttribute("Block end condition based on time duration.\n\nThis condition ends a block after a " +
+ "specified amount of time has elapsed.")]
[Bonsai.WorkflowElementCategoryAttribute(Bonsai.ElementCategory.Source)]
[Bonsai.CombinatorAttribute(MethodName="Generate")]
- public partial class AindVrForagingTaskParameters
+ public partial class BlockEndCondition
{
- private double? _rngSeed;
-
- private string _aindBehaviorServicesPkgVersion;
-
- private System.Collections.Generic.Dictionary _updaters;
-
- private BlockStructure _environment;
+ public BlockEndCondition()
+ {
+ }
- private OperationControl _operationControl;
+ protected BlockEndCondition(BlockEndCondition other)
+ {
+ }
- public AindVrForagingTaskParameters()
+ public System.IObservable Generate()
{
- _aindBehaviorServicesPkgVersion = "0.12.5";
- _environment = new BlockStructure();
- _operationControl = new OperationControl();
+ return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new BlockEndCondition(this)));
}
- protected AindVrForagingTaskParameters(AindVrForagingTaskParameters other)
+ public System.IObservable Generate(System.IObservable source)
{
- _rngSeed = other._rngSeed;
- _aindBehaviorServicesPkgVersion = other._aindBehaviorServicesPkgVersion;
- _updaters = other._updaters;
- _environment = other._environment;
- _operationControl = other._operationControl;
+ return System.Reactive.Linq.Observable.Select(source, _ => new BlockEndCondition(this));
}
- ///
- /// Seed of the random number generator
- ///
- [System.Xml.Serialization.XmlIgnoreAttribute()]
- [Newtonsoft.Json.JsonPropertyAttribute("rng_seed")]
- [System.ComponentModel.DescriptionAttribute("Seed of the random number generator")]
- public double? RngSeed
+ protected virtual bool PrintMembers(System.Text.StringBuilder stringBuilder)
{
- get
- {
- return _rngSeed;
- }
- set
- {
- _rngSeed = value;
- }
+ return false;
}
- [Newtonsoft.Json.JsonPropertyAttribute("aind_behavior_services_pkg_version")]
- public string AindBehaviorServicesPkgVersion
+ public override string ToString()
{
- get
- {
- return _aindBehaviorServicesPkgVersion;
- }
- set
+ System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder();
+ stringBuilder.Append(GetType().Name);
+ stringBuilder.Append(" { ");
+ if (PrintMembers(stringBuilder))
{
- _aindBehaviorServicesPkgVersion = value;
+ stringBuilder.Append(" ");
}
+ stringBuilder.Append("}");
+ return stringBuilder.ToString();
}
+ }
+
+
+ ///
+ /// Block end condition based on number of choices made.
+ ///
+ ///This condition ends a block after the animal has made a specified number
+ ///of choices (e.g., patch visits or reward attempts).
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.9.0.0 (Newtonsoft.Json v13.0.0.0)")]
+ [System.ComponentModel.DescriptionAttribute("Block end condition based on number of choices made.\n\nThis condition ends a block" +
+ " after the animal has made a specified number\nof choices (e.g., patch visits or " +
+ "reward attempts).")]
+ [Bonsai.WorkflowElementCategoryAttribute(Bonsai.ElementCategory.Source)]
+ [Bonsai.CombinatorAttribute(MethodName="Generate")]
+ public partial class BlockEndConditionChoice : BlockEndCondition
+ {
- ///
- /// Look-up table for numeric updaters
- ///
- [System.Xml.Serialization.XmlIgnoreAttribute()]
- [Newtonsoft.Json.JsonPropertyAttribute("updaters")]
- [System.ComponentModel.DescriptionAttribute("Look-up table for numeric updaters")]
- public System.Collections.Generic.Dictionary Updaters
+ private AllenNeuralDynamics.AindBehaviorServices.Distributions.Distribution _value;
+
+ public BlockEndConditionChoice()
{
- get
- {
- return _updaters;
- }
- set
- {
- _updaters = value;
- }
}
- ///
- /// Statistics of the environment
- ///
- [System.Xml.Serialization.XmlIgnoreAttribute()]
- [Newtonsoft.Json.JsonPropertyAttribute("environment", Required=Newtonsoft.Json.Required.Always)]
- [System.ComponentModel.DescriptionAttribute("Statistics of the environment")]
- public BlockStructure Environment
+ protected BlockEndConditionChoice(BlockEndConditionChoice other) :
+ base(other)
{
- get
- {
- return _environment;
- }
- set
- {
- _environment = value;
- }
+ _value = other._value;
}
///
- /// Control of the operation
+ /// Number of choices after which the block ends.
///
[System.Xml.Serialization.XmlIgnoreAttribute()]
- [Newtonsoft.Json.JsonPropertyAttribute("operation_control", Required=Newtonsoft.Json.Required.Always)]
- [System.ComponentModel.DescriptionAttribute("Control of the operation")]
- public OperationControl OperationControl
+ [Newtonsoft.Json.JsonPropertyAttribute("value", Required=Newtonsoft.Json.Required.Always)]
+ [System.ComponentModel.DescriptionAttribute("Number of choices after which the block ends.")]
+ public AllenNeuralDynamics.AindBehaviorServices.Distributions.Distribution Value
{
get
{
- return _operationControl;
+ return _value;
}
set
{
- _operationControl = value;
+ _value = value;
}
}
- public System.IObservable Generate()
- {
- return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new AindVrForagingTaskParameters(this)));
- }
-
- public System.IObservable Generate(System.IObservable source)
+ public System.IObservable Generate()
{
- return System.Reactive.Linq.Observable.Select(source, _ => new AindVrForagingTaskParameters(this));
+ return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new BlockEndConditionChoice(this)));
}
- protected virtual bool PrintMembers(System.Text.StringBuilder stringBuilder)
+ public System.IObservable Generate(System.IObservable source)
{
- stringBuilder.Append("RngSeed = " + _rngSeed + ", ");
- stringBuilder.Append("AindBehaviorServicesPkgVersion = " + _aindBehaviorServicesPkgVersion + ", ");
- stringBuilder.Append("Updaters = " + _updaters + ", ");
- stringBuilder.Append("Environment = " + _environment + ", ");
- stringBuilder.Append("OperationControl = " + _operationControl);
- return true;
+ return System.Reactive.Linq.Observable.Select(source, _ => new BlockEndConditionChoice(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("Value = " + _value);
+ return true;
}
}
///
- /// Controls audio feedback parameters for the task.
+ /// Block end condition based on distance traveled.
///
- ///This class manages audio cue generation including tone duration and frequency
- ///for auditory feedback during the behavioral task.
+ ///This condition ends a block after the animal has traveled a specified distance.
///
- [System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.6.1.0 (Newtonsoft.Json v13.0.0.0)")]
- [System.ComponentModel.DescriptionAttribute("Controls audio feedback parameters for the task.\n\nThis class manages audio cue ge" +
- "neration including tone duration and frequency\nfor auditory feedback during the " +
- "behavioral task.")]
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.9.0.0 (Newtonsoft.Json v13.0.0.0)")]
+ [System.ComponentModel.DescriptionAttribute("Block end condition based on distance traveled.\n\nThis condition ends a block afte" +
+ "r the animal has traveled a specified distance.")]
[Bonsai.WorkflowElementCategoryAttribute(Bonsai.ElementCategory.Source)]
[Bonsai.CombinatorAttribute(MethodName="Generate")]
- public partial class AudioControl
+ public partial class BlockEndConditionDistance : BlockEndCondition
{
- private double _duration;
-
- private double _frequency;
+ private AllenNeuralDynamics.AindBehaviorServices.Distributions.Distribution _value;
- public AudioControl()
+ public BlockEndConditionDistance()
{
- _duration = 0.2D;
- _frequency = 1000D;
}
- protected AudioControl(AudioControl other)
+ protected BlockEndConditionDistance(BlockEndConditionDistance other) :
+ base(other)
{
- _duration = other._duration;
- _frequency = other._frequency;
+ _value = other._value;
}
///
- /// Duration
+ /// Distance after which the block ends.
///
- [Newtonsoft.Json.JsonPropertyAttribute("duration")]
- [System.ComponentModel.DescriptionAttribute("Duration")]
- public double Duration
+ [System.Xml.Serialization.XmlIgnoreAttribute()]
+ [Newtonsoft.Json.JsonPropertyAttribute("value", Required=Newtonsoft.Json.Required.Always)]
+ [System.ComponentModel.DescriptionAttribute("Distance after which the block ends.")]
+ public AllenNeuralDynamics.AindBehaviorServices.Distributions.Distribution Value
{
get
{
- return _duration;
+ return _value;
}
set
{
- _duration = value;
+ _value = value;
}
}
- ///
- /// Frequency (Hz) of the audio cue
- ///
- [Newtonsoft.Json.JsonPropertyAttribute("frequency")]
- [System.ComponentModel.DescriptionAttribute("Frequency (Hz) of the audio cue")]
- public double Frequency
+ public System.IObservable Generate()
{
- get
- {
- return _frequency;
- }
- set
- {
- _frequency = value;
- }
- }
-
- public System.IObservable Generate()
- {
- return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new AudioControl(this)));
- }
-
- public System.IObservable Generate(System.IObservable source)
- {
- return System.Reactive.Linq.Observable.Select(source, _ => new AudioControl(this));
+ return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new BlockEndConditionDistance(this)));
}
- protected virtual bool PrintMembers(System.Text.StringBuilder stringBuilder)
+ public System.IObservable Generate(System.IObservable source)
{
- stringBuilder.Append("Duration = " + _duration + ", ");
- stringBuilder.Append("Frequency = " + _frequency);
- return true;
+ return System.Reactive.Linq.Observable.Select(source, _ => new BlockEndConditionDistance(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("Value = " + _value);
+ return true;
}
}
///
- /// Motor axis available
- ///
- [System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.6.1.0 (Newtonsoft.Json v13.0.0.0)")]
- public enum Axis
- {
-
- [System.Runtime.Serialization.EnumMemberAttribute(Value="0")]
- None = 0,
-
- [System.Runtime.Serialization.EnumMemberAttribute(Value="1")]
- X = 1,
-
- [System.Runtime.Serialization.EnumMemberAttribute(Value="2")]
- Y1 = 2,
-
- [System.Runtime.Serialization.EnumMemberAttribute(Value="3")]
- Y2 = 3,
-
- [System.Runtime.Serialization.EnumMemberAttribute(Value="4")]
- Z = 4,
- }
-
-
- ///
- /// Axis configuration
+ /// Block end condition based on time duration.
+ ///
+ ///This condition ends a block after a specified amount of time has elapsed.
///
- [System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.6.1.0 (Newtonsoft.Json v13.0.0.0)")]
- [System.ComponentModel.DescriptionAttribute("Axis configuration")]
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.9.0.0 (Newtonsoft.Json v13.0.0.0)")]
+ [System.ComponentModel.DescriptionAttribute("Block end condition based on time duration.\n\nThis condition ends a block after a " +
+ "specified amount of time has elapsed.")]
[Bonsai.WorkflowElementCategoryAttribute(Bonsai.ElementCategory.Source)]
[Bonsai.CombinatorAttribute(MethodName="Generate")]
- public partial class AxisConfiguration
+ public partial class BlockEndConditionDuration : BlockEndCondition
{
- private Axis _axis;
-
- private int _stepAccelerationInterval;
-
- private int _stepInterval;
-
- private MicrostepResolution _microstepResolution;
-
- private int _maximumStepInterval;
-
- private MotorOperationMode _motorOperationMode;
-
- private double _maxLimit;
-
- private double _minLimit;
-
- public AxisConfiguration()
- {
- _stepAccelerationInterval = 100;
- _stepInterval = 100;
- _microstepResolution = AindVrForagingDataSchema.MicrostepResolution.Microstep8;
- _maximumStepInterval = 2000;
- _motorOperationMode = AindVrForagingDataSchema.MotorOperationMode.Quiet;
- _maxLimit = 25D;
- _minLimit = -0.01D;
- }
+ private AllenNeuralDynamics.AindBehaviorServices.Distributions.Distribution _value;
- protected AxisConfiguration(AxisConfiguration other)
+ public BlockEndConditionDuration()
{
- _axis = other._axis;
- _stepAccelerationInterval = other._stepAccelerationInterval;
- _stepInterval = other._stepInterval;
- _microstepResolution = other._microstepResolution;
- _maximumStepInterval = other._maximumStepInterval;
- _motorOperationMode = other._motorOperationMode;
- _maxLimit = other._maxLimit;
- _minLimit = other._minLimit;
}
- [System.Xml.Serialization.XmlIgnoreAttribute()]
- [Newtonsoft.Json.JsonPropertyAttribute("axis", Required=Newtonsoft.Json.Required.Always)]
- public Axis Axis
+ protected BlockEndConditionDuration(BlockEndConditionDuration other) :
+ base(other)
{
- get
- {
- return _axis;
- }
- set
- {
- _axis = value;
- }
+ _value = other._value;
}
///
- /// Acceleration of the step interval in microseconds
+ /// Time after which the block ends.
///
- [Newtonsoft.Json.JsonPropertyAttribute("step_acceleration_interval")]
- [System.ComponentModel.DescriptionAttribute("Acceleration of the step interval in microseconds")]
- public int StepAccelerationInterval
+ [System.Xml.Serialization.XmlIgnoreAttribute()]
+ [Newtonsoft.Json.JsonPropertyAttribute("value", Required=Newtonsoft.Json.Required.Always)]
+ [System.ComponentModel.DescriptionAttribute("Time after which the block ends.")]
+ public AllenNeuralDynamics.AindBehaviorServices.Distributions.Distribution Value
{
get
{
- return _stepAccelerationInterval;
+ return _value;
}
set
{
- _stepAccelerationInterval = value;
+ _value = value;
}
}
- ///
- /// Step interval in microseconds.
- ///
- [Newtonsoft.Json.JsonPropertyAttribute("step_interval")]
- [System.ComponentModel.DescriptionAttribute("Step interval in microseconds.")]
- public int StepInterval
+ public System.IObservable Generate()
{
- get
- {
- return _stepInterval;
- }
- set
- {
- _stepInterval = value;
- }
+ return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new BlockEndConditionDuration(this)));
}
- [System.Xml.Serialization.XmlIgnoreAttribute()]
- [Newtonsoft.Json.JsonPropertyAttribute("microstep_resolution")]
- public MicrostepResolution MicrostepResolution
+ public System.IObservable Generate(System.IObservable source)
{
- get
- {
- return _microstepResolution;
- }
- set
- {
- _microstepResolution = value;
- }
+ return System.Reactive.Linq.Observable.Select(source, _ => new BlockEndConditionDuration(this));
}
- [Newtonsoft.Json.JsonPropertyAttribute("maximum_step_interval")]
- public int MaximumStepInterval
+ protected override bool PrintMembers(System.Text.StringBuilder stringBuilder)
{
- get
- {
- return _maximumStepInterval;
- }
- set
+ if (base.PrintMembers(stringBuilder))
{
- _maximumStepInterval = value;
+ stringBuilder.Append(", ");
}
+ stringBuilder.Append("Value = " + _value);
+ return true;
}
+ }
+
+
+ ///
+ /// Block end condition based on number of patches visited.
+ ///
+ ///This condition ends a block after the animal has visited a specified
+ ///number of unique patches.
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.9.0.0 (Newtonsoft.Json v13.0.0.0)")]
+ [System.ComponentModel.DescriptionAttribute("Block end condition based on number of patches visited.\n\nThis condition ends a bl" +
+ "ock after the animal has visited a specified\nnumber of unique patches.")]
+ [Bonsai.WorkflowElementCategoryAttribute(Bonsai.ElementCategory.Source)]
+ [Bonsai.CombinatorAttribute(MethodName="Generate")]
+ public partial class BlockEndConditionPatchCount : BlockEndCondition
+ {
- [System.Xml.Serialization.XmlIgnoreAttribute()]
- [Newtonsoft.Json.JsonPropertyAttribute("motor_operation_mode")]
- public MotorOperationMode MotorOperationMode
+ private AllenNeuralDynamics.AindBehaviorServices.Distributions.Distribution _value;
+
+ public BlockEndConditionPatchCount()
{
- get
- {
- return _motorOperationMode;
- }
- set
- {
- _motorOperationMode = value;
- }
}
- [Newtonsoft.Json.JsonPropertyAttribute("max_limit")]
- public double MaxLimit
+ protected BlockEndConditionPatchCount(BlockEndConditionPatchCount other) :
+ base(other)
{
- get
- {
- return _maxLimit;
- }
- set
- {
- _maxLimit = value;
- }
+ _value = other._value;
}
- [Newtonsoft.Json.JsonPropertyAttribute("min_limit")]
- public double MinLimit
+ ///
+ /// Number of patches after which the block will end.
+ ///
+ [System.Xml.Serialization.XmlIgnoreAttribute()]
+ [Newtonsoft.Json.JsonPropertyAttribute("value", Required=Newtonsoft.Json.Required.Always)]
+ [System.ComponentModel.DescriptionAttribute("Number of patches after which the block will end.")]
+ public AllenNeuralDynamics.AindBehaviorServices.Distributions.Distribution Value
{
get
{
- return _minLimit;
+ return _value;
}
set
{
- _minLimit = value;
+ _value = value;
}
}
- public System.IObservable Generate()
- {
- return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new AxisConfiguration(this)));
- }
-
- public System.IObservable Generate(System.IObservable source)
+ public System.IObservable Generate()
{
- return System.Reactive.Linq.Observable.Select(source, _ => new AxisConfiguration(this));
+ return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new BlockEndConditionPatchCount(this)));
}
- protected virtual bool PrintMembers(System.Text.StringBuilder stringBuilder)
+ public System.IObservable Generate(System.IObservable source)
{
- stringBuilder.Append("Axis = " + _axis + ", ");
- stringBuilder.Append("StepAccelerationInterval = " + _stepAccelerationInterval + ", ");
- stringBuilder.Append("StepInterval = " + _stepInterval + ", ");
- stringBuilder.Append("MicrostepResolution = " + _microstepResolution + ", ");
- stringBuilder.Append("MaximumStepInterval = " + _maximumStepInterval + ", ");
- stringBuilder.Append("MotorOperationMode = " + _motorOperationMode + ", ");
- stringBuilder.Append("MaxLimit = " + _maxLimit + ", ");
- stringBuilder.Append("MinLimit = " + _minLimit);
- return true;
+ return System.Reactive.Linq.Observable.Select(source, _ => new BlockEndConditionPatchCount(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("Value = " + _value);
+ return true;
}
}
- [System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.6.1.0 (Newtonsoft.Json v13.0.0.0)")]
+ ///
+ /// Block end condition based on number of rewards obtained.
+ ///
+ ///This condition ends a block after the animal has obtained a specified
+ ///number of rewards.
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.9.0.0 (Newtonsoft.Json v13.0.0.0)")]
+ [System.ComponentModel.DescriptionAttribute("Block end condition based on number of rewards obtained.\n\nThis condition ends a b" +
+ "lock after the animal has obtained a specified\nnumber of rewards.")]
[Bonsai.WorkflowElementCategoryAttribute(Bonsai.ElementCategory.Source)]
[Bonsai.CombinatorAttribute(MethodName="Generate")]
- public partial class BaseModel
+ public partial class BlockEndConditionReward : BlockEndCondition
{
- public BaseModel()
+ private AllenNeuralDynamics.AindBehaviorServices.Distributions.Distribution _value;
+
+ public BlockEndConditionReward()
{
}
- protected BaseModel(BaseModel other)
+ protected BlockEndConditionReward(BlockEndConditionReward other) :
+ base(other)
{
+ _value = other._value;
}
- public System.IObservable Generate()
+ ///
+ /// Number of rewards after which the block ends.
+ ///
+ [System.Xml.Serialization.XmlIgnoreAttribute()]
+ [Newtonsoft.Json.JsonPropertyAttribute("value", Required=Newtonsoft.Json.Required.Always)]
+ [System.ComponentModel.DescriptionAttribute("Number of rewards after which the block ends.")]
+ public AllenNeuralDynamics.AindBehaviorServices.Distributions.Distribution Value
{
- return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new BaseModel(this)));
+ get
+ {
+ return _value;
+ }
+ set
+ {
+ _value = value;
+ }
}
- public System.IObservable Generate(System.IObservable source)
+ public System.IObservable Generate()
{
- return System.Reactive.Linq.Observable.Select(source, _ => new BaseModel(this));
+ return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new BlockEndConditionReward(this)));
}
- protected virtual bool PrintMembers(System.Text.StringBuilder stringBuilder)
+ public System.IObservable Generate(System.IObservable source)
{
- return false;
+ return System.Reactive.Linq.Observable.Select(source, _ => new BlockEndConditionReward(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("Value = " + _value);
+ return true;
}
}
///
- /// A beta probability distribution.
+ /// Structure defining the sequence and sampling of experimental blocks.
///
- ///Continuous distribution bounded between 0 and 1. Commonly used
- ///for modeling probabilities and proportions.
+ ///This class manages multiple experimental blocks and determines how they
+ ///are presented during the experiment (sequentially or randomly).
///
- [System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.6.1.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.")]
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.9.0.0 (Newtonsoft.Json v13.0.0.0)")]
+ [System.ComponentModel.DescriptionAttribute("Structure defining the sequence and sampling of experimental blocks.\n\nThis class " +
+ "manages multiple experimental blocks and determines how they\nare presented durin" +
+ "g the experiment (sequentially or randomly).")]
[Bonsai.WorkflowElementCategoryAttribute(Bonsai.ElementCategory.Source)]
[Bonsai.CombinatorAttribute(MethodName="Generate")]
- public partial class BetaDistribution : Distribution
+ public partial class BlockStructure
{
- private BetaDistributionParameters _distributionParameters;
-
- private TruncationParameters _truncationParameters;
+ private System.Collections.Generic.List _blocks;
- private ScalingParameters _scalingParameters;
+ private BlockStructureSamplingMode _samplingMode;
- public BetaDistribution()
+ public BlockStructure()
{
- _distributionParameters = new BetaDistributionParameters();
+ _blocks = new System.Collections.Generic.List();
+ _samplingMode = BlockStructureSamplingMode.Sequential;
}
- protected BetaDistribution(BetaDistribution other) :
- base(other)
+ protected BlockStructure(BlockStructure other)
{
- _distributionParameters = other._distributionParameters;
- _truncationParameters = other._truncationParameters;
- _scalingParameters = other._scalingParameters;
+ _blocks = other._blocks;
+ _samplingMode = other._samplingMode;
}
///
- /// Parameters of the distribution
+ /// Statistics of the environment
///
[System.Xml.Serialization.XmlIgnoreAttribute()]
- [Newtonsoft.Json.JsonPropertyAttribute("distribution_parameters")]
- [System.ComponentModel.DescriptionAttribute("Parameters of the distribution")]
- public BetaDistributionParameters DistributionParameters
+ [Newtonsoft.Json.JsonPropertyAttribute("blocks", Required=Newtonsoft.Json.Required.Always)]
+ [System.ComponentModel.DescriptionAttribute("Statistics of the environment")]
+ public System.Collections.Generic.List Blocks
{
get
{
- return _distributionParameters;
+ return _blocks;
}
set
{
- _distributionParameters = value;
+ _blocks = value;
}
}
///
- /// Truncation parameters of the distribution
+ /// Sampling mode of the blocks.
///
- [System.Xml.Serialization.XmlIgnoreAttribute()]
- [Newtonsoft.Json.JsonPropertyAttribute("truncation_parameters")]
- [System.ComponentModel.DescriptionAttribute("Truncation parameters of the distribution")]
- public TruncationParameters TruncationParameters
+ [Newtonsoft.Json.JsonPropertyAttribute("sampling_mode")]
+ [System.ComponentModel.DescriptionAttribute("Sampling mode of the blocks.")]
+ public BlockStructureSamplingMode SamplingMode
{
get
{
- return _truncationParameters;
+ return _samplingMode;
}
set
{
- _truncationParameters = value;
+ _samplingMode = value;
}
}
- ///
- /// 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
+ public System.IObservable Generate()
{
- get
- {
- return _scalingParameters;
- }
- set
- {
- _scalingParameters = value;
- }
+ return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new BlockStructure(this)));
}
- public System.IObservable Generate()
+ public System.IObservable Generate(System.IObservable source)
{
- return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new BetaDistribution(this)));
+ return System.Reactive.Linq.Observable.Select(source, _ => new BlockStructure(this));
}
- public System.IObservable Generate(System.IObservable source)
+ protected virtual bool PrintMembers(System.Text.StringBuilder stringBuilder)
{
- return System.Reactive.Linq.Observable.Select(source, _ => new BetaDistribution(this));
+ stringBuilder.Append("Blocks = " + _blocks + ", ");
+ stringBuilder.Append("SamplingMode = " + _samplingMode);
+ return true;
}
- protected override bool PrintMembers(System.Text.StringBuilder stringBuilder)
+ public override string ToString()
{
- if (base.PrintMembers(stringBuilder))
+ System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder();
+ stringBuilder.Append(GetType().Name);
+ stringBuilder.Append(" { ");
+ if (PrintMembers(stringBuilder))
{
- stringBuilder.Append(", ");
+ stringBuilder.Append(" ");
}
- stringBuilder.Append("DistributionParameters = " + _distributionParameters + ", ");
- stringBuilder.Append("TruncationParameters = " + _truncationParameters + ", ");
- stringBuilder.Append("ScalingParameters = " + _scalingParameters);
- return true;
+ stringBuilder.Append("}");
+ return stringBuilder.ToString();
}
}
- ///
- /// Parameters for a beta distribution.
- ///
- ///Defined by alpha and beta shape parameters.
- ///
- [System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.6.1.0 (Newtonsoft.Json v13.0.0.0)")]
- [System.ComponentModel.DescriptionAttribute("Parameters for a beta distribution.\n\nDefined by alpha and beta shape parameters.")]
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.9.0.0 (Newtonsoft.Json v13.0.0.0)")]
[Bonsai.WorkflowElementCategoryAttribute(Bonsai.ElementCategory.Source)]
[Bonsai.CombinatorAttribute(MethodName="Generate")]
- public partial class BetaDistributionParameters
+ public partial class CameraControllerSpinnakerCamera
{
- private string _family;
+ private string _deviceType;
+
+ private BaseModel _calibration;
+
+ private System.Collections.Generic.Dictionary _cameras;
- private double _alpha;
+ private int? _frameRate;
- private double _beta;
+ public CameraControllerSpinnakerCamera()
+ {
+ _deviceType = "CameraController";
+ _cameras = new System.Collections.Generic.Dictionary();
+ _frameRate = 30;
+ }
- public BetaDistributionParameters()
+ protected CameraControllerSpinnakerCamera(CameraControllerSpinnakerCamera other)
{
- _family = "Beta";
- _alpha = 5D;
- _beta = 5D;
+ _deviceType = other._deviceType;
+ _calibration = other._calibration;
+ _cameras = other._cameras;
+ _frameRate = other._frameRate;
}
- protected BetaDistributionParameters(BetaDistributionParameters other)
+ [Newtonsoft.Json.JsonPropertyAttribute("device_type")]
+ public string DeviceType
{
- _family = other._family;
- _alpha = other._alpha;
- _beta = other._beta;
+ get
+ {
+ return _deviceType;
+ }
+ set
+ {
+ _deviceType = value;
+ }
}
- [Newtonsoft.Json.JsonPropertyAttribute("family")]
- public string Family
+ ///
+ /// Calibration for the device.
+ ///
+ [System.Xml.Serialization.XmlIgnoreAttribute()]
+ [Newtonsoft.Json.JsonPropertyAttribute("calibration")]
+ [System.ComponentModel.DescriptionAttribute("Calibration for the device.")]
+ public BaseModel Calibration
{
get
{
- return _family;
+ return _calibration;
}
set
{
- _family = value;
+ _calibration = value;
}
}
///
- /// Alpha parameter of the distribution
+ /// Cameras to be instantiated
///
- [Newtonsoft.Json.JsonPropertyAttribute("alpha")]
- [System.ComponentModel.DescriptionAttribute("Alpha parameter of the distribution")]
- public double Alpha
+ [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
{
get
{
- return _alpha;
+ return _cameras;
}
set
{
- _alpha = value;
+ _cameras = value;
}
}
///
- /// Beta parameter of the distribution
+ /// Frame rate of the trigger to all cameras
///
- [Newtonsoft.Json.JsonPropertyAttribute("beta")]
- [System.ComponentModel.DescriptionAttribute("Beta parameter of the distribution")]
- public double Beta
+ [Newtonsoft.Json.JsonPropertyAttribute("frame_rate")]
+ [System.ComponentModel.DescriptionAttribute("Frame rate of the trigger to all cameras")]
+ public int? FrameRate
{
get
{
- return _beta;
+ return _frameRate;
}
set
{
- _beta = value;
+ _frameRate = value;
}
}
- public System.IObservable Generate()
+ public System.IObservable Generate()
{
- return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new BetaDistributionParameters(this)));
+ 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(System.IObservable source)
{
- return System.Reactive.Linq.Observable.Select(source, _ => new BetaDistributionParameters(this));
+ return System.Reactive.Linq.Observable.Select(source, _ => new CameraControllerSpinnakerCamera(this));
}
protected virtual bool PrintMembers(System.Text.StringBuilder stringBuilder)
{
- stringBuilder.Append("Family = " + _family + ", ");
- stringBuilder.Append("Alpha = " + _alpha + ", ");
- stringBuilder.Append("Beta = " + _beta);
+ stringBuilder.Append("DeviceType = " + _deviceType + ", ");
+ stringBuilder.Append("Calibration = " + _calibration + ", ");
+ stringBuilder.Append("Cameras = " + _cameras + ", ");
+ stringBuilder.Append("FrameRate = " + _frameRate);
return true;
}
@@ -2245,371 +1828,434 @@ 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.6.1.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.")]
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.9.0.0 (Newtonsoft.Json v13.0.0.0)")]
[Bonsai.WorkflowElementCategoryAttribute(Bonsai.ElementCategory.Source)]
[Bonsai.CombinatorAttribute(MethodName="Generate")]
- public partial class BinomialDistribution : Distribution
+ public partial class CameraControllerWebCamera
{
- private BinomialDistributionParameters _distributionParameters;
+ private string _deviceType;
+
+ private BaseModel _calibration;
+
+ private System.Collections.Generic.Dictionary _cameras;
- private TruncationParameters _truncationParameters;
+ private int? _frameRate;
- private ScalingParameters _scalingParameters;
+ public CameraControllerWebCamera()
+ {
+ _deviceType = "CameraController";
+ _cameras = new System.Collections.Generic.Dictionary();
+ _frameRate = 30;
+ }
- public BinomialDistribution()
+ protected CameraControllerWebCamera(CameraControllerWebCamera other)
{
- _distributionParameters = new BinomialDistributionParameters();
+ _deviceType = other._deviceType;
+ _calibration = other._calibration;
+ _cameras = other._cameras;
+ _frameRate = other._frameRate;
}
- protected BinomialDistribution(BinomialDistribution other) :
- base(other)
+ [Newtonsoft.Json.JsonPropertyAttribute("device_type")]
+ public string DeviceType
{
- _distributionParameters = other._distributionParameters;
- _truncationParameters = other._truncationParameters;
- _scalingParameters = other._scalingParameters;
+ get
+ {
+ return _deviceType;
+ }
+ set
+ {
+ _deviceType = value;
+ }
}
///
- /// Parameters of the distribution
+ /// Calibration for the device.
///
[System.Xml.Serialization.XmlIgnoreAttribute()]
- [Newtonsoft.Json.JsonPropertyAttribute("distribution_parameters")]
- [System.ComponentModel.DescriptionAttribute("Parameters of the distribution")]
- public BinomialDistributionParameters DistributionParameters
+ [Newtonsoft.Json.JsonPropertyAttribute("calibration")]
+ [System.ComponentModel.DescriptionAttribute("Calibration for the device.")]
+ public BaseModel Calibration
{
get
{
- return _distributionParameters;
+ return _calibration;
}
set
{
- _distributionParameters = value;
+ _calibration = value;
}
}
///
- /// Truncation parameters of the distribution
+ /// Cameras to be instantiated
///
[System.Xml.Serialization.XmlIgnoreAttribute()]
- [Newtonsoft.Json.JsonPropertyAttribute("truncation_parameters")]
- [System.ComponentModel.DescriptionAttribute("Truncation parameters of the distribution")]
- public TruncationParameters TruncationParameters
+ [Newtonsoft.Json.JsonPropertyAttribute("cameras", Required=Newtonsoft.Json.Required.Always)]
+ [System.ComponentModel.DescriptionAttribute("Cameras to be instantiated")]
+ public System.Collections.Generic.Dictionary Cameras
{
get
{
- return _truncationParameters;
+ return _cameras;
}
set
{
- _truncationParameters = value;
+ _cameras = value;
}
}
///
- /// Scaling parameters of the distribution
+ /// Frame rate of the trigger to all cameras
///
- [System.Xml.Serialization.XmlIgnoreAttribute()]
- [Newtonsoft.Json.JsonPropertyAttribute("scaling_parameters")]
- [System.ComponentModel.DescriptionAttribute("Scaling parameters of the distribution")]
- public ScalingParameters ScalingParameters
+ [Newtonsoft.Json.JsonPropertyAttribute("frame_rate")]
+ [System.ComponentModel.DescriptionAttribute("Frame rate of the trigger to all cameras")]
+ public int? FrameRate
{
get
{
- return _scalingParameters;
+ return _frameRate;
}
set
{
- _scalingParameters = value;
+ _frameRate = value;
}
}
- public System.IObservable Generate()
+ public System.IObservable Generate()
{
- return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new BinomialDistribution(this)));
+ return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new CameraControllerWebCamera(this)));
}
- public System.IObservable Generate(System.IObservable source)
+ public System.IObservable Generate(System.IObservable source)
{
- return System.Reactive.Linq.Observable.Select(source, _ => new BinomialDistribution(this));
+ return System.Reactive.Linq.Observable.Select(source, _ => new CameraControllerWebCamera(this));
}
- protected override bool PrintMembers(System.Text.StringBuilder stringBuilder)
+ protected virtual bool PrintMembers(System.Text.StringBuilder stringBuilder)
{
- if (base.PrintMembers(stringBuilder))
+ stringBuilder.Append("DeviceType = " + _deviceType + ", ");
+ stringBuilder.Append("Calibration = " + _calibration + ", ");
+ stringBuilder.Append("Cameras = " + _cameras + ", ");
+ stringBuilder.Append("FrameRate = " + _frameRate);
+ 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(" ");
}
- stringBuilder.Append("DistributionParameters = " + _distributionParameters + ", ");
- stringBuilder.Append("TruncationParameters = " + _truncationParameters + ", ");
- stringBuilder.Append("ScalingParameters = " + _scalingParameters);
- return true;
+ stringBuilder.Append("}");
+ return stringBuilder.ToString();
}
}
///
- /// Parameters for a binomial distribution.
+ /// A patch update function that applies multiplicative rate updates with bounds.
///
- ///Defined by number of trials (n) and success probability (p).
+ ///Update in the form of x = clamp(x * rate ** tick_value).
+ ///This function multiplies the current value by the rate parameter, maintaining
+ ///the result within specified minimum and maximum bounds. Useful for percentage-
+ ///based changes and exponential decay/growth patterns.
///
- [System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.6.1.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).")]
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.9.0.0 (Newtonsoft.Json v13.0.0.0)")]
+ [System.ComponentModel.DescriptionAttribute(@"A patch update function that applies multiplicative rate updates with bounds.
+
+ Update in the form of x = clamp(x * rate ** tick_value).
+ This function multiplies the current value by the rate parameter, maintaining
+ the result within specified minimum and maximum bounds. Useful for percentage-
+ based changes and exponential decay/growth patterns.")]
[Bonsai.WorkflowElementCategoryAttribute(Bonsai.ElementCategory.Source)]
[Bonsai.CombinatorAttribute(MethodName="Generate")]
- public partial class BinomialDistributionParameters
+ public partial class ClampedMultiplicativeRateFunction : PatchUpdateFunction
{
- private string _family;
+ private double? _minimum;
- private int _n;
+ private double? _maximum;
- private double _p;
+ private AllenNeuralDynamics.AindBehaviorServices.Distributions.Distribution _rate;
- public BinomialDistributionParameters()
+ public ClampedMultiplicativeRateFunction()
{
- _family = "Binomial";
- _n = 1;
- _p = 0.5D;
+ _minimum = 0;
}
- protected BinomialDistributionParameters(BinomialDistributionParameters other)
+ protected ClampedMultiplicativeRateFunction(ClampedMultiplicativeRateFunction other) :
+ base(other)
{
- _family = other._family;
- _n = other._n;
- _p = other._p;
+ _minimum = other._minimum;
+ _maximum = other._maximum;
+ _rate = other._rate;
}
- [Newtonsoft.Json.JsonPropertyAttribute("family")]
- public string Family
+ ///
+ /// Minimum value of the rate
+ ///
+ [Newtonsoft.Json.JsonPropertyAttribute("minimum")]
+ [System.ComponentModel.DescriptionAttribute("Minimum value of the rate")]
+ public double? Minimum
{
get
{
- return _family;
+ return _minimum;
}
set
{
- _family = value;
+ _minimum = value;
}
}
///
- /// Number of trials
+ /// Maximum value of the rate
///
- [Newtonsoft.Json.JsonPropertyAttribute("n")]
- [System.ComponentModel.DescriptionAttribute("Number of trials")]
- public int N
+ [Newtonsoft.Json.JsonPropertyAttribute("maximum", Required=Newtonsoft.Json.Required.AllowNull)]
+ [System.ComponentModel.DescriptionAttribute("Maximum value of the rate")]
+ public double? Maximum
{
get
{
- return _n;
+ return _maximum;
}
set
{
- _n = value;
+ _maximum = value;
}
}
///
- /// Probability of success
+ /// Rate of the replenishment, in value per rule unit.
///
- [Newtonsoft.Json.JsonPropertyAttribute("p")]
- [System.ComponentModel.DescriptionAttribute("Probability of success")]
- public double P
+ [System.Xml.Serialization.XmlIgnoreAttribute()]
+ [Newtonsoft.Json.JsonPropertyAttribute("rate", Required=Newtonsoft.Json.Required.Always)]
+ [System.ComponentModel.DescriptionAttribute("Rate of the replenishment, in value per rule unit.")]
+ public AllenNeuralDynamics.AindBehaviorServices.Distributions.Distribution Rate
{
get
{
- return _p;
+ return _rate;
}
set
{
- _p = value;
+ _rate = value;
}
}
- public System.IObservable Generate()
- {
- return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new BinomialDistributionParameters(this)));
- }
-
- public System.IObservable Generate(System.IObservable source)
+ public System.IObservable Generate()
{
- return System.Reactive.Linq.Observable.Select(source, _ => new BinomialDistributionParameters(this));
+ return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new ClampedMultiplicativeRateFunction(this)));
}
- protected virtual bool PrintMembers(System.Text.StringBuilder stringBuilder)
+ public System.IObservable Generate(System.IObservable source)
{
- stringBuilder.Append("Family = " + _family + ", ");
- stringBuilder.Append("N = " + _n + ", ");
- stringBuilder.Append("P = " + _p);
- return true;
+ return System.Reactive.Linq.Observable.Select(source, _ => new ClampedMultiplicativeRateFunction(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("Minimum = " + _minimum + ", ");
+ stringBuilder.Append("Maximum = " + _maximum + ", ");
+ stringBuilder.Append("Rate = " + _rate);
+ return true;
}
}
///
- /// Configuration for a single experimental block.
+ /// A patch update function that applies a clamped rate-based update.
///
- ///A block represents a period of the experiment with specific environment
- ///statistics and ending conditions. Each block defines the environmental
- ///parameters and termination criteria for that experimental phase.
+ ///Update in the form of x = clamp(x + rate * tick_value).
+ ///This function updates values at a specified rate while keeping results within
+ ///defined minimum and maximum bounds. The rate is applied per rule unit (e.g.,
+ ///time, distance, choices).
///
- [System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.6.1.0 (Newtonsoft.Json v13.0.0.0)")]
- [System.ComponentModel.DescriptionAttribute("Configuration for a single experimental block.\n\nA block represents a period of th" +
- "e experiment with specific environment\nstatistics and ending conditions. Each bl" +
- "ock defines the environmental\nparameters and termination criteria for that exper" +
- "imental phase.")]
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.9.0.0 (Newtonsoft.Json v13.0.0.0)")]
+ [System.ComponentModel.DescriptionAttribute(@"A patch update function that applies a clamped rate-based update.
+
+ Update in the form of x = clamp(x + rate * tick_value).
+ This function updates values at a specified rate while keeping results within
+ defined minimum and maximum bounds. The rate is applied per rule unit (e.g.,
+ time, distance, choices).")]
[Bonsai.WorkflowElementCategoryAttribute(Bonsai.ElementCategory.Source)]
[Bonsai.CombinatorAttribute(MethodName="Generate")]
- public partial class Block
+ public partial class ClampedRateFunction : PatchUpdateFunction
{
- private EnvironmentStatistics _environmentStatistics;
+ private double? _minimum;
- private System.Collections.Generic.List _endConditions;
+ private double? _maximum;
- public Block()
+ private AllenNeuralDynamics.AindBehaviorServices.Distributions.Distribution _rate;
+
+ public ClampedRateFunction()
{
- _environmentStatistics = new EnvironmentStatistics();
- _endConditions = new System.Collections.Generic.List();
+ _minimum = 0;
}
- protected Block(Block other)
+ protected ClampedRateFunction(ClampedRateFunction other) :
+ base(other)
{
- _environmentStatistics = other._environmentStatistics;
- _endConditions = other._endConditions;
+ _minimum = other._minimum;
+ _maximum = other._maximum;
+ _rate = other._rate;
}
///
- /// Statistics of the environment
+ /// Minimum value of the rate
///
- [System.Xml.Serialization.XmlIgnoreAttribute()]
- [Newtonsoft.Json.JsonPropertyAttribute("environment_statistics", Required=Newtonsoft.Json.Required.Always)]
- [System.ComponentModel.DescriptionAttribute("Statistics of the environment")]
- public EnvironmentStatistics EnvironmentStatistics
+ [Newtonsoft.Json.JsonPropertyAttribute("minimum")]
+ [System.ComponentModel.DescriptionAttribute("Minimum value of the rate")]
+ public double? Minimum
{
get
{
- return _environmentStatistics;
+ return _minimum;
}
set
{
- _environmentStatistics = value;
+ _minimum = value;
}
}
///
- /// List of end conditions that must be true for the block to end.
+ /// Maximum value of the rate
///
- [System.Xml.Serialization.XmlIgnoreAttribute()]
- [Newtonsoft.Json.JsonPropertyAttribute("end_conditions")]
- [System.ComponentModel.DescriptionAttribute("List of end conditions that must be true for the block to end.")]
- public System.Collections.Generic.List EndConditions
+ [Newtonsoft.Json.JsonPropertyAttribute("maximum", Required=Newtonsoft.Json.Required.AllowNull)]
+ [System.ComponentModel.DescriptionAttribute("Maximum value of the rate")]
+ public double? Maximum
{
get
{
- return _endConditions;
+ return _maximum;
}
set
{
- _endConditions = value;
+ _maximum = value;
}
}
- public System.IObservable Generate()
+ ///
+ /// Rate of the replenishment, in value per rule unit.
+ ///
+ [System.Xml.Serialization.XmlIgnoreAttribute()]
+ [Newtonsoft.Json.JsonPropertyAttribute("rate", Required=Newtonsoft.Json.Required.Always)]
+ [System.ComponentModel.DescriptionAttribute("Rate of the replenishment, in value per rule unit.")]
+ public AllenNeuralDynamics.AindBehaviorServices.Distributions.Distribution Rate
{
- return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new Block(this)));
+ get
+ {
+ return _rate;
+ }
+ set
+ {
+ _rate = value;
+ }
}
- public System.IObservable Generate(System.IObservable source)
+ public System.IObservable Generate()
{
- return System.Reactive.Linq.Observable.Select(source, _ => new Block(this));
+ return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new ClampedRateFunction(this)));
}
- protected virtual bool PrintMembers(System.Text.StringBuilder stringBuilder)
+ public System.IObservable Generate(System.IObservable source)
{
- stringBuilder.Append("EnvironmentStatistics = " + _environmentStatistics + ", ");
- stringBuilder.Append("EndConditions = " + _endConditions);
- return true;
+ return System.Reactive.Linq.Observable.Select(source, _ => new ClampedRateFunction(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("Minimum = " + _minimum + ", ");
+ stringBuilder.Append("Maximum = " + _maximum + ", ");
+ stringBuilder.Append("Rate = " + _rate);
+ return true;
}
}
- ///
- /// Block end condition based on time duration.
- ///
- ///This condition ends a block after a specified amount of time has elapsed.
- ///
- [System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.6.1.0 (Newtonsoft.Json v13.0.0.0)")]
- [Newtonsoft.Json.JsonConverter(typeof(JsonInheritanceConverter), "condition_type")]
- [JsonInheritanceAttribute("Duration", typeof(BlockEndConditionDuration))]
- [JsonInheritanceAttribute("Distance", typeof(BlockEndConditionDistance))]
- [JsonInheritanceAttribute("Choice", typeof(BlockEndConditionChoice))]
- [JsonInheritanceAttribute("Reward", typeof(BlockEndConditionReward))]
- [JsonInheritanceAttribute("PatchCount", typeof(BlockEndConditionPatchCount))]
- [System.ComponentModel.DescriptionAttribute("Block end condition based on time duration.\n\nThis condition ends a block after a " +
- "specified amount of time has elapsed.")]
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.9.0.0 (Newtonsoft.Json v13.0.0.0)")]
[Bonsai.WorkflowElementCategoryAttribute(Bonsai.ElementCategory.Source)]
[Bonsai.CombinatorAttribute(MethodName="Generate")]
- public partial class BlockEndCondition
+ public partial class ConnectedClockOutput
{
- public BlockEndCondition()
+ private string _targetDevice;
+
+ private int _outputChannel;
+
+ public ConnectedClockOutput()
{
}
- protected BlockEndCondition(BlockEndCondition other)
+ protected ConnectedClockOutput(ConnectedClockOutput other)
{
+ _targetDevice = other._targetDevice;
+ _outputChannel = other._outputChannel;
}
- public System.IObservable Generate()
+ ///
+ /// Optional device name to provide user additional information
+ ///
+ [Newtonsoft.Json.JsonPropertyAttribute("target_device")]
+ [System.ComponentModel.DescriptionAttribute("Optional device name to provide user additional information")]
+ public string TargetDevice
{
- return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new BlockEndCondition(this)));
+ get
+ {
+ return _targetDevice;
+ }
+ set
+ {
+ _targetDevice = value;
+ }
}
- public System.IObservable Generate(System.IObservable source)
+ ///
+ /// Output channel
+ ///
+ [Newtonsoft.Json.JsonPropertyAttribute("output_channel", Required=Newtonsoft.Json.Required.Always)]
+ [System.ComponentModel.DescriptionAttribute("Output channel")]
+ public int OutputChannel
{
- return System.Reactive.Linq.Observable.Select(source, _ => new BlockEndCondition(this));
+ get
+ {
+ return _outputChannel;
+ }
+ set
+ {
+ _outputChannel = value;
+ }
+ }
+
+ public System.IObservable Generate()
+ {
+ return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new ConnectedClockOutput(this)));
+ }
+
+ public System.IObservable Generate(System.IObservable source)
+ {
+ return System.Reactive.Linq.Observable.Select(source, _ => new ConnectedClockOutput(this));
}
protected virtual bool PrintMembers(System.Text.StringBuilder stringBuilder)
{
- return false;
+ stringBuilder.Append("TargetDevice = " + _targetDevice + ", ");
+ stringBuilder.Append("OutputChannel = " + _outputChannel);
+ return true;
}
public override string ToString()
@@ -2628,188 +2274,168 @@ public override string ToString()
///
- /// Block end condition based on number of choices made.
+ /// A patch update function that uses a continuous-time Markov chain (CTMC)
+ ///to determine patch updates based on a transition probability matrix.
///
- ///This condition ends a block after the animal has made a specified number
- ///of choices (e.g., patch visits or reward attempts).
+ ///It expects a transition matrix that takes the current value of the variable
+ ///of interest (e.g. Probability), and outputs a new value based on the defined
+ ///stochastic process in the transition matrix.
///
- [System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.6.1.0 (Newtonsoft.Json v13.0.0.0)")]
- [System.ComponentModel.DescriptionAttribute("Block end condition based on number of choices made.\n\nThis condition ends a block" +
- " after the animal has made a specified number\nof choices (e.g., patch visits or " +
- "reward attempts).")]
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.9.0.0 (Newtonsoft.Json v13.0.0.0)")]
+ [System.ComponentModel.DescriptionAttribute(@"A patch update function that uses a continuous-time Markov chain (CTMC)
+ to determine patch updates based on a transition probability matrix.
+
+ It expects a transition matrix that takes the current value of the variable
+ of interest (e.g. Probability), and outputs a new value based on the defined
+ stochastic process in the transition matrix.")]
[Bonsai.WorkflowElementCategoryAttribute(Bonsai.ElementCategory.Source)]
[Bonsai.CombinatorAttribute(MethodName="Generate")]
- public partial class BlockEndConditionChoice : BlockEndCondition
+ public partial class CtcmFunction : PatchUpdateFunction
{
- private Distribution _value;
+ private System.Collections.Generic.List> _transitionMatrix;
- public BlockEndConditionChoice()
+ private double _rho;
+
+ private double _dt;
+
+ private double? _rate;
+
+ private double _minimum;
+
+ private double _maximum;
+
+ public CtcmFunction()
{
+ _transitionMatrix = new System.Collections.Generic.List>();
+ _dt = 0.1D;
+ _minimum = 1D;
+ _maximum = 0D;
}
- protected BlockEndConditionChoice(BlockEndConditionChoice other) :
+ protected CtcmFunction(CtcmFunction other) :
base(other)
{
- _value = other._value;
+ _transitionMatrix = other._transitionMatrix;
+ _rho = other._rho;
+ _dt = other._dt;
+ _rate = other._rate;
+ _minimum = other._minimum;
+ _maximum = other._maximum;
}
///
- /// Number of choices after which the block ends.
+ /// Transition matrix between states
///
[System.Xml.Serialization.XmlIgnoreAttribute()]
- [Newtonsoft.Json.JsonPropertyAttribute("value", Required=Newtonsoft.Json.Required.Always)]
- [System.ComponentModel.DescriptionAttribute("Number of choices after which the block ends.")]
- public Distribution Value
+ [Newtonsoft.Json.JsonPropertyAttribute("transition_matrix", Required=Newtonsoft.Json.Required.Always)]
+ [System.ComponentModel.DescriptionAttribute("Transition matrix between states")]
+ public System.Collections.Generic.List> TransitionMatrix
{
get
{
- return _value;
+ return _transitionMatrix;
}
set
{
- _value = value;
+ _transitionMatrix = value;
}
}
- public System.IObservable Generate()
- {
- return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new BlockEndConditionChoice(this)));
- }
-
- public System.IObservable Generate(System.IObservable source)
- {
- return System.Reactive.Linq.Observable.Select(source, _ => new BlockEndConditionChoice(this));
- }
-
- protected override bool PrintMembers(System.Text.StringBuilder stringBuilder)
+ ///
+ /// The underlying value governing the stochastic process
+ ///
+ [Newtonsoft.Json.JsonPropertyAttribute("rho", Required=Newtonsoft.Json.Required.Always)]
+ [System.ComponentModel.DescriptionAttribute("The underlying value governing the stochastic process")]
+ public double Rho
{
- if (base.PrintMembers(stringBuilder))
+ get
{
- stringBuilder.Append(", ");
+ return _rho;
+ }
+ set
+ {
+ _rho = value;
}
- stringBuilder.Append("Value = " + _value);
- return true;
- }
- }
-
-
- ///
- /// Block end condition based on distance traveled.
- ///
- ///This condition ends a block after the animal has traveled a specified distance.
- ///
- [System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.6.1.0 (Newtonsoft.Json v13.0.0.0)")]
- [System.ComponentModel.DescriptionAttribute("Block end condition based on distance traveled.\n\nThis condition ends a block afte" +
- "r the animal has traveled a specified distance.")]
- [Bonsai.WorkflowElementCategoryAttribute(Bonsai.ElementCategory.Source)]
- [Bonsai.CombinatorAttribute(MethodName="Generate")]
- public partial class BlockEndConditionDistance : BlockEndCondition
- {
-
- private Distribution _value;
-
- public BlockEndConditionDistance()
- {
- }
-
- protected BlockEndConditionDistance(BlockEndConditionDistance other) :
- base(other)
- {
- _value = other._value;
}
///
- /// Distance after which the block ends.
+ /// Sampling time step (s)
///
- [System.Xml.Serialization.XmlIgnoreAttribute()]
- [Newtonsoft.Json.JsonPropertyAttribute("value", Required=Newtonsoft.Json.Required.Always)]
- [System.ComponentModel.DescriptionAttribute("Distance after which the block ends.")]
- public Distribution Value
+ [Newtonsoft.Json.JsonPropertyAttribute("dt")]
+ [System.ComponentModel.DescriptionAttribute("Sampling time step (s)")]
+ public double Dt
{
get
{
- return _value;
+ return _dt;
}
set
{
- _value = value;
+ _dt = value;
}
}
- public System.IObservable Generate()
- {
- return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new BlockEndConditionDistance(this)));
- }
-
- public System.IObservable Generate(System.IObservable source)
- {
- return System.Reactive.Linq.Observable.Select(source, _ => new BlockEndConditionDistance(this));
- }
-
- protected override bool PrintMembers(System.Text.StringBuilder stringBuilder)
+ ///
+ /// Rate of the replenishment used to generate the matrix. This value is used for metadata keep sake only
+ ///
+ [Newtonsoft.Json.JsonPropertyAttribute("rate")]
+ [System.ComponentModel.DescriptionAttribute("Rate of the replenishment used to generate the matrix. This value is used for met" +
+ "adata keep sake only")]
+ public double? Rate
{
- if (base.PrintMembers(stringBuilder))
+ get
{
- stringBuilder.Append(", ");
+ return _rate;
+ }
+ set
+ {
+ _rate = value;
}
- stringBuilder.Append("Value = " + _value);
- return true;
- }
- }
-
-
- ///
- /// Block end condition based on time duration.
- ///
- ///This condition ends a block after a specified amount of time has elapsed.
- ///
- [System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.6.1.0 (Newtonsoft.Json v13.0.0.0)")]
- [System.ComponentModel.DescriptionAttribute("Block end condition based on time duration.\n\nThis condition ends a block after a " +
- "specified amount of time has elapsed.")]
- [Bonsai.WorkflowElementCategoryAttribute(Bonsai.ElementCategory.Source)]
- [Bonsai.CombinatorAttribute(MethodName="Generate")]
- public partial class BlockEndConditionDuration : BlockEndCondition
- {
-
- private Distribution _value;
-
- public BlockEndConditionDuration()
- {
}
- protected BlockEndConditionDuration(BlockEndConditionDuration other) :
- base(other)
+ ///
+ /// Maximum value after update
+ ///
+ [Newtonsoft.Json.JsonPropertyAttribute("minimum")]
+ [System.ComponentModel.DescriptionAttribute("Maximum value after update")]
+ public double Minimum
{
- _value = other._value;
+ get
+ {
+ return _minimum;
+ }
+ set
+ {
+ _minimum = value;
+ }
}
///
- /// Time after which the block ends.
+ /// Minimum value after update
///
- [System.Xml.Serialization.XmlIgnoreAttribute()]
- [Newtonsoft.Json.JsonPropertyAttribute("value", Required=Newtonsoft.Json.Required.Always)]
- [System.ComponentModel.DescriptionAttribute("Time after which the block ends.")]
- public Distribution Value
+ [Newtonsoft.Json.JsonPropertyAttribute("maximum")]
+ [System.ComponentModel.DescriptionAttribute("Minimum value after update")]
+ public double Maximum
{
get
{
- return _value;
+ return _maximum;
}
set
{
- _value = value;
+ _maximum = value;
}
}
- public System.IObservable Generate()
+ public System.IObservable Generate()
{
- return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new BlockEndConditionDuration(this)));
+ return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new CtcmFunction(this)));
}
- public System.IObservable Generate(System.IObservable source)
+ public System.IObservable Generate(System.IObservable source)
{
- return System.Reactive.Linq.Observable.Select(source, _ => new BlockEndConditionDuration(this));
+ return System.Reactive.Linq.Observable.Select(source, _ => new CtcmFunction(this));
}
protected override bool PrintMembers(System.Text.StringBuilder stringBuilder)
@@ -2818,225 +2444,187 @@ protected override bool PrintMembers(System.Text.StringBuilder stringBuilder)
{
stringBuilder.Append(", ");
}
- stringBuilder.Append("Value = " + _value);
+ stringBuilder.Append("TransitionMatrix = " + _transitionMatrix + ", ");
+ stringBuilder.Append("Rho = " + _rho + ", ");
+ stringBuilder.Append("Dt = " + _dt + ", ");
+ stringBuilder.Append("Rate = " + _rate + ", ");
+ stringBuilder.Append("Minimum = " + _minimum + ", ");
+ stringBuilder.Append("Maximum = " + _maximum);
return true;
}
}
///
- /// Block end condition based on number of patches visited.
- ///
- ///This condition ends a block after the animal has visited a specified
- ///number of unique patches.
+ /// Represents the calibration parameters of a display.
///
- [System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.6.1.0 (Newtonsoft.Json v13.0.0.0)")]
- [System.ComponentModel.DescriptionAttribute("Block end condition based on number of patches visited.\n\nThis condition ends a bl" +
- "ock after the animal has visited a specified\nnumber of unique patches.")]
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.9.0.0 (Newtonsoft.Json v13.0.0.0)")]
+ [System.ComponentModel.DescriptionAttribute("Represents the calibration parameters of a display.")]
[Bonsai.WorkflowElementCategoryAttribute(Bonsai.ElementCategory.Source)]
[Bonsai.CombinatorAttribute(MethodName="Generate")]
- public partial class BlockEndConditionPatchCount : BlockEndCondition
+ public partial class DisplayCalibration
{
- private Distribution _value;
+ private DisplayIntrinsics _intrinsics;
- public BlockEndConditionPatchCount()
+ private DisplayExtrinsics _extrinsics;
+
+ public DisplayCalibration()
{
+ _intrinsics = new DisplayIntrinsics();
+ _extrinsics = new DisplayExtrinsics();
}
- protected BlockEndConditionPatchCount(BlockEndConditionPatchCount other) :
- base(other)
+ protected DisplayCalibration(DisplayCalibration other)
{
- _value = other._value;
+ _intrinsics = other._intrinsics;
+ _extrinsics = other._extrinsics;
}
///
- /// Number of patches after which the block will end.
+ /// Intrinsics
///
[System.Xml.Serialization.XmlIgnoreAttribute()]
- [Newtonsoft.Json.JsonPropertyAttribute("value", Required=Newtonsoft.Json.Required.Always)]
- [System.ComponentModel.DescriptionAttribute("Number of patches after which the block will end.")]
- public Distribution Value
+ [Newtonsoft.Json.JsonPropertyAttribute("intrinsics")]
+ [System.ComponentModel.DescriptionAttribute("Intrinsics")]
+ public DisplayIntrinsics Intrinsics
{
get
{
- return _value;
+ return _intrinsics;
}
set
{
- _value = value;
- }
- }
-
- public System.IObservable Generate()
- {
- return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new BlockEndConditionPatchCount(this)));
- }
-
- public System.IObservable Generate(System.IObservable source)
- {
- return System.Reactive.Linq.Observable.Select(source, _ => new BlockEndConditionPatchCount(this));
- }
-
- protected override bool PrintMembers(System.Text.StringBuilder stringBuilder)
- {
- if (base.PrintMembers(stringBuilder))
- {
- stringBuilder.Append(", ");
+ _intrinsics = value;
}
- stringBuilder.Append("Value = " + _value);
- return true;
- }
- }
-
-
- ///
- /// Block end condition based on number of rewards obtained.
- ///
- ///This condition ends a block after the animal has obtained a specified
- ///number of rewards.
- ///
- [System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.6.1.0 (Newtonsoft.Json v13.0.0.0)")]
- [System.ComponentModel.DescriptionAttribute("Block end condition based on number of rewards obtained.\n\nThis condition ends a b" +
- "lock after the animal has obtained a specified\nnumber of rewards.")]
- [Bonsai.WorkflowElementCategoryAttribute(Bonsai.ElementCategory.Source)]
- [Bonsai.CombinatorAttribute(MethodName="Generate")]
- public partial class BlockEndConditionReward : BlockEndCondition
- {
-
- private Distribution _value;
-
- public BlockEndConditionReward()
- {
- }
-
- protected BlockEndConditionReward(BlockEndConditionReward other) :
- base(other)
- {
- _value = other._value;
}
///
- /// Number of rewards after which the block ends.
+ /// Extrinsics
///
[System.Xml.Serialization.XmlIgnoreAttribute()]
- [Newtonsoft.Json.JsonPropertyAttribute("value", Required=Newtonsoft.Json.Required.Always)]
- [System.ComponentModel.DescriptionAttribute("Number of rewards after which the block ends.")]
- public Distribution Value
+ [Newtonsoft.Json.JsonPropertyAttribute("extrinsics")]
+ [System.ComponentModel.DescriptionAttribute("Extrinsics")]
+ public DisplayExtrinsics Extrinsics
{
get
{
- return _value;
+ return _extrinsics;
}
set
{
- _value = value;
+ _extrinsics = value;
}
}
- public System.IObservable Generate()
+ public System.IObservable Generate()
{
- return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new BlockEndConditionReward(this)));
+ return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new DisplayCalibration(this)));
}
- public System.IObservable Generate(System.IObservable source)
+ public System.IObservable Generate(System.IObservable source)
{
- return System.Reactive.Linq.Observable.Select(source, _ => new BlockEndConditionReward(this));
+ return System.Reactive.Linq.Observable.Select(source, _ => new DisplayCalibration(this));
}
- protected override bool PrintMembers(System.Text.StringBuilder stringBuilder)
+ protected virtual bool PrintMembers(System.Text.StringBuilder stringBuilder)
{
- if (base.PrintMembers(stringBuilder))
+ stringBuilder.Append("Intrinsics = " + _intrinsics + ", ");
+ stringBuilder.Append("Extrinsics = " + _extrinsics);
+ 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(" ");
}
- stringBuilder.Append("Value = " + _value);
- return true;
+ stringBuilder.Append("}");
+ return stringBuilder.ToString();
}
}
///
- /// Structure defining the sequence and sampling of experimental blocks.
- ///
- ///This class manages multiple experimental blocks and determines how they
- ///are presented during the experiment (sequentially or randomly).
+ /// Represents the extrinsic parameters of a display.
///
- [System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.6.1.0 (Newtonsoft.Json v13.0.0.0)")]
- [System.ComponentModel.DescriptionAttribute("Structure defining the sequence and sampling of experimental blocks.\n\nThis class " +
- "manages multiple experimental blocks and determines how they\nare presented durin" +
- "g the experiment (sequentially or randomly).")]
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.9.0.0 (Newtonsoft.Json v13.0.0.0)")]
+ [System.ComponentModel.DescriptionAttribute("Represents the extrinsic parameters of a display.")]
[Bonsai.WorkflowElementCategoryAttribute(Bonsai.ElementCategory.Source)]
[Bonsai.CombinatorAttribute(MethodName="Generate")]
- public partial class BlockStructure
+ public partial class DisplayExtrinsics
{
- private System.Collections.Generic.List _blocks;
+ private Vector3 _rotation;
- private BlockStructureSamplingMode _samplingMode;
+ private Vector3 _translation;
- public BlockStructure()
+ public DisplayExtrinsics()
{
- _blocks = new System.Collections.Generic.List();
- _samplingMode = AindVrForagingDataSchema.BlockStructureSamplingMode.Sequential;
+ _rotation = new Vector3();
+ _translation = new Vector3();
}
- protected BlockStructure(BlockStructure other)
+ protected DisplayExtrinsics(DisplayExtrinsics other)
{
- _blocks = other._blocks;
- _samplingMode = other._samplingMode;
+ _rotation = other._rotation;
+ _translation = other._translation;
}
///
- /// Statistics of the environment
+ /// Rotation vector (radians)
///
[System.Xml.Serialization.XmlIgnoreAttribute()]
- [Newtonsoft.Json.JsonPropertyAttribute("blocks", Required=Newtonsoft.Json.Required.Always)]
- [System.ComponentModel.DescriptionAttribute("Statistics of the environment")]
- public System.Collections.Generic.List Blocks
+ [Newtonsoft.Json.JsonPropertyAttribute("rotation")]
+ [System.ComponentModel.DescriptionAttribute("Rotation vector (radians)")]
+ public Vector3 Rotation
{
get
{
- return _blocks;
+ return _rotation;
}
set
{
- _blocks = value;
+ _rotation = value;
}
}
///
- /// Sampling mode of the blocks.
+ /// Translation (in cm)
///
[System.Xml.Serialization.XmlIgnoreAttribute()]
- [Newtonsoft.Json.JsonPropertyAttribute("sampling_mode")]
- [System.ComponentModel.DescriptionAttribute("Sampling mode of the blocks.")]
- public BlockStructureSamplingMode SamplingMode
+ [Newtonsoft.Json.JsonPropertyAttribute("translation")]
+ [System.ComponentModel.DescriptionAttribute("Translation (in cm)")]
+ public Vector3 Translation
{
get
{
- return _samplingMode;
+ return _translation;
}
set
{
- _samplingMode = value;
+ _translation = value;
}
}
- public System.IObservable Generate()
+ public System.IObservable Generate()
{
- return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new BlockStructure(this)));
+ return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new DisplayExtrinsics(this)));
}
- public System.IObservable Generate(System.IObservable source)
+ public System.IObservable Generate(System.IObservable source)
{
- return System.Reactive.Linq.Observable.Select(source, _ => new BlockStructure(this));
+ return System.Reactive.Linq.Observable.Select(source, _ => new DisplayExtrinsics(this));
}
protected virtual bool PrintMembers(System.Text.StringBuilder stringBuilder)
{
- stringBuilder.Append("Blocks = " + _blocks + ", ");
- stringBuilder.Append("SamplingMode = " + _samplingMode);
+ stringBuilder.Append("Rotation = " + _rotation + ", ");
+ stringBuilder.Append("Translation = " + _translation);
return true;
}
@@ -3055,160 +2643,249 @@ public override string ToString()
}
- [System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.6.1.0 (Newtonsoft.Json v13.0.0.0)")]
+ ///
+ /// Represents the intrinsic parameters of a display.
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.9.0.0 (Newtonsoft.Json v13.0.0.0)")]
+ [System.ComponentModel.DescriptionAttribute("Represents the intrinsic parameters of a display.")]
[Bonsai.WorkflowElementCategoryAttribute(Bonsai.ElementCategory.Source)]
[Bonsai.CombinatorAttribute(MethodName="Generate")]
- public partial class CameraControllerSpinnakerCamera
+ public partial class DisplayIntrinsics
{
- private string _deviceType;
-
- private string _deviceName;
+ private int _frameWidth;
- private BaseModel _additionalSettings;
+ private int _frameHeight;
- private BaseModel _calibration;
+ private double _displayWidth;
- private System.Collections.Generic.Dictionary _cameras;
+ private double _displayHeight;
- private int? _frameRate;
+ public DisplayIntrinsics()
+ {
+ _frameWidth = 1920;
+ _frameHeight = 1080;
+ _displayWidth = 20D;
+ _displayHeight = 15D;
+ }
- public CameraControllerSpinnakerCamera()
+ protected DisplayIntrinsics(DisplayIntrinsics other)
{
- _deviceType = "CameraController";
- _cameras = new System.Collections.Generic.Dictionary();
+ _frameWidth = other._frameWidth;
+ _frameHeight = other._frameHeight;
+ _displayWidth = other._displayWidth;
+ _displayHeight = other._displayHeight;
}
- protected CameraControllerSpinnakerCamera(CameraControllerSpinnakerCamera other)
+ ///
+ /// Frame width (px)
+ ///
+ [Newtonsoft.Json.JsonPropertyAttribute("frame_width")]
+ [System.ComponentModel.DescriptionAttribute("Frame width (px)")]
+ public int FrameWidth
{
- _deviceType = other._deviceType;
- _deviceName = other._deviceName;
- _additionalSettings = other._additionalSettings;
- _calibration = other._calibration;
- _cameras = other._cameras;
- _frameRate = other._frameRate;
+ get
+ {
+ return _frameWidth;
+ }
+ set
+ {
+ _frameWidth = value;
+ }
}
- [Newtonsoft.Json.JsonPropertyAttribute("device_type")]
- public string DeviceType
+ ///
+ /// Frame height (px)
+ ///
+ [Newtonsoft.Json.JsonPropertyAttribute("frame_height")]
+ [System.ComponentModel.DescriptionAttribute("Frame height (px)")]
+ public int FrameHeight
{
get
{
- return _deviceType;
+ return _frameHeight;
}
set
{
- _deviceType = value;
+ _frameHeight = value;
}
}
///
- /// Device name
+ /// Display width (cm)
///
- [Newtonsoft.Json.JsonPropertyAttribute("device_name")]
- [System.ComponentModel.DescriptionAttribute("Device name")]
- public string DeviceName
+ [Newtonsoft.Json.JsonPropertyAttribute("display_width")]
+ [System.ComponentModel.DescriptionAttribute("Display width (cm)")]
+ public double DisplayWidth
{
get
{
- return _deviceName;
+ return _displayWidth;
}
set
{
- _deviceName = value;
+ _displayWidth = value;
}
}
///
- /// Additional settings
+ /// Display width (cm)
///
- [System.Xml.Serialization.XmlIgnoreAttribute()]
- [Newtonsoft.Json.JsonPropertyAttribute("additional_settings")]
- [System.ComponentModel.DescriptionAttribute("Additional settings")]
- public BaseModel AdditionalSettings
+ [Newtonsoft.Json.JsonPropertyAttribute("display_height")]
+ [System.ComponentModel.DescriptionAttribute("Display width (cm)")]
+ public double DisplayHeight
{
get
{
- return _additionalSettings;
+ return _displayHeight;
}
set
{
- _additionalSettings = value;
+ _displayHeight = value;
+ }
+ }
+
+ public System.IObservable Generate()
+ {
+ return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new DisplayIntrinsics(this)));
+ }
+
+ public System.IObservable Generate(System.IObservable source)
+ {
+ return System.Reactive.Linq.Observable.Select(source, _ => new DisplayIntrinsics(this));
+ }
+
+ protected virtual bool PrintMembers(System.Text.StringBuilder stringBuilder)
+ {
+ stringBuilder.Append("FrameWidth = " + _frameWidth + ", ");
+ stringBuilder.Append("FrameHeight = " + _frameHeight + ", ");
+ stringBuilder.Append("DisplayWidth = " + _displayWidth + ", ");
+ stringBuilder.Append("DisplayHeight = " + _displayHeight);
+ 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();
+ }
+ }
+
+
+ ///
+ /// Defines the statistical properties of the foraging environment.
+ ///
+ ///This class specifies the patches available in the environment, their transition
+ ///probabilities, and initial state occupancy. It forms the core specification
+ ///for the foraging environment structure.
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.9.0.0 (Newtonsoft.Json v13.0.0.0)")]
+ [System.ComponentModel.DescriptionAttribute(@"Defines the statistical properties of the foraging environment.
+
+ This class specifies the patches available in the environment, their transition
+ probabilities, and initial state occupancy. It forms the core specification
+ for the foraging environment structure.")]
+ [Bonsai.WorkflowElementCategoryAttribute(Bonsai.ElementCategory.Source)]
+ [Bonsai.CombinatorAttribute(MethodName="Generate")]
+ public partial class EnvironmentStatistics
+ {
+
+ private System.Collections.Generic.List _patches;
+
+ private System.Collections.Generic.List> _transitionMatrix;
+
+ private System.Collections.Generic.List _firstStateOccupancy;
+
+ public EnvironmentStatistics()
+ {
+ _patches = new System.Collections.Generic.List();
+ _transitionMatrix = new System.Collections.Generic.List>();
+ }
+
+ protected EnvironmentStatistics(EnvironmentStatistics other)
+ {
+ _patches = other._patches;
+ _transitionMatrix = other._transitionMatrix;
+ _firstStateOccupancy = other._firstStateOccupancy;
}
///
- /// Calibration
+ /// List of patches
///
[System.Xml.Serialization.XmlIgnoreAttribute()]
- [Newtonsoft.Json.JsonPropertyAttribute("calibration")]
- [System.ComponentModel.DescriptionAttribute("Calibration")]
- public BaseModel Calibration
+ [Newtonsoft.Json.JsonPropertyAttribute("patches")]
+ [System.ComponentModel.DescriptionAttribute("List of patches")]
+ public System.Collections.Generic.List Patches
{
get
{
- return _calibration;
+ return _patches;
}
set
{
- _calibration = value;
+ _patches = value;
}
}
///
- /// Cameras to be instantiated
+ /// Determines the transition probabilities between patches
///
[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("transition_matrix")]
+ [System.ComponentModel.DescriptionAttribute("Determines the transition probabilities between patches")]
+ public System.Collections.Generic.List> TransitionMatrix
{
get
{
- return _cameras;
+ return _transitionMatrix;
}
set
{
- _cameras = value;
+ _transitionMatrix = value;
}
}
///
- /// Frame rate of the trigger to all cameras
+ /// Determines the first state the animal will be in. If null, it will be randomly drawn.
///
[System.Xml.Serialization.XmlIgnoreAttribute()]
- [Newtonsoft.Json.JsonPropertyAttribute("frame_rate")]
- [System.ComponentModel.DescriptionAttribute("Frame rate of the trigger to all cameras")]
- public int? FrameRate
+ [Newtonsoft.Json.JsonPropertyAttribute("first_state_occupancy")]
+ [System.ComponentModel.DescriptionAttribute("Determines the first state the animal will be in. If null, it will be randomly dr" +
+ "awn.")]
+ public System.Collections.Generic.List FirstStateOccupancy
{
get
{
- return _frameRate;
+ return _firstStateOccupancy;
}
set
{
- _frameRate = value;
+ _firstStateOccupancy = value;
}
}
- public System.IObservable Generate()
+ public System.IObservable Generate()
{
- return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new CameraControllerSpinnakerCamera(this)));
+ return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new EnvironmentStatistics(this)));
}
- public System.IObservable Generate(System.IObservable source)
+ public System.IObservable Generate(System.IObservable source)
{
- return System.Reactive.Linq.Observable.Select(source, _ => new CameraControllerSpinnakerCamera(this));
+ return System.Reactive.Linq.Observable.Select(source, _ => new EnvironmentStatistics(this));
}
protected virtual bool PrintMembers(System.Text.StringBuilder stringBuilder)
{
- stringBuilder.Append("DeviceType = " + _deviceType + ", ");
- stringBuilder.Append("DeviceName = " + _deviceName + ", ");
- stringBuilder.Append("AdditionalSettings = " + _additionalSettings + ", ");
- stringBuilder.Append("Calibration = " + _calibration + ", ");
- stringBuilder.Append("Cameras = " + _cameras + ", ");
- stringBuilder.Append("FrameRate = " + _frameRate);
+ stringBuilder.Append("Patches = " + _patches + ", ");
+ stringBuilder.Append("TransitionMatrix = " + _transitionMatrix + ", ");
+ stringBuilder.Append("FirstStateOccupancy = " + _firstStateOccupancy);
return true;
}
@@ -3227,38 +2904,35 @@ public override string ToString()
}
- [System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.6.1.0 (Newtonsoft.Json v13.0.0.0)")]
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.9.0.0 (Newtonsoft.Json v13.0.0.0)")]
[Bonsai.WorkflowElementCategoryAttribute(Bonsai.ElementCategory.Source)]
[Bonsai.CombinatorAttribute(MethodName="Generate")]
- public partial class CameraControllerWebCamera
+ public partial class HarpAnalogInput
{
private string _deviceType;
- private string _deviceName;
-
- private BaseModel _additionalSettings;
-
private BaseModel _calibration;
- private System.Collections.Generic.Dictionary _cameras;
+ private int _whoAmI;
- private int? _frameRate;
+ private string _serialNumber;
- public CameraControllerWebCamera()
+ private string _portName;
+
+ public HarpAnalogInput()
{
- _deviceType = "CameraController";
- _cameras = new System.Collections.Generic.Dictionary();
+ _deviceType = "AnalogInput";
+ _whoAmI = 1236;
}
- protected CameraControllerWebCamera(CameraControllerWebCamera other)
+ protected HarpAnalogInput(HarpAnalogInput other)
{
_deviceType = other._deviceType;
- _deviceName = other._deviceName;
- _additionalSettings = other._additionalSettings;
_calibration = other._calibration;
- _cameras = other._cameras;
- _frameRate = other._frameRate;
+ _whoAmI = other._whoAmI;
+ _serialNumber = other._serialNumber;
+ _portName = other._portName;
}
[Newtonsoft.Json.JsonPropertyAttribute("device_type")]
@@ -3275,112 +2949,87 @@ public string DeviceType
}
///