Section for working with fuzzy analytical networks
- class fuzzyops.fan.fan.Edge(start_node: Node, end_node: Node, weight: float)[source]
Bases:
objectRepresents an edge in a fuzzy analytical network
- weight
The weight of the edge, representing its degree of feasibility
- Type:
float
- class fuzzyops.fan.fan.Graph[source]
Bases:
objectIt represents a directed graph, a fuzzy analytical network The algorithm is implemented according to the article https://cyberleninka.ru/article/n/nechetkaya-alternativnaya-setevaya-model-analiza-i-planirovaniya-proekta-v-usloviyah-neopredelennosti
- nodes
Dictionary of nodes in a graph
- Type:
dict
- add_edge(start_node_name: Node, end_node_name: Node, weight: float) None[source]
Adds an edge to the graph
- add_node(node_name: str) Node[source]
Adds a node to the graph and returns it
- Parameters:
node_name (str) – The name of the initial node
- calculate_path_fuzziness(path: List[Node]) float[source]
Calculates the fuzziness of a given path
- Parameters:
path (List[Node]) – A path represented as a list of node names
- Returns:
Estimation of path fuzziness
- Return type:
float
- Raises:
ValueError – If the path is invalid (i.e. there are no edges between nodes)
- find_most_feasible_path(start_node_name: Node, end_node_name: Node) List[str][source]
Finds the most feasible path between two nodes based on fuzziness
- class fuzzyops.fan.fan.Node(name: str)[source]
Bases:
objectRepresents a node in a fuzzy analytical network
- name
Node name
- Type:
str
- Parameters:
name (str) – Node name
- fuzzyops.fan.fan.calc_final_scores(f_nums: List[FuzzyNumber]) float[source]
Calculates the final score from a list of fuzzy numbers
- Parameters:
f_nums (List[FuzzyNumber]) – List of fuzzy numbers
- Returns:
The result of defuzzification of fuzzy numbers
- Return type:
float