ex_fuzzy.persistence.save_fuzzy_variables#

ex_fuzzy.persistence.save_fuzzy_variables(fuzzy_variables)[source]#

Save multiple fuzzy variables to a text string representation.

This function serializes a list of fuzzyVariable objects into a single text string that can be saved to files and later loaded using load_fuzzy_variables().

Parameters:

fuzzy_variables (list) – List of fuzzyVariable objects to be serialized. Each variable should contain properly configured fuzzy sets with membership functions.

Returns:

Text representation of all fuzzy variables concatenated with newlines.

Each variable is separated and formatted according to the ex-fuzzy text specification.

Return type:

str

Example

>>> variables = [temperature_var, pressure_var, flow_var]
>>> text = save_fuzzy_variables(variables)
>>> # Save to file
>>> with open('fuzzy_vars.txt', 'w') as f:
...     f.write(text)

Note

This function calls print_fuzzy_variable() for each variable and concatenates the results with newline separators for proper file formatting.