コード例 #1
0
ファイル: Dag.py プロジェクト: chargen/HSynth
   def addOperation(self, OperationType, NodeA, NodeB = None):
      # search for the Operation with the Same Properties

      i = 0

      while i < len(self.Content):
         if (self.Content[i].OperationType == OperationType) and \
            (self.Content[i].NodeA == NodeA) and \
            (self.Content[i].NodeB == NodeB):

            # ...
            return i

         i += 1

      NewElement = DAGElement(OperationType)
      NewElement.NodeA = NodeA
      NewElement.NodeB = NodeB

      self.Content.append(NewElement)

      return i