CS6310 A4 Design - Implementation Spring2024 - v3
CS6310 A4 Design - Implementation Spring2024 - v3
Submission Deliverables
• This assignment must be completed as part of an approved group.
• You must submit the following items in Canvas:
(1) A PDF file named class_model_diagram.pdf that contains your updated UML Class Model
Diagram representing the static structure of the classes, attributes, methods, and the
relationships between the (class-generated) objects.
(2) A PDF file named sequence_diagram.pdf that contains your updated UML Sequence
Diagram representing the dynamic sequence of actions for the interactions specified below.
(3) A PDF file named state_diagram.pdf that contains your description of how the state of your
system – including the states of the participating Pokémon - progresses from start to the
conclusion of a tournament.
(4) A PDF file named use_case_diagram.pdf that displays the main features that will be needed
for an operator of the system to manage Pokémon tournaments.
(5) A ZIP file named 2024_01_A4.zip that includes your Java source code. The structure of the zip
file (i.e., how you should organize your code) is shown in more detail below.
• You may divide your class model diagram or sequence diagrams into multiple files if needed. For
example, if the initial diagram is so large that dividing it into multiples makes it significantly easier
to read, then you may submit multiple files with reasonable name extensions such as
class_model_diagram1.pdf, class_model_diagram2.pdf, etc. You must provide enough
context for the multiple diagrams to allow us to connect them together to understand the
singular/completed diagram.
• Formats other than PDF must be pre-approved by an instructor or TA.
• You must notify us via a private post on Canvas and/or Ed Discussion BEFORE the Due Date if you
are encountering difficulty submitting your project. You will not be penalized for situations where
Canvas is encountering significant technical problems. However, you must alert us before the due
date – not well after the fact. You are responsible for submitting your answers on time in all other
cases.
• Uploading files to Canvas occasionally takes a significantly long time, especially based on the
relative size of the files being submitted. Please plan accordingly, as submissions outside of the
Canvas Availability Date will likely not be accepted. You are permitted – and highly
recommended - to take advantage of the opportunity to submit your files an unlimited number of
times. Use the same file naming standards for your (optional) “interim submissions” that you do
for the final submission.
Problem Scenario
You are continuing your design and development of a system to manage battles between Pokémon.
Your system must support the capability to allow Pokémon to battle each other, and to keep track of
1
the status of the creatures to include (but not limited to) their capability levels, health, and battles
conducted (i.e., wins/losses). And your system must continue to allow new and arbitrary Pokémon to
be defined dynamically.
There are various websites that you can use to learn more about the Pokémon universe, including:
• https://www.pokemon.com/us
• https://en.wikipedia.org/wiki/Pokemon [alt: https://en.wikipedia.org/wiki/Pok%C3%A9mon]
• https://pokemongolive.com/?hl=en
You do not have to be a “Pokémon master” to complete this project successfully but understanding
something about the series will be helpful. The assignment instructions will specify the requirements
for your system.
[4] Source Code Provided & Compatible w/Docker [~20% of the functionality component]
Common issues that cause you to lose points in this category:
• The code doesn’t function properly in docker during testing – for example, JNI errors, etc.
• Gross formatting errors – we’ve designed the testing harness to be as robust as possible when
processing the submissions, but errors caused by including graphical displays of the space region,
diagnostic output, and other random messages will also cause you to lose points.
• Formatting and syntax are important! Use the matching characters for the output strings, and
don’t put extra spaces between elements of the output strings. Strings that do not match the
correct output because of formatting (syntax) errors might receive significant penalties.
• You will be tested against hidden test cases & hidden Pokémon. You need to make sure that your
existing Pokémon & our (new) Pokémon can battle against each other correctly.
• The provided test cases have all the skills your Pokémon will need. You will have to do some
sleuthing to piece together what skills are available to each Pokémon.
displayinfo,Charmander
> displayinfo,Charmander
Pokemon: Charmander has 25 hp
Attack Skills:
Name: Attack Damage: 1
Name: Scratch Damage: 2
Name: Ember Damage: 3
Name: Flamethrower Damage: 6
Defense Skills:
Name: Endure Defense: 1
Name: Block Defense: 2
Name: Protect Defense: 3
3
Conducting a Pokémon Tournament
Your system must be able to conduct a Pokémon Tournament as well. The tournament must be
conducted as a set of knockout rounds until only one Pokémon remains victorious. Also, there are no
Pokémon teams in this phase – each Pokémon is battling to win the tournament for itself.
The Pokémon will be listed in a specific order, and that order will determine how they must be paired
for the tournament. You must verify that there are at least four (4) or more Pokémon participating in
the tournament before the tournament begins.
Once verified you can start the tournament. As an example, in a tournament with four Pokémon, the
1st and 2nd Pokémon (as listed in order) must battle in the 1st round. In the (next) 2nd round, the 3rd and
4th Pokémon must battle. Finally, the winners of the 1st and 2nd rounds must battle in the 3rd and final
round to determine the overall winner of the tournament.
4
Bulbasaur is attempting to defend with Protect
Pikachu is attacking with Tail Whip for 2 damage to Bulbasaur
Bulbasaur successfully reduced Pikachu's damage by 3 with Protect
Bulbasaur has received 0 dmg, remaining hp is 6
Bulbasaur is attempting to defend with Protect
Pikachu is attempting to defend with Block
Bulbasaur is attacking with Vine Whip for 2 damage to Pikachu
Pikachu successfully reduced Bulbasaur's damage by 2 with Block
Pikachu has received 0 dmg, remaining hp is 15
Pikachu is attempting to defend with Endure
Bulbasaur is attempting to defend with Block
Pikachu is attempting to defend with Block
Bulbasaur is attempting to defend with Block
Pikachu is attacking with Thunder for 6 damage to Bulbasaur
Bulbasaur successfully reduced Pikachu's damage by 2 with Block
Bulbasaur has received 4 dmg, remaining hp is 2
Bulbasaur is attacking with Tackle for 1 damage to Pikachu
Pikachu has received 1 dmg, remaining hp is 14
Pikachu is attacking with Growl for 1 damage to Bulbasaur
Bulbasaur has received 1 dmg, remaining hp is 1
Bulbasaur is attempting to defend with Block
Pikachu is attempting to defend with Block
Bulbasaur is attempting to defend with Endure
Pikachu is attacking with Growl for 1 damage to Bulbasaur
Bulbasaur successfully reduced Pikachu's damage by 1 with Endure
Bulbasaur has received 0 dmg, remaining hp is 1
Bulbasaur is attempting to defend with Block
Pikachu is attempting to defend with Protect
Bulbasaur is attacking with Leaf Storm for 6 damage to Pikachu
Pikachu successfully reduced Bulbasaur's damage by 3 with Protect
Pikachu has received 3 dmg, remaining hp is 11
Pikachu is attempting to defend with Endure
Bulbasaur is attacking with Razor Leaf for 3 damage to Pikachu
Pikachu successfully reduced Bulbasaur's damage by 1 with Endure
Pikachu has received 2 dmg, remaining hp is 9
Pikachu is attempting to defend with Block
Bulbasaur is attempting to defend with Protect
Pikachu is attacking with Thunder for 6 damage to Bulbasaur
Bulbasaur successfully reduced Pikachu's damage by 3 with Protect
Bulbasaur has received 3 dmg, remaining hp is 0
Bulbasaur has lost
Pikachu has won the battle
Pikachu has won round 1
The 1st round battle has been concluded, and now the 2nd round battle commences…
5
Charmander has received 6 dmg, remaining hp is 19
Charmander is attacking with Flamethrower for 6 damage to Squirtle
Squirtle has received 6 dmg, remaining hp is 13
Squirtle is attempting to defend with Protect
Charmander is attacking with Scratch for 2 damage to Squirtle
Squirtle successfully reduced Charmander's damage by 3 with Protect
Squirtle has received 0 dmg, remaining hp is 13
Squirtle is attempting to defend with Block
Charmander is attacking with Ember for 3 damage to Squirtle
Squirtle successfully reduced Charmander's damage by 2 with Block
Squirtle has received 1 dmg, remaining hp is 12
Squirtle is attacking with Water Gun for 3 damage to Charmander
Charmander has received 3 dmg, remaining hp is 16
Charmander is attacking with Ember for 3 damage to Squirtle
Squirtle has received 3 dmg, remaining hp is 9
Squirtle is attempting to defend with Block
Charmander is attempting to defend with Protect
Squirtle is attacking with Attack for 1 damage to Charmander
Charmander successfully reduced Squirtle's damage by 3 with Protect
Charmander has received 0 dmg, remaining hp is 16
Charmander is attempting to defend with Endure
Squirtle is attempting to defend with Endure
Charmander is attempting to defend with Endure
Squirtle is attacking with Tackle for 2 damage to Charmander
Charmander successfully reduced Squirtle's damage by 1 with Endure
Charmander has received 1 dmg, remaining hp is 15
Charmander is attempting to defend with Protect
Squirtle is attacking with Attack for 1 damage to Charmander
Charmander successfully reduced Squirtle's damage by 3 with Protect
Charmander has received 0 dmg, remaining hp is 15
Charmander is attempting to defend with Block
Squirtle is attacking with Attack for 1 damage to Charmander
Charmander successfully reduced Squirtle's damage by 2 with Block
Charmander has received 0 dmg, remaining hp is 15
Charmander is attacking with Scratch for 2 damage to Squirtle
Squirtle has received 2 dmg, remaining hp is 7
Squirtle is attempting to defend with Protect
Charmander is attempting to defend with Endure
Squirtle is attempting to defend with Protect
Charmander is attacking with Ember for 3 damage to Squirtle
Squirtle successfully reduced Charmander's damage by 3 with Protect
Squirtle has received 0 dmg, remaining hp is 7
Squirtle is attempting to defend with Block
Charmander is attacking with Ember for 3 damage to Squirtle
Squirtle successfully reduced Charmander's damage by 2 with Block
Squirtle has received 1 dmg, remaining hp is 6
Squirtle is attempting to defend with Block
Charmander is attempting to defend with Block
Squirtle is attempting to defend with Block
Charmander is attacking with Attack for 1 damage to Squirtle
6
Squirtle successfully reduced Charmander's damage by 2 with Block
Squirtle has received 0 dmg, remaining hp is 6
Squirtle is attempting to defend with Block
Charmander is attempting to defend with Protect
Squirtle is attempting to defend with Endure
Charmander is attacking with Ember for 3 damage to Squirtle
Squirtle successfully reduced Charmander's damage by 1 with Endure
Squirtle has received 2 dmg, remaining hp is 4
Squirtle is attacking with Water Gun for 3 damage to Charmander
Charmander has received 3 dmg, remaining hp is 12
Charmander is attempting to defend with Protect
Squirtle is attempting to defend with Endure
Charmander is attacking with Ember for 3 damage to Squirtle
Squirtle successfully reduced Charmander's damage by 1 with Endure
Squirtle has received 2 dmg, remaining hp is 2
Squirtle is attacking with Water Gun for 3 damage to Charmander
Charmander has received 3 dmg, remaining hp is 9
Charmander is attempting to defend with Block
Squirtle is attempting to defend with Protect
Charmander is attempting to defend with Protect
Squirtle is attacking with Water Gun for 3 damage to Charmander
Charmander successfully reduced Squirtle's damage by 3 with Protect
Charmander has received 0 dmg, remaining hp is 9
Charmander is attempting to defend with Endure
Squirtle is attempting to defend with Endure
Charmander is attacking with Flamethrower for 6 damage to Squirtle
Squirtle successfully reduced Charmander's damage by 1 with Endure
Squirtle has received 5 dmg, remaining hp is 0
Squirtle has lost
Charmander has won the battle
Charmander has won round 2
And finally, Pikachu and Charmander face each other in the 3rd and final round. Note that they must
both be restored to their full health (i.e., hot points) before commencing the final battle.
8
Charmander has received 3 dmg, remaining hp is 0
Charmander has lost
Pikachu has won the battle
Pikachu has won round 3
Pikachu has won the tournament
Pikachu wins! Pikachu wins! Note that your system must display the proper messages at the start &
end of the rounds and the tournament.
stop
> stop
stop acknowledged
simulation terminated
The stop command ends the simulation loop gracefully.
Error Handling
Your system must also handle the following types of errors appropriately. Demonstrations of all the
appropriate responses will be provided in the test case expected results files.
1. Invalid Numbers of Pokémon: A valid number of Pokémon must be provided before a battle or
tournament is allowed to begin/proceed.
2. Invalid Pokémon Names: All Pokémon names (i.e., references) must be validated before a
battle is allowed to begin/proceed. If it is deemed that a Pokémon name is invalid, then that
(invalid) Pokémon will immediately forfeit its match.
Sometimes, the new information might seem unclear, ambiguous, or even contradictory to the
existing facts. And you might not realize these conflicts immediately upon reading them, but only
after you’ve attempted to implement some of these changes in your system. In these cases, you may
seek clarification from the instructional team. After receiving further guidance, you should make any
other reasonable assumptions (e.g., that don’t conflict with established requirements) as needed to
complete the assignment.
[3] Implement and test source code that supports the required functional capabilities
Each phase requires you to create and/or modify some source code that implements the required
capabilities. The earlier phases will focus on the functional requirements, while the later phases will
integrate non-functional requirements as well. We will assess the correctness of your system three
main perspectives:
• Does your system display solid (object-oriented) design principles and quality?
• Is your source code organization consistent with the design artifacts that you provided?
• Which of the complete set of test cases does your system pass successfully?
We will often provide you with an initial and limited set of test cases, but we often reserve some test
cases for the official testing of each phase. And there might also be a few additional artifacts that are
required in the later phases: for example, a video demonstration of the final version of your system.
You are allowed – and strongly encouraged – to take an iterative approach: don’t feel that you must
generate a single “perfect” set of designs on your first attempt. Instead, generate an initial (or
updated) set of designs, then implement source code based on those designs, and then review your
results to determine if you’re on the right track. Continue to modify your designs and/or
implementation details as needed, and then repeat this process until you’ve successfully met all the
requirements; or, as many requirements as possible until you’ve reached the submission deadline.
Don't lose sight of the goal for the course: there are many more potential improvements that you
could make to this system, but you really need to think about how you will separate and distribute the
complexity of the overall problem across separate classes; and, how the objects instantiated from
those classes then communicate and collaborate to solve the problem. Helping you develop a solid
structure for your design is the most important aspect of working on this assignment.
The basic testing is focused on the "best case/error-free" use of the system. The test cases exercise
the commands to ensure the system's state is updated correctly for multiple object interactions.
Advanced testing includes various circumstances that should not cause updates – namely, error
conditions such as undefined identifiers, duplicate identifiers, or violations of the logical (e.g.,
"business-level") constraints defined in the problem scenario.
10
• They (Pokemon) must be located in the provided Pokemon package located: cs6310.Pokemon
o /src/cs6310/Pokemon
o Ex: /src/cs6310/Pokemon/Pikachu.java
• They (Pokemon) must have a public constructor that takes an Integer for their seed
o Ex: Pikachu(Integer seed)
• They (Pokemon) must have a public Battle function that takes an Object instance of the other
Pokemon with whom they are battling, and an Integer for the damage being done.
o Ex: Battle(Object pokemon, Integer damage)
• They (Pokemon) must have a public public void DisplayInfo()
• You must create a new custom exception class called “BattleLostException”
o This exception will be thrown when a Pokemon loses a battle,
o This custom exception must have a custom constructor of the following format:
o public BattleLostException(String errorMessage, String pokemonName)
§ The errorMessage you are free to set as you like
§ The pokemonName must be the name of the Pokemon who has lost the battle.
o It should also have:
§ private String LosingPokemonName;
§ Which should be set when the exception containing the Losing Pokemon's Name is
thrown.
o As well as:
§ public String getLosingPokemonName() {
• return LosingPokemonName;
§ }
o This custom exception must live in its own package located: cs6310.Exceptions
o /src/cs6310/Exceptions/
§ Ex: /src/cs6310/Exceptions/BattleLostException.java
You must ensure that the constructors, functions, etc. listed above are implemented as required.
Otherwise, you have significant breadth as the developers to structure the rest of your system’s
organization, classes, attributes, methods, etc. as desired.
• No changes to the docker file or other files will be allowed in your submission.
• The structure above is meant to replicate your local structure. Please do not exclude any files
under your source (src) directory & make sure you include all src/* files, including main or any
others. Please also retain the proper file / folder structure under src. Example: if you have
11
commandprocessor.java under src/edu/gatech/cs6310/commandprocessor.java, do not exclude
the file from your zip & do not consolidate the file to src/commandprocessor.java if that is not
where it is properly located.
• We have given a zip.sh and zip.ps1 scripts. You can read how to use them in the github readme.
Please verify they work correctly and the zip you submit has everything requested.
• Your system must complete each test case in less than three (3) seconds (real time) – otherwise,
your result will be considered to be a failure for that scenario. The scale of these scenarios
shouldn’t require more computing resources than this – in fact, many systems from the previous
term completed all of the test cases (e.g., 20+ cases) in less than three (3) seconds total. Let us
know if you feel that you are unable to develop your system to meet this requirement.
• Your program should display the output directly to “standard output” on the command line or
terminal – not to a file, special console, etc. And you are welcome to use diagnostic output when
testing and troubleshooting your program; however, you must disable or otherwise remove any
"excess output" before you submit your program. Any excess (i.e. non-required) output will
disrupt the automated evaluation of your system, and requests to re-evaluate your system on this
basis will be penalized heavily.
• On a related note, it’s highly suggested that you test your finished system on a separate machine
if possible, away from the original development environment. Unfortunately, we do receive
otherwise correct solutions that fail during our tests because of certain common errors:
o forgetting to include one or more external libraries, etc.
o having your program read files from a specific, hardcoded (and non-existent) folder
o having your program read test files embedded files in its own JAR package
• Many modern Integrated Development Environments (IDEs) such as Eclipse, IntelliJ, Android
Studio, etc. offer very straightforward features that will allow you to create a runnable JAR file
fairly easily. Also, please be aware that we will recompile your source code to verify the
functionality & evaluation of your solution compared to your submitted source code.
Sample Code
We've included some sample Java source "starter code" that provides the command loop for
terminal-based data input. You are also welcome to use portions of the code in your own solution
and use of the provided starter code is 100% optional: you are NOT required/obligated to use this
code. We’ve also provided some test cases, though you are also welcomed (and highly encouraged)
to develop your own tests as well. You are permitted to share your test cases with fellow students,
but you are not permitted to share code and/or specific directions on the code or designs need to
pass the cases.
12
If you would like to review and begin working with the starter code, then the best way is to follow the
directions on the GitHub site: https://github.gatech.edu/GaTechCS6310/2024-01-A2
13