.. (לתיקייה המכילה) | ||
What is this syntax? | |
This is called "List Comprehension". It creates a list of links in legal_list for which the condition "[l.target,current] not in path" holds. In set theory notation, you would write: {l | l \in legal_links & [l.target,current] not in path} This is a python feature which may described as "Syntactic sugar" (a short syntactic structure which is compact and readable but could be implemented otherwise with other syntax structures). For more info, see documentation in the following link under 5.1.4. List Comprehensions. | |
קישור: Link: Ссылка: وصلة: | http://docs.python.org/2/tutorial/datastructures.html |
There seems to be some problem with the conectivity of the graph provided (israel.pickeled) ... | |
You are correct. This issue will hopefully be fixed soon. Try to continue with the assignment while keeping in mind that a new israel.pickeled will be supplied. |
האם צריך להריץ את אלגוריתם Astar עם מגבלת זמן? פרמטר הזמן מופיע ב-API של הפונקציה solve, ולא הייתה התייחסות אליו בהוראות התרגיל. | |
ככל הנראה לא תהיה מגבלת זמן ריצה אמתית בתרגיל. יתכן שנקבע בבדיקה מגבלת זמן מאוד לא הדוקה כך שתמנע מצבים של תקיעה בלולאה אינסופית. |
In part A-2.4, let's assume we have 3 weights: w1 for distance, w2 for time & w3 for petrol. | |
Your are right, the units do not match. So make them match in some way you see fit and describe it in your document... |
לא הבנתי איך אני אמור לממש את פונקציות __hash__.? האם זה בסדר שלשני | |
הדרישה היחידה מפונקציית __hash__ היא שתחזיר ערך זהה לכל שני אובייקטים שווים (equals). "The only required property is that objects which compare equal have the same hash value" http://docs.python.org/2/reference/datamodel.html כל פונקצייה שתעמוד בתנאי זה היא בסדר. היינו רוצים ששני אובייקטים שאינם שווים יקבלו ערך __hash__ שונה אך זה כמובן לא אפשרי במקרה ויש יותר אובייקטים אפשריים מתחום הייצוג של המספרים השלמים (integer). |
טעינת המפה לוקחת זמן רב (כ5 דק') האם ניתן להימנע מכך איכשהו? | |
הנה הצעה יפה לפתרון של מיכאל (סטודנט בקורס). הרעיון הוא שהמעטפת מפעילה את החלק הכבד פעם יחידה, ואז מפעילה את החלק הקל כל פעם מחדש ללא טעינה חדשה (תוך שימוש באובייקט קיים בזכרון). | |
קישור: Link: Ссылка: وصلة: | https://dl.dropbox.com/u/1992761/ForAiStudents/LoadMap_wrapper.zip |
the old version of GenerateProblem is obsolete? will it be a problem if we use it? | |
Note that the old version works differently: It chooses a starting juction and performs a random walk until a junction which is distant enough (DEFAULT_MINIMUM_DISTANCE) is reached. Please do not use it for creating the100-problem dataset. You may use it for debuging if you wish at your own risk. |
Is the Petrol consumption profile supposed to be in KMs/Liter units? | |
Yes, sorry for the previous typo, fixed in the current version. |
בחלק א-5 מתקבלות תוצאות זמן ריצה מוזרות עבור משקל w=1. מה לעשות עם זה? | |
הבעיה ידועה ואינה נובעת ככל הנראה מבאג שלכם. מי שמעוניין לחפור בתופעה ולהסביר את הגורם לה בדו"ח, מוזמן, אך הדבר אינו הכרחי. |
כיצד יתכן שהתוצאות משתנות מטעינה לטעינה? | |
המהירויות מוגרלות בטעינת המפה ולכן כל הרצה תהיה שונה מקודמתה מבחינת המהירויות. כדי להימנע מכך, ניתן להשתמש במעטפת הקוד של מיכאל (ישנו לינק בפורום זה). המעטפת דואגת לבצע טעינה אחת של המפה עבור כל ההרצות. |
לחלק ב' מצאנו פתרון מהיר שפוגע בקבילות האלגוריתם ופתרון איטי ששומר על הקבילות. באיזה מהם להשתמש? | |
בחלק זה חובה לשמור על קבילות האלגוריתם ולשכנע מדוע היא נשמרת. יתכן שזמן הריצה יהיה איטי ולא יחסוך זמן אפילו ביחס לאלגוריתם בייסליין, גם זו תוצאה אפשרית אבל אין לפגוע בקבילות האלגוריתם על מנת לחסוך בזמן ריצה. |
האם בגרסה החדשה (4) השתנו המספרים המזהים של הצמתים ביחס לגרסאות הקודמות? | |
כן! |