How to use the discretize.discretize function in discretize

To help you get started, we’ve selected a few discretize examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github tulip-control / tulip-control / tulip / rhtlp.py View on Github external
raise TypeError("Invalid disc_props.")
        if (not isinstance(sys_dyn, CtsSysDyn) and sys_dyn is not None):
            printError("The type of input sys_dyn is expected to be CtsSysDyn", obj=self)
            raise TypeError("Invalid sys_dyn.")

        # Process the continuous component
        if (cont_state_space is not None):
            if (cont_props is None):
                cont_props = []
            cont_partition = prop2part2(cont_state_space, cont_props)
            disc_dynamics = copy.deepcopy(cont_partition)
            disc_dynamics.trans = disc_dynamics.adj
            for fromcell in xrange(0,len(disc_dynamics.trans)):
                disc_dynamics.trans[fromcell][fromcell] = 1
            if (sys_dyn is not None):
                disc_dynamics = discretize(cont_partition, sys_dyn, verbose=verbose)
        else:
            if (verbose > 0):
                print("No continuous component")
            disc_dynamics = PropPreservingPartition(domain=None, num_prop=0, \
                                                        list_region=[], num_regions=0, \
                                                        adj=[], trans=[], \
                                                        list_prop_symbol=None)

        self.createProbFromDiscDynamics(env_vars=env_vars, \
                                            sys_disc_vars=sys_disc_vars, \
                                            disc_props=disc_props, \
                                            disc_dynamics=disc_dynamics, \
                                            spec=spec, \
                                            verbose=verbose)