Test Based Scores

Test Based Score

class CommonTestBasedScore(*_, **__)

Bases: sphinx.ext.autodoc.importer._MockObject, sims4communitylib.logging.has_class_log.HasClassLog

A test based score used when testing a resolver.

classmethod get_default_score() → int

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

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: <sphinx.ext.autodoc.importer._MockObject object at 0x7ff1c367db50>, threshold: <sphinx.ext.autodoc.importer._MockObject object at 0x7ff1c332a4d0>) → bool

True if the threshold is passed.

Single Sim Test Based Score

class CommonSingleSimTestBasedScore(*_, **__)

Bases: sims4communitylib.classes.test_based_scores.common_test_based_score.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.

Sim To Sim Test Based Score

class CommonSimToSimTestBasedScore(*_, **__)

Bases: sims4communitylib.classes.test_based_scores.common_test_based_score.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.