macop.evaluators.knapsacks

Knapsack evaluators classes

Classes

KnapsackEvaluator(data)

Knapsack evaluator class which enables to compute solution using specific _data

KnapsackMultiEvaluator(data)

Knapsack multi-objective evaluator class which enables to compute solution using specific _data

class macop.evaluators.knapsacks.KnapsackEvaluator(data)[source]

Knapsack evaluator class which enables to compute solution using specific _data

  • stores into its _data dictionary attritute required measures when computing a knapsack solution

  • _data[‘worths’] stores knapsack objects worths information

  • _data[‘weights’] stores knapsack objects weights information

  • compute method enables to compute and associate a score to a given knapsack solution

compute(solution)[source]

Apply the computation of fitness from solution

Parameters

solution – {Solution} – Solution instance

Returns

{float} – fitness score of solution

class macop.evaluators.knapsacks.KnapsackMultiEvaluator(data)[source]

Knapsack multi-objective evaluator class which enables to compute solution using specific _data

  • stores into its _data dictionary attritute required measures when computing a knapsack solution

  • _data[‘worths1’] stores knapsack objects worths information

  • _data[‘worths2’] stores knapsack objects worths information

  • _data[‘weights’] stores knapsack objects weights information

  • compute method enables to compute and associate a score to a given knapsack solution

compute(solution)[source]

Apply the computation of fitness from solution

Parameters

solution – {Solution} – Solution instance

Returns

{float} – fitness score of solution