Skip to content
Snippets Groups Projects
Commit 2bbcc366 authored by imcovangent's avatar imcovangent
Browse files

Finished first version of BLISS-2000 architecture.

Expanded SSBJ database.


Former-commit-id: fbf7c558c75f94e669bef692ed8afb13cb2c06fd
parent b0f5e4dc
No related branches found
No related tags found
No related merge requests found
......@@ -170,6 +170,28 @@ class EquationMixin(object):
return
def add_mathematical_function(self, input_nodes, function_node, output_nodes):
# TODO: Add docstring
assert not self.has_node(function_node), 'Function node {} already exists in the graph.'.format(function_node)
self.add_node(function_node, category='function', instance=1, label=function_node)
for input_node in input_nodes:
if not self.has_node(input_node[0]):
self.add_node(input_node[0], category='variable', instance=1, label=input_node[0].split('/')[-1])
if not self.has_edge(input_node[0], function_node):
self.add_edge(input_node[0], function_node, equation_label=input_node[1])
else:
self.adj[input_node[0]][function_node]['equation_label'] = input_nodes[1]
for output_node in output_nodes:
if not self.has_node(output_node[0]):
self.add_node(output_node[0], category='variable', instance=1, label=output_node[0].split('/')[-1])
if not self.has_edge(function_node, output_node[0]):
self.add_edge(function_node, output_node[0])
self.add_equation((function_node, output_node[0]), output_node[1], output_node[2])
return
def _create_cmdows_equations(self, graph_math_funcs):
"""Method to create the CMDOWS mathematicalFunctions element
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment