BaseTask¶
evotoolkit.core.BaseTask
¶
Bases: ABC
Abstract base class for evolutionary optimization tasks.
This class unifies the functionality of BaseEvaluator and BaseTaskConfig into a single concept, providing both evaluation capabilities and task configuration in one place.
Source code in src/evotoolkit/core/base_task.py
__init__
¶
Initialize the task with input data.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
Any
|
Task-specific input data (format varies by task type). |
required |
evaluate_code
abstractmethod
¶
Evaluate a candidate code solution and return evaluation result.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
candidate_code
|
str
|
The code to evaluate |
required |
Returns:
| Name | Type | Description |
|---|---|---|
EvaluationResult |
EvaluationResult
|
Result of the evaluation |
Source code in src/evotoolkit/core/base_task.py
get_base_task_description
abstractmethod
¶
Get the base task description for prompt generation.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
Task description text |
make_init_sol_wo_other_info
abstractmethod
¶
make_init_sol_wo_other_info() -> Solution
Create initial solution from task info without other_info.
Returns:
| Name | Type | Description |
|---|---|---|
Solution |
Solution
|
Initial solution for this task |
get_task_type
¶
Get the type of this task (e.g., 'Python', 'Cuda').
Default implementation returns 'Python'. Subclasses should override if they represent different task types.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
Task type identifier |
Source code in src/evotoolkit/core/base_task.py
get_task_info
¶
Get the task_info dictionary.
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict
|
Task information dictionary |
See the Custom Task Tutorial for a complete guide.