Any one working on pset11?
I wrote some code for "bruteForceSearch",but get error in the idle.
p11_src(Details are described between line 38 and 54):
and for graph.py(include some class def by myself):
I do some test on my code but get even more confused results, addtional info has been added between line 56 and 80.Sorry to bump aggain,this one can really got a rookie like me crazy...
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga.
Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus.
Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.
so the traceback tells you exactly what the problem is (lines 47 and 48 of your first paste).
that looks like a 'custom' error. you need to find the line of code that says raise ValueError... "Start or end not in graph." and determine what causes it. then work backward from there -
that's what make raising errors nice, especially if you put descriptive info in their arguments
Thanks.I'm still trying..
looks like the digraph is missing a start or end node - line 112,113 of the first paste
Not the answer you are looking for? Search for more explanations.
I print the whole campus map in IDLE.Now i am sure that the 'rode' "32->56"is in my graph,but somehow it looks like the node 32 and 56 is not there. A pretty confusing one,huh? .... I am trying to trace the real problem from line 112 and 113...Maybe the error was raised in the addNode()?
well i didn't try to run it, but it stopped executing because of a ValueError("Start or end not in graph."). How many places in the code can this happen? did you search for the following?
raise ValueError("Start or end not in graph.")
i think it had to get to that line and then digraph was deficient - maybe add some more info to the exception ... http://dpaste.com/811827/