Skip to content

Adaptation

Samuel Gomes edited this page Jul 12, 2024 · 16 revisions

Adaptation

Adaptation encapsulates all the functionalities of GIMME. It is the highest level class, responsible for initializing and executing adaptation iterations. As instances of Adaptation can be initialized and executed whenever, adaptations can dynamically be reconfigured with different arguments. No direct coupling exists between the player and task models and Adaptation and so, even if, e.g., the number of players or tasks changes, the module can be executed.

Constructor and Members

Constructor

Adaptation(
            player_model_bridge: PlayerModelBridge,
            task_model_bridge: TaskModelBridge,
            configs_gen_alg: ConfigsGenAlg,
            name: string

    ): void

Members

Name: expected type Default value Description
player_model_bridge: PlayerModelBridge - The connector for the player data models.
task_model_bridge: TaskModelBridge - The connector for the task data models.
configs_gen_alg: ConfigsGenAlg - The group formation (coalitions structure generation) algorithm to be used.
name: string - A name for the Adaptation (for debug or if identification is needed).

Functions

iterate(): dict { groups: int[][], profiles: InteractionsProfile[], avgCharacteristics: PlayerCharacteristics[], tasks: int[] }

Description

This method triggers the beginning of a new iteration using the current Adaptation configuration.

Return

Returns a dictionary with the following entries:

Name: expected type Description
groups: int[][] An array of groups, with each group represented as an array of IDs.
profiles: InteractionsProfile[] The profiles for each group, in the order that the groups appear in groups.
avgCharacteristics: PlayerCharacteristics[] The average learning states of each group, in the order that the groups appear in groups.
tasks: int[] The tasks assigned for each group, in the order that the groups appear in groups.

bootstrap(num_bootstrap_iterations: int): void

Description

This method performs a bootstrap on the current adaptation process, simulating the learners progression over a number of iterations.

set_name(name: string): void

Description

This method is a setter for the member name.

get_name(): string

Description

This method is a getter for the member name.

__select_task(possible_task_ids: int[], best_config_profile: InteractionProfile, avg_characteristics: PlayerCharacteristics): int

Description

This method returns a new task tailored to a group through its profile and average state. It returns the ID of that task in the TaskModelBridge.

__simulate_reaction(player_id: int): PlayerState

Description

This method simulates the reaction of a given player to the task attributed to their group, and returns the simulated PlayerState.

__calc_reaction(state: PlayerState, player_id: int): PlayerState

Description

An auxiliary method of simulateReaction.

Example

configs_gen_alg = RandomConfigsGenAlg(
    player_model_bridge=player_bridge,
    interactions_profile_template=prof_template.generate_copy(),
    preferred_number_of_players_per_group=preferred_num_group_players
)
course_adapt = Adaptation(name="Test Adaptation",
                          player_model_bridge=player_bridge,
                          task_model_bridge=task_bridge,
                          configs_gen_alg=configs_gen_alg)

# do 50 iterations of statisticsCourseAdapt and print each chosen configuration
for i in range(50):
    print(course_adapt.iterate()["groups"])  # print chosen configuration

Clone this wiki locally