Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Java Task: AN INTERFACE Please help me with a single interface called Space in this program called You Must Fit It. Fit It Good This

Java Task: AN INTERFACE

Please help me with a single interface called "Space" in this program called "You Must Fit It. Fit It Good"

This program is about packing shapes into fixed size containers is an old problem with continued applications, particularly in shipping and handling services. For example, online retailers may seek to pack as many items in an order as possible into a single box to reduce shipping costs. On a larger scale, packing shipping containers onto oceanic container shipsthat travel around the world devolves to the same basic problem of packing a set of objects into a fixed volume.

-----Here is an overview of this program and some examples of how it implements Please read and help me. Thank you

Two-dimensional Packing

Packing shapes into fixed size containers is an old problem with continued applications, particularly in shipping and handling services. For example, online retailers may seek to pack as many items in an order as possible into a single box to reduce shipping costs. On a larger scale, packing shipping containers onto oceanic container shipsthat travel around the world devolves to the same basic problem of packing a set of objects into a fixed volume.

This project will focus on a problem in this class which has the following properties.

Spaces and Shapes

The space into which shapes will be packed is a rectangle comprised of blocks which are empty or filled. Each block in a space is referenced by its row/column coordinate which starts at 0 (in the upper-left corner).

........ .......| .....||| 

The dots (periods) represent empty blocks into which shapes may be put while the permanently filled blocks are drawn as vertical lines (pipes). For clarity, here is the same space with numbers around it to indicate the rows and columns.

 01234567 0 ........ 0 1 .......| 1 2 .....||| 2 01234567 

The space has height 3 and width 8. All blocks are empty except the following filled blocks: (1,7), (2,5), (2,6), (2,7).

There is no requirement that permanently filled blocks must exist on the edges of the space or be contiguous. The following is another valid space demonstrating the arbitrariness of filled block placement.

|....... ..|||..| ..|.|... ........ 

A shape is a rectangular grid of blocks which are filled or empty. For example here are a few all-too familiar shapes.

SHAPE T TTTT SHAPE e ..e eee SHAPE t .t. ttt SHAPE r rr rr SHAPE i i.. iii SHAPE s .ss ss. 

As with a space, a shape represents empty blocks with a period but filled blocks are represented using any other character aside from newlines. By convention, shapes will usually have a single display characterassociated with them which will be used for their filled blocks.

Note: Shapes will be restricted to contain a non-empty border: the 0th row, 0th column, last row, and last column must all contain at least one filled block. For more information refer to the section on illegal layout strings.

Placing Shapes in Spaces

Shapes may be placed into a space if there are no conflicts (overlaps) with any filled blocks (including other shapes). The placement locations indicates where the upper left (0,0) block of the shape would be located in the space. Consider the space and shape below.

SPACE |....... ..|||..| ..|.|... ........ SHAPE i i.. iii 

Placing the shape at block (2,5) would lead the space to look like the following

Shape at (2,5) 01234567 0 |....... 0 1 ..|||..| 1 2 ..|.|i.. 2 3 .....iii 3 01234567 

On the other hand, the shape might be placed at location (2,0).

Shape at (2,0) 01234567 0 |....... 0 1 ..|||..| 1 2 i.|.|... 2 3 iii..... 3 01234567 

Note that the block (2,2) is filled in the space. This is not a problem as the shape has an empty block in that position so it fits at (2,0) nicely. However, attempting to place the shape at (0,0) would lead to several filled blocks in the shape conflicting with filled blocks in the space and should result in an error.

Even if block (0,0) of a shape is empty, it is still used to indicate shape placement. Consider the space and shape below.

SPACE |....... ..|||..| ..|.|... ........ SHAPE t .t. ttt 

Block (0,0) of the shape is empty and can overlap with other filled blocks. The following are some of the valid locations where the shape may be placed. Note the row/column locations indicate where the upper left empty block of the shape will be placed.

Shape at (2,4) 01234567 0 |....... 0 1 ..|||..| 1 2 ..|.|t.. 2 3 ....ttt. 3 01234567 Shape at (2,5) 01234567 0 |....... 0 1 ..|||..| 1 2 ..|.|.t. 2 3 .....ttt 3 01234567 Shape at (1,5) 01234567 0 |....... 0 1 ..|||.t| 1 2 ..|.|ttt 2 3 ........ 3 01234567 Shape at (2,2) 01234567 0 |....... 0 1 ..|||..| 1 2 ..|t|... 2 3 ..ttt... 3 01234567 

Fitting Shapes into a Space

The central problem you will need to solve is whether a give list of shapes can all be fit together into a given space. For example consider the following space and shapes.

SPACE |....... ..|||..| ..|.|... ........ SHAPE T TTTT SHAPE e ..e eee SHAPE r rr rr SHAPE i i.. iii SHAPE s .ss ss. 

One possible fit of the shapes in the space is as follows.

|TTTT.ss rr|||ss| rr|e|i.. .eee.iii 

There may be other fits but you will primarily be responsible for determining if at least one exists and producing one. This is not always possible. For example if the shape

SHAPE t .t. ttt 

is added to the above, there is no way to fit all the shapes in the given space without changing the shapes (rotations are discussed in the next section).

Packing shapes into a space constitutes a computationally difficult problem and is almost certainly in the NP-hard complexity class. In simple terms, this means that to solve the problem, one may be reduced to searching every possible arrangement of shapes in a space to see if any works. While this is feasible for small numbers of shapes and spaces, it becomes intractable for large spaces and long lists of shapes as there are so many possibilities.

Shape Rotations

Shapes can be rotated in 90 degree increments to open up more potential packing solutions. Your implementation will be required to allow shapes to rotate clockwise in increments of 90 degrees. There are therefore 4 possible rotations of each shape referred to as follows.

CW0: no rotation

CW90: 90 degree rotation clockwise

CW180: 180 degree rotation clockwise

CW270: 270 degree rotation clockwise

Consider the following shape and its four valid rotations.

SHAPE t .t. ttt SHAPE t height: 2; width: 3; rotation: CW0 .t. ttt SHAPE t height: 3; width: 2; rotation: CW90 t. tt t. SHAPE t height: 2; width: 3; rotation: CW180 ttt .t. SHAPE t height: 3; width: 2; rotation: CW270 .t tt .t 

Notice that the height and width of the shape changes with rotations and the positions of the filled blocks change with each rotation.

If the initial orientation of the shape were different, then the rotations would be altered as is the case with the shape below.

SHAPE x x. xx x. SHAPE x height: 3; width: 2; rotation: CW0 x. xx x. SHAPE x height: 2; width: 3; rotation: CW90 xxx .x. SHAPE x height: 3; width: 2; rotation: CW180 .x xx .x SHAPE x height: 2; width: 3; rotation: CW270 .x. xxx 

It should be clear however that Shape t and Shape x are equivalent under rotations in terms of how they can be fit into a space.

Some shapes do not change on every rotation. This may lead to some redundancy in during search and among solutions to fitting problems but you are not required to deal with this in any special way. Examples:

SHAPE T TTTT SHAPE T height: 1; width: 4; rotation: CW0 TTTT SHAPE T height: 4; width: 1; rotation: CW90 T T T T SHAPE T height: 1; width: 4; rotation: CW180 TTTT SHAPE T height: 4; width: 1; rotation: CW270 T T T T SHAPE r rr rr SHAPE r height: 2; width: 2; rotation: CW0 rr rr SHAPE r height: 2; width: 2; rotation: CW90 rr rr SHAPE r height: 2; width: 2; rotation: CW180 rr rr SHAPE r height: 2; width: 2; rotation: CW270 rr rr 

The closing example of the last section involved the following space and shapes for which there was no fit without rotations.

SPACE |....... ..|||..| ..|.|... ........ SHAPE T TTTT SHAPE e ..e eee SHAPE t .t. ttt SHAPE r rr rr SHAPE i i.. iii SHAPE s .ss ss. 

However, with the introduction of rotations, a solution does exist. Some additional detail is given at the bottom indicating the state of each shape found.

FOUND FIT SPACE: height: 4 width: 8 |tTTTTss tt|||ss| it|.|err iiieeerr 6 shapes placed Shape at (0,2) SHAPE T height: 1; width: 4; rotation: CW0 TTTT Shape at (2,3) SHAPE e height: 2; width: 3; rotation: CW0 ..e eee Shape at (2,0) SHAPE i height: 2; width: 3; rotation: CW0 i.. iii Shape at (2,6) SHAPE r height: 2; width: 2; rotation: CW0 rr rr Shape at (0,5) SHAPE s height: 2; width: 3; rotation: CW0 .ss ss. Shape at (0,0) SHAPE t height: 3; width: 2; rotation: CW270 .t tt .t 

Implementation Issues

Representation of Spaces and Shapes

One of your primary tasks in solving this problem is to design classes that represent the notions of shapes and spaces. Unlike previous projects, you are not required to use any specific internal structure of the data for these classes. You should read the section Required Design Elements to keep in mind some required methods as specified in a few interfaces, but aside from the presence of the public methods mentioned there, you are free to implement your solution using any number of classes you feel is necessary. The public interfaces required give some guidance as to what should be done but you will need to do some planning about how to surmount the problems faced by these classes. Your solutions will need to be described in your design.txt document. Consider the following issues while designing your classes.

Shapes and Spaces need a way to keep track of their size (height and width) along with which blocks in their grid are filled and empty. There are several ways to do this such as using arrays, using lists of pairs, or other classes.

Shapes will need to be rotated (Spaces do not rotate). On rotation, the Shapes size (height/width) may change and its configuration of filled and empty blocks may also change. You only need to accommodate single clock-wise rotations by 90 degrees but this may happen multiple times. You will need to do some research to figure out how to transform the blocks in a Shape to reflect the rotation that was done. Some internet research may be helpful for this but make sure to include a comment string with any sources drawn from.

Spaces will need a way to detect whether a Shape can fit at a given location or if any filled blocks in the shape would be out of bounds, overlap with a permanently filled block, or overlap with the filled blocks of another shape that has been placed in the space. Code-wise this will look the following.

Shape shape = ...; Space space = ...; boolean fits = space.shapeFitsAt(1,3,shape); // true if the shape would fit, false otherwise 

Spaces will need a way to add shapes to themselves. Adding is done via placement of the shape in the space by passing in a shape along with its placement location. This uses the shape's current rotation.

Shape aShape = ...; Space space = ...; space.placeShapeAt(1,3,aShape); // space now contains aShape 

Spaces can produce string representations of themselves e.g. using the fitString() method and list out their currently placed shapes using the placedShapeInfo(). Placed shapes must be shown sorted by their display character.

Spaces can remove shapes by their display character. For example:

Shape aShape = ...; // display character is a Space bShape = ...; // display character is b space.placeShapeAt(1,3,aShape); space.placeShapeAt(4,0,bShape); space.removeShapeByDisplayChar(aShape.getDisplayChar()); // space no longer contains aShape space.removeShapeByDisplayChar('b'); // space no longer contains bShape 

Shapes and Spaces will be initialized using a layout string that is described in more detail in the Layout String Formats section.

Recursive Search for Fit

The primary objective of your implementation is to search for a fit of all of a given list of shapes into a space. You will specify a method in the FitIt class called

Space searchForFit(Space space, List unplaced) 

which will return either null if no fit exists or a space which is filled with the given list of shapes.

searcForFit() is best implemented recursively. It solves a search problem involving backtracking: while trying out candidate placement for shape X, another shape Y may not also be able to fit, in which case the method must back up and attempt to try another placement of shape X.

As an example, consider the following problem.

SPACE .. .. .| SHAPE a aa SHAPE b bbb 

An obvious strategy for an algorithm is to try placing Shape a at all possible locations with all possible rotations, then attempt the same for Shape b. For example a first attempt might place Shape a at (0,0) with no rotation (CW0).

Trying a rot:CW0 at (0,0)... Fits aa .. .| 

Unfortunately, this does not allow Shape b to be fit into the space. Consider all the possible location/rotation combinations which do not work.

Trying b rot:CW0 at (0,0)... No fit Trying b rot:CW90 at (0,0)... No fit Trying b rot:CW180 at (0,0)... No fit Trying b rot:CW270 at (0,0)... No fit Trying b rot:CW0 at (0,1)... No fit Trying b rot:CW90 at (0,1)... No fit Trying b rot:CW180 at (0,1)... No fit Trying b rot:CW270 at (0,1)... No fit Trying b rot:CW0 at (1,0)... No fit Trying b rot:CW90 at (1,0)... No fit Trying b rot:CW180 at (1,0)... No fit Trying b rot:CW270 at (1,0)... No fit Trying b rot:CW0 at (1,1)... No fit Trying b rot:CW90 at (1,1)... No fit Trying b rot:CW180 at (1,1)... No fit Trying b rot:CW270 at (1,1)... No fit Trying b rot:CW0 at (2,0)... No fit Trying b rot:CW90 at (2,0)... No fit Trying b rot:CW180 at (2,0)... No fit Trying b rot:CW270 at (2,0)... No fit Trying b rot:CW0 at (2,1)... No fit Trying b rot:CW90 at (2,1)... No fit Trying b rot:CW180 at (2,1)... No fit Trying b rot:CW270 at (2,1)... No fit 

At this point, there is no choice but to give up on the original placement of Shape a

Giving up on shape b in aa .. .| 

and try a different placement of it. Importantly, this is the notion of backtracking: one solution path did not work out so we must back up and try another direction to see if it leads to more success.

Trying a rot:CW90 at (0,0)... Fits a. a. .| 

To most humans, this placement for Shape a is equally as bad and will result in no fit being found for Shape b. This is because most humans are good at small constraint problems like this and recognize where Shape a should be placed. However, any such intuition would need to be encoded into an algorithm and it is far easier to simply enumerate all possible placements of shapes.

Eventually, the following placement of Shape a is made.

Trying a rot:CW90 at (0,1)... Fits .a .a .| 

This is the choice most humans would make right off the bat. After this, there is not much left in terms of search.

Trying b rot:CW0 at (0,0)... No fit Trying b rot:CW90 at (0,0)... Fits ba ba b| All shapes placed FOUND FIT SPACE: height: 3 width: 2 ba ba b| 2 shapes placed Shape at (0,1) SHAPE a height: 2; width: 1; rotation: CW90 a a Shape at (0,0) SHAPE b height: 3; width: 1; rotation: CW90 b b b 

Backtracking and Recursive Search

The notion of backtracking is rather easy to implement in a recursive method if you identify two base cases: a base case for success and a base case for failure. Complementing these two base cases is a recursive case in which calls for further search via a recursive call. In a recursive implementation ofsearchForFit(space,unplacedShapes) these cases are roughly as follows.

Success Base Case

The list unplacedShapes is empty so all shapes have been placed and the space currently contains a solution that should be returned.

Failure Base Case

The list unplacedShapes is not empty. A single Shape S is removed from it but there is no place in space to fit S. No solution exists for the current configuration of space so a failure should be signaled by returning null. S should go back into the list of unplacedShapes.

Recursive Case

The list unplacedShapes is not empty. A single Shape S is removed from it and a valid placement is found for S in space. Place S at the valid location in space, remove it from the unplacedShapes list, and recursively call searchForFit(). If the recursive call results in a success, return it. If it results in a failure, try a different placement of S in space.

Do not be seduced into thinking that the above description can be mechanically translated into a code version of searchForFit(): you will need to master the ideas presented there and experiment with the ordering of operations in order to implement the method correctly. This will take some time and effort.

A great boon while coding this effort is the ability to see exactly what is going on at any given moment. You are highly encouraged to use debugging print statements that allow you to see the progress of your algorithm. As an example, here is the whole debugging output for the problem in the previous section. You may use this as a model for your own debugging output or use a different style. It is very likely that teaching staff will want to see debugging output if you need help on searchForFit()and you will expedite your help by providing it.

SPACE: height: 3 width: 2 .. .. .| 0 shapes placed 2 shapes read SHAPE a height: 1; width: 2; rotation: CW0 aa SHAPE b height: 1; width: 3; rotation: CW0 bbb Trying a rot:CW0 at (0,0)... Fits aa .. .| Trying b rot:CW0 at (0,0)... No fit Trying b rot:CW90 at (0,0)... No fit Trying b rot:CW180 at (0,0)... No fit Trying b rot:CW270 at (0,0)... No fit Trying b rot:CW0 at (0,1)... No fit Trying b rot:CW90 at (0,1)... No fit Trying b rot:CW180 at (0,1)... No fit Trying b rot:CW270 at (0,1)... No fit Trying b rot:CW0 at (1,0)... No fit Trying b rot:CW90 at (1,0)... No fit Trying b rot:CW180 at (1,0)... No fit Trying b rot:CW270 at (1,0)... No fit Trying b rot:CW0 at (1,1)... No fit Trying b rot:CW90 at (1,1)... No fit Trying b rot:CW180 at (1,1)... No fit Trying b rot:CW270 at (1,1)... No fit Trying b rot:CW0 at (2,0)... No fit Trying b rot:CW90 at (2,0)... No fit Trying b rot:CW180 at (2,0)... No fit Trying b rot:CW270 at (2,0)... No fit Trying b rot:CW0 at (2,1)... No fit Trying b rot:CW90 at (2,1)... No fit Trying b rot:CW180 at (2,1)... No fit Trying b rot:CW270 at (2,1)... No fit Giving up on shape b in aa .. .| Removing a rot:CW0 from (0,0) Trying a rot:CW90 at (0,0)... Fits a. a. .| Trying b rot:CW0 at (0,0)... No fit Trying b rot:CW90 at (0,0)... No fit Trying b rot:CW180 at (0,0)... No fit Trying b rot:CW270 at (0,0)... No fit Trying b rot:CW0 at (0,1)... No fit Trying b rot:CW90 at (0,1)... No fit Trying b rot:CW180 at (0,1)... No fit Trying b rot:CW270 at (0,1)... No fit Trying b rot:CW0 at (1,0)... No fit Trying b rot:CW90 at (1,0)... No fit Trying b rot:CW180 at (1,0)... No fit Trying b rot:CW270 at (1,0)... No fit Trying b rot:CW0 at (1,1)... No fit Trying b rot:CW90 at (1,1)... No fit Trying b rot:CW180 at (1,1)... No fit Trying b rot:CW270 at (1,1)... No fit Trying b rot:CW0 at (2,0)... No fit Trying b rot:CW90 at (2,0)... No fit Trying b rot:CW180 at (2,0)... No fit Trying b rot:CW270 at (2,0)... No fit Trying b rot:CW0 at (2,1)... No fit Trying b rot:CW90 at (2,1)... No fit Trying b rot:CW180 at (2,1)... No fit Trying b rot:CW270 at (2,1)... No fit Giving up on shape b in a. a. .| Removing a rot:CW90 from (0,0) Trying a rot:CW180 at (0,0)... Fits aa .. .| Trying b rot:CW0 at (0,0)... No fit Trying b rot:CW90 at (0,0)... No fit Trying b rot:CW180 at (0,0)... No fit Trying b rot:CW270 at (0,0)... No fit Trying b rot:CW0 at (0,1)... No fit Trying b rot:CW90 at (0,1)... No fit Trying b rot:CW180 at (0,1)... No fit Trying b rot:CW270 at (0,1)... No fit Trying b rot:CW0 at (1,0)... No fit Trying b rot:CW90 at (1,0)... No fit Trying b rot:CW180 at (1,0)... No fit Trying b rot:CW270 at (1,0)... No fit Trying b rot:CW0 at (1,1)... No fit Trying b rot:CW90 at (1,1)... No fit Trying b rot:CW180 at (1,1)... No fit Trying b rot:CW270 at (1,1)... No fit Trying b rot:CW0 at (2,0)... No fit Trying b rot:CW90 at (2,0)... No fit Trying b rot:CW180 at (2,0)... No fit Trying b rot:CW270 at (2,0)... No fit Trying b rot:CW0 at (2,1)... No fit Trying b rot:CW90 at (2,1)... No fit Trying b rot:CW180 at (2,1)... No fit Trying b rot:CW270 at (2,1)... No fit Giving up on shape b in aa .. .| Removing a rot:CW180 from (0,0) Trying a rot:CW270 at (0,0)... Fits a. a. .| Trying b rot:CW0 at (0,0)... No fit Trying b rot:CW90 at (0,0)... No fit Trying b rot:CW180 at (0,0)... No fit Trying b rot:CW270 at (0,0)... No fit Trying b rot:CW0 at (0,1)... No fit Trying b rot:CW90 at (0,1)... No fit Trying b rot:CW180 at (0,1)... No fit Trying b rot:CW270 at (0,1)... No fit Trying b rot:CW0 at (1,0)... No fit Trying b rot:CW90 at (1,0)... No fit Trying b rot:CW180 at (1,0)... No fit Trying b rot:CW270 at (1,0)... No fit Trying b rot:CW0 at (1,1)... No fit Trying b rot:CW90 at (1,1)... No fit Trying b rot:CW180 at (1,1)... No fit Trying b rot:CW270 at (1,1)... No fit Trying b rot:CW0 at (2,0)... No fit Trying b rot:CW90 at (2,0)... No fit Trying b rot:CW180 at (2,0)... No fit Trying b rot:CW270 at (2,0)... No fit Trying b rot:CW0 at (2,1)... No fit Trying b rot:CW90 at (2,1)... No fit Trying b rot:CW180 at (2,1)... No fit Trying b rot:CW270 at (2,1)... No fit Giving up on shape b in a. a. .| Removing a rot:CW270 from (0,0) Trying a rot:CW0 at (0,1)... No fit Trying a rot:CW90 at (0,1)... Fits .a .a .| Trying b rot:CW0 at (0,0)... No fit Trying b rot:CW90 at (0,0)... Fits ba ba b| All shapes placed FOUND FIT SPACE: height: 3 width: 2 ba ba b| 2 shapes placed Shape at (0,1) SHAPE a height: 2; width: 1; rotation: CW90 a a Shape at (0,0) SHAPE b height: 3; width: 1; rotation: CW90 b b b

Here is the task-----------

Space Interface

The Space interface is also provided in the code pack and you will need to implement one or more classes which cooperate to fulfill the interface requirements.

// A Space is a rectangular grid of empty and filled blocks. On being // initialized, some blocks of a space are permanently filled. // Instances of Shape may be placed in the space so long as they are // in bounds and do not conflict with any filled blocks. Space classes // provide mechanisms to check whether shapes fit at a location in the // space, place shapes at a location, remove shapes, and display the // present contents of the space. public interface Space{ // Return the number of rows of the space public int getHeight(); // Return the number of columns of the space public int getWidth(); // Return true if the space has a filled block at the given row/col // position and false if the block is empty. A block may be filled // if it is permanently filled or if a shape has been placed in a // position such that the space's block is filled by the shape's block // If the position is out of bounds, return true as there is implicit // fill all around the space. DO NOT THROW EXCEPTIONS from this // method. public boolean isFilledAt(int row, int col); // Determine if the given shape may be placed at the indicated // row/col position. The row,col indicates where the upper left // corner [block (0,0)] of the shape would be placed. A shape would // not fit if one of its filled blocks would conflict with an // existing filled block in the space or would be out of bounds in // the space. public boolean shapeFitsAt(int row, int col, Shape shape); // Place the given shape at the given row/col position. The row,col // indicates where the upper left corner [block (0,0)] of the shape // would be placed. The shape should be removable and when // displaying info on the placed shapes, they must be shown in order // of their display characters (shape A before B before C...). // There may be more than one shape in a space with the same display // character. If the shape would not fit at the specified row/col // position, raise a FitItException with an informative message. public void placeShapeAt(int row, int col, Shape shape); // Remove the shape with the display character indicated by dc from this // space. Update all internal state so that blocks in the space that // were filled by the removed shape are emptied. public void removeShapeByDisplayChar(char dc); // Return how many shapes have been placed in this space. public int placedShapeCount(); // Return a string representing the space and the shapes that have // been fit into it. The following character conventions must be // used. // | : vertical bar for permanently filled blocks // . : period for empty blocks // displaychar : any space filled by a shape uses its display char // // Example: // aa.....e // aacddd.| // cccdd||| public String fitString(); // Give a listing of all the placed shapes. This should start with // the number of placed shapes, show the position of each shape, and // use the toString() of each shape. Shapes must be reported in // sorted order based on their display character (shape A before B // before C...). // // Example: // // 3 shapes placed // Shape at (0,0) // SHAPE a // height: 2 width: 2 rotation: CW90 // aa // aa // // Shape at (0,2) // SHAPE b // height: 1 width: 4 rotation: CW180 // bbbb // // Shape at (1,0) // SHAPE c // height: 2 width: 3 rotation: CW270 // ..c // ccc public String placedShapeInfo(); // Print a verbose string representation of the space. Start with // the string SPACE: then follow with the fitString() of the space // and finally the placedShapeInfo() string. // // Example: // // SPACE: // height: 3 width: 8 // aabbbbfe // aacdddf| // cccdd||| // // 6 shapes placed // Shape at (0,0) // SHAPE a // height: 2 width: 2 rotation: CW90 // aa // aa // // Shape at (0,2) // SHAPE b // height: 1 width: 4 rotation: CW180 // bbbb // ... public String toString(); }

-----Tester cases-----

Here is the link to the tester cases for Space.java: https://paste.ee/p/ETE30

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advances In Spatial And Temporal Databases 8th International Symposium Sstd 2003 Santorini Island Greece July 2003 Proceedings Lncs 2750

Authors: Thanasis Hadzilacos ,Yannis Manolopoulos ,John F. Roddick ,Yannis Theodoridis

2003rd Edition

3540405356, 978-3540405351

More Books

Students also viewed these Databases questions

Question

Identify and control your anxieties

Answered: 1 week ago

Question

Understanding and Addressing Anxiety

Answered: 1 week ago