# 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/aggstrat.py
# class AggregationStrategy(Freezable):
# class Unaggregated(AggregationStrategy):
# class Aggregated(AggregationStrategy):
#     def __init__(self):
#     def init_aggdag_data(self, aggdag):
#     def init_aggdag_node_data(self, aggdag_node):
#     def pop_waiting_list(self, waiting_list):
#     def get_deagg_node(self, aggdag):
#     def pretransition(self, t, t_lpi, op_transition):
#     def get_agg_type(self, op_list):
#     def __init__(self, agg_type=AGG_ARNOLDI_BOX, deaggregate=False):
#     def pop_waiting_list(self, waiting_list):
#     def pop_score(self, state):
#     def get_simulation_pop_mode(self, sim_waiting_list):
#     def pretransition(self, t, t_lpi, op_transition):
#     def get_agg_type(self, op_list):
#     def _get_agg_type(self):
#     def get_deagg_node(self, aggdag):
# def get_ancestors(node):
#     AGG_BOX, AGG_ARNOLDI_BOX, AGG_CONVEX_HULL = range(3)
#     POP_LOWEST_MINTIME, POP_LOWEST_AVGTIME, POP_LARGEST_MAXTIME = range(3)
#     DEAGG_LEAVES_FIRST, DEAGG_ROOT_FIRST, DEAGG_MOST_STATES = range(3)


import math
from matplotlib import animation
from hylaa.util import Freezable
from hylaa import aggstrat
    'Settings for the computation'

    STDOUT_NONE, STDOUT_NORMAL, STDOUT_VERBOSE, STDOUT_DEBUG = range(4)

    # Approximation Models: None: discrete-time, chull: convex hull only (different simulation semantics),
    #                       lgg: support function method from Le Guernic'10
    APPROX_NONE, APPROX_CHULL, APPROX_LGG = range(3)

    def __init__(self, step_size, max_time):
        plot_settings = PlotSettings()

        self.step_size = step_size # simulation step size
        self.num_steps = int(math.ceil(max_time / step_size))

        self.plot = plot_settings
        self.stdout = HylaaSettings.STDOUT_NORMAL
        self.stdout_colors = [None, "white", "blue", "yellow"] # colors for each level of printing

        ### SIMULATION-EQUIVALENT SEMANTICS / COMPUTATION PARAMETERS ###
        self.process_urgent_guards = False # allow zero continuous-post steps between transitions?
        self.do_guard_strengthening = True # add invariants of target modes to each guard?
        self.optimize_tt_transitions = True # auto-detect time-triggered transitions and use single-step semantics?
        self.approx_model = HylaaSettings.APPROX_NONE
        self.skip_zero_dynamics_modes = True

        # what to do when an error appears reachable
        self.stop_on_aggregated_error = False # stop whenever any state (aggregated or not) reaches an error mode
        self.stop_on_concrete_error = True # stop whenver a concrete state reaches an error
        self.make_counterexample = True # save counter-example to data structure / file?
        

# 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/aggstrat.py
# class AggregationStrategy(Freezable):
# class Unaggregated(AggregationStrategy):
# class Aggregated(AggregationStrategy):
#     def __init__(self):
#     def init_aggdag_data(self, aggdag):
#     def init_aggdag_node_data(self, aggdag_node):
#     def pop_waiting_list(self, waiting_list):
#     def get_deagg_node(self, aggdag):
#     def pretransition(self, t, t_lpi, op_transition):
#     def get_agg_type(self, op_list):
#     def __init__(self, agg_type=AGG_ARNOLDI_BOX, deaggregate=False):
#     def pop_waiting_list(self, waiting_list):
#     def pop_score(self, state):
#     def get_simulation_pop_mode(self, sim_waiting_list):
#     def pretransition(self, t, t_lpi, op_transition):
#     def get_agg_type(self, op_list):
#     def _get_agg_type(self):
#     def get_deagg_node(self, aggdag):
# def get_ancestors(node):
#     AGG_BOX, AGG_ARNOLDI_BOX, AGG_CONVEX_HULL = range(3)
#     POP_LOWEST_MINTIME, POP_LOWEST_AVGTIME, POP_LARGEST_MAXTIME = range(3)
#     DEAGG_LEAVES_FIRST, DEAGG_ROOT_FIRST, DEAGG_MOST_STATES = range(3)


# Path: hylaa/settings.py
import math
from matplotlib import animation
from hylaa.util import Freezable
from hylaa import aggstrat

    'Settings for the computation'

    STDOUT_NONE, STDOUT_NORMAL, STDOUT_VERBOSE, STDOUT_DEBUG = range(4)

    # Approximation Models: None: discrete-time, chull: convex hull only (different simulation semantics),
    #                       lgg: support function method from Le Guernic'10
    APPROX_NONE, APPROX_CHULL, APPROX_LGG = range(3)

    def __init__(self, step_size, max_time):
        plot_settings = PlotSettings()

        self.step_size = step_size # simulation step size
        self.num_steps = int(math.ceil(max_time / step_size))

        self.plot = plot_settings
        self.stdout = HylaaSettings.STDOUT_NORMAL
        self.stdout_colors = [None, "white", "blue", "yellow"] # colors for each level of printing

        ### SIMULATION-EQUIVALENT SEMANTICS / COMPUTATION PARAMETERS ###
        self.process_urgent_guards = False # allow zero continuous-post steps between transitions?
        self.do_guard_strengthening = True # add invariants of target modes to each guard?
        self.optimize_tt_transitions = True # auto-detect time-triggered transitions and use single-step semantics?
        self.approx_model = HylaaSettings.APPROX_NONE
        self.skip_zero_dynamics_modes = True

        # what to do when an error appears reachable
        self.stop_on_aggregated_error = False # stop whenever any state (aggregated or not) reaches an error mode
        self.stop_on_concrete_error = True # stop whenver a concrete state reaches an error
        self.make_counterexample = True # save counter-example to data structure / file?
        

        self.aggstrat = aggstrat.Aggregated() # aggregation strategy class