Example #1
0
        } /* onExperimentTrialBegin() */

        public virtual void onExperimentTrialEnd(object sender, ApollonEngine.EngineExperimentEventArgs arg)
        {
            // check if there is any trial left
            if (ApollonExperimentManager.Instance.Session.CurrentTrial == ApollonExperimentManager.Instance.Session.LastTrial)
            {
                // log
                UnityEngine.Debug.Log("<color=Blue>Info: </color> ApollonAbstractExperimentProfile.onExperimentTrialEnd() : final trial, session will exit ");

                // request end
                this._trial_requested_type = TrialType.End;
                this._trial_requested      = true;
            }
            else
            {
                // log
                UnityEngine.Debug.Log(
                    "<color=Blue>Info: </color> ApollonAbstractExperimentProfile.onExperimentTrialEnd() : there is stil trial to run, current: [ block:"
                    + ApollonExperimentManager.Instance.Session.currentBlockNum
                    + " / trial: "
                    + ApollonExperimentManager.Instance.Session.currentTrialNum
                    + " ]"
                    );

                // request next trial
                this._trial_requested_type = TrialType.Next;
                this._trial_requested      = true;
            } /* if() */
        }     /* onExperimentTrialEnd() */
Example #2
0
        } /* onExperimentSessionBegin() */

        public override async void onExperimentSessionEnd(object sender, ApollonEngine.EngineExperimentEventArgs arg)
        {
            // log
            UnityEngine.Debug.Log(
                "<color=Blue>Info: </color> ApollonAgencyAndThresholdPerceptionProfile.onExperimentSessionEnd() : begin"
                );

            // base call
            base.onExperimentSessionEnd(sender, arg);

            // deactivate all motion system command/sensor
            gameplay.ApollonGameplayManager.Instance.setInactive(
                gameplay.ApollonGameplayManager.GameplayIDType.MotionSystemSensor
                );
            gameplay.ApollonGameplayManager.Instance.setInactive(
                gameplay.ApollonGameplayManager.GameplayIDType.MotionSystemCommand
                );
            gameplay.ApollonGameplayManager.Instance.setInactive(
                gameplay.ApollonGameplayManager.GameplayIDType.VirtualMotionSystemCommand
                );

            // log
            UnityEngine.Debug.Log(
                "<color=Blue>Info: </color> ApollonAgencyAndThresholdPerceptionProfile.onExperimentSessionEnd() : end"
                );
        } /* onExperimentSessionEnd() */
        public override void onExperimentTrialBegin(object sender, ApollonEngine.EngineExperimentEventArgs arg)
        {
            UnityEngine.Debug.Log(
                "<color=blue>Info: </color> ApollonExperimentManager.onExperimentTrialBegin() : call"
                );

            this.Trial = arg.Trial;
        } /* onExperimentTrialBegin() */
        } /* onExperimentTrialBegin() */

        public override void onExperimentTrialEnd(object sender, ApollonEngine.EngineExperimentEventArgs arg)
        {
            UnityEngine.Debug.Log(
                "<color=blue>Info: </color> ApollonExperimentManager.onExperimentTrialEnd() : call"
                );

            // remove ref
            //this.Trial = null;
        }
        public override void onExperimentSessionBegin(object sender, ApollonEngine.EngineExperimentEventArgs arg)
        {
            // keep session alive
            this.Session = arg.Session;

            // switch to active profile
            switch (this.Session.settings.GetString("APOLLON_profile"))
            {
            // Agency And TBW
            case string param when param.Equals(
                    ApollonEngine.GetEnumDescription(ProfileIDType.AgencyAndTBW),
                    System.StringComparison.InvariantCultureIgnoreCase
                    ): {
                UnityEngine.Debug.Log(
                    "<color=blue>Info: </color> ApollonExperimentManager.onExperimentSessionBegin() : found APOLLON_profile setting value [AgencyAndTBW]"
                    );
                this.setActiveProfile(ProfileIDType.AgencyAndTBW);
                break;
            }

            // AgencyAndThresholdPerception
            case string param when param.Equals(
                    ApollonEngine.GetEnumDescription(ProfileIDType.AgencyAndThresholdPerception),
                    System.StringComparison.InvariantCultureIgnoreCase
                    ): {
                UnityEngine.Debug.Log(
                    "<color=blue>Info: </color> ApollonExperimentManager.onExperimentSessionBegin() : found APOLLON_profile setting value [AgencyAndThresholdPerception]"
                    );
                this.setActiveProfile(ProfileIDType.AgencyAndThresholdPerception);
                break;
            }

            // CAVIAR
            case string param when param.Equals(
                    ApollonEngine.GetEnumDescription(ProfileIDType.CAVIAR),
                    System.StringComparison.InvariantCultureIgnoreCase
                    ): {
                UnityEngine.Debug.Log(
                    "<color=blue>Info: </color> ApollonExperimentManager.onExperimentSessionBegin() : found APOLLON_profile setting value [CAVIAR]"
                    );
                this.setActiveProfile(ProfileIDType.CAVIAR);
                break;
            }

            default:
            {
                UnityEngine.Debug.LogError(
                    "<color=red>Error: </color> ApollonExperimentManager.onExperimentSessionBegin() : could not determine APOLLON_profile setting value... check configuration file"
                    );
                return;
            }
            } /* switch() */

            // call
            this.Profile.onExperimentSessionBegin(sender, arg);
        } /* onExperimentSessionBegin() */
        } /* onExperimentSessionEnd() */

        public override void onExperimentTrialBegin(object sender, ApollonEngine.EngineExperimentEventArgs arg)
        {
            // local
            int currentIdx = ApollonExperimentManager.Instance.Session.currentTrialNum - 1;

            // extract settings
            this._settings.bIsActive = ApollonExperimentManager.Instance.Session.settings.GetBoolList("active_mode")[currentIdx];
            this._settings.upstream_latency_offset        = ApollonExperimentManager.Instance.Session.settings.GetFloat("upstream_latency_offset");
            this._settings.acceleration_offset            = ApollonExperimentManager.Instance.Session.settings.GetFloat("acceleration_offset");
            this._settings.speed_initial                  = ApollonExperimentManager.Instance.Session.settings.GetFloat("speed_initial");
            this._settings.speed_saturation               = ApollonExperimentManager.Instance.Session.settings.GetFloat("speed_saturation");
            this._settings.acceleration_pattern_very_low  = ApollonExperimentManager.Instance.Session.settings.GetFloatList("acceleration_pattern_very_low")[currentIdx];
            this._settings.acceleration_pattern_low       = ApollonExperimentManager.Instance.Session.settings.GetFloatList("acceleration_pattern_low")[currentIdx];
            this._settings.acceleration_pattern_high      = ApollonExperimentManager.Instance.Session.settings.GetFloatList("acceleration_pattern_high")[currentIdx];
            this._settings.acceleration_pattern_very_high = ApollonExperimentManager.Instance.Session.settings.GetFloatList("acceleration_pattern_very_high")[currentIdx];
            this._settings.phase_timeout_A_latency        = ApollonExperimentManager.Instance.Session.settings.GetFloatList("phase_timeout_A_latency")[currentIdx];
            this._settings.phase_timeout_B0_latency       = ApollonExperimentManager.Instance.Session.settings.GetFloatList("phase_timeout_B0_latency")[currentIdx];
            this._settings.phase_timeout_B1_latency       = ApollonExperimentManager.Instance.Session.settings.GetFloatList("phase_timeout_B1_latency")[currentIdx];
            this._settings.phase_timeout_B2_latency       = ApollonExperimentManager.Instance.Session.settings.GetFloatList("phase_timeout_B2_latency")[currentIdx];
            this._settings.phase_timeout_C_SOA            = ApollonExperimentManager.Instance.Session.settings.GetFloatList("phase_timeout_C_SOA")[currentIdx];
            this._settings.phase_timeout_D_latency        = ApollonExperimentManager.Instance.Session.settings.GetFloatList("phase_timeout_D_latency")[currentIdx];
            this._settings.phase_timeout_E0_latency       = ApollonExperimentManager.Instance.Session.settings.GetFloatList("phase_timeout_E0_latency")[currentIdx];
            this._settings.phase_timeout_E1_latency       = ApollonExperimentManager.Instance.Session.settings.GetFloatList("phase_timeout_E1_latency")[currentIdx];
            this._settings.phase_timeout_E2_latency       = ApollonExperimentManager.Instance.Session.settings.GetFloatList("phase_timeout_E2_latency")[currentIdx];
            this._settings.acceleration_pattern_sequence  = ApollonExperimentManager.Instance.Session.settings.GetStringList("acceleration_pattern_sequence")[currentIdx];

            // log the
            UnityEngine.Debug.Log(
                "<color=Blue>Info: </color> ApollonAgencyAndTBWExperimentProfile.onExperimentTrialBegin() : found current settings trial..."
                + "\n - bIsActive : " + this._settings.bIsActive
                + "\n - upstream_latency_offset : " + this._settings.upstream_latency_offset.ToString()
                + "\n - acceleration_offset : " + this._settings.acceleration_offset
                + "\n - speed_initial : " + this._settings.speed_initial
                + "\n - speed_saturation : " + this._settings.speed_saturation
                + "\n - acceleration_pattern_very_low : " + this._settings.acceleration_pattern_very_low
                + "\n - acceleration_pattern_low : " + this._settings.acceleration_pattern_low
                + "\n - acceleration_pattern_high : " + this._settings.acceleration_pattern_high
                + "\n - acceleration_pattern_very_high : " + this._settings.acceleration_pattern_very_high
                + "\n - phase_timeout_A_latency : " + this._settings.phase_timeout_A_latency
                + "\n - phase_timeout_B0_latency : " + this._settings.phase_timeout_B0_latency
                + "\n - phase_timeout_B1_latency : " + this._settings.phase_timeout_B1_latency
                + "\n - phase_timeout_B2_latency : " + this._settings.phase_timeout_B2_latency
                + "\n - phase_timeout_C_SOA : " + this._settings.phase_timeout_C_SOA
                + "\n - phase_timeout_D_latency : " + this._settings.phase_timeout_D_latency
                + "\n - phase_timeout_E0_latency : " + this._settings.phase_timeout_E0_latency
                + "\n - phase_timeout_E1_latency : " + this._settings.phase_timeout_E1_latency
                + "\n - phase_timeout_E2_latency : " + this._settings.phase_timeout_E2_latency
                + "\n - acceleration_pattern_sequence : " + this._settings.acceleration_pattern_sequence
                );

            // base call
            base.onExperimentTrialBegin(sender, arg);

            // initial
            this.DoPhaseA();
        } /* onExperimentTrialBegin() */
Example #7
0
        }     /* onUpdate() */

        public virtual void onExperimentSessionBegin(object sender, ApollonEngine.EngineExperimentEventArgs arg)
        {
            // call config factories
            this.DoSessionConfiguration(arg.Session);

            // request
            this._trial_requested_type = TrialType.First;
            this._trial_requested      = true;

            // inactivate everything first
            frontend.ApollonFrontendManager.Instance.setInactive(frontend.ApollonFrontendManager.FrontendIDType.All);
            gameplay.ApollonGameplayManager.Instance.setInactive(gameplay.ApollonGameplayManager.GameplayIDType.All);
        } /* onExperimentSessionBegin() */
Example #8
0
        } /* onExperimentSessionBegin() */

        public virtual async void onExperimentSessionEnd(object sender, ApollonEngine.EngineExperimentEventArgs arg)
        {
            // inactivate all
            frontend.ApollonFrontendManager.Instance.setInactive(frontend.ApollonFrontendManager.FrontendIDType.All);
            gameplay.ApollonGameplayManager.Instance.setInactive(gameplay.ApollonGameplayManager.GameplayIDType.All);

            // log
            UnityEngine.Debug.Log(
                "<color=Blue>Info: </color> ApollonAbstractExperimentProfile.onExperimentSessionEnd() : definitive end ok"
                );

            // stop
#if UNITY_EDITOR
            UnityEditor.EditorApplication.ExitPlaymode();
#else
            UnityEngine.Application.Quit();
#endif
        } /* onExperimentSessionEnd() */
        } /* onExperimentTrialBegin() */

        public override void onExperimentTrialEnd(object sender, ApollonEngine.EngineExperimentEventArgs arg)
        {
            // // stop audio recording & save it
            // UnityEngine.Microphone.End(UnityEngine.Microphone.devices[0]);
            // common.ApollonWavRecorder recorder = new common.ApollonWavRecorder();
            // recorder.Save(
            //     ApollonExperimentManager.Instance.Session.FullPath
            //     + string.Format(
            //         "/{0}_{1}_T{2:000}.wav",
            //         "audioClip",
            //         "HTCViveMic",
            //         ApollonExperimentManager.Instance.Session.currentTrialNum
            //     ),
            //     this._results.user_clip
            // );

            // base call
            base.onExperimentTrialEnd(sender, arg);
        } /* onExperimentTrialEnd() */
Example #10
0
        } /* onUpdate() */

        public async override void onExperimentSessionBegin(object sender, ApollonEngine.EngineExperimentEventArgs arg)
        {
            // log
            UnityEngine.Debug.Log(
                "<color=Blue>Info: </color> ApollonAgencyAndThresholdPerceptionProfile.onExperimentSessionBegin() : begin"
                );

            // activate all motion system command/sensor
            gameplay.ApollonGameplayManager.Instance.setActive(
                gameplay.ApollonGameplayManager.GameplayIDType.MotionSystemCommand
                );
            gameplay.ApollonGameplayManager.Instance.setActive(
                gameplay.ApollonGameplayManager.GameplayIDType.MotionSystemSensor
                );
            gameplay.ApollonGameplayManager.Instance.setActive(
                gameplay.ApollonGameplayManager.GameplayIDType.VirtualMotionSystemCommand
                );

            // fade in
            await this.DoFadeIn(2500.0f, false);

            // deactivate default DB & activate room setup
            var we_behaviour
                = gameplay.ApollonGameplayManager.Instance.getBridge(
                      gameplay.ApollonGameplayManager.GameplayIDType.WorldElement
                      ).Behaviour as gameplay.element.ApollonWorldElementBehaviour;

            we_behaviour.References["DBTag_Default"].SetActive(false);
            we_behaviour.References["DBTag_Room"].SetActive(true);
            we_behaviour.References["DBTag_ExoFrontend"].SetActive(true);

            // base call
            base.onExperimentSessionBegin(sender, arg);

            // log
            UnityEngine.Debug.Log(
                "<color=Blue>Info: </color> ApollonAgencyAndThresholdPerceptionProfile.onExperimentSessionBegin() : end"
                );
        } /* onExperimentSessionBegin() */
Example #11
0
        } /* getCurrentCounterStatusInfo() */

        public async override void onExperimentSessionBegin(object sender, ApollonEngine.EngineExperimentEventArgs arg)
        {
            // log
            UnityEngine.Debug.Log(
                "<color=Blue>Info: </color> ApollonCAVIARProfile.onExperimentSessionBegin() : begin"
                );

            // fade in
            await this.DoFadeIn(2500.0f, false);

            // inactivate all gameplay & frontend
            gameplay.ApollonGameplayManager.Instance.setInactive(gameplay.ApollonGameplayManager.GameplayIDType.All);
            frontend.ApollonFrontendManager.Instance.setInactive(frontend.ApollonFrontendManager.FrontendIDType.All);

            // base call
            base.onExperimentSessionBegin(sender, arg);

            // log
            UnityEngine.Debug.Log(
                "<color=Blue>Info: </color> ApollonCAVIARProfile.onExperimentSessionBegin() : end"
                );
        } /* onExperimentSessionBegin() */
Example #12
0
        } /* onExperimentSessionEnd() */

        public override async void onExperimentTrialBegin(object sender, ApollonEngine.EngineExperimentEventArgs arg)
        {
            // log
            UnityEngine.Debug.Log(
                "<color=Blue>Info: </color> ApollonAgencyAndThresholdPerceptionProfile.onExperimentTrialBegin() : begin"
                );

            // // send event to motion system backend
            // (
            //     backend.ApollonBackendManager.Instance.GetValidHandle(
            //         backend.ApollonBackendManager.HandleIDType.ApollonMotionSystemPS6TM550Handle
            //     ) as backend.handle.ApollonMotionSystemPS6TM550Handle
            // ).BeginTrial();

            // local
            int currentIdx = ApollonExperimentManager.Instance.Session.currentTrialNum - 1;

            // activate the active seat entity
            gameplay.ApollonGameplayManager.Instance.setActive(gameplay.ApollonGameplayManager.GameplayIDType.ActiveSeatEntity);

            // inactivate all visual cues through LINQ request
            var we_behaviour
                = gameplay.ApollonGameplayManager.Instance.getBridge(
                      gameplay.ApollonGameplayManager.GameplayIDType.WorldElement
                      ).Behaviour as gameplay.element.ApollonWorldElementBehaviour;

            foreach (var vc_ref in we_behaviour.References.Where(kvp => kvp.Key.Contains("VCTag_")).Select(kvp => kvp.Value))
            {
                vc_ref.SetActive(false);
            }

            // current scenario
            switch (arg.Trial.settings.GetString("scenario_name"))
            {
            case "visual-only":
            {
                we_behaviour.References["VCTag_Fan"].SetActive(true);
                this.CurrentSettings.scenario_type = Settings.ScenarioIDType.VisualOnly;
                // transit to corresponding entity state
                (
                    gameplay.ApollonGameplayManager.Instance.getBridge(
                        gameplay.ApollonGameplayManager.GameplayIDType.ActiveSeatEntity
                        ) as gameplay.entity.ApollonActiveSeatEntityBridge
                ).Dispatcher.RaiseVisualOnly();
                break;
            }

            case "vestibular-only":
            {
                we_behaviour.References["VCTag_Spot"].SetActive(true);
                this.CurrentSettings.scenario_type = Settings.ScenarioIDType.VestibularOnly;
                // transit to corresponding entity state
                (
                    gameplay.ApollonGameplayManager.Instance.getBridge(
                        gameplay.ApollonGameplayManager.GameplayIDType.ActiveSeatEntity
                        ) as gameplay.entity.ApollonActiveSeatEntityBridge
                ).Dispatcher.RaiseVestibularOnly();
                break;
            }

            case "visuo-vestibular":
            {
                we_behaviour.References["VCTag_Fan"].SetActive(true);
                this.CurrentSettings.scenario_type = Settings.ScenarioIDType.VisuoVestibular;
                // transit to corresponding entity state
                (
                    gameplay.ApollonGameplayManager.Instance.getBridge(
                        gameplay.ApollonGameplayManager.GameplayIDType.ActiveSeatEntity
                        ) as gameplay.entity.ApollonActiveSeatEntityBridge
                ).Dispatcher.RaiseVisuoVestibular();
                break;
            }

            default:
            {
                this.CurrentSettings.scenario_type = Settings.ScenarioIDType.Undefined;
                break;
            }
            } /* switch() */

            // extract trial settings
            this.CurrentSettings.bIsTryCatch      = arg.Trial.settings.GetBool("is_catch_try_condition");
            this.CurrentSettings.bIsActive        = arg.Trial.settings.GetBool("is_active_condition");
            this.CurrentSettings.phase_A_duration = arg.Trial.settings.GetFloat("phase_A_duration_ms");
            this.CurrentSettings.phase_B_begin_stim_timeout_lower_bound = arg.Trial.settings.GetFloatList("phase_B_begin_stim_timeout_ms")[0];
            this.CurrentSettings.phase_B_begin_stim_timeout_upper_bound = arg.Trial.settings.GetFloatList("phase_B_begin_stim_timeout_ms")[1];
            this.CurrentSettings.phase_C_stim_duration  = arg.Trial.settings.GetFloat("phase_C_stim_duration_ms");
            this.CurrentSettings.phase_C_total_duration = arg.Trial.settings.GetFloat("phase_C_total_duration_ms");
            this.CurrentSettings.phase_C_angular_displacement_limiter          = arg.Trial.settings.GetFloatList("phase_C_angular_displacement_limiter_deg").ToArray();
            this.CurrentSettings.phase_C_angular_acceleration_target           = arg.Trial.settings.GetFloatList("phase_C_angular_acceleration_target_deg_per_s2").ToArray();
            this.CurrentSettings.phase_C_angular_velocity_saturation_threshold = arg.Trial.settings.GetFloatList("phase_C_angular_velocity_saturation_threshold_deg_per_s").ToArray();
            this.CurrentSettings.phase_C_angular_mandatory_axis               = arg.Trial.settings.GetBoolList("phase_C_angular_mandatory_axis").ToArray();
            this.CurrentSettings.phase_C_linear_displacement_limiter          = arg.Trial.settings.GetFloatList("phase_C_linear_displacement_limiter_m").ToArray();
            this.CurrentSettings.phase_C_linear_acceleration_target           = arg.Trial.settings.GetFloatList("phase_C_linear_acceleration_target_m_per_s2").ToArray();
            this.CurrentSettings.phase_C_linear_velocity_saturation_threshold = arg.Trial.settings.GetFloatList("phase_C_linear_velocity_saturation_threshold_m_per_s").ToArray();
            this.CurrentSettings.phase_C_linear_mandatory_axis = arg.Trial.settings.GetBoolList("phase_C_linear_mandatory_axis").ToArray();
            this.CurrentSettings.phase_D_duration = arg.Trial.settings.GetFloat("phase_D_duration_ms");

            // log
            UnityEngine.Debug.Log(
                "<color=Blue>Info: </color> ApollonAgencyAndThresholdPerceptionProfile.onExperimentTrialBegin() : found current settings with pattern["
                + arg.Trial.settings.GetString("current_pattern")
                + "]"
                + "\n - bIsTryCatch : " + this.CurrentSettings.bIsTryCatch
                + "\n - bIsActive : " + this.CurrentSettings.bIsActive
                + "\n - scenario_name : " + ApollonEngine.GetEnumDescription(this.CurrentSettings.scenario_type)
                + "\n - phase_A_duration : " + this.CurrentSettings.phase_A_duration
                + "\n - phase_B_begin_stim_timeout_lower_bound : " + this.CurrentSettings.phase_B_begin_stim_timeout_lower_bound
                + "\n - phase_B_begin_stim_timeout_upper_bound : " + this.CurrentSettings.phase_B_begin_stim_timeout_upper_bound
                + "\n - phase_C_stim_duration : " + this.CurrentSettings.phase_C_stim_duration
                + "\n - phase_C_total_duration : " + this.CurrentSettings.phase_C_total_duration
                + "\n - phase_C_angular_displacement_limiter : [" + System.String.Join(",", this.CurrentSettings.phase_C_angular_displacement_limiter) + "]"
                + "\n - phase_C_angular_acceleration_target : [" + System.String.Join(",", this.CurrentSettings.phase_C_angular_acceleration_target) + "]"
                + "\n - phase_C_angular_velocity_saturation_threshold : [" + System.String.Join(",", this.CurrentSettings.phase_C_angular_velocity_saturation_threshold) + "]"
                + "\n - phase_C_angular_mandatory_axis : [" + System.String.Join(",", this.CurrentSettings.phase_C_angular_mandatory_axis) + "]"
                + "\n - phase_C_linear_displacement_limiter : [" + System.String.Join(",", this.CurrentSettings.phase_C_linear_displacement_limiter) + "]"
                + "\n - phase_C_linear_acceleration_target : [" + System.String.Join(",", this.CurrentSettings.phase_C_linear_acceleration_target) + "]"
                + "\n - phase_C_linear_velocity_saturation_threshold : [" + System.String.Join(",", this.CurrentSettings.phase_C_linear_velocity_saturation_threshold) + "]"
                + "\n - phase_C_linear_mandatory_axis : [" + System.String.Join(",", this.CurrentSettings.phase_C_linear_mandatory_axis) + "]"
                + "\n - phase_D_duration : " + this.CurrentSettings.phase_D_duration
                );

            // activate world element & contriol system
            gameplay.ApollonGameplayManager.Instance.setActive(gameplay.ApollonGameplayManager.GameplayIDType.WorldElement);
            gameplay.ApollonGameplayManager.Instance.setActive(gameplay.ApollonGameplayManager.GameplayIDType.AgencyAndThresholdPerceptionControl);

            // base call
            base.onExperimentTrialBegin(sender, arg);

            // fade out
            await this.DoFadeOut(this._trial_fade_out_duration, false);

            // log
            UnityEngine.Debug.Log(
                "<color=Blue>Info: </color> ApollonAgencyAndThresholdPerceptionProfile.onExperimentTrialBegin() : end " + UnityEngine.Time.fixedTime
                );

            // build protocol
            await this.DoRunProtocol(
                async() => { await this.SetState(new phase.ApollonAgencyAndThresholdPerceptionPhase0(this)); },
                async() => { await this.SetState(new phase.ApollonAgencyAndThresholdPerceptionPhaseA(this)); },
                async() => { await this.SetState(new phase.ApollonAgencyAndThresholdPerceptionPhaseB(this)); },
                async() => { await this.SetState(new phase.ApollonAgencyAndThresholdPerceptionPhaseC(this)); },
                async() => { await this.SetState(new phase.ApollonAgencyAndThresholdPerceptionPhaseD(this)); },
                async() => { await this.SetState(null); }
                );
        } /* onExperimentTrialBegin() */
Example #13
0
        } /* onExperimentSessionEnd() */

        public virtual void onExperimentTrialBegin(object sender, ApollonEngine.EngineExperimentEventArgs arg)
        {
        } /* onExperimentTrialBegin() */
        } /* onExperimentSessionBegin() */

        public override void onExperimentSessionEnd(object sender, ApollonEngine.EngineExperimentEventArgs arg)
        {
            // base call
            base.onExperimentSessionEnd(sender, arg);
        } /* onExperimentSessionEnd() */
Example #15
0
        } /* onExperimentSessionBegin() */

        public override async void onExperimentTrialBegin(object sender, ApollonEngine.EngineExperimentEventArgs arg)
        {
            // log
            UnityEngine.Debug.Log(
                "<color=Blue>Info: </color> ApollonCAVIARProfile.onExperimentTrialBegin() : begin"
                );

            // temporary string
            string log = "";

            // extract current settings
            this.CurrentSettings.phase_B_distance = arg.Trial.settings.GetFloat("phase_B_distance_meter");
            this.CurrentSettings.phase_D_distance = arg.Trial.settings.GetFloat("phase_D_distance_meter");
            this.CurrentSettings.phase_E_distance = arg.Trial.settings.GetFloat("phase_E_distance_meter");
            this.CurrentSettings.phase_F_duration = arg.Trial.settings.GetFloat("phase_F_duration_ms");

            // log
            log += "\n - phase_B_distance : " + this.CurrentSettings.phase_B_distance
                   + "\n - phase_D_distance : " + this.CurrentSettings.phase_D_distance
                   + "\n - phase_E_distance : " + this.CurrentSettings.phase_E_distance
                   + "\n - phase_F_duration : " + this.CurrentSettings.phase_F_duration;

            // clean arrays
            this.CurrentSettings.phase_C_settings.Clear();
            this.CurrentResults.phase_C_results.Clear();
            this.CurrentResults.phase_D_results.Clear();

            // instantiate loopable phase ([C -> D] -> [C -> D] -> ...)
            for (ushort idx = 0; idx < ApollonCAVIARProfile.InternalPhaseLoopCount; ++idx)
            {
                // get current visual cue identifier
                var cue_list = new System.Collections.Generic.List <Settings.VisualCueIDType>();
                foreach (var cue in arg.Trial.settings.GetStringList("phase_C" + idx + "_visual_cue_type_string"))
                {
                    switch (cue)
                    {
                    // 3D object - cube
                    case string param when param.Equals(
                            ApollonEngine.GetEnumDescription(Settings.VisualCueIDType.VC3DCube),
                            System.StringComparison.InvariantCultureIgnoreCase
                            ): {
                        cue_list.Add(Settings.VisualCueIDType.VC3DCube);
                        break;
                    }

                    // 3D object - tetrahedre
                    case string param when param.Equals(
                            ApollonEngine.GetEnumDescription(Settings.VisualCueIDType.VC3DTetrahedre),
                            System.StringComparison.InvariantCultureIgnoreCase
                            ): {
                        cue_list.Add(Settings.VisualCueIDType.VC3DTetrahedre);
                        break;
                    }

                    // 3D object - default
                    case string param when param.Equals(
                            ApollonEngine.GetEnumDescription(Settings.VisualCueIDType.VC3D),
                            System.StringComparison.InvariantCultureIgnoreCase
                            ): {
                        cue_list.Add(Settings.VisualCueIDType.VC3D);
                        break;
                    }

                    // 2D object - grid
                    case string param when param.Equals(
                            ApollonEngine.GetEnumDescription(Settings.VisualCueIDType.VC2DGrid),
                            System.StringComparison.InvariantCultureIgnoreCase
                            ): {
                        cue_list.Add(Settings.VisualCueIDType.VC2DGrid);
                        break;
                    }

                    // 2D object - circle
                    case string param when param.Equals(
                            ApollonEngine.GetEnumDescription(Settings.VisualCueIDType.VC2DCircle),
                            System.StringComparison.InvariantCultureIgnoreCase
                            ): {
                        cue_list.Add(Settings.VisualCueIDType.VC2DCircle);
                        break;
                    }


                    // 2D object - square
                    case string param when param.Equals(
                            ApollonEngine.GetEnumDescription(Settings.VisualCueIDType.VC2DSquare),
                            System.StringComparison.InvariantCultureIgnoreCase
                            ): {
                        cue_list.Add(Settings.VisualCueIDType.VC2DSquare);
                        break;
                    }

                    // 2D object - default
                    case string param when param.Equals(
                            ApollonEngine.GetEnumDescription(Settings.VisualCueIDType.VC2D),
                            System.StringComparison.InvariantCultureIgnoreCase
                            ): {
                        cue_list.Add(Settings.VisualCueIDType.VC2D);
                        break;
                    }

                    // Controle
                    case string param when param.Equals(
                            ApollonEngine.GetEnumDescription(Settings.VisualCueIDType.Control),
                            System.StringComparison.InvariantCultureIgnoreCase
                            ): {
                        cue_list.Add(Settings.VisualCueIDType.Control);
                        break;
                    }

                    // Controle
                    case string param when param.Equals(
                            ApollonEngine.GetEnumDescription(Settings.VisualCueIDType.VCHUDRadiosonde),
                            System.StringComparison.InvariantCultureIgnoreCase
                            ): {
                        cue_list.Add(Settings.VisualCueIDType.VCHUDRadiosonde);
                        break;
                    }

                    default:
                    {
                        // log error
                        UnityEngine.Debug.LogError(
                            "<color=Red>Error: </color> ApollonCAVIARProfile.onExperimentTrialBegin() : found invalid string value["
                            + cue
                            + "] for setting["
                            + "phase_C" + idx + "_visual_cue_type_string"
                            + "]"
                            );
                        break;
                    }
                    } /* switch() */
                }     /* foreach() */

                // instantiate settings & result
                this.CurrentSettings.phase_C_settings.Add(
                    new Settings.PhaseCSettings()
                {
                    visual_cue_type     = cue_list,
                    total_distance      = arg.Trial.settings.GetFloat("phase_C" + idx + "_total_distance_meter"),
                    target_velocity     = arg.Trial.settings.GetFloat("phase_C" + idx + "_target_velocity_meter_per_s"),
                    stim_begin_distance = arg.Trial.settings.GetFloat("phase_C" + idx + "_stim_begin_distance_meter"),
                    stim_acceleration   = arg.Trial.settings.GetFloat("phase_C" + idx + "_stim_acceleration_meter_per_s2"),
                    stim_velocity       = arg.Trial.settings.GetFloat("phase_C" + idx + "_stim_velocity_meter_per_s"),
                    fog_start_distance  = arg.Trial.settings.GetFloat("phase_C" + idx + "_fog_start_distance_meter"),
                    fog_end_distance    = arg.Trial.settings.GetFloat("phase_C" + idx + "_fog_end_distance_meter")
                }
                    );
                this.CurrentResults.phase_C_results.Add(new Results.PhaseCResults());
                this.CurrentResults.phase_D_results.Add(new Results.PhaseDResults());

                // log
                log += "\n - [C" + idx + "] visual_cue_type : " + string.Join(
                    ",",
                    this.CurrentSettings.phase_C_settings[idx].visual_cue_type.ConvertAll(
                        new System.Converter <Settings.VisualCueIDType, string>(ApollonEngine.GetEnumDescription)
                        )
                    )
                       + "\n - [C" + idx + "] total_distance : " + this.CurrentSettings.phase_C_settings[idx].total_distance
                       + "\n - [C" + idx + "] target_velocity : " + this.CurrentSettings.phase_C_settings[idx].target_velocity
                       + "\n - [C" + idx + "] stim_begin_distance : " + this.CurrentSettings.phase_C_settings[idx].stim_begin_distance
                       + "\n - [C" + idx + "] stim_acceleration : " + this.CurrentSettings.phase_C_settings[idx].stim_acceleration
                       + "\n - [C" + idx + "] stim_velocity : " + this.CurrentSettings.phase_C_settings[idx].stim_velocity
                       + "\n - [C" + idx + "] fog_start_distance : " + this.CurrentSettings.phase_C_settings[idx].fog_start_distance
                       + "\n - [C" + idx + "] fog_end_distance : " + this.CurrentSettings.phase_C_settings[idx].fog_end_distance;
            } /* for() */

            // pop last phase_D_results item
            this.CurrentResults.phase_D_results.RemoveAt(this.CurrentResults.phase_D_results.Count - 1);

            // log the final result
            UnityEngine.Debug.Log(
                "<color=Blue>Info: </color> ApollonCAVIARProfile.onExperimentTrialBegin() : found current settings "
                + log
                );

            // write the randomized pattern as result for convenience
            arg.Trial.result["pattern"] = arg.Trial.settings.GetString("current_pattern");

            // activate world, CAVIAR entity, Radiosonde sensor, HOTAS Throttle
            gameplay.ApollonGameplayManager.Instance.setActive(gameplay.ApollonGameplayManager.GameplayIDType.WorldElement);
            gameplay.ApollonGameplayManager.Instance.setActive(gameplay.ApollonGameplayManager.GameplayIDType.FogElement);

            // activate current database
            var db_str                = arg.Trial.settings.GetString("database_name");
            var db_origin_position    = arg.Trial.settings.GetFloatList("database_origin_position");
            var db_origin_orientation = arg.Trial.settings.GetFloatList("database_origin_orientation");

            // log
            UnityEngine.Debug.Log(
                "<color=Blue>Info: </color> ApollonCAVIARProfile.onExperimentTrialBegin() : found settings database name ["
                + db_str
                + "], try finding the only associated game object tag"
                );

            // get bridge
            var we_behaviour
                = gameplay.ApollonGameplayManager.Instance.getBridge(
                      gameplay.ApollonGameplayManager.GameplayIDType.WorldElement
                      ).Behaviour as gameplay.element.ApollonWorldElementBehaviour;

            // LINQ
            foreach (var db_ref in we_behaviour.References.Where(kvp => kvp.Key.Contains("DBTag_")).Select(kvp => kvp.Value))
            {
                // log
                UnityEngine.Debug.Log(
                    "<color=Blue>Info: </color> ApollonCAVIARProfile.onExperimentTrialBegin() : referenced gameObject[" + db_ref.name + "], inactivating"
                    );

                // inactivate all first
                db_ref.SetActive(false);
            }

            // then activate only requested
            if (we_behaviour.References[db_str] != null)
            {
                // log
                UnityEngine.Debug.Log(
                    "<color=Blue>Info: </color> ApollonCAVIARProfile.onExperimentTrialBegin() : found game object, activating"
                    );

                // mark as active
                we_behaviour.References[db_str].SetActive(true);

                // translate to our new origin
                we_behaviour.References[db_str].transform.Translate(
                    -1.0f * new UnityEngine.Vector3(
                        db_origin_position[0],
                        db_origin_position[1],
                        db_origin_position[2]
                        )
                    );

                // apply rotation from our new world space origin
                we_behaviour.References[db_str].transform.Rotate(
                    new UnityEngine.Vector3(
                        db_origin_orientation[0],
                        db_origin_orientation[1],
                        db_origin_orientation[2]
                        ),
                    UnityEngine.Space.World
                    );
            }
            else
            {
                // log
                UnityEngine.Debug.LogError(
                    "<color=Red>Error: </color> ApollonCAVIARProfile.onExperimentTrialBegin() : could not find requested game object by name, error..."
                    );
            } /* if() */

            // finally activate raycasting element
            gameplay.ApollonGameplayManager.Instance.setActive(gameplay.ApollonGameplayManager.GameplayIDType.CAVIAREntity);
            gameplay.ApollonGameplayManager.Instance.setActive(gameplay.ApollonGameplayManager.GameplayIDType.RadioSondeSensor);
            gameplay.ApollonGameplayManager.Instance.setActive(gameplay.ApollonGameplayManager.GameplayIDType.CAVIARControl);

            // base call
            base.onExperimentTrialBegin(sender, arg);

            // fade out
            await this.DoFadeOut(this._trial_fade_out_duration, false);

            // log
            UnityEngine.Debug.Log(
                "<color=Blue>Info: </color> ApollonCAVIARProfile.onExperimentTrialBegin() : end"
                );

            // build protocol
            await this.DoRunProtocol(
                async() => { await this.SetState(new phase.ApollonCAVIARPhaseA(this)); },
                async() => { await this.SetState(new phase.ApollonCAVIARPhaseB(this)); },
                async() => { await this.SetState(new phase.ApollonCAVIARPhaseC(this, 0)); },
                async() => { await this.SetState(new phase.ApollonCAVIARPhaseD(this, 0, 1)); },
                async() => { await this.SetState(new phase.ApollonCAVIARPhaseC(this, 1)); },
                async() => { await this.SetState(new phase.ApollonCAVIARPhaseD(this, 1, 2)); },
                async() => { await this.SetState(new phase.ApollonCAVIARPhaseC(this, 2)); },
                async() => { await this.SetState(new phase.ApollonCAVIARPhaseD(this, 2, 3)); },
                async() => { await this.SetState(new phase.ApollonCAVIARPhaseC(this, 3)); },
                async() => { await this.SetState(new phase.ApollonCAVIARPhaseE(this)); },
                async() => { await this.SetState(new phase.ApollonCAVIARPhaseF(this)); },
                async() => { await this.SetState(null); }
                );
        } /* onExperimentTrialBegin() */
Example #16
0
        } /* onExperimentTrialBegin() */

        public override async void onExperimentTrialEnd(object sender, ApollonEngine.EngineExperimentEventArgs arg)
        {
            // log
            UnityEngine.Debug.Log(
                "<color=Blue>Info: </color> ApollonCAVIARProfile.onExperimentTrialEnd() : begin"
                );

            // write result

            // phase A
            ApollonExperimentManager.Instance.Trial.result["A_timing_on_entry_unity_timestamp"]
                = this.CurrentResults.phase_A_results.timing_on_entry_unity_timestamp.ToString();
            ApollonExperimentManager.Instance.Trial.result["A_timing_on_exit_unity_timestamp"]
                = this.CurrentResults.phase_A_results.timing_on_exit_unity_timestamp.ToString();
            ApollonExperimentManager.Instance.Trial.result["A_timing_on_entry_host_timestamp"]
                = this.CurrentResults.phase_A_results.timing_on_entry_host_timestamp;
            ApollonExperimentManager.Instance.Trial.result["A_timing_on_exit_host_timestamp"]
                = this.CurrentResults.phase_A_results.timing_on_exit_host_timestamp;

            // phase B
            ApollonExperimentManager.Instance.Trial.result["B_timing_on_entry_unity_timestamp"]
                = this.CurrentResults.phase_B_results.timing_on_entry_unity_timestamp.ToString();
            ApollonExperimentManager.Instance.Trial.result["B_timing_on_exit_unity_timestamp"]
                = this.CurrentResults.phase_B_results.timing_on_exit_unity_timestamp.ToString();
            ApollonExperimentManager.Instance.Trial.result["B_timing_on_entry_host_timestamp"]
                = this.CurrentResults.phase_B_results.timing_on_entry_host_timestamp;
            ApollonExperimentManager.Instance.Trial.result["B_timing_on_exit_host_timestamp"]
                = this.CurrentResults.phase_B_results.timing_on_exit_host_timestamp;

            // phase C
            for (ushort idx = 0; idx < ApollonCAVIARProfile.InternalPhaseLoopCount; ++idx)
            {
                ApollonExperimentManager.Instance.Trial.result["C" + idx + "_timing_on_entry_unity_timestamp"]
                    = this.CurrentResults.phase_C_results[idx].timing_on_entry_unity_timestamp.ToString();
                ApollonExperimentManager.Instance.Trial.result["C" + idx + "_timing_on_exit_unity_timestamp"]
                    = this.CurrentResults.phase_C_results[idx].timing_on_exit_unity_timestamp.ToString();
                ApollonExperimentManager.Instance.Trial.result["C" + idx + "_timing_on_entry_host_timestamp"]
                    = this.CurrentResults.phase_C_results[idx].timing_on_entry_host_timestamp;
                ApollonExperimentManager.Instance.Trial.result["C" + idx + "_timing_on_exit_host_timestamp"]
                    = this.CurrentResults.phase_C_results[idx].timing_on_exit_host_timestamp;
                ApollonExperimentManager.Instance.Trial.result["C" + idx + "_user_response"]
                    = this.CurrentResults.phase_C_results[idx].user_response.ToString();
                ApollonExperimentManager.Instance.Trial.result["C" + idx + "_user_stim_distance"]
                    = this.CurrentResults.phase_C_results[idx].user_stim_distance.ToString();
                ApollonExperimentManager.Instance.Trial.result["C" + idx + "_user_stim_host_timestamp"]
                    = this.CurrentResults.phase_C_results[idx].user_stim_host_timestamp;
                ApollonExperimentManager.Instance.Trial.result["C" + idx + "_user_stim_unity_timestamp"]
                    = this.CurrentResults.phase_C_results[idx].user_stim_unity_timestamp.ToString();
                ApollonExperimentManager.Instance.Trial.result["C" + idx + "_user_perception_distance"]
                    = string.Join(
                          ";",
                          this.CurrentResults.phase_C_results[idx].user_perception_distance
                          );
                ApollonExperimentManager.Instance.Trial.result["C" + idx + "_user_perception_host_timestamp"]
                    = string.Join(
                          ";",
                          this.CurrentResults.phase_C_results[idx].user_perception_host_timestamp
                          );
                ApollonExperimentManager.Instance.Trial.result["C" + idx + "_user_perception_unity_timestamp"]
                    = string.Join(
                          ";",
                          this.CurrentResults.phase_C_results[idx].user_perception_unity_timestamp
                          );
            } /* for() */

            // phase D
            for (ushort idx = 0; idx < ApollonCAVIARProfile.InternalPhaseLoopCount - 1; ++idx)
            {
                ApollonExperimentManager.Instance.Trial.result["D" + idx + (idx + 1) + "_timing_on_entry_unity_timestamp"]
                    = this.CurrentResults.phase_D_results[idx].timing_on_entry_unity_timestamp.ToString();
                ApollonExperimentManager.Instance.Trial.result["D" + idx + (idx + 1) + "_timing_on_exit_unity_timestamp"]
                    = this.CurrentResults.phase_D_results[idx].timing_on_exit_unity_timestamp.ToString();
                ApollonExperimentManager.Instance.Trial.result["D" + idx + (idx + 1) + "_timing_on_entry_host_timestamp"]
                    = this.CurrentResults.phase_D_results[idx].timing_on_entry_host_timestamp;
                ApollonExperimentManager.Instance.Trial.result["D" + idx + (idx + 1) + "_timing_on_exit_host_timestamp"]
                    = this.CurrentResults.phase_D_results[idx].timing_on_exit_host_timestamp;
                ApollonExperimentManager.Instance.Trial.result["D" + idx + (idx + 1) + "_user_response"]
                    = this.CurrentResults.phase_D_results[idx].user_response.ToString();
                ApollonExperimentManager.Instance.Trial.result["D" + idx + (idx + 1) + "_user_perception_distance"]
                    = string.Join(
                          ";",
                          this.CurrentResults.phase_D_results[idx].user_perception_distance
                          );
                ApollonExperimentManager.Instance.Trial.result["D" + idx + (idx + 1) + "_user_perception_host_timestamp"]
                    = string.Join(
                          ";",
                          this.CurrentResults.phase_D_results[idx].user_perception_host_timestamp
                          );
                ApollonExperimentManager.Instance.Trial.result["D" + idx + (idx + 1) + "_user_perception_unity_timestamp"]
                    = string.Join(
                          ";",
                          this.CurrentResults.phase_D_results[idx].user_perception_unity_timestamp
                          );
            } /* for() */

            // phase E
            ApollonExperimentManager.Instance.Trial.result["E_timing_on_entry_unity_timestamp"]
                = this.CurrentResults.phase_E_results.timing_on_entry_unity_timestamp.ToString();
            ApollonExperimentManager.Instance.Trial.result["E_timing_on_exit_unity_timestamp"]
                = this.CurrentResults.phase_E_results.timing_on_exit_unity_timestamp.ToString();
            ApollonExperimentManager.Instance.Trial.result["E_timing_on_entry_host_timestamp"]
                = this.CurrentResults.phase_E_results.timing_on_entry_host_timestamp;
            ApollonExperimentManager.Instance.Trial.result["E_timing_on_exit_host_timestamp"]
                = this.CurrentResults.phase_E_results.timing_on_exit_host_timestamp;

            // phase F
            ApollonExperimentManager.Instance.Trial.result["F_timing_on_entry_unity_timestamp"]
                = this.CurrentResults.phase_F_results.timing_on_entry_unity_timestamp.ToString();
            ApollonExperimentManager.Instance.Trial.result["F_timing_on_exit_unity_timestamp"]
                = this.CurrentResults.phase_F_results.timing_on_exit_unity_timestamp.ToString();
            ApollonExperimentManager.Instance.Trial.result["F_timing_on_entry_host_timestamp"]
                = this.CurrentResults.phase_F_results.timing_on_entry_host_timestamp;
            ApollonExperimentManager.Instance.Trial.result["F_timing_on_exit_host_timestamp"]
                = this.CurrentResults.phase_F_results.timing_on_exit_host_timestamp;

            // fade in
            await this.DoFadeIn(this._trial_fade_in_duration, false);

            // inactivate gameplay & frontend
            gameplay.ApollonGameplayManager.Instance.setInactive(gameplay.ApollonGameplayManager.GameplayIDType.All);
            frontend.ApollonFrontendManager.Instance.setInactive(frontend.ApollonFrontendManager.FrontendIDType.All);

            // base call
            base.onExperimentTrialEnd(sender, arg);

            // log
            UnityEngine.Debug.Log(
                "<color=Blue>Info: </color> ApollonCAVIARProfile.onExperimentTrialEnd() : end"
                );
        } /* onExperimentTrialEnd() */
Example #17
0
 public virtual void onExperimentTrialEnd(object sender, ApollonEngine.EngineExperimentEventArgs arg)
 {
     /* nothing by default */
 }
Example #18
0
 public virtual void onExperimentSessionBegin(object sender, ApollonEngine.EngineExperimentEventArgs arg)
 {
     /* nothing by default */
 }
Example #19
0
        } /* onExperimentTrialBegin() */

        public override async void onExperimentTrialEnd(object sender, ApollonEngine.EngineExperimentEventArgs arg)
        {
            // log
            UnityEngine.Debug.Log(
                "<color=Blue>Info: </color> ApollonAgencyAndThresholdPerceptionProfile.onExperimentTrialEnd() : begin"
                );

            // write the randomized scenario/pattern/conditions(s) as result for convenience
            ApollonExperimentManager.Instance.Trial.result["scenario"]            = ApollonEngine.GetEnumDescription(this.CurrentSettings.scenario_type);
            ApollonExperimentManager.Instance.Trial.result["pattern"]             = ApollonExperimentManager.Instance.Trial.settings.GetString("current_pattern");
            ApollonExperimentManager.Instance.Trial.result["active_condition"]    = this.CurrentSettings.bIsActive.ToString();
            ApollonExperimentManager.Instance.Trial.result["catch_try_condition"] = this.CurrentSettings.bIsTryCatch.ToString();

            // write result
            ApollonExperimentManager.Instance.Trial.result["user_command"]                      = this.CurrentResults.user_command;
            ApollonExperimentManager.Instance.Trial.result["user_stim_host_timestamp"]          = this.CurrentResults.user_stim_host_timestamp;
            ApollonExperimentManager.Instance.Trial.result["user_stim_unity_timestamp"]         = this.CurrentResults.user_stim_unity_timestamp;
            ApollonExperimentManager.Instance.Trial.result["user_response_B"]                   = this.CurrentResults.user_response_B;
            ApollonExperimentManager.Instance.Trial.result["user_perception_B_host_timestamp"]  = this.CurrentResults.user_perception_B_host_timestamp;
            ApollonExperimentManager.Instance.Trial.result["user_perception_B_unity_timestamp"] = this.CurrentResults.user_perception_B_unity_timestamp;
            ApollonExperimentManager.Instance.Trial.result["user_response_C"]                   = this.CurrentResults.user_response_C;
            ApollonExperimentManager.Instance.Trial.result["user_perception_C_host_timestamp"]  = this.CurrentResults.user_perception_C_host_timestamp;
            ApollonExperimentManager.Instance.Trial.result["user_perception_C_unity_timestamp"] = this.CurrentResults.user_perception_C_unity_timestamp;

            // fade in
            await this.DoFadeIn(this._trial_fade_in_duration, false);

            // // send event to motion system backend
            // (
            //     backend.ApollonBackendManager.Instance.GetValidHandle(
            //         backend.ApollonBackendManager.HandleIDType.ApollonMotionSystemPS6TM550Handle
            //     ) as backend.handle.ApollonMotionSystemPS6TM550Handle
            // ).EndTrial();

            // get active seat bridge
            gameplay.entity.ApollonActiveSeatEntityBridge seat_bridge
                = gameplay.ApollonGameplayManager.Instance.getBridge(
                      gameplay.ApollonGameplayManager.GameplayIDType.ActiveSeatEntity
                      ) as gameplay.entity.ApollonActiveSeatEntityBridge;

            // check
            if (seat_bridge == null)
            {
                // log
                UnityEngine.Debug.LogError(
                    "<color=Red>Error: </color> ApollonAgencyAndThresholdPerceptionProfile.onExperimentTrialEnd() : Could not find corresponding gameplay bridge !"
                    );

                // fail
                return;
            } /* if() */

            // get back to idle state
            seat_bridge.Dispatcher.RaiseIdle();

            // base call
            base.onExperimentTrialEnd(sender, arg);

            // log
            UnityEngine.Debug.Log(
                "<color=Blue>Info: </color> ApollonAgencyAndThresholdPerceptionProfile.onExperimentTrialEnd() : end"
                );
        } /* onExperimentTrialEnd() */