Loading ...
Sorry, an error occurred while loading the content.

search/domain/vacuum.lisp source code "rotate" function

Expand Messages
  • chenyu468
    Hi everyone, I have read vacuum.lisp , utility.lisp source code. The function rotate in the utility.lisp make me puzzle. The purpose of rotate
    Message 1 of 2 , Nov 30, 2003
    • 0 Attachment
      Hi everyone,
      I have read "vacuum.lisp", "utility.lisp" source code. The
      function "rotate" in the "utility.lisp" make me puzzle.

      The purpose of "rotate" function is to change the "oriention" of
      vacuum depends on the "current orientation" and "change requirement,
      for example 'left', 'right'".

      If I wrote this function ("rotate"), I would use the enumeration
      method to solve the problem, that's, combination of 4 possible ((1 0)
      (-1 0) (0 1) (0 -1))orientation and 2 possible change ("left"
      or "right").

      But the author ( Mr.Norvig or Mr. Russel) has solve the problem by
      algebra operation which is more elegant and abstract (just 2 possible
      combination, not 8 possible combination). I like this method, but
      don't know what's the theory details behind it. What's it, could you
      help me?

      Thank you for your attention.
      kind regards/chenyu
    • Peter Norvig
      The theory is vector arithmetic. If you work out the combinations, it turns out the same as what you would be doing in your enumeration of cases. -Peter
      Message 2 of 2 , Dec 1, 2003
      • 0 Attachment
        The theory is vector arithmetic. If you work out the combinations, it
        turns out the same as what you would be doing in your enumeration of
        cases.

        -Peter Norvig

        On Sunday, November 30, 2003, at 06:33 PM, chenyu468 wrote:

        > Hi everyone,
        > I have read "vacuum.lisp", "utility.lisp" source code. The
        > function "rotate" in the "utility.lisp" make me puzzle.
        >
        > The purpose of "rotate" function is to change the "oriention" of
        > vacuum depends on the "current orientation" and "change requirement,
        > for example 'left', 'right'".
        >
        > If I wrote this function ("rotate"), I would use the enumeration
        > method to solve the problem, that's, combination of 4 possible ((1 0)
        > (-1 0) (0 1) (0 -1))orientation and 2 possible change ("left"
        > or "right").
        >
        > But the author ( Mr.Norvig or Mr. Russel) has solve the problem by
        > algebra operation which is more elegant and abstract (just 2 possible
        > combination, not 8 possible combination). I like this method, but
        > don't know what's the theory details behind it. What's it, could you
        > help me?
        >
        > Thank you for your attention.
        > kind regards/chenyu
        >
        >
        > ------------------------ Yahoo! Groups Sponsor
        > ---------------------~-->
        > Buy Ink Cartridges or Refill Kits for your HP, Epson, Canon or Lexmark
        > Printer at MyInks.com. Free s/h on orders $50 or more to the US &
        > Canada.
        > http://www.c1tracking.com/l.asp?cid=5511
        > http://us.click.yahoo.com/mOAaAA/3exGAA/qnsNAA/7brrlB/TM
        > ---------------------------------------------------------------------
        > ~->
        >
        > To unsubscribe from this group, send an email to:
        > aima-talk-unsubscribe@yahoogroups.com
        >
        >
        >
        > Your use of Yahoo! Groups is subject to
        > http://docs.yahoo.com/info/terms/
        >
      Your message has been successfully submitted and would be delivered to recipients shortly.