Class swarmauri_core.evaluators.IEvaluate.IEvaluate
swarmauri_core.evaluators.IEvaluate.IEvaluate
Bases: ABC
Interface for program evaluation functions.
This abstract class defines the contract that all evaluators must implement, providing methods to assess program fitness according to specific criteria. Evaluators must be stateless to allow for parallel execution.
evaluate
abstractmethod
evaluate(program, **kwargs)
Evaluate a program and return a fitness score with metadata.
This method assesses the fitness of a program according to specific criteria and returns both a scalar score and detailed metadata about the evaluation.
PARAMETER | DESCRIPTION |
---|---|
program
|
The program to evaluate
TYPE:
|
**kwargs
|
Additional parameters for the evaluation process
DEFAULT:
|
RETURNS | DESCRIPTION |
---|---|
Tuple[float, Dict[str, Any]]
|
A tuple containing: - float: A scalar fitness score (higher is better) - Dict[str, Any]: Metadata about the evaluation, including feature dimensions |
RAISES | DESCRIPTION |
---|---|
EvaluationError
|
If the evaluation process fails |
TypeError
|
If the program is not of the expected type |
Source code in swarmauri_core/evaluators/IEvaluate.py
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
|
reset
abstractmethod
reset()
Reset the evaluator to its initial state.
This method should clear any internal state or cached data to ensure that the evaluator is ready for a new evaluation cycle.
Source code in swarmauri_core/evaluators/IEvaluate.py
51 52 53 54 55 56 57 58 59 |
|