PDF Google Drive Downloader v1.1


Báo lỗi sự cố

Nội dung text CMPS103 - Project - Alien Invasion - SP24

Data Structures and Algorithms Project Requirements Data Structures and Algorithms CMPS103 Spring 2024 CMP S103 Data Structures and Algorithms Project Requirements Alien Invasion Simulate or Surrender ! Updates Table 2/4/2024 Highlighted in this color 9/4/2024 Highlighted in this color check Phase2 workload here BONUS Req Added at the end of the doc. Sharing your code with others through github (for example) is counted as cheating. You must NOT publish your code for public before final exams DS 1/16 Spring 2024
Data Structures and Algorithms Project Requirements Objectives By the end of this project, the student should be able to: - Understand unstructured, natural language problem descriptions and derive an appropriate design. - Intuitively modularize a design into independent components and divide these components among team members. - Build and use data structures to implement the proposed design. - Write a complete object-oriented C++ program that performs a non-trivial task. Introduction The whispers have become shouts, the blurry figures in the night sky, confirmed spaceships. An alien invasion is no longer science fiction !!! The world needs to act quickly to be ready for the expected invasion. Using the observed information about alien armies, The Global Defense Unit decided to make the world ready by simulating Earth’s power against aliens’ power. Fortunately, the managers of the Global Defense Unit discovered your programming skills and your deep knowledge of different data structures and decided to get your help as a last resort to develop a program that simulates the battle against alien armies and calculates some related statistics in order to help decision makers around the world. So it's time to choose: simulate or surrender. The future of Earth rests on your code !!! Project Phases The project has two main phases: Phase 1.1: Selecting the appropriate data structures that should be used to store different lists in the project Phase 1.2: Implementing and testing the selected data structures to make sure they work as required to proceed to phase 2 Phase 2: Implementing the algorithms related to the battle fight logic to simulate armies battle and generate the output file that contains statistics about the battle. Phase % Deadline Phase 1.1 10% Week 6 Phase 1.2 30% Week 9 Phase 2 60% Week 14 Late Submission is not allowed. NOTE: Number of students per team = 4 students. DS 2/16 Spring 2024
Data Structures and Algorithms Project Requirements Simulation Time You will use incremental time simulation. You will divide the time into discrete time steps of 1 time unit each and simulate the changes in the system in each time step. Army Units Each army consists of some units. Earth army units are soldier, tank, and gunnery whereas alien army units are soldier, monster, and drone. At each time step, some of these units may join the battle and some may be destroyed or killed and leave the battle. The following information should be stored about each army unit: - ID: unique number for each unit. - Type: soldier, tank, gunnery, alien soldier, monster, or drone. - Join Time (Tj): the timestep when this unit joins the battle. - Health: the unit is alive as long as its health > 0. Initial health should never exceed 100. - Power: the attack power of the unit. - Attack Capacity: the maximum number of units that could be attacked by this unit at one timestep. Battle Rules & Attack logic - Any army unit can join the battle at any time. - At each timestep, Earth army units attack alien units then alien army units attack Earth units. - If the health of any unit becomes zero (or less) due to attack, it should be dismissed from the battle. - The Golden Rule: For all units, the order a unit is picked to make it attack enemies is the same order it is picked to be attacked by enemies. - The battle winner is the army that destroys all units of the other army and has at least one remaining alive unit. - The battle should run for at least 40 timesteps, so don’t check for win/loss before 40 timesteps (phase 2) Earth soldier (ES) & Alien soldier (AS) - ES can attack only AS and vice versa. - Each timestep, pick ONE ES and make it attack a number of alien soldiers depending on ES attack capacity. - The order ES are picked to attack is the same order they joined the battle. - The order AS are picked to be attacked is the same order they joined the battle. - The same logic applies when AS attacks ES. Earth Tanks (ET) - Normally, a tank attacks monsters. - Each time step, pick ONE tank and make it attack monsters. - Pick the freshest tanks first. i.e. a tank that just joins the force should be picked first to attack enemies. - As monsters are hard to control, they are picked to attack/be attacked randomly. - According to tank attack capacity, it picks a number of monsters to attack randomly. DS 3/16 Spring 2024
Data Structures and Algorithms Project Requirements - If Earth soldiers count falls below 30% of alien soldiers count, the tank should attack alien soldiers too until Earth soldiers count reaches 80% of alien soldiers count, then return to attacking monsters only. Earth Gunnery (EG) - Attacks only drones and monsters. - The EG with the highest power_health combination (derive a formula for that) should be picked to attack enemies. - Pick ONE EG and make it attack monsters by picking them randomly as described above. Then EG attacks drones by picking them in pairs from the drones list (pick one drone from the list front and one from the list rear and target both). - If only one drone exists, pick and target it. Alien Monster (AM) - Attacks both tanks and Earth soldiers. - Pick ONE random monster to attack enemies. - The order a monster picks tanks/soldiers to attack is the same order tanks and soldiers are picked to attack their enemies. (the golden rule) Alien Drone (AD) - Attacks both tanks and gunnery. - Drones attack in pairs. So pick one drone from the list front and one from the list rear and make them both attack enemies simultaneously. - If only one drone exists, don’t attack. Required from Credit teams of 4 members only in PHASE 2 (and teams of 3 for Mainstream) Heal Unit (HU), Heal List (HL) and Unit Maintenance List (UML) - HU is an Earth unit (for Earth army only), that is capable of healing soldiers and fixing tanks - The attack capacity of HU is the number of units it can heal in a single timestep. - All available HUs are stored in HL as LIFO - When a soldier's health or a tank's health is greater than 0% and less than 20% of its initial health, it should be moved to (UML) and wait for a HU to be free to act on it. Notice that a unit with health 0 (or less) should be moved directly to the killed list as it is already dead and couldn't be healed. - Each timestep, if there is a unit (or more) in UML that needs healing and If there is a free HU in HL: - pick the HU and make it act on the units in UML by picking units from UML according to HU capacity. - When picking from UML, the HU gives priority to soldiers over tanks. So first it heals soldiers then it heals tanks. - When picking from soldiers, the HU gives priority to soldiers with highest damage (i.e lowest health). But when picking from tanks, it picks them in the same order they are placed in the UML. - After picking a unit and before healing, If it has spent more than 10 timesteps in UML it should be moved to killed list. Otherwise, start healing. DS 4/16 Spring 2024

Tài liệu liên quan

x
Báo cáo lỗi download
Nội dung báo cáo



Chất lượng file Download bị lỗi:
Họ tên:
Email:
Bình luận
Trong quá trình tải gặp lỗi, sự cố,.. hoặc có thắc mắc gì vui lòng để lại bình luận dưới đây. Xin cảm ơn.