![]() |
.. (לתיקייה המכילה) | |
Which function should I use when I want to compute distance between two nodes in the graph? | |
You should use the function "compute_distance" defined in tools.py. |
Units Clarification | |
In the map, link distances are given in [meters]. current_average_speed returns speed in [km/h]. compute_distance returns distance in [km]. cost(UC_time) and cost(A*_time) in question 15 (page 9) should be given in [hours]. |
אם צומת פותח מספר פעמים במהלך ריצת אלגוריתם, כיצד הדבר ישפיע על חישוב מספר פיתוחי הצמתים? | |
שימו לב כי עליכם לספור את *מספר פיתוחי הצמתים* ולא את מספר הצמתים שפותחו. בפרט, עבור כל צומת, מספר פיתוחי הצמתים הכולל יגדל לפי מספר הפעמים שהצומת הזה פותח. זכרו כי אנחנו מתייחסים למספר פיתוחי הצמתים כמדד לזמן הריצה של האלגוריתם, לכן אם באלגוריתם מסוים צמתים מפותחים יותר מפעם אחת הדבר משפיע על זמן הריצה שלו ונרצה לראות זאת בתוצאות המתקבלות. |
Why are some functions required to accept two junctions which have a link between them, and some are required to accept the link itself? | |
No good reason. As long as there is no more than one directional link from node A to node B (which is exactly the case in this HW), this should be equivalent. Specifically, the function expected_time you implement (page 9) can recieve a link between two nodes if you prefer to implement it that way. |
Should I or Shouldn't I implement the algorithms in main2.py and main2b.py? | |
You should implement your algorithms in a separate file. main2.py and main2b.py are meant to test the algorithms, and they are only required to return the path, while, for your assignment, you also need the number of node developments. Implement the algorithms anywhere you'd like, just call them and return the path in the main files. |
I'm having trouble importing things from modules in ways. What should I do? | |
You can edit __init__.py (from the ways folder). Node the comment (first line in the file). After you perform the imports, add these to __all__ You don't have to do this - for most people this doesn't seem to cause a problem |
I have used the original files in my experiments and cost(A*) was optimal. What should I do? | |
In such a case you don't have to regard the problem in the data in your explanations. We do encourage you to try and explain why this is possible (meaning how is it possible that A* returns an optimal solution even though it does not use an admissible heuristic), but this is not necessary. Students who have used the original files and got A* to return non-optimal solutions are expected to explain why this could have happened in the original files. |