SequenceTaskIncrementalDifficulty

class hive.implementation.sequence_task_inc_diff.SequenceTaskIncrementalDifficulty(action, trigger: Dict[str, Trigger])

Bases: AbstractSequenceTask

Protocol for Sequence Task with Incremental Difficulty.

In this protocol, we put an animal in 8-arms maze. Giving a random 4-length sequence, the animal needs to learning and remember this visiting sequence in order to get the food reward. At the beginning, we open the door the first 2 sequence (MODE open-selected), which is the beginning level of the difficulty, and the animal can free move to any arm (MODE start-any). The next expected correct arm is according to the sequence. Any arm the animal visited, no matter whether correct or not, will change the next expected arm (MODE without-correction). When the performance of the animal reach certain criteria, the difficulty will increase by opening the additional door.

Protocol conditions (mode)

  1. food-consist - the mount of food given do not change over all session.

  2. food-increase - the mount of food given increase when the animal visit the correct arm continuous.

Stopping conditions

  1. the animal visited over max_trials arms.

  2. the animal spent time_limit in the maze.

  3. the animal stay on a platform over timeout. In this case, the animal does not have enough motivation to explore the maze.

Measurement of how good the animal’s performance

  1. total successful visiting number over total visiting.

  2. continuous successful visiting over 12~15 times.

  3. extra mathematical analyze.

Use in config file

Task:
  mode : SequenceTaskIncrementalDifficulty
  options:
    max_trial: 250                 # (int) maximal number the animal can visit.
    time_out: 3600 # 1hr           # (int): maximal duration the task can perform.
    time_stay: 600 # 10 min        # (int): maximal duration the animal can stay on a platform.
    seq_start_diff: 2              # (int): start difficulty. (default 2)
    seq_inc_time: 600  # 10 min    # ('None' or int or list[int]): increase the difficulty when over the time spent.
                                   # use `None` to disable this feature.
    seq_inc_perf: 0.8              # (float or list[float]): increase the difficulty when the performance over the criteria
    seq_inc_window: 25             # (int): the at least number of trial for calculate the mean performance
    keyboard_shortcut: FDSAQWER    # (str): shortcut for detection of zone based on the sequence specified.

  trigger :
    - name: Keyboard
    - name: Timer
    - name: Server

Devices used

Door devices named in D1, index from 1 to 8, and Food_delivery devices named in F1, index from 1 to 8.

../_images/sequence_task_inc_diff.png

Attributes Summary

seq_inc_perf

increase the difficulty when the performance over the criteria

seq_inc_time

increase the difficulty when over the time spent

seq_inc_window

the at least number of trial for calculate the mean performance

seq_start_diff

start difficulty

Methods Summary

get_para([para])

get supported parameters (para is None) or parameter value

give_food(visit_arm, result)

invoked when the animal visit the arm.

new_seq_control()

Sequence task protocol with incremental difficulty protocol.

start_task()

invoked when the task start.

Attributes Documentation

seq_inc_perf

increase the difficulty when the performance over the criteria

seq_inc_time

increase the difficulty when over the time spent

seq_inc_window

the at least number of trial for calculate the mean performance

seq_start_diff

start difficulty

Methods Documentation

get_para(para: Optional[str] = None)

get supported parameters (para is None) or parameter value

give_food(visit_arm: int, result: IncDefSeqStepResult)

invoked when the animal visit the arm.

This function purpose to send commands to food/door devices.

Parameters
  • visit_arm – where the animal visiting

  • result – the result of this visiting

new_seq_control() SequenceControl

Sequence task protocol with incremental difficulty protocol.

The task difficulty (how many doors open) will increase when the animal’s performance reaches certain criteria.

start_task()

invoked when the task start. this function is used to reset the door/food control.