Package tulip :: Module dumpsmach
[frames] | no frames]

Module dumpsmach

Code generation and exporting of controllers from TuLiP

Routines in this module are cross-cutting in the sense that they concern multiple aspects of solutions created by TuLiP and accordingly should not be placed under a specific subpackage, like tulip.transys.

Functions
 
write_python_case(filename, *args, **kwargs)
Convenience wrapper for writing output of python_case to file.
str
python_case(M, classname='TulipStrategy', start='Sinit')
Export MealyMachine as Python class based on flat if-else block.
Variables
  __package__ = 'tulip'
Function Details

write_python_case(filename, *args, **kwargs)

 

Convenience wrapper for writing output of python_case to file.

Parameters:
  • filename (str) - Name of file in which to place the code generated by python_case.

python_case(M, classname='TulipStrategy', start='Sinit')

 

Export MealyMachine as Python class based on flat if-else block.

Usage documentation for the generated code is included in the output. Consult the docstrings of the class and move() method.

Parameters:
  • start - initial node in M
  • classname (str)
  • M (MealyMachine)
Returns: str
The returned string is valid Python code and can, for example, be:
  • saved directly into a ".*.py" file, or
  • passed to "exec".