Skip to content

InteractionsProfile

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

InteractionsProfile

This class defines an interaction preference. It also includes some methods that can be used to transform and manipulate the preference profile.

Constructor and Members

Constructor

InteractionsProfile(dimensions: dict = {}): void

Members

Name: expected type Default value Description
dimensions: dict {} The dictionary of dimension keys to values.
__dimensionality: int (derived from dimensions) The number of dimensions of the profile.

Functions

init(): InteractionsProfile

Description

Sets all dimensions to 0.

generateCopy(): InteractionsProfile

Description

Returns a copy of the caller.

__normalization(profile: InteractionsProfile): InteractionsProfile

Description

(auxiliary) Returns a normalized copy of a given profile.

normalize(): InteractionsProfile

Description

Normalizes the caller and returns it.

normalized(): InteractionsProfile

Description

Returns a normalized copy of the caller.

__randomization(profile: InteractionsProfile): InteractionsProfile

Description

(auxiliary) Returns a randomized copy of a given profile.

randomize(): InteractionsProfile

Description

Randomizes the caller and returns it.

randomized(): InteractionsProfile

Description

Returns a randomized copy of the caller.

distance_between(profile_to_test: InteractionsProfile): decimal

Description

Calculates the Euclidean distance between the caller and another profile.

sqr_distance_between(profile_to_test: InteractionsProfile): decimal

Description

Calculates the squared Euclidean distance between the caller and another profile.

flattened(): object[]

Description

Returns an array with the values of the dimensions of the caller.

unflatten(array: object[]): InteractionsProfile

Description

Assigns the dimensions values of the caller as the elements of a given array in the same order. Returns the updated caller.

unflattened(array: object[]): InteractionsProfile

Description

Copies the caller and assigns the dimensions values of the copy as the elements of a given array in the same order. Returns the caller's copy. 

__unflatten_func(profile: InteractionsProfile, array: object[]): InteractionsProfile

Description

(auxiliary) Assigns dimensions values of a given profile as the elements of a given array in the same order.

Clone this wiki locally