Cell-sim

profilejtk101
project_3.pdf

CS 177 – Project #3 Summer 2015

PROJECT 3 TEAM ASSIGNMENTS ARE POSTED ON BLACKBOARD

YOU MUST WORK WITH YOUR ASSIGNED TEAM TO RECEIVE CREDIT

Due Date: ========== This project is due Saturday August 1st before 11:59pm.

This assignment is an team project and should be completed working cooperatively with your team members – however your team may use only Python 3 code that has been personally written by one of the members assigned to your team. Your team will submit one (1) copy of the completed Python program to the Project 3 assignment on Blackboard. ONLY ONE TEAM MEMBER SHOULD SUBMIT A COPY The completed file will include the names of all you team members, the name of the project and a description of its functionality and purpose of in the comments header. The file should be named ”Project-3.py”. This project is a continuation of your earlier projects and will be based on the Project 2 code written by one (or more) of your team members. It is important that you carefully choose the starting code before beginning Project 3 to maximize your final program’s functionality. Problem Description: Enhancing and Finalizing the Simulation ===================================================== Your second Crete and Laelaps simulation program was excellent and you have been asked to continue to enhance it with more realistic cellular behavior.

Crete and Laelaps cells should be able to consume food dropped in the field. In addition, the temperature of the field should affect their movements. In addition, the scientists have asked for the ability to save the simulation in a given state and then be able to restart it from that point later.

Finally, you should come up with three of your own enhancements to the program.

Project Specifications: ==================== PROJECT 2 BASE SCENARIO:

• Start with a completed simulation that fully meets the specifications of Project 2 • If any Project 2 specification is incomplete, they must be finished before starting Project 3

PAUSE, SAVE & RESTART:

• When the ‘Pause’ button on the Control Panel is clicked, in addition to pausing the simulation, all of the current parameters and objects are saved to a file named “simData.txt”

• A message should be printed to the IDLE window: “Simulation Data Saved” • The simData.txt file should include everything shown in both the Field and Control Panel,

including but not limited to: o All Crete and Laelaps cell locations and properties o The location of any food in the field o The current simulation speed and temperature settings o Any other information that would be necessary to recreate the simulation exactly as it

appears when it was paused • When the program starts, if it detects a simData.txt file, before creating any graphics

windows or objects, the user should get the option to restart with data from the saved file

DINNER TIME: • Any cell that contacts “food” will increase their radius by 4 pixels, (food disappears)

HOT IN HERE: • Changing the temperature affects the cell movement speed • Higher temperatures cause Laelaps to move faster, Crete to move slower • Lower temperatures cause Laelaps to move slower, Crete to move faster

o HINT: Use the temperature value to modify the cell’s dx and dy settings PYTHON NINJA STYLE:

• Your team must develop three (3) further modifications to the simulation • These modifications should be fully described and documented in either:

o a readme.txt file that is uploaded along with your Blackboard submission -or- o in comments within your project-3.py program

• The scope and functionality of these modifications are totally up to you and your team. Up to 25 points will be awarded for each of the 3 modifications based on functionality (it should work as you describe) and creativity.

Project 3 Grading Rubric: Points Simulation should meets all Project 2 Specifications

Program meets all coding standards and guidelines (see next page) 5

PAUSE, SAVE & RESTART 10

DINNER TIME 5

HOT IN HERE 5

PYTHON NINJA STYLE #1 25

PYTHON NINJA STYLE #2 25

PYTHON NINJA STYLE #3 25

Total Points 100

This assignment is an team project and should be completed working cooperatively with your team members – however your team may use only Python 3 code that has been personally written by one of the members assigned to your team. Your team will submit one (1) copy of the completed Python program to the Project 3 assignment on Blackboard. ONLY ONE TEAM MEMBER SHOULD SUBMIT A COPY The completed file will include the names of all you team members, the name of the project and a description of its functionality and purpose of in the comments header. The file should be named ”Project-3.py”.

Coding Standards and Guidelines: ============================= In this project, you are required to follow modular coding standards, particularly with respect to modular design, indentation and comments. Your score will be affected if your code does not conform to these standards. Modular Design Divide your program into functions to improve readability and to reduce redundanct code. Your Python code should not have repetitve copies of the same block of statements. Instead, functions to simplify and reduce the size of your code.

For example, if you had to find the distance between two x,y coordinate points in several different parts of your code, instead of creating the formula to calculate this distance over and over again, create a function “def distance(x1, y1, x2, y2):” and code it to calculate and return the distance between the point using the Pythagorean Theorum. Indentation Following are a few rules on how to use indentation in your program,

• Use tabs for indentations • Pay attention to indentation in nested for loops and if-else blocks

Comments Your code for this project must also include appropriate comments about how functions are implemented. Comments make your code more readable and easier to understand.

• Add a comment before a function describing what it does. • Before a nested for loop, describe what happens in the loop and what controls the

iterations. • Before an if-else block, explain what should happen for both the true and false cases. • Always make a priority of keeping the comments up-to-date when the code changes.

For all variables that you use in your program, use meaningful variable and function names to help make your program more readable. Names do not have to be long, but should give a clear indication of the intended purpose of the variable.