# Path: cameo/config.py

# 
# Path: cameo/strain_design/heuristic/evolutionary/objective_functions.py
# class MultiObjectiveFunction(ObjectiveFunction):
#     def __init__(self, objectives, *args, **kwargs):
#         super(MultiObjectiveFunction, self).__init__(*args, **kwargs)
#         failed = []
#         for i, objective in enumerate(objectives):
#             if not isinstance(objective, ObjectiveFunction):
#                 failed.append(i)
# 
#         if len(failed) > 0:
#             raise ValueError("Objectives %s are not instance of ObjectiveFunction" %
#                              ", ".join(str(objectives[i]) for i in failed))
# 
#         self.objectives = objectives
# 
#     def __getitem__(self, item):
#         return self.objectives[item]
# 
#     def __call__(self, model, solution, targets):
#         return Pareto(values=[o(model, solution, targets) for o in self.objectives])
# 
#     def worst_fitness(self, maximize=True):
#         return Pareto(values=[o.worst_fitness(maximize) for o in self.objectives], maximize=maximize)
# 
#     @property
#     def reactions(self):
#         return set(sum([o.reactions for o in self.objectives], []))
# 
#     def __len__(self):
#         return len(self.objectives)
# 
#     @property
#     def name(self):
#         return "MO: " + "|".join([of.name for of in self.objectives])
# 
#     def _repr_latex_(self):
#         return "\\begin{gather}\n" + "\\\\".join(o._repr_latex_() for o in self.objectives) + "\n\\end{gather}\n"


import numpy as np
import scipy
from cameo import config
from cameo.strain_design.heuristic.evolutionary.objective_functions import MultiObjectiveFunction
    from bokeh.plotting import show, figure
    from bokeh.models import ColumnDataSource
    from bokeh.io import push_notebook
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at

#     http://www.apache.org/licenses/LICENSE-2.0

# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from __future__ import absolute_import, print_function



if config.use_bokeh:


class IPythonBokehFitnessPlotter(object):
    __name__ = "IPython Bokeh Fitness Plot"

    def __init__(self, window_size=1000):
        self.iteration = 0
        self.window_size = window_size

# Path: cameo/config.py

# 
# Path: cameo/strain_design/heuristic/evolutionary/objective_functions.py
# class MultiObjectiveFunction(ObjectiveFunction):
#     def __init__(self, objectives, *args, **kwargs):
#         super(MultiObjectiveFunction, self).__init__(*args, **kwargs)
#         failed = []
#         for i, objective in enumerate(objectives):
#             if not isinstance(objective, ObjectiveFunction):
#                 failed.append(i)
# 
#         if len(failed) > 0:
#             raise ValueError("Objectives %s are not instance of ObjectiveFunction" %
#                              ", ".join(str(objectives[i]) for i in failed))
# 
#         self.objectives = objectives
# 
#     def __getitem__(self, item):
#         return self.objectives[item]
# 
#     def __call__(self, model, solution, targets):
#         return Pareto(values=[o(model, solution, targets) for o in self.objectives])
# 
#     def worst_fitness(self, maximize=True):
#         return Pareto(values=[o.worst_fitness(maximize) for o in self.objectives], maximize=maximize)
# 
#     @property
#     def reactions(self):
#         return set(sum([o.reactions for o in self.objectives], []))
# 
#     def __len__(self):
#         return len(self.objectives)
# 
#     @property
#     def name(self):
#         return "MO: " + "|".join([of.name for of in self.objectives])
# 
#     def _repr_latex_(self):
#         return "\\begin{gather}\n" + "\\\\".join(o._repr_latex_() for o in self.objectives) + "\n\\end{gather}\n"


# Path: cameo/strain_design/heuristic/evolutionary/plotters.py
import numpy as np
import scipy
from cameo import config
from cameo.strain_design.heuristic.evolutionary.objective_functions import MultiObjectiveFunction
    from bokeh.plotting import show, figure
    from bokeh.models import ColumnDataSource
    from bokeh.io import push_notebook

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at

#     http://www.apache.org/licenses/LICENSE-2.0

# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from __future__ import absolute_import, print_function



if config.use_bokeh:


class IPythonBokehFitnessPlotter(object):
    __name__ = "IPython Bokeh Fitness Plot"

    def __init__(self, window_size=1000):
        self.iteration = 0
        self.window_size = window_size

        self.iterations = []