Skip to content

InteractionsProfile

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

InteractionsProfile

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

Constructor

+ InteractionsProfile(dimensions: dict): void

Attributes

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.

Methods

+ reset(): void

Description

It sets all dimensions to 0.

+ init(): void

Description

(legacy) This method is equivalent to reset().

+ generateCopy(): InteractionsProfile

Description

It returns a copy of the caller.

- normalization(profile: InteractionsProfile): InteractionsProfile

Description

(auxiliary) A method that returns a normalized copy of a given profile.

+ normalize(): InteractionsProfile

Description

It normalizes the caller and returns it.

+ normalized(): InteractionsProfile

Description

It returns a normalized copy of the caller.

- randomization(profile: InteractionsProfile): InteractionsProfile

Description

(auxiliary) A method that returns a randomized copy of a given profile.

+ randomize(): InteractionsProfile

Description

It randomizes the caller and returns it.

+ randomized(): InteractionsProfile

Description

It returns a randomized copy of the caller.

+ distanceBetween(profileToTest: InteractionsProfile): float

Description

A method that calculates the Euclidean distance between the caller and another profile.

+ sqrDistanceBetween(profileToTest: InteractionsProfile): float

Description

A method that calculates the squared Euclidean distance between the caller and another profile.

+ flattened(): object[]

Description

It returns an array with the values of the dimensions of the caller.

+ unflatten(array: object[]): InteractionsProfile

Description

It 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

It 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. 

- unflattenFunc(profile: InteractionsProfile, array: object[]): InteractionsProfile

Description

(auxiliary) A method that assigns dimensions values of a given profile as the elements of a given array in the same order.

Clone this wiki locally