# Path: platypus/core.py
# class PlatypusError(Exception):
#     pass
# 
# Path: platypus/evaluator.py
# class Job(object):
#     
#     __metaclass__ = ABCMeta
#     
#     def __init__(self):
#         super(Job, self).__init__()
#         
#     @abstractmethod
#     def run(self):
#         raise NotImplementedError("method not implemented")
# 
# class MapEvaluator(Evaluator):
#     
#     def __init__(self, map_func=map):
#         super(MapEvaluator, self).__init__()
#         self.map_func = map_func
#     
#     def evaluate_all(self, jobs, **kwargs):
#         log_frequency = kwargs.get("log_frequency", None)
#         
#         if log_frequency is None:
#             return list(self.map_func(run_job, jobs))
#         else:
#             result = []
#             job_name = kwargs.get("job_name", "Batch Jobs")
#             start_time = time.time()
#             
#             for chunk in _chunks(jobs, log_frequency):
#                 result.extend(self.map_func(run_job, chunk))
#                 LOGGER.log(logging.INFO,
#                            "%s running; Jobs Complete: %d, Elapsed Time: %s",
#                            job_name,
#                            len(result),
#                            datetime.timedelta(seconds=time.time()-start_time))
#                 
#             return result


import six
import time
import datetime
import functools
from collections import OrderedDict
from .core import PlatypusError
from .evaluator import Job, MapEvaluator
    from sets import Set as set
        from .config import PlatypusConfig
        from .config import PlatypusConfig

try:
    set
except NameError:
        
class ExperimentJob(Job):

    def __init__(self, instance, nfe, algorithm_name, problem_name, seed, display_stats):
        super(ExperimentJob, self).__init__()
        self.instance = instance
        self.nfe = nfe
        self.algorithm_name = algorithm_name
        self.problem_name = problem_name
        self.seed = seed
        self.display_stats = display_stats
        
    def run(self):
        if self.display_stats:
            start_time = time.time()
            print("Running seed", self.seed, "of", self.algorithm_name, "on",
                    self.problem_name)
        
        self.instance.run(self.nfe)
    
        if self.display_stats:
            end_time = time.time()
            print("Finished seed", self.seed, "of", self.algorithm_name, "on",
                    self.problem_name, ":",
                    datetime.timedelta(seconds=round(end_time-start_time)))
                    

# Path: platypus/core.py
# class PlatypusError(Exception):
#     pass
# 
# Path: platypus/evaluator.py
# class Job(object):
#     
#     __metaclass__ = ABCMeta
#     
#     def __init__(self):
#         super(Job, self).__init__()
#         
#     @abstractmethod
#     def run(self):
#         raise NotImplementedError("method not implemented")
# 
# class MapEvaluator(Evaluator):
#     
#     def __init__(self, map_func=map):
#         super(MapEvaluator, self).__init__()
#         self.map_func = map_func
#     
#     def evaluate_all(self, jobs, **kwargs):
#         log_frequency = kwargs.get("log_frequency", None)
#         
#         if log_frequency is None:
#             return list(self.map_func(run_job, jobs))
#         else:
#             result = []
#             job_name = kwargs.get("job_name", "Batch Jobs")
#             start_time = time.time()
#             
#             for chunk in _chunks(jobs, log_frequency):
#                 result.extend(self.map_func(run_job, chunk))
#                 LOGGER.log(logging.INFO,
#                            "%s running; Jobs Complete: %d, Elapsed Time: %s",
#                            job_name,
#                            len(result),
#                            datetime.timedelta(seconds=time.time()-start_time))
#                 
#             return result


# Path: platypus/experimenter.py
import six
import time
import datetime
import functools
from collections import OrderedDict
from .core import PlatypusError
from .evaluator import Job, MapEvaluator
    from sets import Set as set
        from .config import PlatypusConfig
        from .config import PlatypusConfig


try:
    set
except NameError:
        
class ExperimentJob(Job):

    def __init__(self, instance, nfe, algorithm_name, problem_name, seed, display_stats):
        super(ExperimentJob, self).__init__()
        self.instance = instance
        self.nfe = nfe
        self.algorithm_name = algorithm_name
        self.problem_name = problem_name
        self.seed = seed
        self.display_stats = display_stats
        
    def run(self):
        if self.display_stats:
            start_time = time.time()
            print("Running seed", self.seed, "of", self.algorithm_name, "on",
                    self.problem_name)
        
        self.instance.run(self.nfe)
    
        if self.display_stats:
            end_time = time.time()
            print("Finished seed", self.seed, "of", self.algorithm_name, "on",
                    self.problem_name, ":",
                    datetime.timedelta(seconds=round(end_time-start_time)))
                    

class IndicatorJob(Job):