sharpie.webserver.data.models

Classes

Episode(*args, **kwargs)

A complete sequence of interactions between a set of agents, and their environment—from an initial state to a terminal or truncated state—representing one coherent task of decision-making cycle.

Record(*args, **kwargs)

A single entry within that captures the state of the environment, an agent’s (human or artificial) actions or other outputs, the resulting outcomes or rewards, and any relevant contextual information at a specific point during a trial.

Session(*args, **kwargs)

The run of a single participant or group of participants through an experiment.

class sharpie.webserver.data.models.Session(*args, **kwargs)

The run of a single participant or group of participants through an experiment. Consists of one or more episodes.

Parameters:
  • id (BigAutoField) – Primary key: ID

  • room (CharField) – Room

  • connected_participants (IntegerField) – Connected participants

  • start_time (DateTimeField) – Start time

  • end_time (DateTimeField) – End time

  • status (CharField) – Status

  • metadata (JSONField) – Metadata

Relationship fields:

Parameters:

Reverse relationships:

Parameters:
  • runner (Reverse ForeignKey from Runner) – All runners of this session (related name of session)

  • episodes (Reverse ForeignKey from Episode) – All episodes of this session (related name of session)

experiment

Type: ForeignKey to Experiment

Experiment (related name: sessions)

participants

Type: ManyToManyField to Participant

Participants (related name: sessions)

room

Type: CharField

Room

connected_participants

Type: IntegerField

Connected participants

start_time

Type: DateTimeField

Start time

end_time

Type: DateTimeField

End time

status

Type: CharField

Status

Choices:

  • not_ready

  • ready

  • pending

  • running

  • completed

  • aborted

metadata

Type: JSONField

Metadata

validate_unique_running_session()
exception DoesNotExist
exception MultipleObjectsReturned
episodes

Type: Reverse ForeignKey from Episode

All episodes of this session (related name of session)

experiment_id

Internal field, use experiment instead.

get_next_by_start_time(*, field=<django.db.models.DateTimeField: start_time>, is_next=True, **kwargs)

Finds next instance based on start_time. See get_next_by_FOO() for more information.

get_previous_by_start_time(*, field=<django.db.models.DateTimeField: start_time>, is_next=False, **kwargs)

Finds previous instance based on start_time. See get_previous_by_FOO() for more information.

get_status_display(*, field=<django.db.models.CharField: status>)

Shows the label of the status. See get_FOO_display() for more information.

id

Type: BigAutoField

Primary key: ID

objects = <django.db.models.Manager object>
runner_set

Type: Reverse ForeignKey from Runner

All runners of this session (related name of session)

class sharpie.webserver.data.models.Episode(*args, **kwargs)

A complete sequence of interactions between a set of agents, and their environment—from an initial state to a terminal or truncated state—representing one coherent task of decision-making cycle.

Parameters:
  • id (BigAutoField) – Primary key: ID

  • started_at (DateTimeField) – Started at

  • ended_at (DateTimeField) – Ended at

  • duration_steps (IntegerField) – Duration steps

  • completed (BooleanField) – Completed

  • outcome (JSONField) – Outcome

Relationship fields:

Parameters:

session (ForeignKey to Session) – Session (related name: episodes)

Reverse relationships:

Parameters:

records (Reverse ForeignKey from Record) – All records of this episode (related name of episode)

session

Type: ForeignKey to Session

Session (related name: episodes)

started_at

Type: DateTimeField

Started at

ended_at

Type: DateTimeField

Ended at

duration_steps

Type: IntegerField

Duration steps

completed

Type: BooleanField

Completed

outcome

Type: JSONField

Outcome

exception DoesNotExist
exception MultipleObjectsReturned
get_next_by_started_at(*, field=<django.db.models.DateTimeField: started_at>, is_next=True, **kwargs)

Finds next instance based on started_at. See get_next_by_FOO() for more information.

get_previous_by_started_at(*, field=<django.db.models.DateTimeField: started_at>, is_next=False, **kwargs)

Finds previous instance based on started_at. See get_previous_by_FOO() for more information.

id

Type: BigAutoField

Primary key: ID

objects = <django.db.models.Manager object>
records

Type: Reverse ForeignKey from Record

All records of this episode (related name of episode)

session_id

Internal field, use session instead.

class sharpie.webserver.data.models.Record(*args, **kwargs)

A single entry within that captures the state of the environment, an agent’s (human or artificial) actions or other outputs, the resulting outcomes or rewards, and any relevant contextual information at a specific point during a trial.

Parameters:
  • id (BigAutoField) – Primary key: ID

  • step_index (IntegerField) – Step index

  • state (JSONField) – State

  • action (JSONField) – Action

  • reward (JSONField) – Reward

  • info (JSONField) – Info

  • timestamp (DateTimeField) – Timestamp

Relationship fields:

Parameters:

episode (ForeignKey to Episode) – Episode (related name: records)

episode

Type: ForeignKey to Episode

Episode (related name: records)

step_index

Type: IntegerField

Step index

state

Type: JSONField

State

action

Type: JSONField

Action

reward

Type: JSONField

Reward

info

Type: JSONField

Info

timestamp

Type: DateTimeField

Timestamp

exception DoesNotExist
exception MultipleObjectsReturned
episode_id

Internal field, use episode instead.

get_next_by_timestamp(*, field=<django.db.models.DateTimeField: timestamp>, is_next=True, **kwargs)

Finds next instance based on timestamp. See get_next_by_FOO() for more information.

get_previous_by_timestamp(*, field=<django.db.models.DateTimeField: timestamp>, is_next=False, **kwargs)

Finds previous instance based on timestamp. See get_previous_by_FOO() for more information.

id

Type: BigAutoField

Primary key: ID

objects = <django.db.models.Manager object>