Jump Box Drill Generator
02 Jan 2006
Update 25-Oct-2010 The New Jump Box Generator is HERE
I decided to write a web page for generating custom Click Here.to wrap up this subject. This article describes my approach. If you just want to generate some exercises you can skip the discussion and
As I discussed previously, you can always generate a valid sequence of jumps in a Jump Box by numbering the jump-sides in any order. I was initially interested in generating all sequences without repeating any obstacle. I was hoping the number of permutations was small enough that I could write a program to generate them all and post them for posterity. It turns out that this is possible but the number is too large to be of much use…
The classic analysis of permutations (Selection Without Replacement) would focus on using/visiting each jump-side combination only once. From that analysis there would be 8! (eight factorial) sequences (four jumps at two sides each) that visited each jump-side once and only once. That is 40320 sequences of eight jumps.
So while it would be straight forward to generate all 40320 sequences, that is still too many to post. Even the most training obsessed team wouldn’t want to practice every permutation.
Jump Box Actions
It is also true that specifying which side of a jump in the Box to jump doesn’t communicate anything about the skills needed to perform a drill. I wanted to figure out the unique permutations of the types of dog paths Agility handlers normally think about. So I focused on the shortest meaningful maneuver that can be performed in a Box. That “atomic operation” seemed to be the path from one jump-side to another jump-side. I call this maneuver an “Action”.
A dog can take a specific jump either going toward the center of the box or away from the center of the box. Once you choose a jump and the side from which to jump it, the next jump can be any of the four jumps in the box (this includes “back jumping” the jump the dog just went over) and which side of the second jump to take. Each Action ends with the dog in position for another Action that starts with jumping in or out of the Box.
So I made the following two diagrams. The left diagram shows the possible Actions from the starting location (“X”) when the dog takes the bottom jump jumping in to the center of the box. The right diagram shows the possible Actions from the starting location (“X”) when the dog takes the bottom jump jumping out from the center of the box.
|Possible Actions Jumping In||Possible Actions Jumping Out|
While the diagrams show a specific direction for Around I don’t want to specify the direction that the dog is wrapped around a jump; the direction shown is just one of the options. Specifying the Wrap/Around direction would have added further permutations to the mix and made for some really ugly permutations by over constraining the handling. So, in spite of the diagrams, an Action with a Jump Wrap or an Around doesn’t actually specify wrapping to the left or the right.and
I also didn’t distinguishing between Action “A” performed between the bottom and left jumps from performing Action “A” between the top and right jumps; both count as “A” Actions. Given that decision, for each of the two directions for taking a jump there are 7 possible choices of next Action. Since I’m allowing each Action to be used only once I believe the total number of unique Action sequences is then 7! + 7! = 10080. Still too many sequences to enumerate.
Jump Box Drill Generator
So I decided that it would be more useful to create a web page (CGI script) to allow handlers to generate their own Jump Box sequences instead. The page allows you to specify the total number of obstacles in each sequence and the maximum number of each Action to perform in each sequence. Setting the maximum for an Action to zero excludes that Action from the sequence. A page is generated containing up to eight randomly generated drills according to the user’s specification. The same settings can be supplied again and again to generate different sets of drills (assuming valid settings).
For the software developers out there I represented each of the Actions as a node in a directed graph. Where nodes are connected based on the allowable next Actions. I then used a depth first traversal of the nodes with randomized selection of next nodes and a counter of the maximum allowed use of each node to build the paths.
As is the case for many software development tasks, the 80-20 rule (Pareto Principle) applied. I was able to generate the permutations of Actions within a couple hours (my Perl skills were a little rusty). It then took significantly more time to resolve the layout of the jump numbers, course sizing, and limiting the CPU used for searching for highly constrained solutions. The other application of the 80-20 rule was also true, I found 80% of the bugs in 20% of the code. I won’t bore you with the details.
I decided to generate pure HTML using only two images (the two jumps) to allow users to easily store generated pages for use offline.
So if you want to make your own set(s) of Jump Box Drills just Click Here.
I have always wanted to automatically generate courses. This was a baby step that allowed me to play around with some of the representation and computation issues that have to be resolved to generate more complex types of courses.