Assignment 2, CS 349, W13

Due Friday, February 8, 2013 @ 11:59pm

Note the 48 hour grace period policy in the course slides.

The programming language for this assignment is Java

In the world of Fraggle Rock, the Doozers are a group of construction workers who build structures out of a candy-like substance that the Fraggles then eat. To understand more about the world of Fraggle Rock and the life of hard work the Doozers endure, check out the Wikipedia Page on Fraggle Rock characters.

The Doozers have recently received a new construction device, a remotely controlled crane. The crane has arms that pivot in circular arcs. It has a non-pivoting electromagnet on the end of its set of arms. Finally, it rests on tracks which allow it to move forward and backward. A basic picture of the crane is shown to the right.

Your task for this assignment is to implement a remote-controlled-crane simulator in Java, i.e. a Java software program that allows doozers to practice with the crane before trying to use it in the real world.

Base-Level Interactions

You may assume your world is a 2.5D world. The crane exists on one level and the blocks exist on a second level. As a result, the crane can pass in front of the blocks that it manipulates. The electromagnet exists in both planes of your 2.5D world, so it must be lifted over blocks as you are driving, and obviously it can come into contact with blocks it wishes to lift. Note that blocks should also not overlap with other blocks. Only the crane and crane arms can pass in front of blocks. The blocks should not be visible when the crane passes in front of them.

The following base-level expectations exist for this project:

  1. The crane is controlled via a direct manipulation interface. Users can click on the crane's arms. A vector can be calculated relative to the selected arm's pivot point. As the arm moves, new vectors are created. To determine the angular movement of the arm, you need to calculate the angle between vectors as you manipulate the arm using the dot product of the vectors and the product of the vectors' magnitudes. See Wikihow entry if you've forgotten how to do this. While pivoting one arm, all other arms are locked in a fixed position.
  2. To pick up a block, the electromagnet must be placed directly on top of the block, i.e. its long edge should be very close to parallel to the top of the block.
  3. You can fasten and release the electromagnet-block connection (i.e. turn on and off the electromagnet) by clicking on the electromagnet attachment at the end of the crane.
  4. Once attached to the block, the electromagnet is very strong magnet. The blocks should freely rotate to stay aligned with the electromagnet, and the electromagnet can be assumed to be strong enough to lift any block without the block falling off.
  5. Blocks are somewhat fragile. If they are not placed on the ground with one edge parallel to the ground, then they will break in the real world. Remember, these blocks are actually formed of a candy-like substance. In your simulator, you obviously don't need to break the blocks, but an expected penalty for a block that is not placed carefully on the ground could be that the movement of the block is undone, and the block (but not the crane) returned to its initial position.
  6. Note that, because of the fragility of the blocks, if you detach the electromagnet with the block in the air, a similar penalty should occur.
For this assignment, fulfilling the base-level expectations elegantly will generate 85% of the marks for this project.

Enhancements

The remaining 15 marks for this project are dedicated to enhancements. What makes sense in a simulator? Possibilities might include:
  1. Some gamification (i.e. rearrange the blocks into the following orientation)?
  2. Variations in terrain, and a crane that takes these variations into accound (orientation changes, tracks move at the rate of the ground displacement, gullies and hills are traversed as a crane on tracks would traverse these geographic features).
  3. Physics associated with the block placement (e.g. placing them so the centre of mass is not over the base causes the blocks to fall down).
  4. Etc.

Any single significant custom enhancement to the basics of the simulator (on the order of the enhancements above) will be sufficient for the remaining 15%. You enhancement should be described in a README file, included with your submission.

Submission

Submit the following:

Assessment

FAQ

  1. Say I can't do a very good enhancement. What happens if I do two half-baked enhancements? One good enhancement is worth more than two half-baked enhancements. The TAs will be looking to a single, good enhancement to generate that bulk of the additional marks. Don't try to half do a bunch of things. Pick one thing and do it well.