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.
Hey, i need help in prolog, would you be kind enough to give me some advice ?
ReplyDeleteHow can I help you?
ReplyDeletehm .. i stuck at how to identify a transfer station when doing the printing
ReplyDeleteWhat I did was to find when the line change and then print out the name of the previous station.
ReplyDeleteprint([H1|[H2|T]]) :-
interchange(H2),
\+ sameline(H1,T),
print_name(H2),
actual_print([H2|T]).
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 ?
ReplyDeleteyup. 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.
ReplyDeletethx thx .. dunno if i know u or we have met before in lectures or tutorial, but thanks for helping me. arigatou gozaimasu
ReplyDeletenp, you're welcome.
ReplyDeletehi, i was wondering if u're taking csc 203 ? can help me with some explaination ?
ReplyDeleteHmm.. I'll try..
ReplyDeletefor the lab 5 rite, part 5.3.2 Specify and check progress property.
ReplyDeletei dun really understand that progress thingy =X
Progress property is for specifying those actions that are expected to be used for a system.
ReplyDeleteFor 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.
i see, so it would be something like this ?
ReplyDeleteprogress PEOPLE = {p[Y].enter}
progress BOAT = {sail_under}
then u give lower priority to p[Y].exit, sail_out ?
Yup but remember that there are many instances of boats as well.
ReplyDeletethx for telling me there are N instance of boats.. now I'm stuck ..lol can I check my answer with you ?
ReplyDeleteOk. I'll see if I can help.
ReplyDeletethx thx .. btw can i know ur name or something ? I should have seen you during lectures or tutorial rite ?
ReplyDeleteHaha, I'm Jack. What's your name?
ReplyDeletei'm xinwei. lol . just as my nick suggest.
ReplyDeletei think i saw u before. correct me if i'm wrong, yang feng's friend ?
ReplyDeleteYeah haha. Don't remember you though paiseh..
ReplyDeletelol .. narh .. is ok .. always out to make new friends !
ReplyDelete