Friday, 30 September 2011

CSC301 Assignment

Goal: Develop an application that returns at most 3 results for the shortest path between 2 MRT stations in Prolog, Scheme and C# languages.

C# and Prolog version is around 80 - 90% done. Just need to touch up on UI / data entry segments. The worry here is Scheme. Hopes to get it done by next week if possible. Leave us buffer time.

Remember Murphy's Law - Anything that can go wrong, will go wrong.

22 comments:

  1. Hey, i need help in prolog, would you be kind enough to give me some advice ?

    ReplyDelete
  2. hm .. i stuck at how to identify a transfer station when doing the printing

    ReplyDelete
  3. What I did was to find when the line change and then print out the name of the previous station.

    print([H1|[H2|T]]) :-
    interchange(H2),
    \+ sameline(H1,T),
    print_name(H2),
    actual_print([H2|T]).

    ReplyDelete
  4. cool, your code looks elegant. but I dun quite understand your code. =X interchange(H2) means u check if H2 is an interchange rite ? if H1 and the rest, T is not on same line, you print H2 ?

    ReplyDelete
  5. yup. What did was to check if it is an interchange, if the first and third station is not on the sameline then I'll print the 2nd station then I'll continue with the rest of the stations. BTW, the last line is print([H2|T]) not actual_print([H2|T]), it's supposed to call itself recursively until the list runs out, which is handled by another rule.

    ReplyDelete
  6. thx thx .. dunno if i know u or we have met before in lectures or tutorial, but thanks for helping me. arigatou gozaimasu

    ReplyDelete
  7. hi, i was wondering if u're taking csc 203 ? can help me with some explaination ?

    ReplyDelete
  8. for the lab 5 rite, part 5.3.2 Specify and check progress property.

    i dun really understand that progress thingy =X

    ReplyDelete
  9. Progress property is for specifying those actions that are expected to be used for a system.

    For example, if a system consists of flipping coins, we would expect heads and tails to occur at least once should we flip long enough.

    However, if the coin is unfair and always lands a head, we won't get a tail no matter how many times we flip the coin.

    We specify the progress property to check if both heads and tails will occur at least once. A bad progress (e.g. the unfair coin) will be found as it violates the progress property.

    Therefore, progress property is for checking if starvation will occur in that system.

    So for lab 5, the progress property is asking for those actions that are supposed to happen at least once in infinite occurrences.

    The checking of stress conditions is asking for a way to be simulate the bridge in a busy situation, i.e. how to show that there is a lot of traffic using the bridge.

    ReplyDelete
  10. i see, so it would be something like this ?
    progress PEOPLE = {p[Y].enter}
    progress BOAT = {sail_under}

    then u give lower priority to p[Y].exit, sail_out ?

    ReplyDelete
  11. Yup but remember that there are many instances of boats as well.

    ReplyDelete
  12. thx for telling me there are N instance of boats.. now I'm stuck ..lol can I check my answer with you ?

    ReplyDelete
  13. thx thx .. btw can i know ur name or something ? I should have seen you during lectures or tutorial rite ?

    ReplyDelete
  14. Haha, I'm Jack. What's your name?

    ReplyDelete
  15. i'm xinwei. lol . just as my nick suggest.

    ReplyDelete
  16. i think i saw u before. correct me if i'm wrong, yang feng's friend ?

    ReplyDelete
  17. Yeah haha. Don't remember you though paiseh..

    ReplyDelete
  18. lol .. narh .. is ok .. always out to make new friends !

    ReplyDelete