BoredomFrustration

model.entities.customers.BoredomFrustration

Defines the contract for an entity that experiences boredom and frustration.

This trait allows entities to track and update their emotional states, which can influence their decisions and behavior in the simulation. Boredom and frustration values are typically represented as percentages (0-100).

Type parameters

T

The concrete type of the entity that extends this trait, enabling F-bounded polymorphism for immutable updates.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Customer

Members list

Value members

Abstract methods

def withBoredom(newBoredom: Double): T

Returns a new instance of the entity with an updated boredom level. This method must be implemented by concrete classes to ensure immutability.

Returns a new instance of the entity with an updated boredom level. This method must be implemented by concrete classes to ensure immutability.

Value parameters

newBoredom

The new boredom level.

Attributes

Returns

A new instance of the entity with the new boredom level.

def withFrustration(newFrustration: Double): T

Returns a new instance of the entity with an updated frustration level. This method must be implemented by concrete classes to ensure immutability.

Returns a new instance of the entity with an updated frustration level. This method must be implemented by concrete classes to ensure immutability.

Value parameters

newFrustration

The new frustration level.

Attributes

Returns

A new instance of the entity with the new frustration level.

Concrete methods

def updateBoredom(boredomGain: Double): T

Updates the entity's boredom level by adding a boredomGain. The new boredom level is clamped between 0.0 and 100.0.

Updates the entity's boredom level by adding a boredomGain. The new boredom level is clamped between 0.0 and 100.0.

Value parameters

boredomGain

The amount to add to the current boredom level. Can be positive or negative.

Attributes

Returns

A new instance of the entity with the updated boredom level.

def updateFrustration(frustrationGain: Double): T

Updates the entity's frustration level by adding a frustrationGain. The new frustration level is clamped between 0.0 and 100.0.

Updates the entity's frustration level by adding a frustrationGain. The new frustration level is clamped between 0.0 and 100.0.

Value parameters

frustrationGain

The amount to add to the current frustration level. Can be positive or negative.

Attributes

Returns

A new instance of the entity with the updated frustration level.

Abstract fields

val boredom: Double

The current boredom level of the entity (0.0 - 100.0).

The current boredom level of the entity (0.0 - 100.0).

Attributes

val frustration: Double

The current frustration level of the entity (0.0 - 100.0).

The current frustration level of the entity (0.0 - 100.0).

Attributes