You take your dogs to the dog park, and have a bag of tennis balls that you use to exercise them. Each of your d dogs has its own tennis ball that it recognizes, and it ignores all other tennis balls. When you throw a ball, the corresponding dog immediately chases it until it reaches the point where the ball landed. During the chase, it gets exercise. On the way back, however, the dog walks and does not get exercise. Exercise is measured in seconds, and accumulates only when the dog is running. Each of your dogs may have a different speed.
The dog park hosts many dogs/owners who use the park at the same time, all hoping to exercise their dogs. Over time, the owners have collectively trained their dogs to observe the following behavior. When a dog (say Fido) picks up a tennis ball, it checks to see if its owner is within 10 meters. If so, Fido returns to its owner. If not, and there is a person (say Mary) who is within 10 meters and closer to Fido than all other owners, the dog walks over to Mary, stopping 1 meter from her. Fido then waits up to 30 seconds for Mary to take Fido's tennis ball from him and throw it. If Mary throws Fido's ball, Fido chases it and the process continues. If after 30 seconds Mary does not take Fido's ball, or if Mary changes position within the 30 seconds without taking Fido's ball, Fido will abandon Mary and walk back to its owner. Fido will wait indefinitely for its owner at a 1m distance.
Each dog breed has its own running speed given below, and its walking speed is one quarter of its running speed:
Labrador | 10m/s |
Poodle | 8m/s |
Spaniel | 7m/s |
Terrier | 4m/s |
The simulation will happen at a fine granularity (e.g., 0.01 seconds per step) in order to properly handle collision detection for the faster dogs. You will probably want to visualize the simulation at a coarser granularity most of the time, e.g., one frame every simulated second. Every player will be assigned a name by the simulator from the set { Alice, Bob, Carol, Dave, ... }. See the simulator for a complete list. If your code is being used for two instances of an owner, each instance will be assigned a different name.
Owners can do one of the following things every 5 seconds:
Note that the 30 second wait time for a non-owned dog starts when the dog arrives, meaning that you will probably have up to 5 turns with an opportunity to interact with that dog.
The dog park is 200m by 200m, and n owners all show up at the gate at one of the corners at opening time. Each owner has exactly d dogs, but may have a different mix of the four dog breeds. (The set of mixes is a configuration parameter.) You have two potentially compatible goals:
We'll provide a dictionary of (nonoffensive) English words that you can use for signaling -- the simulator will check whether your word is in the dictionary or is a player name. In principle you can formulate sentences, but each word takes 5 seconds to communicate, and you can't do anything else while you're talking. On the other hand, you can listen while doing other tasks, and are notified of each spoken word at the end of the 5 second interval of the speaker, in time to use that information for your action in the next 5-second step. Your hearing is so good that you can make out individual words even if they're spoken at the same time.
Your player can see the positions of all owners and all dogs at the end of each 5 second interval, but as mentioned previously, can only communicate with other owners who are within 50m. You can also see whether (at the given moment) each dog (a) has a ball, (b) is running, (c) whether it is heading for its ball or a person, including the identity of the person, and (d) if it is waiting for a person to respond, and if so, how long it has been waiting. The simulator will keep track of the amount of exercise each dog accumulates. You can access this information from the simulator for your dogs, but not for other owners' dogs. The simulator will enumerate your dogs and your tennis balls, so that dog number 1 chases ball number 1, etc. The breed of each dog is accessible via the simulator. The balls and dogs will also have an owner (a name from the name list) that will enable you to specify actions specific to both your dogs/balls and dogs/balls belonging to other owners. At the start of the simulation, all dogs will be carrying their respective tennis balls.
Ken Ross 2020-09-09