# Path: hylaa/aggstrat.py
# def get_ancestors(node):
#     '''
#     get an ordered list of all the ancestors, starting from the root to the leaf
#     '''
# 
#     rv = []
# 
#     if node.parent_ops[0].parent_node is not None:
#         rv += get_ancestors(node.parent_ops[0].parent_node)
# 
#     rv.append(node)
# 
#     return rv
# 
# Path: hylaa/util.py
# class Freezable():
#     'a class where you can freeze the fields (prevent new fields from being created)'
# 
#     _frozen = False
# 
#     def freeze_attrs(self):
#         'prevents any new attributes from being created in the object'
#         self._frozen = True
# 
#     def __setattr__(self, key, value):
#         if self._frozen and not hasattr(self, key):
#             raise TypeError("{} does not contain attribute '{}' (object was frozen)".format(self, key))
# 
#         object.__setattr__(self, key, value)


from collections import defaultdict
from collections import deque
from sympy import Polygon, Point, Point2D
from scipy.integrate import odeint
from scipy.sparse import csr_matrix
from hylaa.aggstrat import get_ancestors
from hylaa.util import Freezable
import numpy as np





class HylaaResult(Freezable): # pylint: disable=too-few-public-methods
    'result object returned by core.run()'

    def __init__(self):
        self.top_level_timer = None # TimerData for total time

        # verification result:
        self.has_aggregated_error = False
        self.has_concrete_error = False

        self.counterexample = [] # if unsafe, a list of CounterExampleSegment objects

        # assigned if setting.plot.store_plot_result is True, an instance of PlotData
        self.plot_data = None

        # the last core.cur_state object... used for unit testing
        self.last_cur_state = None

        # lines plotted for simulations
        # nested lists. first index is plot number, second is segment number,
        # third is simulation number, last is list of 2-d points 
        self.sim_lines = None 

        self.freeze_attrs()


# Path: hylaa/aggstrat.py
# def get_ancestors(node):
#     '''
#     get an ordered list of all the ancestors, starting from the root to the leaf
#     '''
# 
#     rv = []
# 
#     if node.parent_ops[0].parent_node is not None:
#         rv += get_ancestors(node.parent_ops[0].parent_node)
# 
#     rv.append(node)
# 
#     return rv
# 
# Path: hylaa/util.py
# class Freezable():
#     'a class where you can freeze the fields (prevent new fields from being created)'
# 
#     _frozen = False
# 
#     def freeze_attrs(self):
#         'prevents any new attributes from being created in the object'
#         self._frozen = True
# 
#     def __setattr__(self, key, value):
#         if self._frozen and not hasattr(self, key):
#             raise TypeError("{} does not contain attribute '{}' (object was frozen)".format(self, key))
# 
#         object.__setattr__(self, key, value)


# Path: hylaa/result.py
from collections import defaultdict
from collections import deque
from sympy import Polygon, Point, Point2D
from scipy.integrate import odeint
from scipy.sparse import csr_matrix
from hylaa.aggstrat import get_ancestors
from hylaa.util import Freezable
import numpy as np






class HylaaResult(Freezable): # pylint: disable=too-few-public-methods
    'result object returned by core.run()'

    def __init__(self):
        self.top_level_timer = None # TimerData for total time

        # verification result:
        self.has_aggregated_error = False
        self.has_concrete_error = False

        self.counterexample = [] # if unsafe, a list of CounterExampleSegment objects

        # assigned if setting.plot.store_plot_result is True, an instance of PlotData
        self.plot_data = None

        # the last core.cur_state object... used for unit testing
        self.last_cur_state = None

        # lines plotted for simulations
        # nested lists. first index is plot number, second is segment number,
        # third is simulation number, last is list of 2-d points 
        self.sim_lines = None 

        self.freeze_attrs()


class PlotData(Freezable):