Permalink
Browse files

Just removing cateory, and put added attributes inside the algorithm …

…framework
  • Loading branch information...
1 parent c373629 commit 640dcfa44abaf641c028fcaf3e95100c7ed1f088 @jonatasteixeira jonatasteixeira committed Nov 30, 2011
View
@@ -5,7 +5,6 @@ class Astar(Algorithm):
def __init__(self, graph):
Algorithm.__init__(self, graph)
- self.category = "Examples"
self.first = self.find(int(self.input_box("", "Origem")))
self.goal = self.find(int(self.input_box("", "Destino")))
@@ -4,8 +4,6 @@ class BreadthFirstSearch(Algorithm):
def __init__(self, graph):
Algorithm.__init__(self, graph)
- self.category = "Examples"
-
def run(self):
first = self.vertex_list[0]
View
@@ -4,13 +4,11 @@
class Cicle(Algorithm):
def __init__(self, graph):
Algorithm.__init__(self, graph)
-
- self.category = "Examples"
def run(self):
dest = [0,2,7,16,5,0]
-
+
for i in range(len(dest)):
v = self.find(dest[i])
for e in v.edge_list:
View
@@ -4,7 +4,6 @@ class Dijkstra(Algorithm):
def __init__(self, graph):
Algorithm.__init__(self, graph)
- self.category = "Examples"
self.first = int(self.input_box("", "Origem"))
self.goal = int(self.input_box("", "Destino"))
View
@@ -1 +1 @@
-eJytWst22zgS3fM3ZpGsbFTh/QHjOb2YXkyfM1sfWVZgdRxLx1L6MV8/9SApggQVpdObxKIIoHDvRb2g7fZw/PPxfVc6+md7eDud379uz4f37mi6j9vX/dNded8cX7p/yb9H6LaPj09f96/n/dvjY3d4+nW3PXdH7H4+H233n6PrPj4ffffLh+c9TXfePX/ojqH7yZju9MuHL19p2PF1R88iPQN+dt6f5UGiMdvD4fVuWz7Rx8zfPW22n8v74evb8+P28Hp4p+dg6L1/fPrE74BM8Nvu/bzf7k78ALuPr0ewXRls5y93f3T/1f+O4LoipoInWyGwsRA7nWT3x+Pr/nTmeVK9y9OOtgi5+0izo5HZyzgVAk2FyFMhrUxjy/Cqm7/Kq6KsirF+lf6kOTaz9zO9bw2/b6F63yK9EroNgc6oW8dInHavA+TWD5h/OrydH0/7/zHGNnQPgHf6fP/6Oq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05dFpfmG25ai7cDm6eNIXqMsDTHUhpjjhljdZhw6xFIh/0iHOKiQEgxonWk5RteZ1vWV41tONqsas1C3I4bb6rYOVq7LYzfvwTvJ+5256SoL5Bsoa1dZzsxDvZPbSae3k87OL7EEPL4kMeu3WDc5OOhvR8UVMHC0tAVZunWX5TgXZauqMUuACbd2O966te+CLL6O0DewnA1iTrxFw2ZNw07Ovly/qfniD3l2wRlaftOBbYxZbhbYV9q4vNFZ95VmvlnQ60G+UZC7MvmGRd8esoo3e1Np4W/kSmtTxDKRedCXWffaG+Ju29A45L7JRgsDKZo2UktvJDffnMa+gxS2jtzcLwBDOX+SR0536etbzEoFElzkXrM6fnJZM7vfX4tBela/kST2XYbe1jDYetxIGe+A64z7l8OX3f3Tdnv/+9mk+z8P759Px812d8/fCdzdnzZfjq+70/3ke3tOW8Lnv487+cSdhH/z1/7k+4P8CM203fI4fH3vcbvZvsgYKsZ+PT3d/R/yDLO/
View
@@ -289,14 +289,10 @@ def edit_properties(self, cell, path, new_text, column):
return
def add_properties(self):
- t_identifier = "identifier"
- t_value = "value"
+ t_identifier = "identifier"
+ t_value = "value"
self.liststore_properties.append([t_identifier, t_value])
-
setattr(self.vertex, "user_" + t_identifier, t_value)
-
-# self.add_state()
-# self.area.queue_draw()
def remove_properties(self):
selection = self.treeview_properties.get_selection()
View
@@ -173,4 +173,12 @@ def input_box(self, markup="", prompt="", secondary_markup=""):
dialog.destroy()
return text
-
+ def set_attribute(self, what, identifier, value):
+ setattr(what, "user_" + str(identifier), str(value))
+
+ def get_attribute(self, what, identifier):
+ return getattr(what, "user_" + str(identifier))
+
+ def remove_attribute(self, what, identifier):
+ delattr(what, "user_" + str(identifier))
+
View
Binary file not shown.

0 comments on commit 640dcfa

Please sign in to comment.