zadeh.compile package

Module contents

Compilation tools for Zadeh

class zadeh.compile.CompiledFIS(*args, **kwargs)[source]

Bases: zadeh.fis.FIS

A compiled version of a FIS

static from_existing(fis)[source]

Get a CompiledFIS from a existing FIS.

Parameters

fis (FIS) – A Fuzzy Inference System

Returns

A compiled version of the FIS

Return type

CompiledFIS

get_crisp_output(values)[source]

Get the output of the system as a crisp value

Parameters

values (dict of str) – A mapping from variables to their fuzzy values.

Returns

Centroid of the output of the system

get_output(values)[source]

Get the output of the system as a fuzzy set

Parameters

values (dict of str) – A mapping from variables to their fuzzy values.

Returns

The fuzzy set

Return type

FuzzySet

zadeh.compile.compile_model(model, function_name='f')[source]

Generate and link a C-function.

Parameters
  • model (FIS) – Fuzzy inference System.

  • function_name (str) – Internal name of the function. Irrelevant while using the returned wrapper.

  • CC (str) – Compiler to use.

Returns

a wrapper around the compiled function.

Return type

Callable