Lines Matching refs:self

22     def __init__(self, file_path):
23 self.__dot_path = file_path
24 self.name = self.__get_model_name()
25 self.__dot_lines = self.__open_dot()
26 self.states, self.initial_state, self.final_states = self.__get_state_variables()
27 self.events = self.__get_event_variables()
28 self.function = self.__create_matrix()
30 def __get_model_name(self):
31 basename = ntpath.basename(self.__dot_path)
34 raise Exception("not a dot file: %s" % self.__dot_path)
38 raise Exception("not a dot file: %s" % self.__dot_path)
42 def __open_dot(self):
46 dot_file = open(self.__dot_path)
48 raise Exception("Cannot open the file: %s" % self.__dot_path)
57 raise Exception("Not a valid .dot format: %s" % self.__dot_path)
62 def __get_cursor_begin_states(self):
64 while self.__dot_lines[cursor].split()[0] != "{node":
68 def __get_cursor_begin_events(self):
70 while self.__dot_lines[cursor].split()[0] != "{node":
72 while self.__dot_lines[cursor].split()[0] == "{node":
78 def __get_state_variables(self):
84 cursor = self.__get_cursor_begin_states()
87 while self.__dot_lines[cursor].split()[0] == "{node":
88 line = self.__dot_lines[cursor].split()
97 if self.__dot_lines[cursor].__contains__("doublecircle") == True:
101 if self.__dot_lines[cursor].__contains__("ellipse") == True:
118 def __get_event_variables(self):
120 cursor = self.__get_cursor_begin_events()
123 while self.__dot_lines[cursor][1] == '"':
127 if self.__dot_lines[cursor].split()[1] == "->":
128 line = self.__dot_lines[cursor].split()
142 def __create_matrix(self):
144 events = self.events
145 states = self.states
159 matrix = [[ self.invalid_state_str for x in range(nr_event)] for y in range(nr_state)]
162 cursor = self.__get_cursor_begin_events()
164 while self.__dot_lines[cursor][1] == '"':
165 if self.__dot_lines[cursor].split()[1] == "->":
166 line = self.__dot_lines[cursor].split()