Skip to content

ConfigsGenAlg

Samuel Gomes edited this page Jul 15, 2021 · 23 revisions

ConfigsGenAlg

ConfigsGenAlg is an abstract base class for the group organization algorithms. These algorithms are usually called coalition structure generation algorithms. GIMME currently implements a few of them, such as: a purely random generator; an exploratory algorithm which does not save any information between iterations; a genetic driven approach (still to be fully implemented); etc...

Note: Some of these approaches were renamed since the current master deployment.

Constructor and Attributes

Constructor

ConfigsGenAlg(numberOfConfigChoices, minNumberOfPlayersPerGroup, maxNumberOfPlayersPerGroup, preferredNumberOfPlayersPerGroup, fitnessWeights, regAlg)

Attributes

Name: expected type Default value Description
playerModelBridge: PlayerModelBridge - The connector for the players data model
interactionsProfileTemplate: InteractionsProfile - A template for creating new profiles. The template acts as a facilitator to not only the number of interaction dimensions to be considered, but also their designations.
preferredNumberOfPlayersPerGroup: int None A preferred group size to consider. When filled (=/= None), the configurations will try following a fixed group size (with the few smaller groups containing the remaining players)
minNumberOfPlayersPerGroup: int 2 The minimum group size to consider
maxNumberOfPlayersPerGroup: int 5 The maximum group size to consider

Methods

init(): void

Description

Abstract method to be used for initializing a configuration algorithm if data is stored between iterations.

reset(): void

Description

Abstract method to be used for resetting the configuration algorithm if data is stored between iterations.

organize(): int[][]

Description

Abstract method to be used for performing group organization and returning a group configuration (or coalition structure).

randomConfigGenerator(playerIds, minNumGroups, maxNumGroups): void

Description

An auxiliary method which generates a random group configuration.

updateMetrics( generatedConfig: int[][] ) : void

Description

An auxiliary method to update group organization performance metrics.

Example

regAlg = KNNRegression(playerModelBridge = playerBridge, numberOfNNs = 5)
intProfTemplate2D = InteractionsProfile(dimensions = {"dim_0": 0, "dim_1": 0})

configsAlg = PureRandomSearchConfigsGen(
	playerModelBridge = playerBridge, 
	interactionsProfileTemplate = intProfTemplate2D.generateCopy(), 
	regAlg = regAlg, 
	persEstAlg = ExplorationPreferencesEstAlg(
		playerModelBridge = playerBridge, 
		interactionsProfileTemplate = intProfTemplate2D.generateCopy(), 
		regAlg = regAlg,
		numTestedPlayerProfiles = numTestedPlayerProfilesInEst, 
		qualityWeights = PlayerCharacteristics(ability=0.5, engagement=0.5)), 
	numberOfConfigChoices = numberOfConfigChoices, 
	preferredNumberOfPlayersPerGroup = preferredNumberOfPlayersPerGroup, 
	qualityWeights = PlayerCharacteristics(ability=0.5, engagement=0.5)
)

print(configsAlg.organize())

# Example return for a 10 player class: {'groups': [[6, 0, 2, 7], [1, 5, 4, 3], [9, 8]], 'profiles': 
#[<InteractionsProfile.InteractionsProfile object at 0x7f426050bad0>, <InteractionsProfile.InteractionsProfile object 
#at 0x7f426050bb10>, <InteractionsProfile.InteractionsProfile object at 0x7f426050bcd0>], 'avgStates': 
#[<PlayerStructs.PlayerState object at 0x7f426050bb50>, <PlayerStructs.PlayerState object at 0x7f426050bc10>, 
#<PlayerStructs.PlayerState object at 0x7f426050bbd0>]}

Clone this wiki locally