Test Based Scores

Test Based Score

class CommonTestBasedScore(*_, **__)

Bases: TestBasedScore, HasClassLog

A test based score used when testing a resolver.

classmethod get_default_score()

The default score used when no other score is found or when an error occurs.

Return type:

int

classmethod get_log_identifier()

A string identifier for the log of the class.

Note

This is the text that will appear when logging messages.

Returns:

The identifier for the log

Return type:

str

classmethod get_mod_identity()

Retrieve the identity of the mod that owns the class.

Warning

Override this function with the CommonModIdentity of your mod.

This is a MUST override to allow for proper Exception Handling and Logging!

Returns:

An instance of CommonModIdentity

Return type:

CommonModIdentity

Raises:

NotImplementedError – Thrown when the function is not implemented.

classmethod passes_threshold(resolver, threshold)

True if the threshold is passed.

Return type:

bool

Single Sim Test Based Score

class CommonSingleSimTestBasedScore(*_, **__)

Bases: CommonTestBasedScore

A test based score used when testing a resolver involving one Sim.

classmethod calculate_score(resolver, source_sim_info, interaction)

Calculate a score involving one Sim.

Parameters:
  • resolver (Resolver) – A resolver containing information about what is being tested.

  • source_sim_info (SimInfo) – The Source or Actor Sim of the test.

  • interaction (Interaction) – The interaction or affordance, if available, that the Source Sim is attempting to perform. If no interaction or affordance is present, this value will be None.

Returns:

The calculated Score.

Return type:

int

classmethod get_log_identifier()

A string identifier for the log of the class.

Note

This is the text that will appear when logging messages.

Returns:

The identifier for the log

Return type:

str

classmethod get_mod_identity()

Retrieve the identity of the mod that owns the class.

Warning

Override this function with the CommonModIdentity of your mod.

This is a MUST override to allow for proper Exception Handling and Logging!

Returns:

An instance of CommonModIdentity

Return type:

CommonModIdentity

Raises:

NotImplementedError – Thrown when the function is not implemented.

classmethod get_score(resolver)

Calculate the score.

Return type:

int

Sim To Sim Test Based Score

class CommonSimToSimTestBasedScore(*_, **__)

Bases: CommonTestBasedScore

A test based score used when testing a resolver involving two Sims.

classmethod calculate_score(resolver, source_sim_info, target_sim_info, interaction)

Calculate a score involving two Sims.

Parameters:
  • resolver (Resolver) – A resolver containing information about what is being tested.

  • source_sim_info (SimInfo) – The Source or Actor Sim of the test, also known as Sim A.

  • target_sim_info (SimInfo) – The Target or Listener Sim of the test, also known as Sim B.

  • interaction (Interaction) – The interaction or affordance, if available, that Sim A is attempting to perform with the Sim B. If no interaction or affordance is present, this value will be None.

Returns:

The calculated Score.

Return type:

int

classmethod get_log_identifier()

A string identifier for the log of the class.

Note

This is the text that will appear when logging messages.

Returns:

The identifier for the log

Return type:

str

classmethod get_mod_identity()

Retrieve the identity of the mod that owns the class.

Warning

Override this function with the CommonModIdentity of your mod.

This is a MUST override to allow for proper Exception Handling and Logging!

Returns:

An instance of CommonModIdentity

Return type:

CommonModIdentity

Raises:

NotImplementedError – Thrown when the function is not implemented.

classmethod get_score(resolver)

Calculate the score.

Return type:

int