|
Post by Hannes Vilhjalmsson on Feb 6, 2011 18:49:28 GMT -5
Please feel free to ask questions here that relate to the first programming assignment. For example if there is something in the information or code given to you that you do not understand.
We prefer that you post questions here than sending questions by email, simply because here everyone has an equal chance to read the answers.
Cheers!
|
|
|
Post by thorsteinnth on Feb 8, 2011 14:31:14 GMT -5
What is the BF, DF and ID search strategies supposed receive as an input parameter?
I don't understand the given Lisp code, how can I port a code I don't understand to C++ or Java? How should I implement BF, DF and ID search strategies in Lisp ( a language we just made "hello world" apps 2 weeks ago )?
|
|
|
Post by Angelo Cafaro on Feb 9, 2011 7:14:21 GMT -5
Hello thorsteinnth, first I recommend you to formulate the problem clearly, then you should be able to understand the data structures needed (i.e. node, state, environment). Then, depending on the data structures you have and how you organized them, your algorithm should have access to this data and manipulate them accordingly to the strategy. If you have difficulties you can follow the pseudo-code provided by the book (i.e. for BF at page 82 or DF at page 77).
Regarding the LISP questions what are exactly your problems?
|
|
|
Post by sigurdurjokull on Feb 9, 2011 9:21:04 GMT -5
How big should the environment be?
|
|
|
Post by Angelo Cafaro on Feb 9, 2011 9:33:41 GMT -5
sigurdurjokullHi, you can use the set of environments provided in the LISP skeleton file (the largest one is a 10x10 environment). However, if you like, you can try your implementations on a different environment with different sizes, maybe bigger! 
|
|
|
Post by Helgi Siemsen Sigurðarson on Feb 9, 2011 9:45:01 GMT -5
Can you make a list of struct for example: (defstruct square (my-square-id 0) (parrent-id 0) (movecount 0))
(setq bla (make-square :my-square-id 2 :parrent-id 1 :movecount 3)) (setq bla1 (make-square :my-square-id 1 :parrent-id 2 :movecount 4))
can you then put bla and bla1 into a list ?
|
|
|
Post by Angelo Cafaro on Feb 9, 2011 9:55:45 GMT -5
|
|
|
Post by Helgi Siemsen Sigurðarson on Feb 9, 2011 11:43:50 GMT -5
@angelo could you explane a little further i have tried but i always get an error
|
|
|
Post by Angelo Cafaro on Feb 9, 2011 12:41:03 GMT -5
Ok sure!
Let's use your declarations above (for example). Then you can create a new list with the following expression:
(setf my-list (list bla bla1) )
or you can create an empty list:
(setf my-list-2 (list) )
and then, add elements using push:
(push bla my-list-2)
Does this solve your problem?
|
|
|
Post by Helgi Siemsen Sigurðarson on Feb 9, 2011 13:03:34 GMT -5
yes
|
|
|
Post by thorsteinnth on Feb 9, 2011 17:33:42 GMT -5
Regarding the LISP questions what are exactly your problems? Everything. How do I create an environment using the given code? How do I create a "node" using LISP? How do I include information in that node? How do I make that node as a part of a linked list? How do I use stacks and queues in LISP? How do I make the BF and DF receive a node as a parameter? How do I access elements in each node? . . .
|
|
|
Post by Angelo Cafaro on Feb 10, 2011 6:01:46 GMT -5
Everything. How do I create an environment using the given code? How do I create a "node" using LISP? How do I include information in that node? How do I make that node as a part of a linked list? How do I use stacks and queues in LISP? How do I make the BF and DF receive a node as a parameter? How do I access elements in each node? . . . Well, in this case it would be better for you to meet me at CADIA (V.2.16) so I can clarify "everything" for you. Cheers, Angelo
|
|
|
Post by Helgi Siemsen Sigurðarson on Feb 11, 2011 9:56:03 GMT -5
@angelo I am having trouble debuging is there a possibilty to meet you.
|
|
|
Post by Angelo Cafaro on Feb 11, 2011 11:20:34 GMT -5
@angelo I am having trouble debuging is there a possibilty to meet you. Yes I'm at CADIA V.2.16, give me a ring when you are upstairs in front of the door so I can open you (7744221)
|
|
|
Post by sigurdurjokull on Feb 11, 2011 14:16:45 GMT -5
I didn't really find any good code to follow on DFS and Iterative deepening and heuristics. So i just took BFS and modified it. But now im wondering if the algorithms are actually correct. They return the result im looking for but the details may be off. For instance DFS is supposed to save space by only keeping track of part of the search tree, i'm not sure im doing that. I don't even see how they implement the search tree or node datastructure in the book. The question being: do you have pseudocode of DFS and Iterative Deepening?
|
|