-
Notifications
You must be signed in to change notification settings - Fork 1
PlayerModelBridge

The player model bridge connects the execution of the GIMME processes to the player data storage. After creating a child class, a user is required to implement several methods so that the algorithms of the framework can fetch and save data.
PlayerModelBridge(): voidreset_player(playerId: string): voidCalled whenever a learner needs to be reset to original structure values.
get_all_player_ids(): string[]Called whenever a list of all learner ids is needed. Must return an int[]
get_player_personality(player_id: string): PlayerPersonalityCalled whenever the personality of a learner is needed. Care is needed so that used model is compatible throughout execution (see PlayerPersonality).
get_player_preferences_est(player_id: string): InteractionsProfileCalled whenever the estimated preference of a player is needed. Must return an InteractionsProfile (which can be created from data fetched in the data structure or stored directly).
get_player_states_data_frame(player_id: string): PlayerStatesDataFrameCalled whenever the history of a player is needed. Must return a PlayerStatesDataFrame (which can be created from data fetched from storage or stored directly).
set_and_save_player_state_to_data_frame(player_id: string, increases: PlayerCharacteristics, new_state: PlayerState): voidCalled to update and save a PlayerState to the storage entry of a player.
set_player_preferences_est(player_id: string, preferences: InteractionsProfile): voidCalled to save an estimation of the preference profile of a player.
set_player_characteristics(player_id: string, characteristics: PlayerCharacteristics): voidCalled to set the PlayerCharacteristics of a player.
set_player_group(player_id: string, group: string[]): voidA method called to set the current group of a player.
set_player_profile(playerId: string, profile: InteractionsProfile): voidA method called to set the current preference profile of a player.
from GIMMECore import PlayerModelBridge
class CustomPlayerModelBridge(PlayerModelBridge):
def __init__(self):
self.players = []
def clear_players(self):
self.players = []
def register_new_player(self, player_id, name, curr_state, past_model_increases_data_frame,
preferences_est, real_preferences, base_learning_rate):
new_player = PlayerModelMock(player_id, name, curr_state, past_model_increases_data_frame,
preferences_est, real_preferences, base_learning_rate)
if int(player_id) < len(self.players):
self.players[int(player_id)] = new_player
else:
self.players.append(new_player)
def reset_player(self, player_id):
self.players[int(player_id)].curr_state.reset()
self.players[int(player_id)].past_model_increases_data_frame.reset()
def reset_state(self, player_id):
self.players[int(player_id)].curr_state.reset()
def set_and_save_player_state_to_data_frame(self, player_id, increases, new_state):
self.players[int(player_id)].curr_state = new_state
self.players[int(player_id)].past_model_increases_data_frame.push_to_data_frame(increases)
def set_base_learning_rate(self, player_id, blr):
self.players[int(player_id)].base_learning_rate = blr
def get_base_learning_rate(self, player_id):
return self.players[int(player_id)].base_learning_rate
def get_all_player_ids(self):
return [str(player.id) for player in self.players]
def get_player_name(self, player_id):
return self.players[int(player_id)].name
def get_player_curr_state(self, player_id):
return self.players[int(player_id)].curr_state
def get_player_curr_profile(self, player_id):
return self.players[int(player_id)].curr_state.profile
def get_player_states_data_frame(self, player_id):
return self.players[int(player_id)].past_model_increases_data_frame
def get_player_curr_characteristics(self, player_id):
return self.players[int(player_id)].curr_state.characteristics
def get_player_preferences_est(self, player_id):
return self.players[int(player_id)].preferences_est
def get_player_personality(self, player_id):
return "<MOCKED PERSONALITY>"
def set_player_preferences_est(self, player_id, preferences_est):
self.players[int(player_id)].preferences_est = preferences_est
def set_player_characteristics(self, player_id, characteristics):
self.players[int(player_id)].curr_state.characteristics = characteristics
def set_player_profile(self, player_id, profile):
self.players[int(player_id)].curr_state.profile = profile
def set_player_group(self, player_id, group):
self.players[int(player_id)].curr_state.group = group
def set_player_tasks(self, player_id, tasks):
self.players[int(player_id)].curr_state.tasks = tasks
def set_player_real_preferences(self, player_id, real_preferences):
self.players[int(player_id)].real_preferences = real_preferences
def get_player_real_preferences(self, player_id):
return self.players[int(player_id)].real_preferencesAdaptation
Group Configuration Generation
- ConfigsGenAlg
- RandomConfigsGenAlg
- PureRandomSearchConfigsGenAlg
- EvolutionaryConfigsGenAlg
- ODPIPConfigsGenAlg (exact)
- CLinkConfigsGenAlg (legacy)
Preferences Estimation
Quality Evaluation Algorithms
- QualityEvalAlg
- Group-Based Quality Evaluation:
- Regression-Based Quality Evaluation:
- Tabular Quality Evaluation:
Auxiliary Structures
- InteractionsProfile
- PlayerCharacteristics
- PlayerState
- Personality (Inherent Preference):
- PlayerStatesDataFrame
Model Bridges
Player Data Trim