Skip to content

Commit

Permalink
Fixed the rest of monotonic
Browse files Browse the repository at this point in the history
  • Loading branch information
alcides committed Feb 26, 2024
1 parent 064acc7 commit e8b95bb
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions geneticengine/evaluation/recorder.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from abc import ABC
import csv
from time import time_ns
from time import monotonic_ns
from typing import Any, Callable
from geneticengine.problems import Problem
from geneticengine.solutions import Individual
Expand All @@ -9,8 +9,7 @@


class SearchRecorder(ABC):
def register(self, tracker: Any, individual: Individual, problem: Problem, is_best=True):
...
def register(self, tracker: Any, individual: Individual, problem: Problem, is_best=True): ...


class CSVSearchRecorder(SearchRecorder):
Expand All @@ -29,7 +28,7 @@ def __init__(
self.fields = fields
else:
self.fields = {
"Execution Time": lambda t, i, _: time_ns() - t.start_time,
"Execution Time": lambda t, i, _: (monotonic_ns() - t.start_time) * 0.000000001,
"Phenotype": lambda t, i, _: i.get_phenotype(),
}
for comp in range(problem.number_of_objectives()):
Expand Down

0 comments on commit e8b95bb

Please sign in to comment.