working on RSNA

This commit is contained in:
Artur Meski
2016-12-29 20:21:56 +01:00
parent ba8cb798e4
commit ebee3aa03e
6 changed files with 132 additions and 263 deletions

View File

@@ -8,7 +8,11 @@ class ExtendedContextAutomaton(ContextAutomaton):
def __init__(self, reaction_system):
self._actions = []
super(ExtendedContextAutomaton, self).__init__(reaction_system)
@property
def number_of_actions(self):
return len(self._actions)
def add_transition(self, src, actions, ctx_reaction, dst):
"""Adds a transition

View File

@@ -3,12 +3,16 @@ from sys import exit
class NetworkOfContextAutomata(object):
def __init__(self, context_automata):
self.cas = list(context_automata)
self.automata = list(context_automata)
@property
def number_of_automata(self):
return len(self.automata)
def show(self):
for ca in self.cas:
for ca in self.automata:
print()
ca.show()
def add(self, aut):
self.cas.append(aut)
self.automata.append(aut)