Flock_Specification-2004.doc - Old Flock Specification for revision for CREATURES 1 NOTE Not all of the creature implementations need to be the same The

Flock_Specification-2004.doc - Old Flock Specification for...

This preview shows page 1 - 3 out of 6 pages.

Old Flock Specification, for revision for CREATURES NOTE: Not all of the creature implementations need to be the same. The implementations must only meet the specifications outlined. Differences in creature behavior will not be penalized as long as the behavior is within the specifications contained in this document. Flock Algorithm: Within a single "creature", the crowd algorithm that you will implement is as follows: A) INITIALIZATION STATE: (only used when creature is first turned on) set gNum = Local # % 16 Wait to receive a packet of type AdjustGlobals then go to C (optional: accept PlaySoundN, just keep the gNum = Local # % 16 instead of a random sound ) B) WAIT STATE Wait to receive a packet of type AdjustGlobals or PlaySoundN IF( AdjustGlobals) set gNum = random sound On AdjustGlobals go to C IF( PlaySoundN) set gNum = received in message On PlaySoundN go to D C) CLEAR STATE With radio off, clear FIFO data (all historical data) Wait for random amount of time (1000- 4000 milliseconds) D) PLAY STATE With radio off, play gesture(gNum), If got to PLAY STATE from a PlaySoundN packet goto WAIT STATE after sending a PlayedSound message E) Start the radio and set listen timer for random(minListen, maxListen) milliseconds. Goto F (unless silent). Do not wait for listen timer to complete (done in state G.) F) Set a timer for minListen/2 milliseconds for sending a "I played sound" message when timer fired G) When listen timer runs out, decide next gNum (see below for algorithm. You need to follow the specified algorithm) H) Repeat steps D through H. Some Implementation Details: Each of your creature’s Node ID (LOCAL_ADDRESS) will be your (Kit Number*2)-1 or (Kit Number*2). The first item in the data/payload section of a crowd message is the address of the sender. There are two designators for the sender address in the message specifications: “Node0” and “TransmittingNodeNum”. The “Node0” designator is used to signify that a packet should only be processed if it was sent from the root node (address == 0). The “TransmittingNodeNum” designator signifies that packets should be accepted from any source. 1
Image of page 1

Subscribe to view the full document.

Old Flock Specification, for revision for CREATURES There are 5 types of Active Messages your program must handle; they are as follows: AM # Flock Message / Packet 50 AdjustGlobals - A message from Node 0 containing global parameters for all creatures .
Image of page 2
Image of page 3
  • Winter '14
  • CHARLES

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern

Ask Expert Tutors You can ask You can ask ( soon) You can ask (will expire )
Answers in as fast as 15 minutes