Base_problems
Functional_problem
- class gaggle.problem.base_problems.functional_problem.FunctionalProblem(fitness_function: Callable, problem_args: ProblemArgs = None, sys_args: SysArgs = None, *args, **kwargs)[source]
Bases:
Problem
Problem that just uses a predefined fitness_function with default input arguments beyond the individual.
- evaluate(individual: Individual, *args, **kwargs) float [source]
Evaluate the given individual based on this problem.
- Parameters:
individual – individual to be evaluated
train – whether this is a training or testing evaluation (matters for certain problems)
*args – additional args that would need to be passed to the individual forward function (call)
**kwargs – additional kwargs that would need to be passed to the individual forward function (call)
Returns: a float representing the individual’s fitness